Cyberpanel upgrade failure

I have been trying to upgrade Cyberpanel for some time now without success.

I am following the official instructions here: link

I am experiencing the exact same problem as discussed here but no solution provided.
https://community.cyberpanel.net/t/cyberpanel-upgrade-failed/54491/6

I am on Ubuntu 22.04 on a VPS and I use sudo su - to run the script.

The version management link does not work. Just time’s out.
Upgrade script prints that branch name is set to v2.3.9
I already have 2.3.9 but a different commit. I just can’t get the info anymore.
I tried to upgrade because SSL certificates are not being renewed anymore.

As in the link provided above the script runs for a while and then I get this:

Collecting cffi==1.14.3 (from -r /usr/local/requirments-old.txt (line 1))
  Using cached cffi-1.14.3.tar.gz (470 kB)
  Preparing metadata (setup.py) ... error
  error: subprocess-exited-with-error

  × python setup.py egg_info did not run successfully.
  │ exit code: 1
  ╰─> [43 lines of output]
      running egg_info
...
        File "/usr/local/CyberPanelTemp/lib/python3.10/site-packages/setuptools/_core_metadata.py", line 290, in _distribution_fullname
          canonicalize_version(version, strip_trailing_zero=False),
      TypeError: canonicalize_version() got an unexpected keyword argument 'strip_trailing_zero'
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
error: metadata-generation-failed

To me, this seems like the function all canonicalize_version() is failing because of the argument strip_trailing_zeros shouldn’t be there but since this python call is part of Cyberpanel upgrade script I don’t think I can fix it on my side (I’m asking).

Any help from fellow users who have experienced this would be greatly appreciated.

Update:

In my research I found the following link that seem to indicate that this is a known issue with setuptools and old(er) dependencies. I’m not a python programmer so I’d appreciate any clues of how I can update these dependencies on my server.

Update 2:

Made some progress with the help of this (non-cyberpanl) post: link

Since the first post said that the problem was due to a mismatch in dependency revisions I search how to fix it.

Here’s what I did:

sudo su -
apt update
apt install -y python3-dev pyhton3-pip
pip install -U setuptools
pip install -U canvasapi
pip install -U packaging
cd /usrl/local/
./cyberpanel_upgrade.sh

This fixed my initial issue and the upgrade script passed the previous failure and continued for some time but ultimately failed with this.

[02.14.2025_18-35-49] #########################################################################

[02.14.2025_18-35-49] fix csf if there successful.

[02.14.2025_18-35-49] #########################################################################

Restoring files...
Traceback (most recent call last):
  File "/root/cyberpanel_upgrade_tmp/upgrade.py", line 3983, in <module>
    main()
  File "/root/cyberpanel_upgrade_tmp/upgrade.py", line 3979, in main
    Upgrade.upgrade(args.branch)
  File "/root/cyberpanel_upgrade_tmp/upgrade.py", line 3610, in upgrade
    restore_files()
  File "/root/cyberpanel_upgrade_tmp/upgrade.py", line 3592, in restore_files
    shutil.copy(backup_file, file)
  File "/usr/lib/python3.10/shutil.py", line 417, in copy
    copyfile(src, dst, follow_symlinks=follow_symlinks)
  File "/usr/lib/python3.10/shutil.py", line 256, in copyfile
    with open(dst, 'wb') as fdst:
FileNotFoundError: [Errno 2] No such file or directory: '/etc/csf/csf.allow'
above command failed...

So now I will try to find out what this is and fix it.

WARNING:

After doing this, my system is no longer usable. I cannot SSH into it anymore. Luckily the host provider provides online terminal. Seems that CSF got disabled and all ports, including 8090, are now blocked.

I guess the update script stopped before all services were enabled

1 Like

Can you please sned me an email at [email protected]

Same here, what a mess. First time used CyberPanel in long time. Attempted update from inside the control panel. Locked out and no way in…,