cyberpanel icon indicating copy to clipboard operation
cyberpanel copied to clipboard

[BUG] cli/cyberPanel.py version is broken

Open Lvl4Sword opened this issue 8 months ago • 6 comments

Describe the bug When trying to run cyberpanel version, the following error occurs:

Traceback (most recent call last):
  File "/usr/bin/cyberpanel", line 1603, in <module>
    main()
  File "/usr/bin/cyberpanel", line 1357, in main
    print(get_cyberpanel_version())
  File "/usr/bin/cyberpanel", line 35, in get_cyberpanel_version
    version = json.loads(str(version_file))
  File "/usr/lib/python3.8/json/__init__.py", line 357, in loads
    return _default_decoder.decode(s)
  File "/usr/lib/python3.8/json/decoder.py", line 340, in decode
    raise JSONDecodeError("Extra data", s, end)
json.decoder.JSONDecodeError: Extra data: line 2 column 1 (char 4)

To Reproduce What steps did you take when the issue occurred?

  1. Run cyberpanel version
  2. See the error

Expected behavior For there to not be an error

Operating system: Ubuntu 20.04 LTS

CyberPanel version: Version 2.3 / Build: 4 / Current Commit: https://github.com/usmannasir/cyberpanel/commit/c8da443334b8815ec250a0fba606e75355f641cd

Lvl4Sword avatar Dec 03 '23 20:12 Lvl4Sword

I'll do a commit in a bit, but the fix is

def get_cyberpanel_version():
    with open('/usr/local/CyberCP/version.txt') as version:
        version_file = version.read().split()
    return f"{version_file[0]}.{version_file[1]}"

Lvl4Sword avatar Dec 03 '23 20:12 Lvl4Sword

This seems to be fixed.

usmannasir avatar Jan 15 '24 13:01 usmannasir

This doesn't appear to be completed

Lvl4Sword avatar Jan 15 '24 16:01 Lvl4Sword

@usmannasir What made you believe this was completed?

Lvl4Sword avatar Jan 15 '24 16:01 Lvl4Sword

I can execute cyberpanel version on my end, you can not ?

usmannasir avatar Jan 16 '24 06:01 usmannasir

Works fine for me also in 2.3.5 - Almalinux 8.9

master3395 avatar Feb 02 '24 12:02 master3395