Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Python Version does not get updated #422

Open
Raukze opened this issue Oct 9, 2024 · 9 comments
Open

Python Version does not get updated #422

Raukze opened this issue Oct 9, 2024 · 9 comments
Labels
bug Something isn't working

Comments

@Raukze
Copy link

Raukze commented Oct 9, 2024

Describe The Problem
I tried to update wireguard's dashboard today (./wgd.sh update), but it fails because the installed Python version is too low. I would have expected the update script to also update my Python version if it is below the minimum required version.

Expected Error / Traceback

root@wireguard:/etc/wgdashboard/src# ./wgd.sh update
[WGDashboard] OS: debian
[WGDashboard] ✔ Python is installed
[WGDashboard] ✗ Could not find a compatible version of Python. Current Python is Python 3.9.2.
[WGDashboard] WGDashboard required Python 3.10, 3.11 or 3.12. Halting install now.
Terminated

To Reproduce
LXC-Container in Proxmox created via https://tteck.github.io/Proxmox/#wireguard-lxc
Running ./wgd.sh update

OS Information:

  • Debian 11
  • Python 3.9.2
@Raukze Raukze added the bug Something isn't working label Oct 9, 2024
@DaanSelen
Copy link
Collaborator

Hello Raukze, I think updating Python itself is kind of a big ask if you just want to update your WGDashboard, because there are a lot of changes between Python versions. therefore it is really riskful to suddenly update the Python version.

But if you see this differently! Please tell me how we can improve this!

@Raukze
Copy link
Author

Raukze commented Oct 11, 2024

The point I want to make is that ./wgd.sh installs Python if it is not already installed. Therefore, I would have expected it to also update the version of Python when I use the update command of ./wgd.sh. I mean, I also understand your point that it is risky, but in my case I have a dedicated LCX container in Proxmox running only wireguard and WGDashboard. Maybe an optional flag would be a way to let the user decide. What do you think?

@Raukze
Copy link
Author

Raukze commented Oct 12, 2024

To add to that. I tried manually updating the Python version to 3.10.0 with the following commands from here

wget https://www.python.org/ftp/python/3.10.0/Python-3.10.0.tgz && \
tar -xvf Python-3.10.0.tgz && \
cd Python-3.10.0 && \
sudo ./configure --enable-optimizations && \
sudo make && \
sudo make altinstall

I then added the symlink ln -s /usr/local/bin/python3.10 /usr/local/bin/python3

When running the ./wgd.sh update I get the following errors:

root@wireguard:/etc/wgdashboard/src# ./wgd.sh update
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/usr/local/lib/python3.10/urllib/request.py", line 216, in urlopen
    return opener.open(url, data, timeout)
  File "/usr/local/lib/python3.10/urllib/request.py", line 519, in open
    response = self._open(req, data)
  File "/usr/local/lib/python3.10/urllib/request.py", line 541, in _open
    return self._call_chain(self.handle_open, 'unknown',
  File "/usr/local/lib/python3.10/urllib/request.py", line 496, in _call_chain
    result = func(*args)
  File "/usr/local/lib/python3.10/urllib/request.py", line 1419, in unknown_open
    raise URLError('unknown url type: %s' % type)
urllib.error.URLError: <urlopen error unknown url type: https>
------------------------------------------------------------
| Are you sure you want to update to the ? (Y/N): Y
| Shutting down WGDashboard...                             |
| Downloading  from GitHub...                            |
| Upgrading pip                                            |
| Installing latest Python dependencies                    |
| Update Successfully!                                     |
------------------------------------------------------------

I then tried running ./wgd.sh start which also is no success:

root@wireguard:/etc/wgdashboard/src# ./wgd.sh start
[WGDashboard] WireGuard is already installed.
------------------------------------------------------------
[WGDashboard] Starting WGDashboard with Gunicorn in the background.
[WGDashboard] Creating Python Virtual Environment under ./venv
sudo: ./venv/bin/gunicorn: command not found

it seems to be stuck in the script after that output.

@donaldzou
Copy link
Owner

Hi, please try the step 1,2 and 3 on here "How to update?" and see if it works?

@Raukze
Copy link
Author

Raukze commented Oct 12, 2024

Damn I just restored the backup. Will try the whole update progress later again. Thanks!

@Raukze
Copy link
Author

Raukze commented Oct 14, 2024

Update is successful:

root@wireguard:/etc/wgdashboard/src# ./wgd.sh update
------------------------------------------------------------
| Are you sure you want to update to the v4.0.4? (Y/N): Y
| Shutting down WGDashboard...                             |
| Downloading v4.0.4 from GitHub...                            |
| Upgrading pip                                            |
| Installing latest Python dependencies                    |
| Update Successfully!                                     |
------------------------------------------------------------

But when trying to start:

root@wireguard:/etc/wgdashboard/src# ./wgd.sh start
------------------------------------------------------------
[WGDashboard] Starting WGDashboard with Gunicorn in the background.
[WGDashboard] Creating Python Virtual Environment under ./venv
sudo: ./venv/bin/gunicorn: command not found

and it stops there.

@barryboom
Copy link

reported a few weeks ago that the upgrade process does not work moving from v3 to v4 but as yet still no resoloution but some troubleshooting links it back to bcrypt

@donaldzou
Copy link
Owner

Hi @Raukze , you mind follow these steps instead of using ./wgd.sh update?

  1. Change your directory to wgdashboard

    cd wgdashboard/src
  2. Update the dashboard

    git pull https://github.com/donaldzou/WGDashboard.git --force
  3. Install

    sudo ./wgd.sh install

@DaanSelen
Copy link
Collaborator

@donaldzou the updating method is through GitHub correct?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants