1 (edited by temabu 2020-01-08 14:17:04)

Topic: iredadmin upgrade SQL Error - should be concerned?

==== REQUIRED BASIC INFO OF YOUR IREDMAIL SERVER ====
- iRedMail version (check /etc/iredmail-release): 1.0
- Deployed with iRedMail Easy or the downloadable installer? when first installed a long time ago. upgrade manually otherwise
- Linux/BSD distribution name and version: 18.04 LTS
- 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.
====

upgrade for IredAdmin 1.0 give me an SQL error:

root@ms:~/iRedAdmin-1.0/tools# bash upgrade_iredadmin.sh
* Detected Linux/BSD distribution: UBUNTU
* HTTP server root: /opt/www
* Found iRedAdmin directory: /opt/www/iredadmin, symbol link of iRedAdmin-Pro-SQL-3.1
* Found iRedAdmin config file: /opt/www/iredadmin/settings.py
* Copying new version to /opt/www/iRedAdmin-1.0
* Copy /opt/www/iredadmin/settings.py.
* Remove existing systemd service files.
* Copy systemd service file: /lib/systemd/system/iredadmin.service.
* Removing old symbol link /opt/www/iredadmin
* Creating symbol link /opt/www/iredadmin to /opt/www/iRedAdmin-1.0
* Delete all existing sessions, admins are forced to re-login to iRedAdmin.
* Enable mlmmj integration.
mlmmjadmin_api_auth_token = 'A2SLD1eeAEodhvKdsJIwrHsqVii7X6Vn'
* Restarting service: mlmmjadmin.
* Check and install dependent Python modules:
  + [required] json or simplejson
  + [required] dnspython
  + [required] pycurl
  + [required] requests
* Check SQL tables, and add missed ones - if there's any
ERROR 1071 (42000) at line 140 in file: '/opt/www/iredadmin/SQL/iredadmin.mysql': Specified key was too long; max key length is 767 bytes
* Clean up.
* iRedAdmin has been successfully upgraded.
* Restarting uwsgi service.
* Enable service: iredadmin
Created symlink /etc/systemd/system/multi-user.target.wants/iredadmin.service â /lib/systemd/system/iredadmin.service.
* 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/

Should I worry?

Line 140 in that SQL file is:
CREATE TABLE IF NOT EXISTS `settings` (
    `id` BIGINT(20) UNSIGNED AUTO_INCREMENT,
    `account` VARCHAR(255) NOT NULL DEFAULT 'global',
    `k` VARCHAR(255) NOT NULL,
    `v` TEXT,
    PRIMARY KEY (id),
    UNIQUE INDEX (account, k)
) ENGINE=InnoDB;

----

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

2

Re: iredadmin upgrade SQL Error - should be concerned?

temabu wrote:

* Check SQL tables, and add missed ones - if there's any
ERROR 1071 (42000) at line 140 in file: '/opt/www/iredadmin/SQL/iredadmin.mysql': Specified key was too long; max key length is 767 bytes

It should be concerned.
Which version of MySQL/MariaDB are you running?

3

Re: iredadmin upgrade SQL Error - should be concerned?

ZhangHuangbin wrote:
temabu wrote:

* Check SQL tables, and add missed ones - if there's any
ERROR 1071 (42000) at line 140 in file: '/opt/www/iredadmin/SQL/iredadmin.mysql': Specified key was too long; max key length is 767 bytes

It should be concerned.
Which version of MySQL/MariaDB are you running?

mysqld  Ver 10.1.43-MariaDB-0ubuntu0.18.04.1 for debian-linux-gnu on x86_64 (Ubuntu 18.04)

4

Re: iredadmin upgrade SQL Error - should be concerned?

So is there anything I need do?  I can upgrade MariaDB to 10.3 if that helps

5

Re: iredadmin upgrade SQL Error - should be concerned?

Try this:

- Copy the SQL command used to create "settings" SQL table in a plain text file.
- Shortern the length of "k" column, reduce from VARCHAR(255) to VARCHAR(100)
- Import this SQL file to create the table.

6

Re: iredadmin upgrade SQL Error - should be concerned?

ZhangHuangbin wrote:

Try this:

- Copy the SQL command used to create "settings" SQL table in a plain text file.
- Shortern the length of "k" column, reduce from VARCHAR(255) to VARCHAR(100)
- Import this SQL file to create the table.

Which database is it targeting?  roundcubemail?  vmail? iredadmin?

7

Re: iredadmin upgrade SQL Error - should be concerned?

"iredadmin" db.