1 (edited by hopp 2020-11-01 00:41:43)

Topic: iRedAdminPro4.4 to 4.6 failed

==== REQUIRED BASIC INFO OF YOUR IREDMAIL SERVER ====
- iRedMail version (check /etc/iredmail-release):
mail0# more /etc/iredmail-release                                                                                                                           
1.3.1 MARIADB edition.

- Deployed with iRedMail Easy or the downloadable installer?
downloadable installer.
mail0# sha256 iRedAdmin-Pro-SQL-4.6.tar.bz2                                                                                                                 
SHA256 (iRedAdmin-Pro-SQL-4.6.tar.bz2) = f10615bca232c6aa93ff4af5a44fb85cbe274b9d0f0784dc8f1cf4895d636ff6

- Linux/BSD distribution name and version:
mail0# uname -a
OpenBSD mail0.redacted.net 6.7 GENERIC.MP#5 amd64

- Store mail accounts in which backend (LDAP/MySQL/PGSQL):
MySQL

- Web server (Apache or Nginx):
mail0# nginx -v
nginx version: nginx/1.16.1

- Manage mail accounts with iRedAdmin-Pro?
Yes working fine before upgrade. Now I get "Internal Server Error" on /iredadmin/

- [IMPORTANT] Related original log or error message is required if you're experiencing an issue.
====

Upgrade log follows:
mail0# ./upgrade_iredadmin.sh                                                                                                                               
* Detected Linux/BSD distribution: OPENBSD
* HTTP server root: /opt/www
* Found iRedAdmin directory: /opt/www/iredadmin, symbol link of iRedAdmin-Pro-SQL-4.6
* Found iRedAdmin config file: /opt/www/iredadmin/settings.py
* Copying new version to /opt/www/iRedAdmin-Pro-SQL-4.6
* Copy /opt/www/iredadmin/settings.py.
cp: /opt/www/iRedAdmin-Pro-SQL-4.6/settings.py and /opt/www/iredadmin/settings.py are identical (not copied).
* Removing old symbol link /opt/www/iredadmin
* Creating symbol link /opt/www/iredadmin to /opt/www/iRedAdmin-Pro-SQL-4.6
* Enable mlmmj integration.
* Restarting service: mlmmjadmin.
mlmmjadmin(ok)
mlmmjadmin(ok)
* Check and install required packages.
Install package(s): python3-pymysql
quirks-3.326 signed on 2020-10-09T09:09:21Z
Can't find python3-pymysql
Collecting web.py>=0.61
  Downloading https://files.pythonhosted.org/packages … ne-any.whl (78kB)
     |ââââââââââââââââââââââââââââââââ| 81kB 1.1MB/s
Requirement already satisfied, skipping upgrade: cheroot in /usr/local/lib/python3.7/site-packages (from web.py>=0.61) (8.2.1)
Requirement already satisfied, skipping upgrade: six>=1.11.0 in /usr/local/lib/python3.7/site-packages (from cheroot->web.py>=0.61) (1.13.0)
Requirement already satisfied, skipping upgrade: more_itertools>=2.6 in /usr/local/lib/python3.7/site-packages (from cheroot->web.py>=0.61) (4.1.0)
Requirement already satisfied, skipping upgrade: jaraco.functools in /usr/local/lib/python3.7/site-packages (from cheroot->web.py>=0.61) (2.0)
Installing collected packages: web.py
  Found existing installation: web.py 0.40
    Uninstalling web.py-0.40:
      Successfully uninstalled web.py-0.40
Successfully installed web.py-0.61
* Check SQL tables, and add missed ones - if there's any
* Replace py2 by py3 in cron jobs.
* Clean up.
* Delete all existing sessions to force all admins to re-login.
* iRedAdmin has been successfully upgraded.
* Restarting iredadmin service.
iredadmin(ok)
iredadmin(ok)
* Enable service: iredadmin
iredadmin(ok)
iredadmin(ok)
* Upgrading completed.
<<< NOTE >>> If iRedAdmin doesn't work as expected, please post your issue in
<<< NOTE >>> our online support forum: http://www.iredmail.org/forum/
mail0#


Edit: Currently upgrading to 6.8 and redmail 1.3.2 to see if that'll fix it.

2

Re: iRedAdminPro4.4 to 4.6 failed

hopp wrote:

Can't find python3-pymysql

please run commands below to fix it:

pip3 install PyMySQL
rcctl restart iredadmin

----

Buy me a cup of coffee ($5) to support iRedMail:

buy me a cup of coffee

3 (edited by hopp 2020-11-01 02:04:06)

Re: iRedAdminPro4.4 to 4.6 failed

mail0# pip3 install PyMySQL
Collecting PyMySQL
     |ââââââââââââââââââââââââââââââââ| 47 kB 961 kB/s eta 0:00:01
Installing collected packages: PyMySQL| 30 kB 1.1 MB/s eta 0:00:01
Successfully installed PyMySQL-0.10.1
mail0# rcctl restart iredadmin
iredadmin(ok)
iredadmin(ok)
mail0#

After running the above /iredadmin/ still gives: Internal Server Error

I tried to upgrade iRedAdminPro again.
mail0# bash upgrade_iredadmin.sh                                                                                                                             
* Detected Linux/BSD distribution: OPENBSD
* HTTP server root: /opt/www
* Found iRedAdmin directory: /opt/www/iredadmin, symbol link of iRedAdmin-Pro-SQL-4.6
* Found iRedAdmin config file: /opt/www/iredadmin/settings.py
* Copying new version to /opt/www/iRedAdmin-Pro-SQL-4.6
* Copy /opt/www/iredadmin/settings.py.
cp: /opt/www/iRedAdmin-Pro-SQL-4.6/settings.py and /opt/www/iredadmin/settings.py are identical (not copied).
* Removing old symbol link /opt/www/iredadmin
* Creating symbol link /opt/www/iredadmin to /opt/www/iRedAdmin-Pro-SQL-4.6
* Enable mlmmj integration.
* Restarting service: mlmmjadmin.
mlmmjadmin(ok)
mlmmjadmin(ok)
* Check and install required packages.
Install package(s): python3-pymysql py3-pip py3-simplejson py3-dnspython py3-requests py3-jinja2
quirks-3.439 signed on 2020-10-31T12:23:49Z
Can't find python3-pymysql
* Check SQL tables, and add missed ones - if there's any
* Replace py2 by py3 in cron jobs.
* Clean up.
Traceback (most recent call last):
  File "delete_sessions.py", line 16, in <module>
    from tools import ira_tool_lib
  File "/opt/www/iRedAdmin-Pro-SQL-4.6/tools/../tools/ira_tool_lib.py", line 21, in <module>
    from libs import iredutils
  File "/opt/www/iRedAdmin-Pro-SQL-4.6/tools/../libs/iredutils.py", line 17, in <module>
    import simplejson as json
ModuleNotFoundError: No module named 'simplejson'
* iRedAdmin has been successfully upgraded.
* Restarting iredadmin service.
iredadmin(ok)
iredadmin(ok)
* Enable service: iredadmin
iredadmin(failed)
Failed, please restart service manually and check its log file.
* Upgrading completed.
<<< NOTE >>> If iRedAdmin doesn't work as expected, please post your issue in
<<< NOTE >>> our online support forum: http://www.iredmail.org/forum/

4 (edited by hopp 2020-11-01 02:19:51)

Re: iRedAdminPro4.4 to 4.6 failed

I think it's because the pkg is called py3-pymysql on OBSD.

I found and removed leftover python-3.7 install and reran upgrade script.

mail0# bash upgrade_iredadmin.sh                                                                                                                             
* Detected Linux/BSD distribution: OPENBSD
* HTTP server root: /opt/www
* Found iRedAdmin directory: /opt/www/iredadmin, symbol link of iRedAdmin-Pro-SQL-4.6
* Found iRedAdmin config file: /opt/www/iredadmin/settings.py
* Copying new version to /opt/www/iRedAdmin-Pro-SQL-4.6
* Copy /opt/www/iredadmin/settings.py.
cp: /opt/www/iRedAdmin-Pro-SQL-4.6/settings.py and /opt/www/iredadmin/settings.py are identical (not copied).
* Removing old symbol link /opt/www/iredadmin
* Creating symbol link /opt/www/iredadmin to /opt/www/iRedAdmin-Pro-SQL-4.6
* Enable mlmmj integration.
* Restarting service: mlmmjadmin.
mlmmjadmin(ok)
mlmmjadmin(ok)
* Check and install required packages.
* Check SQL tables, and add missed ones - if there's any
* Replace py2 by py3 in cron jobs.
* Clean up.
* Delete all existing sessions to force all admins to re-login.
* iRedAdmin has been successfully upgraded.
* Restarting iredadmin service.
iredadmin(ok)
iredadmin(ok)
* Enable service: iredadmin
iredadmin(ok)
iredadmin(ok)
* Upgrading completed.
<<< NOTE >>> If iRedAdmin doesn't work as expected, please post your issue in
<<< NOTE >>> our online support forum: http://www.iredmail.org/forum/


/iredadmin/ still failing.

5

Re: iRedAdminPro4.4 to 4.6 failed

I backed up my config and installed 1.3.2 SQL skipping the postfix dovecot iredadmin and backend portions.

It re-downloaded a different version of webpy (.60) and after a reboot /iredadmin/ pro works.

/iredadmin/ appears to work well. I was able to do everything I tried but I did receive the following error.

/iredadmin/users/redacted.net?msg=JSONDecodeError('Expecting value%3A line 1 column 1 (char 0)')

roundcube isn't working but mail is being delivered to the proper vmail boxes or the greater internet.

6 (edited by hopp 2020-11-01 05:01:24)

Re: iRedAdminPro4.4 to 4.6 failed

Problem solved. I had to reinstall the php modules because os upgrade asked me to remove ini files in the 6.7 -> 6.8 upgrade.


Edit:

I spoke too soon. Mailserver is working well but following admin page fails:
https://redacted.net/iredadmin/profile/ … dacted.net

with an internal server error.

Where can I see a log for that?

7

Re: iRedAdminPro4.4 to 4.6 failed

Just checking in again iRedAdminPro is still not working. I cannot edit my domains.



https://redacted.net/iredadmin/profile/ … dacted.net

still gives "internal server error" What is the next troubleshooting step?

8

Re: iRedAdminPro4.4 to 4.6 failed

Hi @hopp,

Sorry about this trouble.

- There's a bug in iRedAdmin(-Pro) upgrade script, it should use package "py3-mysqlclient" (for OpenBSD 6.7 and earlier) or "py3-pymysql" (6.8 or later), not "python3-mysql". This has been fixed moment ago.
- About the "internal server error", could you please try steps below:

cd /opt/www/iredadmin/
python3 iredadmin.py

It will start a dev http server on port 8080, now please access it with a web browser and trigger the error again. Copy me full console output for troubleshooting.

If you prefer sending via email, you can mail to "zhb _at_ iredmail _dot_ org". Thanks. smile

----

Buy me a cup of coffee ($5) to support iRedMail:

buy me a cup of coffee

9 (edited by hopp 2020-11-05 22:43:13)

Re: iRedAdminPro4.4 to 4.6 failed

Thanks for the update. I had figured out the python module but I suspect some db permission is perhaps incorrect.

Traceback (most recent call last):
  File "/usr/local/lib/python3.8/site-packages/web/application.py", line 280, in process
    return self.handle()
  File "/usr/local/lib/python3.8/site-packages/web/application.py", line 271, in handle
    return self._delegate(fn, self.fvars, args)
  File "/usr/local/lib/python3.8/site-packages/web/application.py", line 514, in _delegate
    return handle_class(cls)
  File "/usr/local/lib/python3.8/site-packages/web/application.py", line 492, in handle_class
    return tocall(*args)
  File "/opt/www/iRedAdmin-Pro-SQL-4.6/libs/sqllib/decorators.py", line 32, in proxyfunc
    return func(*args, **kw)
  File "/opt/www/iRedAdmin-Pro-SQL-4.6/controllers/sql/domain.py", line 235, in GET
    inbound_throttle_setting = iredapd_throttle.get_throttle_setting(account=_account,
  File "/opt/www/iRedAdmin-Pro-SQL-4.6/libs/iredapd/throttle.py", line 17, in get_throttle_setting
    qr = web.conn_iredapd.select(
  File "/usr/local/lib/python3.8/site-packages/web/db.py", line 894, in select
    return self.query(qout, processed=True)
  File "/usr/local/lib/python3.8/site-packages/web/db.py", line 840, in query
    db_cursor = self._db_cursor()
  File "/usr/local/lib/python3.8/site-packages/web/db.py", line 746, in _db_cursor
    return self.ctx.db.cursor()
  File "/usr/local/lib/python3.8/site-packages/web/db.py", line 686, in _getctx
    self._load_context(self._ctx)
  File "/usr/local/lib/python3.8/site-packages/web/db.py", line 698, in _load_context
    ctx.db = self._connect(self.keywords)
  File "/usr/local/lib/python3.8/site-packages/web/db.py", line 726, in _connect
    return self.db_module.connect(**keywords)
  File "/usr/local/lib/python3.8/site-packages/pymysql/__init__.py", line 94, in Connect
    return Connection(*args, **kwargs)
  File "/usr/local/lib/python3.8/site-packages/pymysql/connections.py", line 325, in __init__
    self.connect()
  File "/usr/local/lib/python3.8/site-packages/pymysql/connections.py", line 599, in connect
    self._request_authentication()
  File "/usr/local/lib/python3.8/site-packages/pymysql/connections.py", line 861, in _request_authentication
    auth_packet = self._read_packet()
  File "/usr/local/lib/python3.8/site-packages/pymysql/connections.py", line 684, in _read_packet
    packet.check_error()
  File "/usr/local/lib/python3.8/site-packages/pymysql/protocol.py", line 220, in check_error
    err.raise_mysql_exception(self._data)
  File "/usr/local/lib/python3.8/site-packages/pymysql/err.py", line 109, in raise_mysql_exception
    raise errorclass(errno, errval)
pymysql.err.OperationalError: (1045, "Access denied for user 'iredapd'@'localhost' (using password: YES)")

x.x.x.x:50455 - - [05/Nov/2020 09:30:39] "HTTP/1.1 GET /profile/domain/general/redacted.net" - 500 Internal Server Error

Here are the iredapd mysql permissions:
iredapd     iredapd     localhost     Select table data | Insert table data | Update table data | Delete table data | Create tables | Drop tables | Reference operations | Manage indexes | Alter tables | Create temp tables | Lock tables | Create View | Show View | Create Routine | Alter Routine | Execute | Create Event | Create Trigger | Delete_history_priv

Edit: FWIW here are the sql pkgs installed:
mail0# pkg_info | grep mysql             
dovecot-mysql-2.3.11.3v0 MySQL authentication / dictionary support for Dovecot
p5-DBD-mysql-4.050p0 MySQL drivers for the Perl DBI
php-pdo_mysql-7.4.12 PDO mysql database access extensions for php
postfix-3.5.7-sasl2-mysql fast, secure sendmail replacement
py3-pymysql-0.9.3p0 MySQL driver in pure Python
sope-mysql-5.0.0    SOPE MySQL adaptor
mail0# pkg_info | grep sql   
dovecot-mysql-2.3.11.3v0 MySQL authentication / dictionary support for Dovecot
p5-DBD-mysql-4.050p0 MySQL drivers for the Perl DBI
php-pdo_mysql-7.4.12 PDO mysql database access extensions for php
postfix-3.5.7-sasl2-mysql fast, secure sendmail replacement
postgresql-client-12.4 PostgreSQL RDBMS (client)
py-sqlalchemy-docs-1.2.19 documentation and examples for sqlalchemy
py3-pymysql-0.9.3p0 MySQL driver in pure Python
py3-sqlalchemy-1.2.19p0 database toolkit for Python
sope-mysql-5.0.0    SOPE MySQL adaptor
sqlite3-3.31.1p0    embedded SQL implementation

10

Re: iRedAdminPro4.4 to 4.6 failed

Try to fix it with SQL commands below, ran as MySQL root user:

grant all on iredapd.* to iredapd@localhost;
flush privileges;

----

Buy me a cup of coffee ($5) to support iRedMail:

buy me a cup of coffee

11

Re: iRedAdminPro4.4 to 4.6 failed

When that didn't work and I had the same error, I REVOKED that and replaced the password in mysql with the password in the settings.py file in iRedAdmin-Pro-SQL-4.6.

Everything seems to be fixed now.

Thanks!