Skip to content

Internal Server Error #63

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

Closed
modir opened this issue Jul 24, 2020 · 11 comments
Closed

Internal Server Error #63

modir opened this issue Jul 24, 2020 · 11 comments

Comments

@modir
Copy link

modir commented Jul 24, 2020

I made a fresh installation with iRedMail 1.3.1 on CentOS 7. The installation went fine. After the reboot I wanted to log into iredadmin and I always get the error message "Internal Server Error".

I find no error messages in the logs? Is there a specific log for iredadmin? I couldn't find any information about a log file in the iRedMail.tips file either.

@modir
Copy link
Author

modir commented Jul 24, 2020

OK I found out that the logs are in the normal messages file.

Here is the real problem:

uwsgi: Traceback (most recent call last):
uwsgi:  File "/opt/www/iRedAdmin-1.0/iredadmin.py", line 9, in <module>
uwsgi: 
uwsgi: from libs import iredbase
uwsgi:  File "/opt/www/iRedAdmin-1.0/libs/iredbase.py", line 7, in <module>
uwsgi: 
uwsgi: import web
uwsgi: ImportError
uwsgi: :
uwsgi: No module named web
uwsgi: 

It looks like something was not installed during installation.

@modir
Copy link
Author

modir commented Jul 24, 2020

After some more investigation:

[root@server iRedMail-1.3.1]# pip3 install web.py
WARNING: Running pip install with root privileges is generally not a good idea. Try `pip3 install --user` instead.
Requirement already satisfied: web.py in /usr/local/lib/python3.6/site-packages
Requirement already satisfied: cheroot in /usr/local/lib/python3.6/site-packages (from web.py)
Requirement already satisfied: jaraco.functools in /usr/local/lib/python3.6/site-packages (from cheroot->web.py)
Requirement already satisfied: six>=1.11.0 in /usr/local/lib/python3.6/site-packages (from cheroot->web.py)
Requirement already satisfied: more-itertools>=2.6 in /usr/local/lib/python3.6/site-packages (from cheroot->web.py)
        
[root@server iRedMail-1.3.1]# cd /opt/www/iredadmin/
  
[root@server iredadmin]# python ./iredadmin.py 
Traceback (most recent call last):
  File "./iredadmin.py", line 9, in <module>
    from libs import iredbase
  File "/opt/www/iRedAdmin-1.0/libs/iredbase.py", line 7, in <module>
    import web
ImportError: No module named web
[root@server iredadmin]# python3 ./iredadmin.py 
Traceback (most recent call last):
  File "./iredadmin.py", line 9, in <module>
    from libs import iredbase
  File "/opt/www/iRedAdmin-1.0/libs/iredbase.py", line 202
    except Exception, e:
                    ^
SyntaxError: invalid syntax

So the problem is that web.py was installed with python3. Because with python3 the script can be started. But then we have syntax error. So it looks like right now no installation is possible which gives us a stable set-up.

@iredmail
Copy link
Owner

iRedAdmin(-Pro) relies on Python 2, not 3.
Please run commands below to fix it:

pip2 install web.py==0.51
service iredadmin restart

Will double check and fix it, then repack iRedMail-1.3.1.

We're working on moving iRedAdmin(-Pro) to Python 3, SQL edition is done, but LDAP edition requires huge changes, it will delay for some more time.

@iredmail
Copy link
Owner

Some more detail if you're interested in: web.py team released a new version 0.60 yesterday, but it's not marked as Python 3 (>=3.5) only. But iRedMail installer installs web.py with >=0.51 flag, this way it installs 0.60 instead of 0.51 and failed.

@iredmail
Copy link
Owner

Update: re-packaged iRedMail-1.3.1 with pip issue fixed.

@modir
Copy link
Author

modir commented Jul 26, 2020

Thanks for the details.

Now it works again.

@UweKrause
Copy link

UweKrause commented Aug 18, 2020

I have the same issue ("internal server error" after fresh install)
Absolute fresh Debian 10, fresh installation, I did everything absolutely according to the book.

pip2 install web.py==0.51 did not fix it.

But by first installing python-setuptools (apt-get install python-setuptools)
and afterwards installing web.py (pip install web.py==0.51) it worked!

During installation it already showed the problem:

Collecting web.py==0.51
  Using cached https://files.pythonhosted.org/packages/45/81/4f598ed7089a7be632d5787882c8a384f413ef4262b4fe30b1972e61f9dc/web.py-0.51.tar.gz
    Complete output from command python setup.py egg_info:
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
    ImportError: No module named setuptools

    ----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-install-5A2227/web.py/

content of /var/log/nginx/error.log

2020/08/18 23:43:24 [error] 739#739: *793 FastCGI sent in stderr: "Primary script unknown" while reading response header from upstream, client: 195.54.160.21, server: _, request: "GET /index.php?s=/Index/\think\app/invokefunction&function=call_user_func_array&vars[0]=md5&vars[1][]=HelloThinkPHP HTTP/1.1", upstream: "fastcgi://127.0.0.1:9999", host: "116.203.202.52:443"
2020/08/18 23:46:52 [error] 739#739: *878 open() "/var/www/html/api/jsonws/invoke" failed (2: No such file or directory), client: 195.54.160.21, server: _, request: "POST /api/jsonws/invoke HTTP/1.1", host: "116.203.202.52:443"
2020/08/19 00:22:04 [error] 720#720: *667 FastCGI sent in stderr: "Primary script unknown" while reading response header from upstream, client: 195.54.160.21, server: _, request: "GET /vendor/phpunit/phpunit/src/Util/PHP/eval-stdin.php HTTP/1.1", upstream: "fastcgi://127.0.0.1:9999", host: "116.203.202.52:443"
2020/08/19 00:22:04 [error] 720#720: *669 FastCGI sent in stderr: "Primary script unknown" while reading response header from upstream, client: 195.54.160.21, server: _, request: "POST /vendor/phpunit/phpunit/src/Util/PHP/eval-stdin.php HTTP/1.1", upstream: "fastcgi://127.0.0.1:9999", host: "116.203.202.52:443"

@iredmail
Copy link
Owner

Dear @UweKrause

Please install package python-setuptools first, then install web.py with pip:

apt install python-setuptools
pip2 install web.py==0.51

@xpresserversllc
Copy link

Just upgraded distro from Ubuntu 18.04 LTS to Ubuntu 20.04 LTS. iRedMail was working fine before upgrade but after upgrade admin panel throwing internal server error with this log

Jul 10 13:45:04 iredmail iredadmin[4313]: spawned uWSGI worker 5 (pid: 4320, cores: 1)
Jul 10 13:45:11 iredmail iredadmin[4313]: Traceback (most recent call last):
Jul 10 13:45:11 iredmail iredadmin[4313]:   File "/opt/www/iRedAdmin-1.3/iredadmin.py", line 8, in <module>
Jul 10 13:45:11 iredmail iredadmin[4313]:     from libs import iredbase
Jul 10 13:45:11 iredmail iredadmin[4313]:   File "/opt/www/iRedAdmin-1.3/libs/iredbase.py", line 5, in <module>
Jul 10 13:45:11 iredmail iredadmin[4313]:     import web
Jul 10 13:45:11 iredmail iredadmin[4313]: ModuleNotFoundError: No module named 'web'
Jul 10 13:45:11 iredmail iredadmin[4313]: unable to load app 0 (mountpoint='iredmail.xpresservers.pk|/iredadmin') (call>
Jul 10 13:45:11 iredmail iredadmin[4313]: --- no python application found, check your startup logs for errors ---
Jul 10 13:45:11 iredmail iredadmin[4313]: [xx.xx.xx.xx] GET /iredadmin/dashboard 500 104 "-"

@therodfather
Copy link

You are an absolute legend! Thank you!

I had to do: pip3 install web.py==0.61

Once I did that, my upgrade to 1.7 worked.

Thanks again!

@iredmail
Copy link
Owner

iredmail commented Jun 1, 2022

Better upgrade to 0.62 instead.

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

5 participants