CyberPanel support for Ubuntu 22

I got this error when I try to upgrade on Unbuntu 22

python3-pip is already the newest version (22.0.2+dfsg-1).
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
Reading package lists… Done
Building dependency tree… Done
Reading state information… Done
build-essential is already the newest version (12.9ubuntu3).
libffi-dev is already the newest version (3.4.2-4).
libssl-dev is already the newest version (3.0.2-0ubuntu1.6).
python3-dev is already the newest version (3.10.6-1~22.04).
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
Reading package lists… Done
Building dependency tree… Done
Reading state information… Done
python3-venv is already the newest version (3.10.6-1~22.04).
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
Requirement already satisfied: virtualenv==16.7.9 in /usr/local/lib/python3.10/dist-packages (16.7.9)
WARNING: Running pip as the ‘root’ user can result in broken permissions and conflicting behaviour with the system package manager. It is recommended to use a virtual environment instead: 12. Virtual Environments and Packages — Python 3.11.1 documentation

No need to re-setup virtualenv at /usr/local/CyberPanel…

–2022-10-15 15:38:44-- https://raw.githubusercontent.com/usmannasir/cyberpanel/v2.3.2/requirments.txt
Resolving raw.githubusercontent.com (raw.githubusercontent.com)… 185.199.111.133, 185.199.109.133, 185.199.110.133, …
Connecting to raw.githubusercontent.com (raw.githubusercontent.com)|185.199.111.133|:443… connected.
HTTP request sent, awaiting response… 200 OK
Length: 1475 (1.4K) [text/plain]
Saving to: ‘/usr/local/requirments.txt’

/usr/local/requirme 100%[===================>] 1.44K --.-KB/s in 0s

2022-10-15 15:38:44 (28.3 MB/s) - ‘/usr/local/requirments.txt’ saved [1475/1475]

Could not find platform independent libraries
Could not find platform dependent libraries <exec_prefix>
Consider setting $PYTHONHOME to [:<exec_prefix>]
Python path configuration:
PYTHONHOME = (not set)
PYTHONPATH = (not set)
program name = ‘/usr/local/CyberPanel/bin/python3’
isolated = 0
environment = 1
user site = 1
import site = 1
sys._base_executable = ‘/usr/local/CyberPanel/bin/python3’
sys.base_prefix = ‘/usr’
sys.base_exec_prefix = ‘/usr’
sys.executable = ‘/usr/local/CyberPanel/bin/python3’
sys.prefix = ‘/usr’
sys.exec_prefix = ‘/usr’
sys.path = [
‘/usr/lib/python38.zip’,
‘/usr/lib/python3.8’,
‘/usr/lib/lib-dynload’,
]
Fatal Python error: init_fs_encoding: failed to get the Python codec of the filesystem encoding
Python runtime state: core initialized
ModuleNotFoundError: No module named ‘encodings’

Current thread 0x00007fd3ad96c740 (most recent call first):

above command failed…
dasd@xdd:~# client_loop: send disconnect: Broken pipe

2 Likes

Dear Sir,

root@C20210814185128:~# hostnamectl
Static hostname: C20210814185128
Icon name: computer-vm
Chassis: vm
Machine ID: ca3bc69b2f5d3c646f08f31da391dd4c
Boot ID: 0b4e14c3cd1740e0b63258927c46a6e4
Virtualization: kvm
Operating System: Ubuntu 22.04 LTS
Kernel: Linux 5.15.0-30-generic
Architecture: x86-64
Hardware Vendor: Red Hat
Hardware Model: KVM

Error happen, for the Install Service

systemctl list-units --failed

UNIT LOAD ACTIVE SUB DESCRIPTION
● fwupd-refresh.service loaded failed failed Refresh fwupd metadata and update motd
● logrotate.service loaded failed failed Rotate log files
● networking.service loaded failed failed Raise network interfaces
● ua-timer.service loaded failed failed Ubuntu Advantage Timer for running repeated jobs
● unattended-upgrades.service loaded failed failed Unattended Upgrades Shutdown

It is need Linux 5.15.0-50-generic

The: Create Email List does not work in Cyberpanel

It gives the result;

cat: /home/cyberpanel/9896: No such file or directory

… and is stuck showing the spinning two balls at the line: create email list. Also: the Go-Back button does not respond/do-anything
… when trying again (for example after a new login to cyberpanel); the number is always different

when:

at: [as a new community user: I had to remove the link.]/emailMarketing/[as a new community user: I had to remove the link.]/emailLists

Did put into field; List Name: testemails

Did put into field; Path: /home/[as a new community user: I had to remove the link.]/temptestemails.txt

Note that prior to doing this:

at: [as a new community user: I had to remove the link.]/filemanager/[as a new community user: I had to remove the link.]

… the filemanager shows in the folder: Home (Current path: /home/[as a new community user: I had to remove the link.]) a file: temptestemails.txt with permissions: -rwxrwxrwx (That is: 777)
… I changed the file permission to 777 to eliminate any access restrictions.

My question is: How do I debug the actual cause for this failure?

None of your instructions in: Log files on CyberPanel give any additional helpful data.

==> I need a much better way to debug and dig up the root cause.

My setup:

The Cyberpanel version as from the Version Management:

CyberPanel
Current Version: 2.3
Build: 2
Current Commit: 7427667c14c2ddbc2fcb7bfa35870155d4a343dc
Latest Version: 2.3
Latest Build: 2
Latest Commit: 7427667c14c2ddbc2fcb7bfa35870155d4a343dc

The web server:

OpenLiteSpeed

The Ubuntu freshly installed VPS-instance as shown by command: cat /etc/*release

DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=22.04
DISTRIB_CODENAME=jammy
DISTRIB_DESCRIPTION=“Ubuntu 22.04.1 LTS”
PRETTY_NAME=“Ubuntu 22.04.1 LTS”
NAME=“Ubuntu”
VERSION_ID=“22.04”
VERSION=“22.04.1 LTS (Jammy Jellyfish)”
VERSION_CODENAME=jammy
ID=ubuntu
ID_LIKE=debian
HOME_URL= [as a new community user: I had to remove the link.]
SUPPORT_URL= [as a new community user: I had to remove the link.]
BUG_REPORT_URL= [as a new community user: I had to remove the link.]
PRIVACY_POLICY_URL= [as a new community user: I had to remove the link.]
UBUNTU_CODENAME=jammy

P.S If necessary: I can DM to you the whole installation log that was created from the ssh-connection monitor output. (lasted [more than] 45 minutes)

P.P.S After reading the thread; was it a (=the) mistake to install into Ubuntu 22.04 in this way:

curl -o cyberpanel.sh “https://cyberpanel.sh/?dl&Ubuntu22
chmod +x cyberpanel.sh
./cyberpanel.sh $@

An update:

It seems to get stuck in a function: installWordpressStatus

==> It keeps repeating the installWordpressStatus after it just once does the: submitEmailList


Shows in the view: cat: /home/cyberpanel/5080: No such file or directory

submitEmailList
{status: 1, tempStatusPath: “/home/cyberpanel/5080”}
status: 1
tempStatusPath: “/home/cyberpanel/5080”

installWordpressStatus
{abort: 0, installStatus: 0, installationProgress: 0,…}
abort: 0
currentStatus: “cat: /home/cyberpanel/5080: No such file or directory”
installStatus: 0
installationProgress: 0

My question: Is it really so that it is not possible to load any emaillist when wordpress is not installed?

I had/have no intention for using wordpress for this domain.

P.S I noticed this behavior with the browser “Developer Tools” (nowadays almost any browser has it)

Hi, @usmannasir

I am trying to put some debug points into:

/usr/local/CyberCP/emailMarketing/static/emailMarketing/emailMarketing.js

with:

new PNotify({
title: ‘Debugging Point Output’,
text: ‘The flow got this far, the specific info is…’,
type: ‘error’});

However, no matter where I put it; nothing shows.

So, my question: how do I reset all the server(s?) caches so that the(=my) server then actually takes the javascript file I modified?

Hi,

IF: you experience the problem:

“Create Email List does not work in Cyberpanel”

It gives you the result;

cat: /home/cyberpanel/9896: No such file or directory

… and is stuck showing the spinning two balls at the line: create email list. Also: the Go-Back button does not respond/do-anything
… when trying again (for example after a new login to cyberpanel); the number is always different

THEN: you need to check the following file: emailMarketingManager.py

Which for example in Ubuntu22 can be found in folder:

/usr/local/CyberCP/emailMarketing/

In the file: emailMarketingManager.py

You need to change/edit the two following lines: (Usually at lines 144 and 145)

line 144: # em = EM(‘createEmailList’, extraArgs)
line 145: # em.start()

…to become as this:

line 144: em = EM(‘createEmailList’, extraArgs)
line 145: em.start()

Saying this thing in an other way: the lines need to be uncommented. The # makes anything after it a comment, so that is why you need to remove it in these lines.

I have the same issue:

2022-10-31 04:28:36 (8.00 MB/s) - ‘/usr/local/requirments.txt’ saved [1475/1475]

Could not find platform independent libraries
Could not find platform dependent libraries <exec_prefix>
Consider setting $PYTHONHOME to [:<exec_prefix>]
Python path configuration:
PYTHONHOME = (not set)
PYTHONPATH = (not set)
program name = ‘/usr/local/CyberPanel/bin/python3’
isolated = 0
environment = 1
user site = 1
import site = 1
sys._base_executable = ‘/usr/local/CyberPanel/bin/python3’
sys.base_prefix = ‘/usr’
sys.base_exec_prefix = ‘/usr’
sys.executable = ‘/usr/local/CyberPanel/bin/python3’
sys.prefix = ‘/usr’
sys.exec_prefix = ‘/usr’
sys.path = [
‘/usr/lib/python38.zip’,
‘/usr/lib/python3.8’,
‘/usr/lib/lib-dynload’,
]
Fatal Python error: init_fs_encoding: failed to get the Python codec of the filesystem encoding
Python runtime state: core initialized
ModuleNotFoundError: No module named ‘encodings’

Current thread 0x00007efeb519d740 (most recent call first):

above command failed…

The CyperPanel admin URL now shows:

# 503
## Service Unavailable
The server is temporarily busy, try again later!
3 Likes

hi, I am facing the same error post ubuntu 22 installation. did you manage to solve this?

No solution yet.

upgraded from 20.04 to 22.04 and its your normal production server? dosn’t work

this the solution already given .
install new iso on server am have 4 vps working without problem on ubuntu 22.04 LTS

Anyone facing issues with snappymail post upgrade to ubuntu 22? i am getting authentication failed problem while logging in.

@usmannasir any update on v2.3.3 release?

You will need to reset the snappymail admin credentials as it gets new randomly set credentials while upgrade as far as I seen. Try to reset it and see

I read this whole thread before trying to install and I guess none of the early users of CP on ubuntu 22.04 use FTP.

Ubuntu 22.04 (and RH 9 Rocky 9 alma 9) have PureFTPd 1.5x which does not support MD5 hash.

CP uses MD5 hash for FTP passwords.

A safe(ish) solution at the moment is to install the following from Ubuntu 20.04 and put them on hold for updates:
libssl1.1_1.1.1 (which has the openssl vulnerability patched)
pure-ftpd-common 1.49
pure-ftpd-mysql 1.49
The Deb packages are available for download from the ubuntu 20.04 archive.

Is this the reason why my e-mail cannot send messages? Are there still a lot of bugs if I use ubuntu 22.04?

1 Like

@Grow just curious if you made any headway on your previous issues associated with not being able to access the CyberPanel dashboard via 8090 due to 503 service unavailable error since it’s been a few months. I see @usmannasir was able to release v2.3.4 stable version in the past few days which I thank him for and am grateful for, but it hasn’t resolved the 503 error for me. In fact, I can’t even run the CyberPanel upgrade script successfully unfortunately anymore. Figured I ask.

Fetching latest data from CyberPanel server...

This may take few seconds...

Checking root privileges...

You are running as root...

Checking server location...

System: Ubuntu 22 detected...


Press the Enter key to continue with latest version, or enter specific version such as: 1.9.4 , 1.9.5 ...etc

If nothing is input in 10 seconds, script will proceed with the latest stable version. 

Please press the Enter key or specify a version number, or wait for 10 seconds: 


Branch name set to v2.3.4
Hit:1 http://us.archive.ubuntu.com/ubuntu jammy InRelease
Get:2 http://us.archive.ubuntu.com/ubuntu jammy-updates InRelease [119 kB]
Get:3 http://us.archive.ubuntu.com/ubuntu jammy-backports InRelease [108 kB]
Get:4 http://us.archive.ubuntu.com/ubuntu jammy-security InRelease [110 kB]
Fetched 337 kB in 6s (58.9 kB/s)
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
5 packages can be upgraded. Run 'apt list --upgradable' to see them.
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
Calculating upgrade... Done
Get more security updates through Ubuntu Pro with 'esm-apps' enabled:
  libmagickcore-6.q16-dev libmagickwand-dev libopenexr-dev libopenexr25
  libmagickcore-6.q16-6-extra libmagickwand-6.q16-6 libmagickcore-6.q16-6
  imagemagick-6-common libmagickcore-6-arch-config libmagickwand-6-headers
  libmagickwand-6.q16-dev libmagickcore-6-headers
Learn more about Ubuntu Pro at https://ubuntu.com/pro
The following packages have been kept back:
  libglib2.0-0 libglib2.0-bin libglib2.0-data libglib2.0-dev libglib2.0-dev-bin
0 upgraded, 0 newly installed, 0 to remove and 5 not upgraded.
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
Note, selecting 'libidn2-dev' instead of 'libidn2-0-dev'
Note, selecting 'libcom-err2' instead of 'libcomerr2'
htop is already the newest version (3.0.5-7build2).
libattr1 is already the newest version (1:2.5.1-1build1).
libattr1-dev is already the newest version (1:2.5.1-1build1).
libgcrypt20-dev is already the newest version (1.9.4-3ubuntu3).
libgpgme-dev is already the newest version (1.16.0-1.2ubuntu4).
libidn2-dev is already the newest version (2.3.2-2build1).
liblzma-dev is already the newest version (5.2.5-2ubuntu1).
libnghttp2-dev is already the newest version (1.43.0-1build3).
libpsl-dev is already the newest version (0.21.0-1.2build2).
librtmp-dev is already the newest version (2.4+20151223.gitfa8646d.1-2build4).
net-tools is already the newest version (1.60+git20181103.0eebece-1ubuntu5).
nettle-dev is already the newest version (3.7.3-1build2).
socat is already the newest version (1.7.4.1-3ubuntu4).
telnet is already the newest version (0.17-44build1).
zip is already the newest version (3.0-12build2).
idn2 is already the newest version (2.3.2-2build1).
nghttp2 is already the newest version (1.43.0-1build3).
virtualenv is already the newest version (20.13.0+ds-2).
git is already the newest version (1:2.34.1-1ubuntu1.8).
libcom-err2 is already the newest version (1.46.5-2ubuntu1.1).
libcurl4-gnutls-dev is already the newest version (7.81.0-1ubuntu1.10).
libgnutls28-dev is already the newest version (3.7.3-4ubuntu1.2).
libgssapi-krb5-2 is already the newest version (1.19.2-2ubuntu0.1).
libk5crypto3 is already the newest version (1.19.2-2ubuntu0.1).
libkrb5-dev is already the newest version (1.19.2-2ubuntu0.1).
libldap2-dev is already the newest version (2.5.14+dfsg-0ubuntu0.22.04.2).
libssl-dev is already the newest version (3.0.2-0ubuntu1.9).
unzip is already the newest version (6.0-26ubuntu3.1).
vim is already the newest version (2:8.2.3995-1ubuntu2.7).
dnsutils is already the newest version (1:9.18.12-0ubuntu0.22.04.1).
libmariadb-dev is already the newest version (1:10.6.12-0ubuntu0.22.04.1).
libmariadb-dev-compat is already the newest version (1:10.6.12-0ubuntu0.22.04.1).
0 upgraded, 0 newly installed, 0 to remove and 5 not upgraded.
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
python3-pip is already the newest version (22.0.2+dfsg-1ubuntu0.2).
0 upgraded, 0 newly installed, 0 to remove and 5 not upgraded.
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
build-essential is already the newest version (12.9ubuntu3).
libffi-dev is already the newest version (3.4.2-4).
libssl-dev is already the newest version (3.0.2-0ubuntu1.9).
python3-dev is already the newest version (3.10.6-1~22.04).
0 upgraded, 0 newly installed, 0 to remove and 5 not upgraded.
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
python3-venv is already the newest version (3.10.6-1~22.04).
0 upgraded, 0 newly installed, 0 to remove and 5 not upgraded.
Requirement already satisfied: virtualenv==16.7.9 in /usr/local/lib/python3.10/dist-packages (16.7.9)
WARNING: Running pip as the 'root' user can result in broken permissions and conflicting behaviour with the system package manager. It is recommended to use a virtual environment instead: https://pip.pypa.io/warnings/venv

No need to re-setup virtualenv at /usr/local/CyberPanel...

--2023-04-29 23:13:45--  https://raw.githubusercontent.com/usmannasir/cyberpanel/v2.3.4/requirments.txt
Resolving raw.githubusercontent.com (raw.githubusercontent.com)... 185.199.108.133, 185.199.109.133, 185.199.110.133, ...
Connecting to raw.githubusercontent.com (raw.githubusercontent.com)|185.199.108.133|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 1461 (1.4K) [text/plain]
Saving to: ‘/usr/local/requirments.txt’

/usr/local/requirments.txt         100%[==============================================================>]   1.43K  --.-KB/s    in 0s      

2023-04-29 23:13:45 (5.25 MB/s) - ‘/usr/local/requirments.txt’ saved [1461/1461]

Could not find platform independent libraries <prefix>
Could not find platform dependent libraries <exec_prefix>
Consider setting $PYTHONHOME to <prefix>[:<exec_prefix>]
Python path configuration:
  PYTHONHOME = (not set)
  PYTHONPATH = (not set)
  program name = '/usr/local/CyberPanel/bin/python3'
  isolated = 0
  environment = 1
  user site = 1
  import site = 1
  sys._base_executable = '/usr/local/CyberPanel/bin/python3'
  sys.base_prefix = '/usr'
  sys.base_exec_prefix = '/usr'
  sys.executable = '/usr/local/CyberPanel/bin/python3'
  sys.prefix = '/usr'
  sys.exec_prefix = '/usr'
  sys.path = [
    '/usr/lib/python38.zip',
    '/usr/lib/python3.8',
    '/usr/lib/lib-dynload',
  ]
Fatal Python error: init_fs_encoding: failed to get the Python codec of the filesystem encoding
Python runtime state: core initialized
ModuleNotFoundError: No module named 'encodings'

Current thread 0x00007f12e3df1740 (most recent call first):
<no Python frame>
above command failed...
1 Like

Hi. I stopped using CyberPanel and switched to Plesk.

Gotcha. I appreciate you responding. Thanks.

Even though I installed a fresh installation of Ubuntu 22.04 with CyberPanel, I couldn’t rest until I got my old dev server fixed after upgrading it from 20.04 to 22.04 and breaking Cyberpanel.

Final solution for me: (follow these instructions at your own risk)

  1. I first had to install python3.8 which was removed after the upgrade. Only 3.10 existed on my server.
  2. Attempted CyberPanel upgrade which got a little bit further this time but ended up getting an error that certain packages had unmet dependencies. To fix that error, I had to run the following command: ‘apt --fix-broken install’ which got rid of the error.
  3. Attempted CyberPanel upgrade again, this time getting a python ImportError: cannot import name ‘dist’. To fix this, I had to run `sudo apt install python3.8-distutils’
  4. Attempted CyberPanel upgrade again, this time getting the ‘fatal error: Python.h: No such file or directory’. To fix this this, I ran ‘sudo apt-get install python3.8-dev’
  5. Attempted CyberPanel upgrade again, and this time it completed successfully. I no longer received the 503 WebServer Busy page and can successfully access the dashboard.

Summary:
Install python3.8, python3.8-distutils, python3.8-dev if you’ve broken your CyberPanel install after upgrading from Ubuntu 20.04 to 22.04 and are unable to upgrade to the latest CyberPanel stable version.

Sharing is caring!

*disclaimer, it is still recommended you not upgrade from 20.04 to 22.04 and start with a fresh copy of Cyberpanel on a 22.04 install as the CyberPanel team has stated.

1 Like

I have also encountered the “no module named ‘encodings’” error after upgrading my VPS from Ubuntu 20.04 to 22.04.

@Troop, how were you able to install Python 3.8 on Ubuntu 22.04? I followed several guides online, but they all failed to install it. Most errors were that such commands were not found.

I’m also concerned about doing it because many guides said it’s a bad idea to install 3.8 when the default version on Ubuntu 22.04 is 3.10. Is that concern valid?

Am I forced to uninstall Cyberpanel, reinstall it, and then rebuild my site?

Hey Derek. To install Python 3.8, I followed the instructions here: Install Python 3.9 or 3.8 on Ubuntu 22.04 LTS Jammy JellyFish using the PPA provided by deadsnakes and it worked for me. With every step as I outlined in my last post…I would get a bit further and then get a different error and used the fixes I identified to resolve them. I have both python 3.8 and 3.10 installed on my server after the upgrade and it is still running strong with no issues that I can see. I’ve been able to run all Ubuntu and Cyberpanel upgrades ever since. 3.10 is still the default version.

It goes without saying, please ensure you have everything backed up just in case.

I hope this helps. I believe your installation is salvageable and not lost.