PhlexPlexico / get5-web

[END OF LIFE] Webpanel for servers using the get5 CS:GO server plugin
GNU General Public License v3.0
21 stars 10 forks source link

[BUG] pip install -r requirements.txt MySQL-python==1.2.5 error #169

Closed gouyeh closed 4 years ago

gouyeh commented 4 years ago

Getting error using this command pip install -r requirements.txt Using Centos7, Vestacp with nginx+apache and mariadb.

`Collecting MySQL-python==1.2.5 Using cached https://files.pythonhosted.org/packages/a5/e9/51b544da85a36a68debe7a7091f068d802fc515a3a202652828c73453cad/MySQL-python-1.2.5.zip ERROR: Command errored out with exit status 1: command: /var/get5-web/venv/bin/python2 -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-n8YwqK/MySQL-python/setup.py'"'"'; file='"'"'/tmp/pip-install-n8YwqK/MySQL-python/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(file);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, file, '"'"'exec'"'"'))' egg_info --egg-base /tmp/pip-install-n8YwqK/MySQL-python/pip-egg-info cwd: /tmp/pip-install-n8YwqK/MySQL-python/ Complete output (10 lines): sh: mysql_config: command not found Traceback (most recent call last): File "", line 1, in File "/tmp/pip-install-n8YwqK/MySQL-python/setup.py", line 17, in metadata, options = get_config() File "setup_posix.py", line 43, in get_config libs = mysql_config("libs_r") File "setup_posix.py", line 25, in mysql_config raise EnvironmentError("%s not found" % (mysql_config.path,)) EnvironmentError: mysql_config not found

ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output. `

PhlexPlexico commented 4 years ago

Looking online, it seems you're missing libraries on your machine. This is only supported on Apache with Debian/Ubuntu 16.04. Please see the install guide. Chances are packages are missing, and that is causing Crypto to not install either. And please use templates when submitting an issue :)

Also reference for packages: here

gouyeh commented 4 years ago

Actually #169 error i got when i try to install from scratch. and not related to error #168

PhlexPlexico commented 4 years ago

If you made it past this error with pip, it would solve the error with the manager.db, as you're not installing all the packages. This webpanel isn't meant to be used as a drop-in replacement for splewis', so I would highly recommend against just replacing files. Once you make it past this error, the other one will resolve itself.

There's new libraries and updates to old ones, as it was patching security issues with outdated/older versions of things. The whole point of a virtual environment is to make sure it's separate from other projects, and you should not copy it from one project to another.

PhlexPlexico commented 4 years ago

Also, if you're using a newer system (e.g. I was using Raspbian Buster I believe), mysql-client was removed as well, which caused me to do a bunch of work arounds on the system itself, such as re-linking a few *.so files, installing mariadb client, etc.

As it stands, there's not much I can do to "fix" this in the code. This is all user/system configuration, and not making changes in the web-app. The link I sent you in the reference should have a CentOS similar command that will install the proper MySQL headers/libraries on your machine, and after that please get back to me as we can use this as a learning experience for installing on different operating systems :)

Also, googling "CentOS Python-Mysql mysql_config not found" I've stumbled upon this: https://stackoverflow.com/a/13932070/2124946

In the comments, it mentions if you're using mariadb, you can install mariadb-devel to get the required files to install mysql-python.

PhlexPlexico commented 4 years ago

So, has this been resolved?

PhlexPlexico commented 4 years ago

Closing as no response in two weeks.

gouyeh commented 4 years ago

Sorry for late response, this issue has been resolved with downgrading my mariadb from 10.2 to 5.5, now every requirement installed correctly without any error, but when upgrading database getting error.

Specs: Centos 7, Vestacp with nginx+apache and mariadb 5.5

./manager.py db upgrade Traceback (most recent call last): File "./manager.py", line 3, in import get5 File "/var/www/get5-web/init.py", line 30, in from flask import (Flask, render_template, flash, jsonify, File "/var/www/get5-web/venv/lib/python2.7/site-packages/flask/init.py", line 21, in from .app import Flask, Request, Response File "/var/www/get5-web/venv/lib/python2.7/site-packages/flask/app.py", line 23, in from werkzeug.routing import BuildError, Map, RequestRedirect, Rule File "/var/www/get5-web/venv/lib/python2.7/site-packages/werkzeug/routing.py", line 948 exec(code, globs, locs) SyntaxError: unqualified exec is not allowed in function '_compile_builder' it contains a nested function with free variables

PhlexPlexico commented 4 years ago

Not sure how downgrading the database solved it, but alright. As for that other error, and I'm not sure about the version of werkzeug but it seems it's a problem with using Cent OS' python deliverables. Either up the Werkzeug line in requirements.txt or downgrade python to 2.7.4 I guess.

https://github.com/pallets/werkzeug/issues/1544 for reference.

gouyeh commented 4 years ago

Splewis also updated this requirement Werkzeug==0.11.9 to Werkzeug==0.15.3 same error getting on Splewis version.

But i change requirement to old one Werkzeug==0.11.9 and try to upgrade db and successfully upgraded.

Can i use old version of this Werkzeug requirement is it safe or any issue :s??

gouyeh commented 4 years ago

Update! I changed requirement to Werkzeug 0.14 version because your get5 version incompatible with 11.9 version.

Successfully upgraded database and panel is working fine.

Clicking links of web panel again and again to test errors and getting some time this error on browser

Sorry, unexpected error: 'Pagination' object is not iterable

After restart apache this error is fixed.

Werkzeug 0.14 This version is safe to use?

Thanks

PhlexPlexico commented 4 years ago

Could be. Haven't looked over the release notes to indicate if it's safe, so I'm unsure.

Support for this project has been dropped, but if you would like to create a PR and integrate it after a decent amount of testing, feel free to!

A note as well, whenever you make changes to the webpanel, you will always have to restart Apache for the changes to take affect, there is no hot-loading for this application.

gouyeh commented 4 years ago

Can you guide me how to disable Ajax based pages. This Panel take too much time to load.

PhlexPlexico commented 4 years ago

You're gonna have to google for that. I don't help with server setup, sorry.