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

[BUG] MySQL Configuration Error with remote db host in settings.py and db user creation #1125

Open
agenciesunited opened this issue Sep 10, 2023 · 2 comments

Comments

@agenciesunited
Copy link

Describe the bug
When installing Cyberpanel with the script and MySQL on a remote host, the script on my opinion misconfigures /usr/local/CyberCP/CyberCP/settings.py which causes the a 500 error because Cyberpanel cannot read/write on the database “cyberpanel”.

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

  1. Installation with Script on Rocky Linux 8
  2. Remote MySQL / MariaDB Host
  3. calling https://IP:8090 causes Error 500

Expected behavior
Showing Panel Login Page

Operating system:
Rocky 8

CyberPanel version:
2.3.4

Additional context
when installing Cyberpanel with the script and MySQL on a remote host, the script on my opinion misconfigures /usr/local/CyberCP/CyberCP/settings.py which causes the a 500 error because Cyberpanel cannot read/write on the database “cyberpanel”.

The IP of the remote MySQL Host is correctly configured for the root user (local IP of container running MariaDB). But for the cyberpanel database it sets the public IP:


    DATABASES = {
    ‘default’: {
    ‘ENGINE’: ‘django.db.backends.mysql’,
    ‘NAME’: ‘cyberpanel’,
    ‘USER’: ‘cyberpanel’,
    ‘PASSWORD’: ‘XXXXXXXX’,
    ‘HOST’: ‘1.2.3.4’, ← public IP of LXD host
    ‘PORT’:‘3306’
    },
    ‘rootdb’: {
    ‘ENGINE’: ‘django.db.backends.mysql’,
    ‘NAME’: ‘mysql’,
    ‘USER’: ‘root’,
    ‘PASSWORD’: ‘XXXXXXXX’,
    ‘HOST’: ‘192.168. 100.10’, ← local IP of LXD Database Container
    ‘PORT’:‘3306’,
    },
    }

The cyberpanel user created on the database container is granted all privileges on the public IP, not on the local IP as specified in the set up script as it should to in order to be able to read/write the database.

So the remote cyberpanel database cannot be accessed from the cyberpanel container which causes the 500 error on access of the panel (http://192.168.100.20:8090/).

I tried to simply update /usr/local/CyberCP/CyberCP/settings.py and grant the cyberpanel user all privileges on the local IP as well but debug mode then shows

    ProgrammingError at /
    (1146, “Table ‘cyberpanel.django_session’ doesn’t exist”)

I assume that because of the public IP Cyberpanel could not initially create all database tables and data.

What could I do?
Does the script has to be adapted?

Thanks for helping!

Magnus

@asklinux
Copy link

asklinux commented Sep 10, 2023 via email

@agenciesunited
Copy link
Author

If you want to sell Add-Ons, you should be a bit faster with reacting to issues. We love your features and your OLS integration but we decided to buy another solution now.

Before we buy it, we wanted to make sure that the system is running perfectly. That is not the case. Pity.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants