Error on deploying SSL certificates

Discuss your pilot or production implementation with other Zimbra admins or our engineers.
User avatar
JDunphy
Outstanding Member
Outstanding Member
Posts: 896
Joined: Fri Sep 12, 2014 11:18 pm
Location: Victoria, BC
ZCS/ZD Version: 9.0.0_P39 NETWORK Edition

Re: Error on deploying SSL certificates

Post by JDunphy »

Ok... looks like you posted more information while I was writing the previous response. I'll look at what you posted.
octet
Posts: 23
Joined: Thu Jan 06, 2022 2:35 pm

Re: Error on deploying SSL certificates

Post by octet »

Here's is netstat stuff, what's listening and on what port:

Code: Select all

[root@mail ~]# netstat -nalp | grep LISTEN
tcp        0      0 127.0.0.1:10026         0.0.0.0:*               LISTEN      4084/amavisd (maste 
tcp        0      0 127.0.0.1:7306          0.0.0.0:*               LISTEN      3592/mysqld         
tcp        0      0 127.0.0.1:10027         0.0.0.0:*               LISTEN      4592/master         
tcp        0      0 0.0.0.0:587             0.0.0.0:*               LISTEN      4592/master         
tcp        0      0 0.0.0.0:11211           0.0.0.0:*               LISTEN      4000/memcached      
tcp        0      0 127.0.0.1:10028         0.0.0.0:*               LISTEN      4592/master         
tcp        0      0 127.0.0.1:10029         0.0.0.0:*               LISTEN      4592/master         
tcp        0      0 127.0.0.1:3310          0.0.0.0:*               LISTEN      4326/clamd          
tcp        0      0 127.0.0.1:10030         0.0.0.0:*               LISTEN      4592/master         
tcp        0      0 0.0.0.0:110             0.0.0.0:*               LISTEN      4027/nginx: master  
tcp        0      0 0.0.0.0:143             0.0.0.0:*               LISTEN      4027/nginx: master  
tcp        0      0 0.0.0.0:111             0.0.0.0:*               LISTEN      1/systemd           
tcp        0      0 127.0.0.1:10032         0.0.0.0:*               LISTEN      4084/amavisd (maste 
tcp        0      0 0.0.0.0:80              0.0.0.0:*               LISTEN      4027/nginx: master  
tcp        1      0 127.0.0.1:8080          0.0.0.0:*               LISTEN      3720/java           
tcp        0      0 0.0.0.0:465             0.0.0.0:*               LISTEN      4592/master         
tcp        0      0 127.0.0.1:8465          0.0.0.0:*               LISTEN      4347/opendkim       
tcp        0      0 127.0.0.1:7025          0.0.0.0:*               LISTEN      3720/java           
tcp        0      0 127.0.0.1:53            0.0.0.0:*               LISTEN      821/named           
tcp        0      0 0.0.0.0:22              0.0.0.0:*               LISTEN      1092/sshd           
tcp        0      0 0.0.0.0:25              0.0.0.0:*               LISTEN      4592/master         
tcp        0      0 0.0.0.0:7993            0.0.0.0:*               LISTEN      3720/java           
tcp        0      0 127.0.0.1:953           0.0.0.0:*               LISTEN      821/named           
tcp        0      0 0.0.0.0:443             0.0.0.0:*               LISTEN      4027/nginx: master  
tcp        0      0 0.0.0.0:7995            0.0.0.0:*               LISTEN      3720/java           
tcp       51      0 0.0.0.0:8443            0.0.0.0:*               LISTEN      3720/java           
tcp        4      0 0.0.0.0:7071            0.0.0.0:*               LISTEN      3720/java           
tcp        0      0 127.0.0.1:23232         0.0.0.0:*               LISTEN      4052/perl           
tcp       51      0 0.0.0.0:7072            0.0.0.0:*               LISTEN      3720/java           
tcp        0      0 127.0.0.1:23233         0.0.0.0:*               LISTEN      4054/perl           
tcp        0      0 0.0.0.0:993             0.0.0.0:*               LISTEN      4027/nginx: master  
tcp       12      0 0.0.0.0:7073            0.0.0.0:*               LISTEN      3720/java           
tcp        0      0 0.0.0.0:995             0.0.0.0:*               LISTEN      4027/nginx: master  
tcp        0      0 127.0.0.1:7171          0.0.0.0:*               LISTEN      1530/java           
tcp        0      0 10.70.150.43:389        0.0.0.0:*               LISTEN      1501/slapd          
tcp        0      0 192.168.168.168:389     0.0.0.0:*               LISTEN      1501/slapd          
tcp        0      0 0.0.0.0:7110            0.0.0.0:*               LISTEN      3720/java           
tcp        0      0 0.0.0.0:7143            0.0.0.0:*               LISTEN      3720/java           
tcp        0      0 127.0.0.1:10663         0.0.0.0:*               LISTEN      3596/zmlogger: zmrr 
tcp        0      0 127.0.0.1:10024         0.0.0.0:*               LISTEN      4084/amavisd (maste 
tcp        0      0 127.0.0.1:10025         0.0.0.0:*               LISTEN      4592/master         
tcp6       0      0 ::1:10026               :::*                    LISTEN      4084/amavisd (maste 
tcp6       0      0 :::11211                :::*                    LISTEN      4000/memcached      
tcp6       0      0 :::8143                 :::*                    LISTEN      5955/java           
tcp6       0      0 :::111                  :::*                    LISTEN      1/systemd           
tcp6       0      0 ::1:10032               :::*                    LISTEN      4084/amavisd (maste 
tcp6       0      0 ::1:53                  :::*                    LISTEN      821/named           
tcp6       0      0 :::22                   :::*                    LISTEN      1092/sshd           
tcp6       0      0 ::1:953                 :::*                    LISTEN      821/named           
tcp6       0      0 :::8993                 :::*                    LISTEN      5955/java           
tcp6       0      0 :::7780                 :::*                    LISTEN      4379/httpd          
tcp6       0      0 ::1:10024               :::*                    LISTEN      4084/amavisd (maste 
unix  2      [ ACC ]     SEQPACKET  LISTENING     19711    1/systemd            /run/systemd/coredump
unix  2      [ ACC ]     STREAM     LISTENING     72576    4326/clamd           /opt/zimbra/data/clamav/clamav.sock
unix  2      [ ACC ]     STREAM     LISTENING     67543    4052/perl            /opt/zimbra/data/tmp/amavisd-zmq.sock
unix  2      [ ACC ]     STREAM     LISTENING     16145    714/irqbalance       @irqbalance714.sock
unix  2      [ ACC ]     STREAM     LISTENING     64408    3592/mysqld          /opt/zimbra/data/tmp/mysql/mysql.sock
unix  2      [ ACC ]     STREAM     LISTENING     23079    812/gssproxy         /run/gssproxy.sock
unix  2      [ ACC ]     STREAM     LISTENING     22589    1/systemd            /var/run/.heim_org.h5l.kcm-socket
unix  2      [ ACC ]     STREAM     LISTENING     16294    755/sssd_nss         /var/lib/sss/pipes/nss
unix  2      [ ACC ]     STREAM     LISTENING     22591    1/systemd            /run/dbus/system_bus_socket
unix  2      [ ACC ]     STREAM     LISTENING     69609    4592/master          private/cyrus
unix  2      [ ACC ]     STREAM     LISTENING     69612    4592/master          private/uucp
unix  2      [ ACC ]     STREAM     LISTENING     69615    4592/master          private/ifmail
unix  2      [ ACC ]     STREAM     LISTENING     69618    4592/master          private/bsmtp
unix  2      [ ACC ]     STREAM     LISTENING     69968    4477/saslauthd       /opt/zimbra/data/sasl2/state/mux
unix  2      [ ACC ]     STREAM     LISTENING     69621    4592/master          private/smtp-amavis
unix  2      [ ACC ]     STREAM     LISTENING     69517    4592/master          private/tlsproxy
unix  2      [ ACC ]     STREAM     LISTENING     19812    1/systemd            /run/rpcbind.sock
unix  2      [ ACC ]     STREAM     LISTENING     69520    4592/master          private/dnsblog
unix  2      [ ACC ]     STREAM     LISTENING     69523    4592/master          private/smtpd
unix  2      [ ACC ]     STREAM     LISTENING     69532    4592/master          private/scan
unix  2      [ ACC ]     STREAM     LISTENING     28776    1000/systemd         /run/user/988/systemd/private
unix  2      [ ACC ]     STREAM     LISTENING     69546    4592/master          private/tlsmgr
unix  2      [ ACC ]     STREAM     LISTENING     69549    4592/master          private/rewrite
unix  2      [ ACC ]     STREAM     LISTENING     69552    4592/master          private/bounce
unix  2      [ ACC ]     STREAM     LISTENING     69555    4592/master          private/defer
unix  2      [ ACC ]     STREAM     LISTENING     69558    4592/master          private/trace
unix  2      [ ACC ]     STREAM     LISTENING     69561    4592/master          private/verify
unix  2      [ ACC ]     STREAM     LISTENING     69567    4592/master          private/proxymap
unix  2      [ ACC ]     STREAM     LISTENING     69570    4592/master          private/smtp
unix  2      [ ACC ]     STREAM     LISTENING     69573    4592/master          private/relay
unix  2      [ ACC ]     STREAM     LISTENING     69579    4592/master          private/error
unix  2      [ ACC ]     STREAM     LISTENING     1396     1/systemd            /run/systemd/journal/stdout
unix  2      [ ACC ]     STREAM     LISTENING     69582    4592/master          private/retry
unix  2      [ ACC ]     STREAM     LISTENING     69585    4592/master          private/discard
unix  2      [ ACC ]     STREAM     LISTENING     69588    4592/master          private/local
unix  2      [ ACC ]     STREAM     LISTENING     69591    4592/master          private/virtual
unix  2      [ ACC ]     STREAM     LISTENING     69594    4592/master          private/lmtp
unix  2      [ ACC ]     STREAM     LISTENING     69597    4592/master          private/anvil
unix  2      [ ACC ]     STREAM     LISTENING     69600    4592/master          private/scache
unix  2      [ ACC ]     STREAM     LISTENING     28796    1000/systemd         /run/user/988/bus
unix  2      [ ACC ]     STREAM     LISTENING     69603    4592/master          private/maildrop
unix  2      [ ACC ]     STREAM     LISTENING     29386    1501/slapd           /opt/zimbra/data/ldap/state/run/ldapi
unix  2      [ ACC ]     STREAM     LISTENING     69606    4592/master          private/old-cyrus
unix  2      [ ACC ]     STREAM     LISTENING     23078    812/gssproxy         /var/lib/gssproxy/default.sock
unix  2      [ ACC ]     STREAM     LISTENING     16283    715/sssd             /var/lib/sss/pipes/private/sbus-monitor
unix  2      [ ACC ]     STREAM     LISTENING     94081    8580/systemd         /run/user/0/systemd/private
unix  2      [ ACC ]     STREAM     LISTENING     68459    4084/amavisd (maste  /opt/zimbra/data/amavisd/amavisd.sock
unix  2      [ ACC ]     STREAM     LISTENING     94087    8580/systemd         /run/user/0/bus
unix  2      [ ACC ]     STREAM     LISTENING     22707    752/sssd_be          /var/lib/sss/pipes/private/sbus-dp_implicit_files.752
unix  2      [ ACC ]     STREAM     LISTENING     69535    4592/master          public/pickup
unix  2      [ ACC ]     STREAM     LISTENING     69539    4592/master          public/cleanup
unix  2      [ ACC ]     STREAM     LISTENING     69542    4592/master          public/qmgr
unix  2      [ ACC ]     STREAM     LISTENING     69564    4592/master          public/flush
unix  2      [ ACC ]     STREAM     LISTENING     69576    4592/master          public/showq
unix  2      [ ACC ]     STREAM     LISTENING     19693    1/systemd            /run/systemd/private
unix  2      [ ACC ]     SEQPACKET  LISTENING     19704    1/systemd            /run/udev/control
[root@mail ~]# 
Need to sort out the mysql privileges, looks like they are messed and mysql can't work on 127.0.0.1
User avatar
JDunphy
Outstanding Member
Outstanding Member
Posts: 896
Joined: Fri Sep 12, 2014 11:18 pm
Location: Victoria, BC
ZCS/ZD Version: 9.0.0_P39 NETWORK Edition

Re: Error on deploying SSL certificates

Post by JDunphy »

I am really rusty in my db admin skills. Don't know if this helps.

Code: Select all

# su - zimbra
%  mysql zimbra
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A

Welcome to the MariaDB monitor.  Commands end with ; or \g.
Your MariaDB connection id is 7512
Server version: 10.1.25-MariaDB Zimbra MariaDB binary distribution

Copyright (c) 2000, 2017, Oracle, MariaDB Corporation Ab and others.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

MariaDB [zimbra]> select table_name from information_schema.tables where table_schema='mysql' and engine='InnoDB';
+--------------------+
| table_name         |
+--------------------+
| gtid_slave_pos     |
| innodb_index_stats |
| innodb_table_stats |
+--------------------+
3 rows in set (0.00 sec)
MariaDB [zimbra]> desc mysql.gtid_slave_pos;
+-----------+---------------------+------+-----+---------+-------+
| Field     | Type                | Null | Key | Default | Extra |
+-----------+---------------------+------+-----+---------+-------+
| domain_id | int(10) unsigned    | NO   | PRI | NULL    |       |
| sub_id    | bigint(20) unsigned | NO   | PRI | NULL    |       |
| server_id | int(10) unsigned    | NO   |     | NULL    |       |
| seq_no    | bigint(20) unsigned | NO   |     | NULL    |       |
+-----------+---------------------+------+-----+---------+-------+
4 rows in set (0.00 sec)

octet
Posts: 23
Joined: Thu Jan 06, 2022 2:35 pm

Re: Error on deploying SSL certificates

Post by octet »

Fixed mysql, user table was crashed:

Code: Select all

[zimbra@mail ~]$ mysql zimbra
ERROR 1045 (28000): Access denied for user 'zimbra'@'localhost' (using password: YES)
[zimbra@mail ~]$ zmlocalconfig -s | grep mysql | grep password
antispam_mysql_password = 
antispam_mysql_root_password = 
mysql_root_password = XXXX
zimbra_mysql_password = XXXX
[zimbra@mail ~]$ mysql -u zimbra -p
Enter password: 
ERROR 1045 (28000): Access denied for user 'zimbra'@'localhost' (using password: YES)
So I wasn't able to connect this way. I modified the /opt/zimbra/conf/my.cnf and added skip-grant-tables and restarted mysql then:

Code: Select all

[zimbra@mail ~]$ mysql
Welcome to the MariaDB monitor.  Commands end with ; or \g.
Your MariaDB connection id is 20
Server version: 10.1.25-MariaDB Zimbra MariaDB binary distribution

Copyright (c) 2000, 2017, Oracle, MariaDB Corporation Ab and others.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

MariaDB [(none)]> SHOW DATABASES;
+--------------------+
| Database           |
+--------------------+
| chat               |
| information_schema |
| mboxgroup1         |
| mboxgroup10        |
| mboxgroup11        |
| mboxgroup12        |
| mboxgroup13        |
| mboxgroup14        |
| mboxgroup15        |
| mboxgroup16        |
| mboxgroup17        |
| mboxgroup18        |
| mboxgroup19        |
| mboxgroup2         |
| mboxgroup20        |
| mboxgroup21        |
| mboxgroup22        |
| mboxgroup23        |
| mboxgroup24        |
| mboxgroup25        |
| mboxgroup26        |
| mboxgroup27        |
| mboxgroup28        |
| mboxgroup29        |
| mboxgroup3         |
| mboxgroup30        |
| mboxgroup31        |
| mboxgroup32        |
| mboxgroup33        |
| mboxgroup34        |
| mboxgroup35        |
| mboxgroup36        |
| mboxgroup37        |
| mboxgroup38        |
| mboxgroup39        |
| mboxgroup4         |
| mboxgroup40        |
| mboxgroup41        |
| mboxgroup42        |
| mboxgroup43        |
| mboxgroup44        |
| mboxgroup45        |
| mboxgroup46        |
| mboxgroup47        |
| mboxgroup48        |
| mboxgroup49        |
| mboxgroup5         |
| mboxgroup50        |
| mboxgroup51        |
| mboxgroup52        |
| mboxgroup53        |
| mboxgroup54        |
| mboxgroup6         |
| mboxgroup7         |
| mboxgroup8         |
| mboxgroup9         |
| mysql              |
| performance_schema |
| test               |
| zimbra             |
+--------------------+
60 rows in set (0.13 sec)

MariaDB [(none)]> USE mysql;
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A

Database changed
MariaDB [mysql]> REPAIR TABLE user;
+------------+--------+----------+--------------------------------------------------+
| Table      | Op     | Msg_type | Msg_text                                         |
+------------+--------+----------+--------------------------------------------------+
| mysql.user | repair | info     | Wrong bytesec:   0-  0-  0 at 312; Skipped       |
| mysql.user | repair | info     | Found block that points outside data file at 272 |
| mysql.user | repair | info     | Found block that points outside data file at 276 |
| mysql.user | repair | info     | Found block that points outside data file at 280 |
| mysql.user | repair | info     | Found block that points outside data file at 284 |
| mysql.user | repair | info     | Found block that points outside data file at 288 |
| mysql.user | repair | info     | Found block that points outside data file at 292 |
| mysql.user | repair | info     | Found block that points outside data file at 296 |
| mysql.user | repair | info     | Found block that points outside data file at 328 |
| mysql.user | repair | info     | Found block that points outside data file at 332 |
| mysql.user | repair | info     | Found block that points outside data file at 336 |
| mysql.user | repair | info     | Found block that points outside data file at 340 |
| mysql.user | repair | info     | Found block that points outside data file at 344 |
| mysql.user | repair | info     | Found block that points outside data file at 348 |
| mysql.user | repair | info     | Found block that points outside data file at 352 |
| mysql.user | repair | warning  | Number of rows changed from 8 to 4               |
| mysql.user | repair | status   | OK                                               |
+------------+--------+----------+--------------------------------------------------+
17 rows in set (0.00 sec)

MariaDB [mysql]> REPAIR TABLE user;
+------------+--------+----------+----------+
| Table      | Op     | Msg_type | Msg_text |
+------------+--------+----------+----------+
| mysql.user | repair | status   | OK       |
+------------+--------+----------+----------+
1 row in set (0.00 sec)

MariaDB [mysql]> UPDATE mysql.user SET Password=PASSWORD('XXXX') WHERE User='root';
Query OK, 0 rows affected (0.00 sec)
Rows matched: 1  Changed: 0  Warnings: 0

MariaDB [mysql]> UPDATE mysql.user SET Password=PASSWORD('XXX') WHERE User='zimbra';
Query OK, 0 rows affected (0.00 sec)
Rows matched: 3  Changed: 0  Warnings: 0

MariaDB [mysql]> FLUSH PRIVILEGES;
Query OK, 0 rows affected (0.00 sec)

MariaDB [mysql]> exit
Bye
I obviously used the same passwords that from zimbra.


I now get another error:

Code: Select all

[zimbra@mail ~]$ tail -f /opt/zimbra/log/mailbox.log
	at com.zimbra.cs.db.StatTrackingPreparedStatement.executeQuery(StatTrackingPreparedStatement.java:352)
	at com.zimbra.cs.db.DbConfig.getAll(DbConfig.java:161)
	... 66 more
Caused by: java.sql.SQLException: Table 'zimbra.config' doesn't exist in engine
Query is: SELECT * FROM config
java thread: main
	at org.mariadb.jdbc.internal.util.LogQueryTool.exceptionWithQuery(LogQueryTool.java:163)
	at org.mariadb.jdbc.internal.protocol.AbstractQueryProtocol.executeQuery(AbstractQueryProtocol.java:292)
	at org.mariadb.jdbc.ClientSidePreparedStatement.executeInternal(ClientSidePreparedStatement.java:221)
	... 73 more

Code: Select all

MariaDB [zimbra]> SHOW TABLES;
+-------------------+
| Tables_in_zimbra  |
+-------------------+
| config            |
| current_sessions  |
| current_volumes   |
| deleted_account   |
| mailbox           |
| mailbox_metadata  |
| mobile_devices    |
| out_of_office     |
| pending_acl_push  |
| scheduled_task    |
| service_status    |
| table_maintenance |
| volume            |
| volume_blobs      |
| zmg_devices       |
+-------------------+
15 rows in set (0.00 sec)

MariaDB [zimbra]>MariaDB [zimbra]> REPAIR TABLE config;
+---------------+--------+----------+-----------------------------------------------+
| Table         | Op     | Msg_type | Msg_text                                      |
+---------------+--------+----------+-----------------------------------------------+
| zimbra.config | repair | Error    | Table 'zimbra.config' doesn't exist in engine |
| zimbra.config | repair | status   | Operation failed                              |
+---------------+--------+----------+-----------------------------------------------+
2 rows in set (0.00 sec)
I need to take a gym break and will probably look at it with fresher eyes afterwards
User avatar
JDunphy
Outstanding Member
Outstanding Member
Posts: 896
Joined: Fri Sep 12, 2014 11:18 pm
Location: Victoria, BC
ZCS/ZD Version: 9.0.0_P39 NETWORK Edition

Re: Error on deploying SSL certificates

Post by JDunphy »

There are some db scripts in /opt/zimbra/libexec/scripts which you might be able to copy the create table's from. I believe they are applied during the update/install phase when install.sh runs. Some are really really old but it might be useful as background information.

Code: Select all

MariaDB [zimbra]> desc config;
+-------------+--------------+------+-----+-------------------+-----------------------------+
| Field       | Type         | Null | Key | Default           | Extra                       |
+-------------+--------------+------+-----+-------------------+-----------------------------+
| name        | varchar(255) | NO   | PRI | NULL              |                             |
| value       | text         | YES  |     | NULL              |                             |
| description | text         | YES  |     | NULL              |                             |
| modified    | timestamp    | NO   |     | CURRENT_TIMESTAMP | on update CURRENT_TIMESTAMP |
+-------------+--------------+------+-----+-------------------+-----------------------------+
4 rows in set (0.00 sec)

MariaDB [zimbra]> select * from config;
+---------------------+-------+-------------------+---------------------+
| name                | value | description       | modified            |
+---------------------+-------+-------------------+---------------------+
| db.version          | 111   | db schema version | 2021-07-09 16:42:32 |
| index.version       | 2     | index version     | 2021-07-09 16:42:32 |
| purge.lastMailboxId | 3     | NULL              | 2022-01-13 12:30:49 |
| redolog.version     | 1.42  | redolog version   | 2021-07-09 16:42:32 |
+---------------------+-------+-------------------+---------------------+
4 rows in set (0.00 sec)
I can't remember the history of this OSS install that I call my test machine. I think I might have built it when I was writing my build machine scripts last year and it came from a NETWORK version converted to an OSS version. I remember testing to see if that OSS conversion option was still in play with 8.8.15 commercial. It could also be a self-compile as I was doing that around the same time in that build machine script incorporating Ian's build scripts. Bottom line is the contents might be different as I don't believe I have a vanilla OSS version here.

This thread is becoming quite the education in recovery. ;-) Keep going you are close!

Jim
octet
Posts: 23
Joined: Thu Jan 06, 2022 2:35 pm

Re: Error on deploying SSL certificates

Post by octet »

Slight development, web interface is up, however I get a blank page.

This seems to be the reason:

Code: Select all

[zimbra@mail ~]$ zmmailbox -z -m XXX@XXX.com gaf
        Id  View      Unread   Msg Count  Path
----------  ----  ----------  ----------  ----------
ERROR: service.FAILURE (system failure: fetching folder data for mailbox 20)
[zimbra@mail ~]$ ll /opt/zimbra/db/data/mboxgroup20
total 13752
-rw-rw---- 1 zimbra zimbra     2300 Jan  3 10:41 appointment.frm
-rw-rw---- 1 zimbra zimbra   131072 Jan  3 10:41 appointment.ibd
-rw-rw---- 1 zimbra zimbra     2300 Jan  3 10:41 appointment_dumpster.frm
-rw-rw---- 1 zimbra zimbra   131072 Jan  3 10:41 appointment_dumpster.ibd
-rw-rw---- 1 zimbra zimbra     2450 Jan  3 10:41 data_source_item.frm
-rw-rw---- 1 zimbra zimbra   114688 Jan  3 10:41 data_source_item.ibd
-rw-rw---- 1 zimbra zimbra       61 Jan  3 10:41 db.opt
-rw-rw---- 1 zimbra zimbra     8172 Jan  3 10:41 imap_folder.frm
-rw-rw---- 1 zimbra zimbra   131072 Jan  3 10:41 imap_folder.ibd
-rw-rw---- 1 zimbra zimbra     1540 Jan  3 10:41 imap_message.frm
-rw-rw---- 1 zimbra zimbra   131072 Jan  3 10:41 imap_message.ibd
-rw-rw---- 1 zimbra zimbra    10680 Jan  3 10:41 mail_item.frm
-rw-rw---- 1 zimbra zimbra 11534428 Jan  3 10:41 mail_item.ibd
-rw-rw---- 1 zimbra zimbra    10191 Jan  3 10:41 mail_item_dumpster.frm
-rw-rw---- 1 zimbra zimbra   212992 Jan  3 10:41 mail_item_dumpster.ibd
-rw-rw---- 1 zimbra zimbra     1554 Jan  3 10:41 open_conversation.frm
-rw-rw---- 1 zimbra zimbra   573440 Jan  3 10:41 open_conversation.ibd
-rw-rw---- 1 zimbra zimbra     2375 Jan  3 10:41 pop3_message.frm
-rw-rw---- 1 zimbra zimbra   114688 Jan  3 10:41 pop3_message.ibd
-rw-rw---- 1 zimbra zimbra     1205 Jan  3 10:41 purged_conversations.frm
-rw-rw---- 1 zimbra zimbra    98304 Jan  3 10:41 purged_conversations.ibd
-rw-rw---- 1 zimbra zimbra     2757 Jan  3 10:41 purged_messages.frm
-rw-rw---- 1 zimbra zimbra    98304 Jan  3 10:41 purged_messages.ibd
-rw-rw---- 1 zimbra zimbra     5231 Jan  3 10:41 revision.frm
-rw-rw---- 1 zimbra zimbra    98304 Jan  3 10:41 revision.ibd
-rw-rw---- 1 zimbra zimbra     5231 Jan  3 10:41 revision_dumpster.frm
-rw-rw---- 1 zimbra zimbra    98304 Jan  3 10:41 revision_dumpster.ibd
-rw-rw---- 1 zimbra zimbra     5095 Jan  3 10:41 tag.frm
-rw-rw---- 1 zimbra zimbra   114688 Jan  3 10:41 tag.ibd
-rw-rw---- 1 zimbra zimbra     1476 Jan  3 10:41 tagged_item.frm
-rw-rw---- 1 zimbra zimbra   278528 Jan  3 10:41 tagged_item.ibd
-rw-rw---- 1 zimbra zimbra     1040 Jan  3 10:41 tombstone.frm
-rw-rw---- 1 zimbra zimbra   114688 Jan  3 10:41 tombstone.ibd
[zimbra@mail ~]$ 
Must be because of the ib* files I moved and re-created when mysql wasn't starting.

Would be amazing if there was a way to sync emails I have locally in the email client with what's on the server. I could delete the user, recreate it and then sync, like merging what's on the client with what's on the server via IMAP, but doubt that's possible.
User avatar
JDunphy
Outstanding Member
Outstanding Member
Posts: 896
Joined: Fri Sep 12, 2014 11:18 pm
Location: Victoria, BC
ZCS/ZD Version: 9.0.0_P39 NETWORK Edition

Re: Error on deploying SSL certificates

Post by JDunphy »

Don't know much about how zmmailbox internally works so I need to go look at the src. I can tell you that nothing is lost...

Code: Select all

[zimbra@tmail ~]$ mysql mboxgroup3
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A

Welcome to the MariaDB monitor.  Commands end with ; or \g.
Your MariaDB connection id is 22303
Server version: 10.1.25-MariaDB Zimbra MariaDB binary distribution

Copyright (c) 2000, 2017, Oracle, MariaDB Corporation Ab and others.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.


MariaDB [mboxgroup3]> show tables;
+----------------------+
| Tables_in_mboxgroup3 |
+----------------------+
| appointment          |
| appointment_dumpster |
| data_source_item     |
| imap_folder          |
| imap_message         |
| mail_item            |
| mail_item_dumpster   |
| open_conversation    |
| pop3_message         |
| purged_conversations |
| purged_messages      |
| revision             |
| revision_dumpster    |
| tag                  |
| tagged_item          |
| tombstone            |
+----------------------+
16 rows in set (0.00 sec)

MariaDB [mboxgroup3]> describe mail_item;
+--------------+---------------------+------+-----+---------+-------+
| Field        | Type                | Null | Key | Default | Extra |
+--------------+---------------------+------+-----+---------+-------+
| mailbox_id   | int(10) unsigned    | NO   | PRI | NULL    |       |
| id           | int(10) unsigned    | NO   | PRI | NULL    |       |
| type         | tinyint(4)          | NO   |     | NULL    |       |
| parent_id    | int(10) unsigned    | YES  |     | NULL    |       |
| folder_id    | int(10) unsigned    | YES  |     | NULL    |       |
| prev_folders | text                | YES  |     | NULL    |       |
| index_id     | int(10) unsigned    | YES  |     | NULL    |       |
| imap_id      | int(10) unsigned    | YES  |     | NULL    |       |
| date         | int(10) unsigned    | NO   |     | NULL    |       |
| size         | bigint(20) unsigned | NO   |     | NULL    |       |
| locator      | varchar(1024)       | YES  |     | NULL    |       |
| blob_digest  | varchar(44)         | YES  |     | NULL    |       |
| unread       | int(10) unsigned    | YES  |     | NULL    |       |
| flags        | int(11)             | NO   |     | 0       |       |
| tags         | bigint(20)          | NO   |     | 0       |       |
| tag_names    | text                | YES  |     | NULL    |       |
| sender       | varchar(128)        | YES  |     | NULL    |       |
| recipients   | varchar(128)        | YES  |     | NULL    |       |
| subject      | text                | YES  |     | NULL    |       |
| name         | varchar(255)        | YES  |     | NULL    |       |
| metadata     | mediumtext          | YES  |     | NULL    |       |
| mod_metadata | int(10) unsigned    | NO   |     | NULL    |       |
| change_date  | int(10) unsigned    | YES  |     | NULL    |       |
| mod_content  | int(10) unsigned    | NO   |     | NULL    |       |
| uuid         | varchar(127)        | YES  |     | NULL    |       |
+--------------+---------------------+------+-----+---------+-------+
25 rows in set (0.00 sec)


Even if you only have the raw mail files you can re-introduce it to Zimbra... it is slow but that is basically how we get stuff out of quarantine.

Code: Select all

to=$(head -100 $filename | grep "^To:" | awk '{print $2}' | sed 's/["\n\r<>]//g' | head -1)
from=$(head -100 $filename | grep "^From:" | sed -E 's/.*<(.*)>.*/\1/' | sed -E 's/^From:\s*//g' )
zmlmtpinject -r $to -s $from $filename
I wonder if you injected a single message would it build/correct some missing information?

Otherwise, there are other methods of pulling the raw files and rebuilding stores that folks here have described in these forums in the past. I would think also that imap would work if that interface/path is still intact even if you have to stage locally to another imap server or folder and then restore.

Ref: https://wiki.zimbra.com/wiki/ShanxT-Notes
octet
Posts: 23
Joined: Thu Jan 06, 2022 2:35 pm

Re: Error on deploying SSL certificates

Post by octet »

Code: Select all

[zimbra@mail ~]$ mysql mboxgroup20
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A

Welcome to the MariaDB monitor.  Commands end with ; or \g.
Your MariaDB connection id is 1370
Server version: 10.1.25-MariaDB Zimbra MariaDB binary distribution

Copyright (c) 2000, 2017, Oracle, MariaDB Corporation Ab and others.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

MariaDB [mboxgroup20]> show tables;
+-----------------------+
| Tables_in_mboxgroup20 |
+-----------------------+
| appointment           |
| appointment_dumpster  |
| data_source_item      |
| imap_folder           |
| imap_message          |
| mail_item             |
| mail_item_dumpster    |
| open_conversation     |
| pop3_message          |
| purged_conversations  |
| purged_messages       |
| revision              |
| revision_dumpster     |
| tag                   |
| tagged_item           |
| tombstone             |
+-----------------------+
16 rows in set (0.00 sec)

MariaDB [mboxgroup20]> describe mail_item;
ERROR 1932 (42S02): Table 'mboxgroup20.mail_item' doesn't exist in engine
MariaDB [mboxgroup20]> 
octet
Posts: 23
Joined: Thu Jan 06, 2022 2:35 pm

Re: Error on deploying SSL certificates

Post by octet »

Trying to follow these steps to recover mailboxes from the folders, not having much luck.

https://wiki.zimbra.com/wiki/ShanxT-Notes

Code: Select all

[zimbra@mail 20]$ pwd
/opt/zimbra/store/0/20
[zimbra@mail 20]$ zmmailbox -zadmin
mbox> selectMailbox xxx@xxx.com
ERROR: service.FAILURE (system failure: fetching folder data for mailbox 20)
mbox> 
Checked the files already, that mailbox is correct, id 20.
octet
Posts: 23
Joined: Thu Jan 06, 2022 2:35 pm

Re: Error on deploying SSL certificates

Post by octet »

All fixed now, used the Aug 2021 backup, created a new server and restored the full server there. Moved the storage folder and imported the messages using this:

https://wiki.zimbra.com/wiki/ShanxT-Notes

Thanks all for help, I'm a zimbra guru now :lol:
Post Reply