CyberPanel support for Ubuntu 22

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.

That worked! The Python installation guide you linked to had the right commands.

For anyone else seeing this, for step 2 it’s important that there is a space between ‘fix-broken’ and ‘install’, as: ‘sudo apt --fix-broken install’. It will not work as ‘fix-broken-install’, even though that seemed to me to be the intention behind the command.

It would have taken me a long time to figure out the rest of the steps. Thanks for the guide and reply.

Now my server and CyberPanel are upgraded!

1 Like

No problem. Glad I could help.