1

Topic: 'internal server error' accessing Admin logs

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

- iRedMail 0.9.9
- iRedAdminPro 3.2 (MySQL)
- Initially deployed using installed - updated using site instructions
- Apache

If I try and use any of the filters on -System-Admin Log - it just returns a page with "internal server error".

Is there a fix for this?

Thanks

2

Re: 'internal server error' accessing Admin logs

nickg wrote:

If I try and use any of the filters on -System-Admin Log - it just returns a page with "internal server error".

I thought this was fixed in the latest iRedAdmin-Pro stable release. sad

What's the relevant error message in your Apache log file?

----

Does my reply help a little? How about buying me a cup of coffee ($5) as an encouragement?

buy me a cup of coffee

3

Re: 'internal server error' accessing Admin logs

Hi,
I have 0.9.9 and Admin-Pro 3.3, yet I have this errors for hosted client accounts when they access Admin Logs
Appreciate if this is fixed.
Cheers

ZhangHuangbin wrote:
nickg wrote:

If I try and use any of the filters on -System-Admin Log - it just returns a page with "internal server error".

I thought this was fixed in the latest iRedAdmin-Pro stable release. sad

What's the relevant error message in your Apache log file?

4

Re: 'internal server error' accessing Admin logs

Dear @Aurum,

Any relevant error in Apache/Nginx log file? i need the log for troubleshooting.

----

Does my reply help a little? How about buying me a cup of coffee ($5) as an encouragement?

buy me a cup of coffee

5

Re: 'internal server error' accessing Admin logs

ZhangHuangbin wrote:

Dear @Aurum,

Any relevant error in Apache/Nginx log file? i need the log for troubleshooting.

It gives nothing in error log sad   
Below are the access and error log texts.
root@mail:/var/log/nginx# tail -10 error.log
2019/04/26 13:24:05 [error] 24229#24229: *3901 access forbidden by rule, client: 185.234.217.42, server: mail.aurummail.net, request: "GET /.env HTTP/1.1", host: "206.189.117.246"
2019/04/26 14:58:15 [error] 24229#24229: *3907 access forbidden by rule, client: 185.234.217.42, server: mail.aurummail.net, request: "GET /.env HTTP/1.1", host: "206.189.117.246"
2019/04/26 16:58:31 [crit] 24229#24229: *3912 SSL_do_handshake() failed (SSL: error:1417D102:SSL routines:tls_process_client_hello:unsupported protocol) while SSL handshaking, client: 185.173.35.17, server: 0.0.0.0:443
root@mail:/var/log/nginx# tail -10 access.log
31.167.71.15 - - [26/Apr/2019:20:37:37 +0000] "GET /iredadmin/profile/domain/general/heidelberg.com.sa HTTP/1.1" 200 19328 "https://imail.heidelberg.com.sa/iredadmin/domains" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:66.0) Gecko/20100101 Firefox/66.0"
31.167.71.15 - - [26/Apr/2019:20:37:38 +0000] "GET /iredadmin/static/default/images/rule2.gif HTTP/1.1" 200 54 "https://imail.heidelberg.com.sa/iredadm … screen.css" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:66.0) Gecko/20100101 Firefox/66.0"
31.167.71.15 - - [26/Apr/2019:20:37:41 +0000] "GET /iredadmin/users/heidelberg.com.sa HTTP/1.1" 200 11259 "https://imail.heidelberg.com.sa/iredadm … erg.com.sa" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:66.0) Gecko/20100101 Firefox/66.0"
31.167.71.15 - - [26/Apr/2019:20:37:41 +0000] "GET /iredadmin/static/default/images/arrow_right_off.png HTTP/1.1" 200 346 "https://imail.heidelberg.com.sa/iredadm … screen.css" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:66.0) Gecko/20100101 Firefox/66.0"
31.167.71.15 - - [26/Apr/2019:20:37:41 +0000] "GET /iredadmin/static/default/images/arrow_rightend_off.png HTTP/1.1" 200 367 "https://imail.heidelberg.com.sa/iredadm … screen.css" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:66.0) Gecko/20100101 Firefox/66.0"
31.167.71.15 - - [26/Apr/2019:20:37:41 +0000] "GET /iredadmin/static/fontawesome/webfonts/fa-regular-400.woff2 HTTP/1.1" 200 12228 "https://imail.heidelberg.com.sa/iredadm … ll.min.css" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:66.0) Gecko/20100101 Firefox/66.0"
31.167.71.15 - - [26/Apr/2019:20:37:44 +0000] "GET /iredadmin/activities/quarantined HTTP/1.1" 200 5824 "https://imail.heidelberg.com.sa/iredadm … erg.com.sa" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:66.0) Gecko/20100101 Firefox/66.0"
31.167.71.15 - - [26/Apr/2019:20:37:44 +0000] "GET /iredadmin/static/default/images/but_slide.png HTTP/1.1" 200 629 "https://imail.heidelberg.com.sa/iredadm … screen.css" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:66.0) Gecko/20100101 Firefox/66.0"
31.167.71.15 - - [26/Apr/2019:20:38:07 +0000] "GET /iredadmin/system/log HTTP/1.1" 500 32 "https://imail.heidelberg.com.sa/iredadm … uarantined" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:66.0) Gecko/20100101 Firefox/66.0"
31.167.71.15 - - [26/Apr/2019:20:48:20 +0000] "GET /iredadmin/activities/quarantined/raw/LCke7BU-b9Rj HTTP/1.1" 200 3911 "https://imail.heidelberg.com.sa/iredadm … uarantined" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:66.0) Gecko/20100101 Firefox/66.0"

6

Re: 'internal server error' accessing Admin logs

We released new iRedAdmin-Pro release today, could you upgrade and try again?

----

Does my reply help a little? How about buying me a cup of coffee ($5) as an encouragement?

buy me a cup of coffee

7 (edited by jstewart 2019-04-29 20:54:02)

Re: 'internal server error' accessing Admin logs

FYI this has happened to me on the past two Admin-Pro updates, including today's (3.6). I tried restarting services without any luck, but a complete reboot brought everything back for me.

8

Re: 'internal server error' accessing Admin logs

jstewart wrote:

FYI this has happened to me on the past two Admin-Pro updates, including today's (3.6). I tried restarting services without any luck, but a complete reboot brought everything back for me.

I'm having a similar issue where I get internal server error when viewing existing users or creating new ones.
using 0.9.9 and upgraded today to SQL 3.4
after upgrade it worked, however after changing minimal characters for a user password from 8 to 12 i'm only getting internal server error when viewing user account.  logging into to roundcube still work fine for all users.

nginx error.log is showing nothing.

9

Re: 'internal server error' accessing Admin logs

Phyrax wrote:

after upgrade it worked, however after changing minimal characters for a user password from 8 to 12 i'm only getting internal server error when viewing user account.  logging into to roundcube still work fine for all users.

- Any error in /var/log/syslog or /var/log/messages?
- Is service "mlmmjadmin" running?

----

Does my reply help a little? How about buying me a cup of coffee ($5) as an encouragement?

buy me a cup of coffee

10 (edited by Phyrax 2019-04-30 16:22:05)

Re: 'internal server error' accessing Admin logs

ZhangHuangbin wrote:
Phyrax wrote:

after upgrade it worked, however after changing minimal characters for a user password from 8 to 12 i'm only getting internal server error when viewing user account.  logging into to roundcube still work fine for all users.

- Any error in /var/log/syslog or /var/log/messages?
- Is service "mlmmjadmin" running?

/var/log/messages show this:

Apr 30 08:20:48 mail uwsgi: 127.0.0.1:7790 [pid: 17701|app: 0|req: 3/5] 127.0.0.1 () {32 vars in 666 bytes} [Tue Apr 30 08:20:48 2019] GET /api/subscriber/firstname.lastname@domainname.com/subscribed?query_all_lists=no&email_only=yes => generated 31 bytes in 1 msecs (HTTP/1.1 200) 1 headers in 51 bytes (2 switches on core 0)
Apr 30 08:20:48 mail uwsgi: 127.0.0.1:7790 [pid: 17698|app: 0|req: 1/6] 127.0.0.1 () {32 vars in 664 bytes} [Tue Apr 30 08:20:48 2019] GET /api/subscriber/firstname.lastname@domainname.com/subscribed?query_all_lists=no&email_only=no => generated 31 bytes in 13 msecs (HTTP/1.1 200) 1 headers in 51 bytes (2 switches on core 0)
Apr 30 08:20:50 mail uwsgi: Traceback (most recent call last):#012  File "/usr/lib/python2.7/site-packages/web/application.py", line 239, in process#012    return self.handle()#012  File "/usr/lib/python2.7/site-packages/web/application.py", line 230, in handle#012    return self._delegate(fn, self.fvars, args)#012  File "/usr/lib/python2.7/site-packages/web/application.py", line 420, in _delegate#012    return handle_class(cls)#012  File "/usr/lib/python2.7/site-packages/web/application.py", line 396, in handle_class#012    return tocall(*args)#012  File "/var/www/iRedAdmin-Pro-SQL-3.4/controllers/sql/user.py", line 477, in GET#012    msg=form.get('msg'),#012  File "/var/www/iRedAdmin-Pro-SQL-3.4/libs/iredbase.py", line 179, in render_template#012    return jinja_env.get_template(template_name).render(context)#012  File "/usr/lib/python2.7/site-packages/jinja2/environment.py", line 969, in render#012    return self.environment.handle_exception(exc_info, True)#012  File "/usr/lib/python2.7/site-packages/jinja2/environment.py", line 742, in handle_exception#012    reraise(exc_type, exc_value, tb)#012  File "/var/www/iRedAdmin-Pro-SQL-3.4/libs/../templates/default/sql/user/profile.html", line 46, in top-level template code#012    {% from "macros/msg_handlers.html" import user_msg_handler with context %}#012  File "/var/www/iRedAdmin-Pro-SQL-3.4/libs/../templates/default/layout.html", line 192, in top-level template code#012    {% block main %}{% endblock %}#012  File "/var/www/iRedAdmin-Pro-SQL-3.4/libs/../templates/default/sql/user/profile.html", line 509, in block "main"#012    {{ display_random_password(password_length=min_passwd_length,#012  File "/var/www/iRedAdmin-Pro-SQL-3.4/libs/../templates/default/macros/general.html", line 1914, in template#012    {% set random_password = password_length | generate_random_password %}#012  File "/var/www/iRedAdmin-Pro-SQL-3.4/libs/iredpwd.py", line 113, in generate_random_password#012    length -= 1#012TypeError: unsupported operand type(s) for -=: 'unicode' and 'int'
Apr 30 08:20:50 mail uwsgi: 0)
Apr 30 08:20:50 mail uwsgi: mail.domainname.com [pid: 6469|app: 1|req: 9/16] 10.100.10.25 () {54 vars in 1244 bytes} [Tue Apr 30 08:20:48 2019] GET /iredadmin/profile/user/general/firstname.lastname@domainname.com => generated 21 bytes in 1777 msecs (HTTP/1.1 500) 3 headers in 190 bytes (2 switches on core 0) 

service mlmmjadmin status -l shows me this:

● mlmmjadmin.service - RESTful API server used to manage mlmmj mailing list manager
   Loaded: loaded (/usr/lib/systemd/system/mlmmjadmin.service; enabled; vendor preset: disabled)
   Active: active (running) since Mon 2019-04-29 23:35:51 CEST; 8h ago
  Process: 17683 ExecStopPost=/usr/bin/rm -rf /var/run/mlmmjadmin (code=exited, status=0/SUCCESS)
  Process: 17680 ExecStop=/usr/sbin/uwsgi --stop /var/run/mlmmjadmin/mlmmjadmin.pid (code=exited, status=0/SUCCESS)
  Process: 17693 ExecStartPre=/usr/bin/chmod 0755 /var/run/mlmmjadmin (code=exited, status=0/SUCCESS)
  Process: 17690 ExecStartPre=/usr/bin/chown mlmmj:mlmmj /var/run/mlmmjadmin (code=exited, status=0/SUCCESS)
  Process: 17688 ExecStartPre=/usr/bin/mkdir /var/run/mlmmjadmin (code=exited, status=0/SUCCESS)
 Main PID: 17695 (uwsgi)
   CGroup: /system.slice/mlmmjadmin.service
           ├─17695 /usr/sbin/uwsgi --ini /opt/mlmmjadmin/rc_scripts/uwsgi/rhel.ini --pidfile /var/run/mlmmjadmin/mlmmjadmin.pid
           ├─17698 /usr/sbin/uwsgi --ini /opt/mlmmjadmin/rc_scripts/uwsgi/rhel.ini --pidfile /var/run/mlmmjadmin/mlmmjadmin.pid
           ├─17699 /usr/sbin/uwsgi --ini /opt/mlmmjadmin/rc_scripts/uwsgi/rhel.ini --pidfile /var/run/mlmmjadmin/mlmmjadmin.pid
           ├─17700 /usr/sbin/uwsgi --ini /opt/mlmmjadmin/rc_scripts/uwsgi/rhel.ini --pidfile /var/run/mlmmjadmin/mlmmjadmin.pid
           ├─17701 /usr/sbin/uwsgi --ini /opt/mlmmjadmin/rc_scripts/uwsgi/rhel.ini --pidfile /var/run/mlmmjadmin/mlmmjadmin.pid
           └─17702 /usr/sbin/uwsgi --ini /opt/mlmmjadmin/rc_scripts/uwsgi/rhel.ini --pidfile /var/run/mlmmjadmin/mlmmjadmin.pid

Apr 29 23:35:51 mail.domainname.com uwsgi[17695]: spawned uWSGI worker 2 (pid: 17699, cores: 1)
Apr 29 23:35:51 mail.domainname.com uwsgi[17695]: spawned uWSGI worker 3 (pid: 17700, cores: 1)
Apr 29 23:35:51 mail.domainname.com uwsgi[17695]: spawned uWSGI worker 4 (pid: 17701, cores: 1)
Apr 29 23:35:51 mail.domainname.com uwsgi[17695]: spawned uWSGI worker 5 (pid: 17702, cores: 1)
Apr 30 08:20:48 mail.domainname.com uwsgi[17695]: 127.0.0.1:7790 [pid: 17701|app: 0|req: 3/5] 127.0.0.1 () {32 vars in 666 bytes} [Tue Apr 30 08:20:48 2019] GET /api/subscriber/firstname.lastname@domainname.com/subscribed?query_all_lists=no&email_only=yes => generated 31 bytes in 1 msecs (HTTP/1.1 200) 1 headers in 51 bytes (2 switches on core 0)
Apr 30 08:20:48 mail.domainname.com uwsgi[17695]: 127.0.0.1:7790 [pid: 17698|app: 0|req: 1/6] 127.0.0.1 () {32 vars in 664 bytes} [Tue Apr 30 08:20:48 2019] GET /api/subscriber/firstname.lastname@domainname.com/subscribed?query_all_lists=no&email_only=no => generated 31 bytes in 13 msecs (HTTP/1.1 200) 1 headers in 51 bytes (2 switches on core 0)

based on another forum post i've noticed that /var/vmail is owned by vmail:vmail and not root:root (755)
changed this to be owned by root with chmod 755 however this didn't change anything.


**Update**
downgraded to iRedAdmin-Pro-SQL-3.3 again and now it works as it should again.
please let me know when it's safe to upgrade to 3.4.
thanks!

11

Re: 'internal server error' accessing Admin logs

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

We are experiencing a similar issue, was working after the upgrade but after changing the password requirements we are getting "internal server error" on user profile page.

Apache log below (IP redacted):

[Wed May 01 14:05:59.163123 2019] [wsgi:error] [pid 4934] [remote XXX.XXX.XXX.XXX:8452] Traceback (most recent call last):
[Wed May 01 14:05:59.163907 2019] [wsgi:error] [pid 4934] [remote XXX.XXX.XXX.XXX:8452]   File "/usr/lib/python2.7/dist-packages/web/application.py", line 239, in process
[Wed May 01 14:05:59.164601 2019] [wsgi:error] [pid 4934] [remote XXX.XXX.XXX.XXX:8452]     return self.handle()
[Wed May 01 14:05:59.164617 2019] [wsgi:error] [pid 4934] [remote XXX.XXX.XXX.XXX:8452]   File "/usr/lib/python2.7/dist-packages/web/application.py", line 230, in handle
[Wed May 01 14:05:59.164625 2019] [wsgi:error] [pid 4934] [remote XXX.XXX.XXX.XXX:8452]     return self._delegate(fn, self.fvars, args)
[Wed May 01 14:05:59.164631 2019] [wsgi:error] [pid 4934] [remote XXX.XXX.XXX.XXX:8452]   File "/usr/lib/python2.7/dist-packages/web/application.py", line 420, in _delegate
[Wed May 01 14:05:59.164638 2019] [wsgi:error] [pid 4934] [remote XXX.XXX.XXX.XXX:8452]     return handle_class(cls)
[Wed May 01 14:05:59.164644 2019] [wsgi:error] [pid 4934] [remote XXX.XXX.XXX.XXX:8452]   File "/usr/lib/python2.7/dist-packages/web/application.py", line 396, in handle_class
[Wed May 01 14:05:59.164651 2019] [wsgi:error] [pid 4934] [remote XXX.XXX.XXX.XXX:8452]     return tocall(*args)
[Wed May 01 14:05:59.164657 2019] [wsgi:error] [pid 4934] [remote XXX.XXX.XXX.XXX:8452]   File "/opt/www/iredadmin/controllers/decorators.py", line 42, in proxyfunc
[Wed May 01 14:05:59.164664 2019] [wsgi:error] [pid 4934] [remote XXX.XXX.XXX.XXX:8452]     return func(self, *args, **kw)
[Wed May 01 14:05:59.164670 2019] [wsgi:error] [pid 4934] [remote XXX.XXX.XXX.XXX:8452]   File "/opt/www/iredadmin/controllers/sql/admin.py", line 145, in GET
[Wed May 01 14:05:59.164677 2019] [wsgi:error] [pid 4934] [remote XXX.XXX.XXX.XXX:8452]     msg=web_input.get('msg'),
[Wed May 01 14:05:59.164683 2019] [wsgi:error] [pid 4934] [remote XXX.XXX.XXX.XXX:8452]   File "/opt/www/iredadmin/libs/iredbase.py", line 179, in render_template
[Wed May 01 14:05:59.164690 2019] [wsgi:error] [pid 4934] [remote XXX.XXX.XXX.XXX:8452]     return jinja_env.get_template(template_name).render(context)
[Wed May 01 14:05:59.164697 2019] [wsgi:error] [pid 4934] [remote XXX.XXX.XXX.XXX:8452]   File "/usr/lib/python2.7/dist-packages/jinja2/environment.py", line 989, in render
[Wed May 01 14:05:59.164703 2019] [wsgi:error] [pid 4934] [remote XXX.XXX.XXX.XXX:8452]     return self.environment.handle_exception(exc_info, True)
[Wed May 01 14:05:59.164710 2019] [wsgi:error] [pid 4934] [remote XXX.XXX.XXX.XXX:8452]   File "/usr/lib/python2.7/dist-packages/jinja2/environment.py", line 754, in handle_exception
[Wed May 01 14:05:59.164723 2019] [wsgi:error] [pid 4934] [remote XXX.XXX.XXX.XXX:8452]     reraise(exc_type, exc_value, tb)
[Wed May 01 14:05:59.164731 2019] [wsgi:error] [pid 4934] [remote XXX.XXX.XXX.XXX:8452]   File "/opt/www/iredadmin/libs/../templates/default/sql/admin/profile.html", line 27, in top-level template code
[Wed May 01 14:05:59.164737 2019] [wsgi:error] [pid 4934] [remote XXX.XXX.XXX.XXX:8452]     {% from "macros/msg_handlers.html" import admin_msg_handler with context %}
[Wed May 01 14:05:59.164744 2019] [wsgi:error] [pid 4934] [remote XXX.XXX.XXX.XXX:8452]   File "/opt/www/iredadmin/libs/../templates/default/layout.html", line 192, in top-level template code
[Wed May 01 14:05:59.164751 2019] [wsgi:error] [pid 4934] [remote XXX.XXX.XXX.XXX:8452]     {% block main %}{% endblock %}
[Wed May 01 14:05:59.164757 2019] [wsgi:error] [pid 4934] [remote XXX.XXX.XXX.XXX:8452]   File "/opt/www/iredadmin/libs/../templates/default/sql/admin/profile.html", line 143, in block "main"
[Wed May 01 14:05:59.164764 2019] [wsgi:error] [pid 4934] [remote XXX.XXX.XXX.XXX:8452]     {{ display_random_password(password_length=min_passwd_length,
[Wed May 01 14:05:59.164771 2019] [wsgi:error] [pid 4934] [remote XXX.XXX.XXX.XXX:8452]   File "/opt/www/iredadmin/libs/../templates/default/macros/general.html", line 1914, in template
[Wed May 01 14:05:59.164777 2019] [wsgi:error] [pid 4934] [remote XXX.XXX.XXX.XXX:8452]     {% set random_password = password_length | generate_random_password %}
[Wed May 01 14:05:59.164784 2019] [wsgi:error] [pid 4934] [remote XXX.XXX.XXX.XXX:8452]   File "/opt/www/iredadmin/libs/iredpwd.py", line 113, in generate_random_password
[Wed May 01 14:05:59.164791 2019] [wsgi:error] [pid 4934] [remote XXX.XXX.XXX.XXX:8452]     length -= 1
[Wed May 01 14:05:59.164797 2019] [wsgi:error] [pid 4934] [remote XXX.XXX.XXX.XXX:8452] TypeError: unsupported operand type(s) for -=: 'unicode' and 'int'

12

Re: 'internal server error' accessing Admin logs

Patch is available here:
https://forum.iredmail.org/post68958.html#p68958

----

Does my reply help a little? How about buying me a cup of coffee ($5) as an encouragement?

buy me a cup of coffee