1

Topic: Internal Server Error, iredadmin login

==== REQUIRED BASIC INFO OF YOUR IREDMAIL SERVER ====
- iRedMail version (check /etc/iredmail-release): 1.6.3 MARIADB edition
- Deployed with iRedMail Easy or the downloadable installer?: download
- Linux/BSD distribution name and version: centos7
- Store mail accounts in which backend (LDAP/MySQL/PGSQL): mariadb
- 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.
====

I want to login to iredadmin panel from https //xxx.xxx/iredamin/
but  https //xxx.xxx/iredadmin/dashboard?checknew  displayed "internal server error".
e-mail send and recived are working.

I tried to check server log following

/var/log/messages
Sep 28 10:49:12 xxx mariadbd: 2023-09-28 10:49:12 570 [Warning] Aborted connection 570 to db: 'iredadmin' user: 'iredadmin' host: 'localhost' (Got an error reading communication packets)
Sep 28 10:49:14 xxx  mariadbd: 2023-09-28 10:49:14 572 [Warning] Aborted connection 572 to db: 'iredadmin' user: 'iredadmin' host: 'localhost' (Got an error reading communication packets)
Sep 28 10:49:14 xxx  mariadbd: 2023-09-28 10:49:14 573 [Warning] Aborted connection 573 to db: 'vmail' user: 'vmailadmin' host: 'localhost' (Got an error reading communication packets)

/var/log/nginx/access.log
my.ip.addr - admin [28/Sep/2023:10:49:12 +0900] "POST /iredadmin/login HTTP/1.1" 303 5 " https //xxx.xxx/iredadmin/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/117.0.0.0 Safari/537.36"
my.ip.addr - admin [28/Sep/2023:10:49:14 +0900] "GET /iredadmin/dashboard?checknew HTTP/1.1" 500 32 "https //xxx.xxx/iredadmin/ " "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/117.0.0.0 Safari/537.36"

/var/log/nginx/error.log
nothing

/var/log/iredapd/iredapd.log
nothing

how to fix this problem?

----

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, iredadmin login

Try this:

Add "log_warnings = 1" in /etc/my.cnf, under "[mysqld] section, then restart mysql service.

3

Re: Internal Server Error, iredadmin login

add log_warnings=1, but difference nothing .
I add "general_log = 1" and "general_log_file = /var/log/mysql.log"
following log are output. I think it look normal.

230928 13:53:55     

                     7 Connect  iredadmin@localhost on iredadmin using TCP/IP
                     7 Query    SET AUTOCOMMIT = 0
                     7 Query    SELECT * FROM sessions WHERE session_id='SESSIONID1'
                     7 Query    COMMIT
                     7 Query    SELECT * FROM sessions WHERE session_id='SESSIONID1'
                     7 Query    COMMIT
                     7 Query    UPDATE sessions SET atime = '2023-09-28 13:53:55.928448' WHERE session_id='SESSIONID1'
                     7 Query    COMMIT

                     8 Connect  vmailadmin@localhost on vmail using TCP/IP
                     8 Query    SET AUTOCOMMIT = 0
                     8 Query    SELECT password, language, settings FROM admin WHERE username='postmaster@DOMAINNAME' AND active=1 LIMIT 1
                     8 Query    COMMIT
                     8 Query    SELECT password, language, isadmin, isglobaladmin, settings FROM mailbox WHERE username='postmaster@DOMAINNAME' AND isglobaladmin=1 AND active=1 LIMIT 1
                     8 Query    COMMIT
                     8 Query    SELECT settings FROM domain WHERE domain='DOMAINNAME' LIMIT 1
                     8 Query    COMMIT

                     7 Query    INSERT INTO log (admin, domain, event, ip, loglevel, msg, timestamp, username) VALUES ('postmaster@DOMAINNAME', '', 'login', '118.238.215.174', 'info', 'Admin login success', '2023-09-28 04:53:55', '')
                     7 Query    SELECT last_insert_id()
                     7 Query    COMMIT
                     7 Query    SELECT * FROM sessions WHERE session_id='SESSIONID1'
                     7 Query    COMMIT
                     7 Query    UPDATE sessions SET atime = '2023-09-28 13:53:55.948996', data = 'SNIFF1\n' WHERE session_id='SESSIONID1'
                     7 Query    COMMIT
                     8 Quit

                     9 Connect  iredadmin@localhost on iredadmin using TCP/IP
                     9 Query    SET AUTOCOMMIT = 0
                     9 Query    SELECT * FROM sessions WHERE session_id='SESSIONID1'
                     9 Query    COMMIT
                     9 Query    SELECT * FROM sessions WHERE session_id='SESSIONID1'
                     9 Query    COMMIT
                     9 Query    UPDATE sessions SET atime = '2023-09-28 13:53:55.987759' WHERE session_id='SESSIONID1'
                     9 Query    COMMIT
                     9 Query    SELECT * FROM updatelog WHERE date='2023-09-28' LIMIT 1
                     9 Query    COMMIT
230928 13:53:57      9 Query    DELETE FROM updatelog WHERE date < '2023-09-28'
                     9 Query    COMMIT
                     9 Query    SELECT * FROM sessions WHERE session_id='SESSIONID1'
                     9 Query    COMMIT
                     9 Query    UPDATE sessions SET atime = '2023-09-28 13:53:57.417929', data = 'SNIFF2\n' WHERE session_id='SESSIONID1'
                     9 Query    COMMIT



                    10 Connect  vmailadmin@localhost on vmail using TCP/IP
                    10 Query    SET AUTOCOMMIT = 0
                    10 Query    SELECT COUNT(domain) AS total FROM domain
                    10 Query    COMMIT
                    10 Query    SELECT domain FROM domain ORDER BY domain
                    10 Query    COMMIT
                    10 Query    SELECT COUNT(username) AS total FROM mailbox WHERE domain IN ('DOMAINNAME')
                    10 Query    COMMIT
                    10 Query    SELECT SUM(messages) AS messages,
                                  SUM(bytes) AS bytes
                             FROM used_quota
                    10 Query    COMMIT


                    11 Connect  vmailadmin@localhost on vmail using TCP/IP
                    11 Query    SET AUTOCOMMIT = 0
                    11 Quit

4

Re: Internal Server Error, iredadmin login

journalctl output

 9月 28 16:35:36 SERVERNAME systemd[1]: Stopped iRedAdmin daemon service.
 9月 28 16:35:36 SERVERNAME systemd[1]: Starting iRedAdmin daemon service...
 9月 28 16:35:36 SERVERNAME systemd[1]: Started iRedAdmin daemon service.
 9月 28 16:35:36 SERVERNAME uwsgi[32249]: [uWSGI] getting INI configuration from /var/www/iredadmin/rc_scripts/uwsgi/rhel7.ini
 9月 28 16:35:37 SERVERNAME iredadmin[32249]: *** Starting uWSGI 2.0.18 (64bit) on [Thu Sep 28 16:35:36 2023] ***
 9月 28 16:35:37 SERVERNAME iredadmin[32249]: compiled with version: 4.8.5 20150623 (Red Hat 4.8.5-39) on 13 May 2020 17:24:14
 9月 28 16:35:37 SERVERNAME iredadmin[32249]: os: Linux-3.10.0-1160.31.1.el7.x86_64 #1 SMP Thu Jun 10 13:32:12 UTC 2021
 9月 28 16:35:37 SERVERNAME iredadmin[32249]: nodename: SERVERNAME
 9月 28 16:35:37 SERVERNAME iredadmin[32249]: machine: x86_64
 9月 28 16:35:37 SERVERNAME iredadmin[32249]: clock source: unix
 9月 28 16:35:37 SERVERNAME iredadmin[32249]: pcre jit disabled
 9月 28 16:35:37 SERVERNAME iredadmin[32249]: detected number of CPU cores: 8
 9月 28 16:35:37 SERVERNAME iredadmin[32249]: current working directory: /
 9月 28 16:35:37 SERVERNAME iredadmin[32249]: writing pidfile to /var/run/iredadmin/iredadmin.pid
 9月 28 16:35:37 SERVERNAME iredadmin[32249]: detected binary path: /usr/sbin/uwsgi
 9月 28 16:35:37 SERVERNAME iredadmin[32249]: setgid() to 2001
 9月 28 16:35:37 SERVERNAME iredadmin[32249]: setuid() to 2001
 9月 28 16:35:37 SERVERNAME iredadmin[32249]: chdir() to /var/www/iredadmin
 9月 28 16:35:37 SERVERNAME iredadmin[32249]: your processes number limit is 63751
 9月 28 16:35:37 SERVERNAME iredadmin[32249]: your memory page size is 4096 bytes
 9月 28 16:35:37 SERVERNAME iredadmin[32249]: detected max file descriptor number: 1024
 9月 28 16:35:37 SERVERNAME iredadmin[32249]: VirtualHosting mode enabled.
 9月 28 16:35:37 SERVERNAME iredadmin[32249]: lock engine: pthread robust mutexes
 9月 28 16:35:37 SERVERNAME iredadmin[32249]: thunder lock: disabled (you can enable it with --thunder-lock)
 9月 28 16:35:37 SERVERNAME iredadmin[32249]: uwsgi socket 0 bound to TCP address 127.0.0.1:7791 fd 6
 9月 28 16:35:37 SERVERNAME iredadmin[32249]: Python version: 3.6.8 (default, Jun 20 2023, 11:53:23)  [GCC 4.8.5 20150623 (Red Hat 4.8.5-44)]
 9月 28 16:35:37 SERVERNAME iredadmin[32249]: Python main interpreter initialized at 0x1ca6210
 9月 28 16:35:37 SERVERNAME iredadmin[32249]: python threads support enabled
 9月 28 16:35:37 SERVERNAME iredadmin[32249]: your server socket listen backlog is limited to 100 connections
 9月 28 16:35:37 SERVERNAME iredadmin[32249]: your mercy for graceful operations on workers is 60 seconds
 9月 28 16:35:37 SERVERNAME iredadmin[32249]: mapped 462096 bytes (451 KB) for 5 cores
 9月 28 16:35:37 SERVERNAME iredadmin[32249]: *** Operational MODE: preforking ***
 9月 28 16:35:37 SERVERNAME iredadmin[32249]: WSGI app 0 (mountpoint='') ready in 1 seconds on interpreter 0x1ca6210 pid: 32249 (default app)
 9月 28 16:35:37 SERVERNAME iredadmin[32249]: *** uWSGI is running in multiple interpreter mode ***
 9月 28 16:35:37 SERVERNAME iredadmin[32249]: spawned uWSGI master process (pid: 32249)
 9月 28 16:35:37 SERVERNAME iredadmin[32249]: spawned uWSGI worker 1 (pid: 32250, cores: 1)
 9月 28 16:35:37 SERVERNAME iredadmin[32249]: spawned uWSGI worker 2 (pid: 32251, cores: 1)
 9月 28 16:35:37 SERVERNAME iredadmin[32249]: spawned uWSGI worker 3 (pid: 32252, cores: 1)
 9月 28 16:35:37 SERVERNAME iredadmin[32249]: spawned uWSGI worker 4 (pid: 32253, cores: 1)
 9月 28 16:35:37 SERVERNAME iredadmin[32249]: spawned uWSGI worker 5 (pid: 32254, cores: 1)

 9月 28 16:36:03 SERVERNAME iredadmin[32249]: WSGI app 1 (mountpoint='SERVERNAME|/iredadmin') ready in 0 seconds on interpreter 0x2044890 pid: 32250
 9月 28 16:36:05 SERVERNAME iredadmin[32249]: [1MYIPADDR] GET /iredadmin/dashboard?checknew 500 224 "-"

 9月 28 16:36:08 SERVERNAME iredadmin[32249]: [1MYIPADDR] GET /iredadmin 200 5627 "-"

 9月 28 16:36:11 SERVERNAME uwsgi[32250]: iredadmin Admin login success admin=postmaster@DOMAINNAME, domain=, username=, event=login, ip=1MYIPADDR (/var/www/iRedAdmin-2.4/libs/logger.py, L73)
 9月 28 16:36:11 SERVERNAME iredadmin[32249]: [1MYIPADDR] POST /iredadmin/login 303 232 "https //SERVERNAME/iredadmin"
 9月 28 16:36:11 SERVERNAME iredadmin[32249]: WSGI app 1 (mountpoint='SERVERNAME|/iredadmin') ready in 0 seconds on interpreter 0x2044890 pid: 32251
 9月 28 16:36:12 SERVERNAME iredadmin[32249]: [1MYIPADDR] GET /iredadmin/dashboard?checknew 500 224 "https //SERVERNAME/iredadmin"

5

Re: Internal Server Error, iredadmin login

- Any related error in /var/log/messages?
- CentOS 7 is out of date, any plan to upgrade to 8?

6

Re: Internal Server Error, iredadmin login

- Any related error in /var/log/messages?

any error  not found

- CentOS 7 is out of date, any plan to upgrade to 8?

Not currently scheduled
If replace after april 2024.

7

Re: Internal Server Error, iredadmin login

I check /var/log/dovecot/dovecot.log
following error found.

Sep 29 09:18:53 SERVERNAME iredadmin: Traceback (most recent call last):#012  File "/var/www/iRedAdmin-2.4/web/application.py", line 277, in process#012    return self.handle()#012  File "/var/www/iRedAdmin-2.4/web/application.py", line 268, in handle#012    return self._delegate(fn, self.fvars, args)#012  File "/var/www/iRedAdmin-2.4/web/application.py", line 510, in _delegate#012    return handle_class(cls)#012  File "/var/www/iRedAdmin-2.4/web/application.py", line 488, in handle_class#012    return tocall(*args)#012  File "/var/www/iRedAdmin-2.4/controllers/decorators.py", line 23, in proxyfunc#012    return func(*args, **kw)#012  File "/var/www/iRedAdmin-2.4/controllers/sql/basic.py", line 140, in GET#012    total_bytes=total_bytes,#012  File "/var/www/iRedAdmin-2.4/libs/iredbase.py", line 135, in render_template#012    return jinja_env.get_template(template_name).render(kwargs)#012  File "/usr/lib/python3.6/site-packages/jinja2/environment.py", line 1090, in render#012    self.environment.handle_exception()#012  File "/usr/lib/python3.6/site-packages/jinja2/environment.py", line 832, in handle_exception#012    reraise(*rewrite_traceback_stack(source=source))#012  File "/usr/lib/python3.6/site-packages/jinja2/_compat.py", line 28, in reraise#012    raise value.with_traceback(tb)#012  File "/var/www/iRedAdmin-2.4/libs/../templates/default/dashboard.html", line 4, in top-level template code#012    {% from "macros/msg_handlers.html" import success_info, error_info with context %}#012  File "/var/www/iRedAdmin-2.4/libs/../templates/default/layout.html", line 92, in top-level template code#012    {% block main %}{% endblock %}#012  File "/var/www/iRedAdmin-2.4/libs/../templates/default/dashboard.html", line 13, in block "main"#012    {{ success_info( _("New version of iRedAdmin, %s, is now available for upgrading. <a href='https //docs.iredmail.org/migrate.or.upgrade.iredadmin.html' class='button green'>Upgrade tutorial</a>.") |format(session.get('new_version') |e), removable=false, trusted=true ) }}#012  File "/usr/lib/python3.6/site-packages/jinja2/filters.py", line 823, in do_format#012    return soft_unicode(value) % (kwargs or args)#012TypeError: not enough arguments for format string#012#012Traceback (most recent call last):#012  File "/var/www/iRedAdmin-2.4/web/application.py", line 277, in process#012    return self.handle()#012  File "/var/www/iRedAdmin-2.4/web/application.py", line 268, in handle#012    return self._delegate(fn, self.fvars, args)#012  File "/var/www/iRedAdmin-2.4/web/application.py", line 510, in _delegate#012    return handle_class(cls)#012  File "/var/www/iRedAdmin-2.4/web/application.py", line 488, in handle_class#012    return tocall(*args)#012  File "/var/www/iRedAdmin-2.4/controllers/decorators.py", line 23, in proxyfunc#012    return func(*args, **kw)#012  File "/var/www/iRedAdmin-2.4/controllers/sql/basic.py", line 140, in GET#012    total_bytes=total_bytes,#012  File "/var/www/iRedAdmin-2.4/libs/iredbase.py", line 135, in render_template#012    return jinja_env.get_template(template_name).render(kwargs)#012  File "/usr/lib/python3.6/site-packages/jinja2/environment.py", line 1090, in render#012    self.environment.handle_exception()#012  File "/usr/lib/python3.6/site-packages/jinja2/environment.py", line 832, in handle_exception#012    reraise(*rewrite_traceback_stack(source=source))#012  File "/usr/lib/python3.6/site-packages/jinja2/_compat.py", line 28, in reraise#012    raise value.with_traceback(tb)#012  File "/var/www/iRedAdmin-2.4/libs/../templates/default/dashboard.html", line 4, in top-level template code#012    {% from "macros/msg_handlers.html" import success_info, error_info with context %}#012  File "/var/www/iRedAdmin-2.4/libs/../templates/default/layout.html", line 92, in top-level template code#012    {% block main %}{% endblock %}#012  File "/var/www/iRedAdmin-2.4/libs/../templates/default/dashboard.html", line 13, in block "main"#012    {{ success_info( _("New version of iRedAdmin, %s, is now available for upgrading. <a href='https //docs.iredmail.org/migrate.or.upgrade.iredadmin.html' class='button green'>Upgrade tutorial</a>.") |format(session.get('new_version') |e), removable=false, trusted=true ) }}#012  File "/usr/lib/python3.6/site-packages/jinja2/filters.py", line 823, in do_format#012    return soft_unicode(value) % (kwargs or args)#012TypeError: not enough arguments for format string#012#012Traceback (most recent call last):#012  File "/var/www/iRedAdmin-2.4/web/application.py", line 277, in process#012    return self.handle()#012  File "/var/www/iRedAdmin-2.4/web/application.py", line 268, in handle#012    return self._delegate(fn, self.fvars, args)#012  File "/var/www/iRedAdmin-2.4/web/application.py", line 510, in _delegate#012    return handle_class(cls)#012  File "/var/www/iRedAdmin-2.4/web/application.py", line 488, in handle_class#012    return tocall(*args)#012  File "/var/www/iRedAdmin-2.4/controllers/decorators.py", line 23, in proxyfunc#012    return func(*args, **kw)#012  File "/var/www/iRedAdmin-2.4/controllers/sql/basic.py", line 140, in GET#012    total_bytes=total_bytes,#012  File "/var/www/iRedAdmin-2.4/libs/iredbase.py", line 135, in render_template#012    return jinja_env.get_template(template_name).render(kwargs)#012  File "/usr/lib/python3.6/site-packages/jinja2/environment.py", line 1090, in render#012    self.environment.handle_exception()#012  File "/usr/lib/python3.6/site-packages/jinja2/environment.py", line 832, in handle_exception#012    reraise(*rewrite_traceback_stack(source=source))#012  File "/usr/lib/python3.6/site-packages/jinja2/_compat.py", line 28, in reraise#012    raise value.with_traceback(tb)#012  File "/var/www/iRedAdmin-2.4/libs/../templates/default/dashboard.html", line 4, in top-level template code#012    {% from "macros/msg_handlers.html" import success_info, error_info with context %}#012  File "/var/www/iRedAdmin-2.4/libs/../templates/default/layout.html", line 92, in top-level template code#012    {% block main %}{% endblock %}#012  File "/var/www/iRedAdmin-2.4/libs/../templates/default/dashboard.html", line 13, in block "main"#012    {{ success_info( _("New version of iRedAdmin, %s, is now available for upgrading. <a href='https //docs.iredmail.org/migrate.or.upgrade.iredadmin.html' class='button green'>Upgrade tutorial</a>.") |format(session.get('new_version') |e), removable=false, trusted=true ) }}#012  File "/usr/lib/python3.6/site-packages/jinja2/filters.py", line 823, in do_format#012    return soft_unicode(value) % (kwargs or args)#012TypeError: not enough arguments for format string#012#012Traceback (most recent call last):#012  File "/var/www/iRedAdmin-2.4/web/application.py", line 277, in process#012    return self.handle()#012  File "/var/www/iRedAdmin-2.4/web/application.py", line 268, in handle#012    return self._delegate(fn, self.fvars, args)#012  File "/var/www/iRedAdmin-2.4/web/application.py", line 510, in _delegate#012    return handle_class(cls)#012  File "/var/www/iRedAdmin-2.4/web/application.py", line 488, in handle_class#012    return tocall(*args)#012  File "/var/www/iRedAdmin-2.4/controllers/decorators.py", line 23, in proxyfunc#012    return func(*args, **kw)#012  File "/var/www/iRedAdmin-2.4/controllers/sql/basic.py", line 140, in GET#012    total_bytes=total_bytes,#012  File "/var/www/iRedAdmin-2.4/libs/iredbase.py", line 135, in render_template#012    return jinja_env.get_template(template_name).render(kwargs)#012  File "/usr/lib/python3.6/site-packages/jinja2/environment.py", line 1090, in render#012    self.environment.handle_exception()#012  File "/usr/lib/python3.6/site-packages/jinja2/environment.py", line 832, in handle_exception#012    reraise(*rewrite_traceback_stack(source=source))#012  File "/usr/lib/python3.6/site-packages/jinja2/_compat.py", line 28, in reraise#012    raise value.with_traceback(tb)#012  File "/var/www/iRedAdmin-2.4/libs/../templates/default/dashboard.html", line 4, in top-level template code#012    {% from "macros/msg_handlers.html" import success_info, error_info with context %}#012  File "/var/www/iRedAdmin-
Sep 29 09:18:53 SERVERNAME iredadmin: [118.238.215.174] GET /iredadmin/dashboard?checknew 500 224 "https //SERVERNAME/iredadmin/"

8

Re: Internal Server Error, iredadmin login

Seems an error in JSON data while checking new iRedAdmin release.

- Please upgrade to iRedAdmin-2.5 and try again: https://docs.iredmail.org/migrate.or.up … admin.html
- CentOS 7 is too old and its Python v3 environment may not fully work.

9

Re: Internal Server Error, iredadmin login

thanks!
iRedAdmin-2.5 worked .
Login success