1

Topic: iRedAdmin: internal server error in 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? downloadable installe
- Linux/BSD distribution name and version: ubuntu server 18.04
- Store mail accounts in which backend (LDAP/MySQL/PGSQL): MySQL
- Web server (Apache or Nginx):Nginx
- Manage mail accounts with iRedAdmin-Pro? no
- [IMPORTANT] Related original log or error message is required if you're experiencing an issue.
====

iRedAdmin v0.9.4 (MySQL)

After submit filter in iRedAdmin> System> System log, i see "internal server error".

ls -la /var/log/uwsgi/

drwxr-xr-x  3 root root   4096 дек 22 13:38 .
drwxrwxr-x 17 root syslog 4096 янв 17 06:25 ..
drwxr-xr-x  2 root root   4096 сен 27 20:50 app

2

Re: iRedAdmin: internal server error in system log

Any relevant log in /var/log/iredadmin/iredadmin.log or /var/log/syslog, or /var/log/nginx/error.log?

----

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: iRedAdmin: internal server error in system log

/var/log/syslog

Jan 22 08:09:02 mail uwsgi: my.domain [pid: 1199|app: 1|req: 1/1] xxx.xxx.xxx.xxx () {52 vars in 844 bytes} [Tue Jan 22 08:08:59 2019] GET /iredadmin => generated 5002 bytes in 3135 msecs (HTTP/1.1 200) 2 headers in 136 bytes (2 switches on core 0)
Jan 22 08:09:42 mail uwsgi: WSGI app 1 (mountpoint='my.domain|/iredadmin') ready in 1 seconds on interpreter 0x55c3a6a40230 pid: 1200
Jan 22 08:09:42 mail uwsgi: my.domain [pid: 1200|app: 1|req: 1/2] xxx.xxx.xxx.xxx () {58 vars in 1070 bytes} [Tue Jan 22 08:09:41 2019] POST /iredadmin/login => generated 0 bytes in 862 msecs (HTTP/1.1 303) 3 headers in 206 bytes (2 switches on core 0)
Jan 22 08:09:43 mail uwsgi: WSGI app 1 (mountpoint='my.domain|/iredadmin') ready in 1 seconds on interpreter 0x55c3a6a40230 pid: 1202
Jan 22 08:09:45 mail uwsgi: my.domain [pid: 1202|app: 1|req: 1/3] xxx.xxx.xxx.xxx () {54 vars in 981 bytes} [Tue Jan 22 08:09:42 2019] GET /iredadmin/dashboard/checknew => generated 10440 bytes in 3077 msecs (HTTP/1.1 200) 2 headers in 136 bytes (2 switches on core 0)
Jan 22 08:09:53 mail uwsgi: my.domain [pid: 1200|app: 1|req: 2/4] xxx.xxx.xxx.xxx () {54 vars in 984 bytes} [Tue Jan 22 08:09:51 2019] GET /iredadmin/system/log => generated 43466 bytes in 2026 msecs (HTTP/1.1 200) 2 headers in 136 bytes (2 switches on core 0)
Jan 22 08:09:59 mail uwsgi: Traceback (most recent call last):#012  File "/usr/lib/python2.7/dist-packages/web/application.py", line 257, in process#012    return self.handle()#012  File "/usr/lib/python2.7/dist-packages/web/application.py", line 248, in handle#012    return self._delegate(fn, self.fvars, args)#012  File "/usr/lib/python2.7/dist-packages/web/application.py", line 488, in _delegate#012    return handle_class(cls)#012  File "/usr/lib/python2.7/dist-packages/web/application.py", line 466, in handle_class#012    return tocall(*args)#012  File "/opt/www/iRedAdmin-0.9.4/controllers/decorators.py", line 11, in proxyfunc#012    return func(self, *args, **kw)#012  File "/opt/www/iRedAdmin-0.9.4/controllers/panel/log.py", line 31, in GET#012    cur_page=self.cur_page,#012  File "/opt/www/iRedAdmin-0.9.4/controllers/decorators.py", line 11, in proxyfunc#012    return func(self, *args, **kw)#012  File "/opt/www/iRedAdmin-0.9.4/libs/panel/log.py", line 39, in listLogs#012    qr = db.select('log', what='COUNT(timestamp) AS total', where=web.db.sqlwhere(queryDict),)#012  File "/usr/lib/python2.7/dist-packages/web/db.py", line 403, in sqlwhere#012    return SQLQuery.join([k + ' = ' + sqlparam(v) for k, v in data], grouping)#012ValueError: too many values to unpack
Jan 22 08:09:59 mail uwsgi:
Jan 22 08:09:59 mail uwsgi: my.domain [pid: 1202|app: 1|req: 2/5] xxx.xxx.xxx.xxx () {54 vars in 999 bytes} [Tue Jan 22 08:09:59 2019] GET /iredadmin/system/log?event=login => generated 21 bytes in 95 msecs (HTTP/1.1 500) 2 headers in 155 bytes (2 switches on core 0)

4

Re: iRedAdmin: internal server error in system log

Same error here:

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

iRedAdmin v3.1 (MySQL)

If the user is Global admin the log is show corectly but if it is not internel error is shown.

/var/log/messages:
Jan 30 13:19:19 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.1/controllers/decorators.py", line 42, in proxyfunc#012    return func(self, *args, **kw)#012  File "/var/www/iRedAdmin-Pro-SQL-3.1/controllers/panel/log.py", line 41, in GET#012    cur_page=form_cur_page)#012  File "/var/www/iRedAdmin-Pro-SQL-3.1/controllers/decorators.py", line 42, in proxyfunc#012    return func(self, *args, **kw)#012  File "/var/www/iRedAdmin-Pro-SQL-3.1/libs/panel/log.py", line 56, in list_logs#012    where=web.db.sqlwhere(query_dict.items()),#012  File "/usr/lib/python2.7/site-packages/web/db.py", line 394, in sqlwhere#012    return SQLQuery.join([k + ' = ' + sqlparam(v) for k, v in dictionary.items()], grouping)#012AttributeError: 'list' object has no attribute 'items'
Jan 30 13:19:19 mail uwsgi: ut
Jan 30 13:19:19 mail uwsgi: 10.1.16.41 [pid: 8542|app: 1|req: 7/61] 10.101.7.9 () {56 vars in 938 bytes} [Wed Jan 30 13:19:19 2019] GET /iredadmin/system/log => generated 21 bytes in 16 msecs (HTTP/1.1 500) 2 headers in 165 bytes (2 switches on core 0)

If the user is global admin the admin log is shown correctly
/var/log/messages:
Jan 30 13:25:04 mail uwsgi: 10.1.16.41 [pid: 8544|app: 1|req: 14/75] 10.101.7.9 () {56 vars in 970 bytes} [Wed Jan 30 13:25:03 2019] GET /iredadmin/system/log => generated 53860 bytes in 1201 msecs (HTTP/1.1 200) 2 headers in 146 bytes (2 switches on core 0)

5

Re: iRedAdmin: internal server error in system log

For iRedAdmin open source edition, please apply this patch:
https://bitbucket.org/zhb/iredadmin-ose … 024415ffe1

For iRedAdmin-Pro, please apply patch below (just one line change). if you're not familiar with patch, contact us to get a patched version: https://www.iredmail.org/contact.html

--- a/libs/panel/log.py    Fri Jan 25 16:45:06 2019 +0800
+++ b/libs/panel/log.py    Sat Jan 26 16:54:35 2019 +0800
@@ -53,7 +53,7 @@
         else:
             # With filter.
             entries = db.select('log',
-                                where=web.db.sqlwhere(query_dict),
+                                where=web.db.sqlwhere(query_dict.items()),
                                 offset=(cur_page - 1) * settings.PAGE_SIZE_LIMIT,
                                 limit=settings.PAGE_SIZE_LIMIT,
                                 order='timestamp DESC')

----

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

buy me a cup of coffee

6 (edited by it-egt 2019-02-04 16:53:40)

Re: iRedAdmin: internal server error in system log

ZhangHuangbin wrote:

For iRedAdmin-Pro, please apply patch below (just one line change). if you're not familiar with patch, contact us to get a patched version: https://www.iredmail.org/contact.html

--- a/libs/panel/log.py    Fri Jan 25 16:45:06 2019 +0800
+++ b/libs/panel/log.py    Sat Jan 26 16:54:35 2019 +0800
@@ -53,7 +53,7 @@
         else:
             # With filter.
             entries = db.select('log',
-                                where=web.db.sqlwhere(query_dict),
+                                where=web.db.sqlwhere(query_dict.items()),
                                 offset=(cur_page - 1) * settings.PAGE_SIZE_LIMIT,
                                 limit=settings.PAGE_SIZE_LIMIT,
                                 order='timestamp DESC')

Hi Zhang,
We are using iRedAdmin Pro with SQL and the patch is already applied. Any other ideas?

7

Re: iRedAdmin: internal server error in system log

it-egt wrote:

We are using iRedAdmin Pro with SQL and the patch is already applied. Any other ideas?

Do you still get this error?
Possible to give me direct ssh access with root privilege and a testing admin account to reproduce and fix the issue?

----

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

buy me a cup of coffee

8

Re: iRedAdmin: internal server error in system log

ZhangHuangbin wrote:
it-egt wrote:

We are using iRedAdmin Pro with SQL and the patch is already applied. Any other ideas?

Do you still get this error?
Possible to give me direct ssh access with root privilege and a testing admin account to reproduce and fix the issue?

I will try again on clean installation and on our test environment and will report.

9

Re: iRedAdmin: internal server error in system log

After second try with the last, on the same server, version everything works as expected