1

Topic: 'Internal server error accessing ' iredadmin/system/log?*

==== REQUIRED BASIC INFO OF YOUR IREDMAIL SERVER ====
- iRedMail version (check /etc/iredmail-release): 0.9.9
- Deployed with iRedMail Easy or the downloadable installer? No
- Linux/BSD distribution name and version: CentOS 7.7
- Store mail accounts in which backend (LDAP/MySQL/PGSQL): MySQL
- Web server (Apache or Nginx): Apache
- Manage mail accounts with iRedAdmin-Pro? No
- [IMPORTANT] Related original log or error message is required if you're experiencing an issue.
====

I refer to this post as representing the same issue that I have.
iRedAdmin-Pro Support Post

My log /var/log/messages
Showing 200 response for system/log and 500 response when a QueryString is added.

Sep 29 01:07:41 server uwsgi: server.domain.com [pid: 15601|app: 0|req: 11/33] 103.115.189.3 () {76 vars in 1618 bytes} [Sun Sep 29 01:07:41 2019] GET /iredadmin/system/log => generated 43646 bytes in 470 msecs (HTTP/1.1 200) 2 headers in 136 bytes (2 switches on core 0)
Sep 29 01:08:05 server uwsgi: server.domain.com [pid: 15601|app: 0|req: 12/34] 103.115.189.3 () {76 vars in 1647 bytes} [Sun Sep 29 01:08:05 2019] GET /iredadmin/system/log?admin=postmaster@domain.com => generated 21 bytes in 8 msecs (HTTP/1.1 500) 2 headers in 155 bytes (2 switches on core 0)

Unfortunately the fix includes "easy_install web.py==0.40.dev1".
I am not using easy_install, so I do not have access to the updated code.

I am happy to perform the steps described if I can get the new version.

For reference, these are the versions of the python packages referred to in the other post.  Both were already installed.

# yum info python-webpy
Installed Packages
Name        : python-webpy
Arch        : noarch
Version     : 0.37
Release     : 8.el7
Size        : 592 k
Repo        : installed
From repo   : epel
# yum info python-setuptools
Installed Packages
Name        : python-setuptools
Arch        : noarch
Version     : 0.9.8
Release     : 7.el7
Size        : 1.9 M
Repo        : installed
From repo   : base

Thank you.

----

Spider Email Archiver: On-Premises, lightweight email archiving software developed by iRedMail team. Supports Amazon S3 compatible storage and custom branding.

2

Re: 'Internal server error accessing ' iredadmin/system/log?*

With package "python-setuptools" installed, you should have command "easy_install" available.
Run "easy_install web.py" should install the latest web.py 0.40 for you (btw, i'm now one of the web.py maintainers and i tagged this 0.40 release days ago), then restart "iredadmin" service.

3

Re: 'Internal server error accessing ' iredadmin/system/log?*

ZhangHuangbin wrote:

With package "python-setuptools" installed, you should have command "easy_install" available.

Oh, wow.  Clearly I know nothing of the Python eco system.
I was confused that "iRedMail Easy" and "easy_install" were the same.

I ran this:

# easy_install web.py
Searching for web.py
Best match: web.py 0.37
Adding web.py 0.37 to easy-install.pth file

Using /usr/lib/python2.7/site-packages
Processing dependencies for web.py
Finished processing dependencies for web.py

and restarted iredadmin (I'm using the Apache mod_proxy_uwsgi)

systemctl restart iredadmin

But refreshing the iredadmin page and clicking the link in the "Admin" column still shows

internal server error

Given your update to the post, I tried the specifying the version.

# easy_install web.py==0.40
Searching for web.py==0.40
Reading https://pypi.python.org/simple/web.py/
Best match: web.py 0.40
Processing web.py-0.40-py2.7.egg
Adding web.py 0.40 to easy-install.pth file

Using /usr/lib/python2.7/site-packages/web.py-0.40-py2.7.egg
Processing dependencies for web.py==0.40
Searching for cheroot
Reading https://pypi.python.org/simple/cheroot/
Best match: cheroot 7.0.0
Downloading https://files.pythonhosted.org/packages/8a/07/18c73c3064e6a429084b93ed05acd51d557235ef32b72e1545ec09f30f5b/cheroot-7.0.0.tar.gz#sha256=6168371ab9aaf574ac5f75675f244bbfebf990202bf75048065e9d675b9ae719
Processing cheroot-7.0.0.tar.gz
Writing /tmp/easy_install-bAgHPo/cheroot-7.0.0/setup.cfg
Running cheroot-7.0.0/setup.py -q bdist_egg --dist-dir /tmp/easy_install-bAgHPo/cheroot-7.0.0/egg-dist-tmp-wU0sb6
Traceback (most recent call last):
  File "/usr/bin/easy_install", line 9, in <module>
    load_entry_point('setuptools==0.9.8', 'console_scripts', 'easy_install')()
  File "/usr/lib/python2.7/site-packages/setuptools/command/easy_install.py", line 1992, in main
    with_ei_usage(lambda:
  File "/usr/lib/python2.7/site-packages/setuptools/command/easy_install.py", line 1979, in with_ei_usage
    return f()
  File "/usr/lib/python2.7/site-packages/setuptools/command/easy_install.py", line 1996, in <lambda>
    distclass=DistributionWithoutHelpCommands, **kw
  File "/usr/lib64/python2.7/distutils/core.py", line 152, in setup
    dist.run_commands()
  File "/usr/lib64/python2.7/distutils/dist.py", line 953, in run_commands
    self.run_command(cmd)
  File "/usr/lib64/python2.7/distutils/dist.py", line 972, in run_command
    cmd_obj.run()
  File "/usr/lib/python2.7/site-packages/setuptools/command/easy_install.py", line 380, in run
    self.easy_install(spec, not self.no_deps)
  File "/usr/lib/python2.7/site-packages/setuptools/command/easy_install.py", line 623, in easy_install
    return self.install_item(spec, dist.location, tmpdir, deps)
  File "/usr/lib/python2.7/site-packages/setuptools/command/easy_install.py", line 658, in install_item
    self.process_distribution(spec, dists[0], deps, "Using")
  File "/usr/lib/python2.7/site-packages/setuptools/command/easy_install.py", line 706, in process_distribution
    [requirement], self.local_index, self.easy_install
  File "/usr/lib/python2.7/site-packages/pkg_resources.py", line 618, in resolve
    dist = best[req.key] = env.best_match(req, self, installer)
  File "/usr/lib/python2.7/site-packages/pkg_resources.py", line 862, in best_match
    return self.obtain(req, installer) # try and download/install
  File "/usr/lib/python2.7/site-packages/pkg_resources.py", line 874, in obtain
    return installer(requirement)
  File "/usr/lib/python2.7/site-packages/setuptools/command/easy_install.py", line 623, in easy_install
    return self.install_item(spec, dist.location, tmpdir, deps)
  File "/usr/lib/python2.7/site-packages/setuptools/command/easy_install.py", line 653, in install_item
    dists = self.install_eggs(spec, download, tmpdir)
  File "/usr/lib/python2.7/site-packages/setuptools/command/easy_install.py", line 849, in install_eggs
    return self.build_and_install(setup_script, setup_base)
  File "/usr/lib/python2.7/site-packages/setuptools/command/easy_install.py", line 1130, in build_and_install
    self.run_setup(setup_script, setup_base, args)
  File "/usr/lib/python2.7/site-packages/setuptools/command/easy_install.py", line 1115, in run_setup
    run_setup(setup_script, args)
  File "/usr/lib/python2.7/site-packages/setuptools/sandbox.py", line 69, in run_setup
    lambda: execfile(
  File "/usr/lib/python2.7/site-packages/setuptools/sandbox.py", line 120, in run
    return func()
  File "/usr/lib/python2.7/site-packages/setuptools/sandbox.py", line 71, in <lambda>
    {'__file__':setup_script, '__name__':'__main__'}
  File "setup.py", line 123, in <module>
  File "setup.py", line 74, in read_configuration
  File "setup.py", line 50, in cfg_val_to_list
TypeError: descriptor 'strip' requires a 'str' object but received a 'unicode'

# systemctl restart iredadmin

But now iredadmin does not work at all.

I found I could roll back like this.... and now the web page works, but still exhibiting the original system/logs issue.

# easy_install web.py==0.37
Searching for web.py==0.37
Best match: web.py 0.37
Removing web.py 0.40 from easy-install.pth file
Adding web.py 0.37 to easy-install.pth file

Using /usr/lib/python2.7/site-packages
Processing dependencies for web.py==0.37
Finished processing dependencies for web.py==0.37

# systemctl restart iredadmin

I'm not quite sure what the issue was with easy_install.

Thanks, Rob

4

Re: 'Internal server error accessing ' iredadmin/system/log?*

For reference, I am running iRedAdmin v0.9.8 (MySQL).

5

Re: 'Internal server error accessing ' iredadmin/system/log?*

rob.ired wrote:

I was confused that "iRedMail Easy" and "easy_install" were the same.

iRedMail Easy is the name of our web-based deployment/upgrade/tech support platform. "easy_install" is a Python package manager. They're different things.

Is command "pip" or "pip2" available on your server? If yes, try it instead of "easy_install" like this:

pip install web.py==0.40

6

Re: 'Internal server error accessing ' iredadmin/system/log?*

No luck on the pip commands.

# pip install web.py==0.40
-bash: pip: command not found
# pip2 install web.py==0.40
-bash: pip2: command not found

It seems that the easy_install fails trying to install cheroot.  so I tried that by itself.

# easy_install cheroot
Searching for cheroot
Reading [url]https://pypi.python.org/simple/cheroot/[/url]
Best match: cheroot 7.0.0
<snip - error as previously posted>
TypeError: descriptor 'strip' requires a 'str' object but received a 'unicode'
# 

Thanks, Rob

7

Re: 'Internal server error accessing ' iredadmin/system/log?*

Try the previous stable release 6.6.0 instead of latest 7.0.0:

easy_install https://files.pythonhosted.org/packages/c7/2b/9d8f54399f1acd2c87a61d72de7018aeb7d4adfabb6c0ca1ff89c9d2b79b/cheroot-6.6.0.tar.gz

8

Re: 'Internal server error accessing ' iredadmin/system/log?*

ZhangHuangbin wrote:

Try the previous stable release 6.6.0 instead of latest 7.0.0:

Ok, and this is the result.

# easy_install https://files.pythonhosted.org/packages/c7/2b/9d8f54399f1acd2c87a61d72de7018aeb7d4adfabb6c0ca1ff89c9d2b79b/cheroot-6.6.0.tar.gz
Downloading https://files.pythonhosted.org/packages/c7/2b/9d8f54399f1acd2c87a61d72de7018aeb7d4adfabb6c0ca1ff89c9d2b79b/cheroot-6.6.0.tar.gz
Processing cheroot-6.6.0.tar.gz
Writing /tmp/easy_install-c0ic5O/cheroot-6.6.0/setup.cfg
Running cheroot-6.6.0/setup.py -q bdist_egg --dist-dir /tmp/easy_install-c0ic5O/cheroot-6.6.0/egg-dist-tmp-X82PAP
Traceback (most recent call last):
  File "/usr/bin/easy_install", line 9, in <module>
    load_entry_point('setuptools==0.9.8', 'console_scripts', 'easy_install')()
  File "/usr/lib/python2.7/site-packages/setuptools/command/easy_install.py", line 1992, in main
    with_ei_usage(lambda:
  File "/usr/lib/python2.7/site-packages/setuptools/command/easy_install.py", line 1979, in with_ei_usage
    return f()
  File "/usr/lib/python2.7/site-packages/setuptools/command/easy_install.py", line 1996, in <lambda>
    distclass=DistributionWithoutHelpCommands, **kw
  File "/usr/lib64/python2.7/distutils/core.py", line 152, in setup
    dist.run_commands()
  File "/usr/lib64/python2.7/distutils/dist.py", line 953, in run_commands
    self.run_command(cmd)
  File "/usr/lib64/python2.7/distutils/dist.py", line 972, in run_command
    cmd_obj.run()
  File "/usr/lib/python2.7/site-packages/setuptools/command/easy_install.py", line 380, in run
    self.easy_install(spec, not self.no_deps)
  File "/usr/lib/python2.7/site-packages/setuptools/command/easy_install.py", line 599, in easy_install
    return self.install_item(None, download, tmpdir, deps, True)
  File "/usr/lib/python2.7/site-packages/setuptools/command/easy_install.py", line 653, in install_item
    dists = self.install_eggs(spec, download, tmpdir)
  File "/usr/lib/python2.7/site-packages/setuptools/command/easy_install.py", line 849, in install_eggs
    return self.build_and_install(setup_script, setup_base)
  File "/usr/lib/python2.7/site-packages/setuptools/command/easy_install.py", line 1130, in build_and_install
    self.run_setup(setup_script, setup_base, args)
  File "/usr/lib/python2.7/site-packages/setuptools/command/easy_install.py", line 1115, in run_setup
    run_setup(setup_script, args)
  File "/usr/lib/python2.7/site-packages/setuptools/sandbox.py", line 69, in run_setup
    lambda: execfile(
  File "/usr/lib/python2.7/site-packages/setuptools/sandbox.py", line 120, in run
    return func()
  File "/usr/lib/python2.7/site-packages/setuptools/sandbox.py", line 71, in <lambda>
    {'__file__':setup_script, '__name__':'__main__'}
  File "setup.py", line 123, in <module>
  File "setup.py", line 74, in read_configuration
  File "setup.py", line 50, in cfg_val_to_list
TypeError: descriptor 'strip' requires a 'str' object but received a 'unicode'
# 

9

Re: 'Internal server error accessing ' iredadmin/system/log?*

Please try even older cheroot release:
https://pypi.org/project/cheroot/#history

10

Re: 'Internal server error accessing ' iredadmin/system/log?*

OK, i got feedback from cheroot developers, the "easy_install" tool is out of date and not supported by cheroot. You have to install "pip" first, then install cheroot with pip:

easy_install pip
pip install cheroot

11

Re: 'Internal server error accessing ' iredadmin/system/log?*

Thank you.

I have installed pip.

# easy_install pip
Searching for pip
Reading https://pypi.python.org/simple/pip/
Best match: pip 19.2.3
Downloading https://files.pythonhosted.org/packages/00/9e/4c83a0950d8bdec0b4ca72afd2f9cea92d08eb7c1a768363f2ea458d08b4/pip-19.2.3.tar.gz#sha256=e7a31f147974362e6c82d84b91c7f2bdf57e4d3163d3d454e6c3e71944d67135
Processing pip-19.2.3.tar.gz
Writing /tmp/easy_install-kTDAOn/pip-19.2.3/setup.cfg
Running pip-19.2.3/setup.py -q bdist_egg --dist-dir /tmp/easy_install-kTDAOn/pip-19.2.3/egg-dist-tmp-K87FDM
/usr/lib64/python2.7/distutils/dist.py:267: UserWarning: Unknown distribution option: 'python_requires'
  warnings.warn(msg)
warning: no files found matching 'docs/docutils.conf'
warning: no previously-included files found matching '.coveragerc'
warning: no previously-included files found matching '.mailmap'
warning: no previously-included files found matching '.appveyor.yml'
warning: no previously-included files found matching '.travis.yml'
warning: no previously-included files found matching 'tox.ini'
warning: no files found matching 'Makefile' under directory 'docs'
warning: no files found matching '*.bat' under directory 'docs'
warning: no previously-included files found matching 'src/pip/_vendor/six'
warning: no previously-included files found matching 'src/pip/_vendor/six/moves'
warning: no previously-included files matching '*.pyi' found under directory 'src/pip/_vendor'
no previously-included directories found matching '.github'
no previously-included directories found matching '.azure-pipelines'
no previously-included directories found matching 'docs/build'
no previously-included directories found matching 'news'
no previously-included directories found matching 'tasks'
no previously-included directories found matching 'tests'
no previously-included directories found matching 'tools'
Adding pip 19.2.3 to easy-install.pth file
Installing pip script to /usr/bin
Installing pip2.7 script to /usr/bin
Installing pip2 script to /usr/bin

Installed /usr/lib/python2.7/site-packages/pip-19.2.3-py2.7.egg
Processing dependencies for pip
Finished processing dependencies for pip

Looks ok.
Next, Install cheroot.

#pip install cheroot
DEPRECATION: Python 2.7 will reach the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 won't be maintained after that date. A future version of pip will drop support for Python 2.7. More details about Python 2 support in pip, can be found at https://pip.pypa.io/en/latest/development/release-process/#python-2-support
Collecting cheroot
  Downloading https://files.pythonhosted.org/packages/b8/9d/c3ea7e706c13070722a115ca456ae58951dfb0bf01ae2e6b589155dec9fd/cheroot-8.1.0-py2.py3-none-any.whl (79kB)
     | 81kB 16.4MB/s 
Collecting jaraco.functools (from cheroot)
  Downloading https://files.pythonhosted.org/packages/12/a4/3e7366d0f5e75dcad7be88524c8cbd0f3a9fb1db243269550981740c57fe/jaraco.functools-2.0-py2.py3-none-any.whl
Collecting six>=1.11.0 (from cheroot)
  Downloading https://files.pythonhosted.org/packages/73/fb/00a976f728d0d1fecfe898238ce23f502a721c0ac0ecfedb80e0d88c64e9/six-1.12.0-py2.py3-none-any.whl
Collecting more-itertools>=2.6 (from cheroot)
  Downloading https://files.pythonhosted.org/packages/2f/9d/dcfe59e213093695f108508af1214cf9cd95cc5489e46877ec5cb56369e5/more_itertools-5.0.0-py2-none-any.whl (52kB)
     | 61kB 16.0MB/s 
Collecting backports.functools-lru-cache; python_version < "3.3" (from cheroot)
  Downloading https://files.pythonhosted.org/packages/03/8e/2424c0e65c4a066e28f539364deee49b6451f8fcd4f718fefa50cc3dcf48/backports.functools_lru_cache-1.5-py2.py3-none-any.whl
Installing collected packages: six, more-itertools, backports.functools-lru-cache, jaraco.functools, cheroot
  Found existing installation: six 1.9.0
    Uninstalling six-1.9.0:
      Successfully uninstalled six-1.9.0
Successfully installed backports.functools-lru-cache-1.5 cheroot-8.1.0 jaraco.functools-2.0 more-itertools-5.0.0 six-1.12.0

Looks ok.
Next, Install web.py.

#easy_install web.py
Searching for web.py
Best match: web.py 0.40
Processing web.py-0.40-py2.7.egg
Adding web.py 0.40 to easy-install.pth file

Using /usr/lib/python2.7/site-packages/web.py-0.40-py2.7.egg
Processing dependencies for web.py
Finished processing dependencies for web.py
# systemctl restart iredadmin

Looks ok.
Next, check the iredadmin webpage.

internal server error

Sad.
I returned to 0.37

# easy_install web.py==0.37

Restarted iredadmin service, and the webpage responded again.

Thanks, Rob.

12

Re: 'Internal server error accessing ' iredadmin/system/log?*

After installed web.py 0.40, did you restart Apache service? (If you're running Nginx, you should restart "iredadmin" service instead)

13

Re: 'Internal server error accessing ' iredadmin/system/log?*

ZhangHuangbin wrote:

After installed web.py 0.40, did you restart Apache service? (If you're running Nginx, you should restart "iredadmin" service instead)

I have not restarted Apache because I have updated the config to use the new iredadmin service on port 7791 as per this post.

    Alias               /iredadmin/static "/var/www/iredadmin/static/"
    ProxyPass        /iredadmin/static  !
    ProxyPass        /iredadmin "uwsgi://127.0.0.1:7791"

I did restart the iredadmin service

rob.ired wrote:

Restarted iredadmin service, and the webpage responded again.

Thanks, Rob.