Cyrus replica 2.4 to 3.2.2 issues

2020-07-23 Thread Marco
Hello, I'm trying to replicate from Cyrus IMAP 2.4.20 to Cyrus IMAP 
3.2.2 using replication.


Because Cyrus 2.4 doesn't support IMAP replication (is this true?), I 
configured the replica with


replica2to3syncserver cmd="/usr/libexec/cyrus-imapd/sync_server" 
proto=tcp4 listen="csync"


in SERVICES of cyrus.conf.

The sync_client in master works in rolling mode, such as

/usr/lib/cyrus-imapd/sync_client -r -n replica2-3

Both master and replica hosts work with delayed deleted and delayed 
expunge fashion.


I experience some problems.
In the below logs tst-msg01 is the master, tst-msg03 is the replica.

== 1 ==
I found "errors" of this kind:

2020-07-21T15:05:16.803765+02:00 tst-msg03 
cyrus/replica2to3syncserver[1238 sync_log(): Failed to lock 
/var/lib/imap/sync/squatter/log for MAILBOX 
example.com!user.demo^gruppoarchivio.ticket.Vecchi#012 after 65 attempts
2020-07-21T15:05:16.803898+02:00 tst-msg03 
cyrus/replica2to3syncserver[1238 mailbox: longlock 
example.com!user.demo^gruppoarchivio.ticket.Vecchi for 2.5 seconds
2020-07-21T15:05:17.090124+02:00 tst-msg03 
cyrus/replica2to3syncserver[1238 sync_log(): Failed to lock 
/var/lib/imap/sync/squatter/log for MAILBOX 
example.com!user.demo^gruppoarchivio.ticket.Vecchi#012 after 65 attempts
2020-07-21T15:05:17.101288+02:00 tst-msg03 
cyrus/replica2to3syncserver[1238 mappedfile: longlock 
/var/lib/imap/domain/Q/example.com/user/E/demo.gruppoarchivio.conversations 
for 2.7 seconds
2020-07-21T15:05:17.101410+02:00 tst-msg03 cyrus/squatter[27276]: 
indexing mailbox user/demo.gruppoarchivio/ticket/vec...@example.com...
2020-07-21T15:05:18.132371+02:00 tst-msg03 cyrus/squatter[27276]: Xapian 
committed 740 updates in 0.374236 sec
2020-07-21T15:05:18.145507+02:00 tst-msg03 cyrus/squatter[27276]: 
mappedfile: longlock 
/var/lib/imap/domain/Q/example.com/user/E/demo.gruppoarchivio.xapianactive 
for 1.0 seconds


But the xapian index seems to be ok:

-rw--- 1 cyrus mail  864 Jul 21 15:05 cyrus.indexed.db
-rw--- 1 cyrus mail0 Jul 21 15:05 flintlock
-rw--- 1 cyrus mail  116 Jul 21 15:05 iamglass
-rw--- 1 cyrus mail 13115392 Jul 21 15:05 position.glass
-rw--- 1 cyrus mail  5545984 Jul 21 15:05 postlist.glass
-rw--- 1 cyrus mail  3530752 Jul 21 15:05 termlist.glass

I hope I can ignore this. I've found these errors only for one mailbox.


== 2 ==
Another problem is that the "expire" annotation value is not configured 
as an "expire" metadata value on Cyrus 3.2.2. I don't know if this is 
expected or if this is a bug. But it is a problem for me, I have to 
rewrite all these mailboxes metadata.


To be more clear, the Cyrus IMAP 2.4.20 annotation like

* ANNOTATION "user/marco/tr...@example.com" 
"/vendor/cmu/cyrus-imapd/expire" ("value.shared" "14" 
"content-type.shared" "text/plain" "size.shared" "2" 
"modifiedsince.shared" "1406624279")


become in Cyrus IMAP 3.2.2 after the sync:
* METADATA user/marco/tr...@example.com 
("/shared/vendor/cmu/cyrus-imapd/expire" NIL)


I expected "14" and not NIL.

== 3 ==
The specialuse flags are not kept in the replica server:

* LIST (\HasNoChildren \Sent) "/" INBOX/Sent
become
* LIST (\HasNoChildren) "/" INBOX/Sent

Do I have to suppose that I must run the cvt_xlist_specialuse tool as 
described in 
https://www.cyrusimap.org/3.2/imap/download/upgrade.html#upgrade-specific-items 
?
It's not clear to me if this instruction is related to the in place 
upgrade only or to the replication mode too.



== 4 ==
This is a severe error. When I expunge a message in the master, the 
expunge action is not replicated on the replica, and the sync_client dies:


2020-07-23T14:50:44.695378+02:00 tst-msg01 cyrus/imap[26851]: Expunged 1 
messages from example.com!user.marco^fff.Trash
2020-07-23T14:51:10.147600+02:00 tst-msg03 
cyrus/replica2to3syncserver[1207 Fatal error: Internal error: assertion 
failed: imap/dlist.c: 156: base != NULL
2020-07-23T14:51:10.693261+02:00 tst-msg01 cyrus/sync_client[26834]: 
RESERVE received * response:
2020-07-23T14:51:10.693321+02:00 tst-msg01 cyrus/sync_client[26834]: 
reserve messages: failed: Bad protocol
2020-07-23T14:51:10.693730+02:00 tst-msg01 cyrus/sync_client[26834]: 
Error in do_sync(): bailing out! Bad protocol
2020-07-23T14:51:10.693750+02:00 tst-msg01 cyrus/sync_client[26834]: 
Processing sync log file /var/lib/imap/sync/replica2-3/log-26834 failed: 
Bad protocol
2020-07-23T14:51:10.706750+02:00 tst-msg03 cyrus/master[24009]: process 
type:SERVICE name:replica2to3syncserver 
path:/usr/libexec/cyrus-imapd/sync_server age:1142.993s pid:1207 exited, 
status 70


I can't no more suppress this error. All sync_client die, even in non 
rolling mode. I have to delete permanently the replicated mailboxes to 
resume the right working.


I see the same error when I delete a mailbox on replica and after that I 
do a sync_client on master. In this last case the error disappear only 
when I delete the delayed DELETED mailbox too.


I read the documentation, I didn't find restri

Re: backupd and sync_client Syntax error

2020-07-23 Thread Marco

Ouch, sorry, ignore this.

I suppose to have found the problem.

My goal is to sync from Cyrus IMAP 2.4 to 3.2, and to 3.2 to a backupd host.
I see it works just starting by hand the sync_client in Cyrus IMAP 2.4, 
meanwhile in the middle host the rolling mode is sufficient with 
sync_log_chain.


But I had a bad Cyrus IMAP 2.4 with some mailboxes which had references 
in mailboxes.db only, and not in file system and metadata.


Solving above error, then sync_client from 3.2 IMAP host to backupd host 
works.


I don't know why I don't see errors in sync_client from 2.4 to 3.2 already.

Cheers
Marco


Il 22/07/2020 11:51, Marco ha scritto:

Hello,

  I would ask an help with a new replication error in backup channel.
I have this never-ending loop error:

2020-07-22T11:35:16.212126+02:00 tst-msg03 cyrus/sync_client[22465]: 
MAILBOXES received NO response: IMAP_PROTOCOL_BAD_PARAMETERS Bad parameters
2020-07-22T11:35:16.212185+02:00 tst-msg03 cyrus/sync_client[22465]: 
Error in do_sync(): bailing out! Syntax error in parameters
2020-07-22T11:35:16.212228+02:00 tst-msg03 cyrus/sync_client[22465]: 
Processing sync log file /var/lib/imap/sync/bck/log-run failed: Syntax 
error in parameters
2020-07-22T11:35:16.216962+02:00 tst-msg03 cyrus/sync_client[22465]: 
Reprocessing sync log file /var/lib/imap/sync/bck/log-run



The "log-run" file ends with:

APPEND "example.com!user.gianni^ferromagnetic.  Cartella Molto Spaziosa"
MAILBOX "example.com!user.gianni^ferromagnetic.  Cartella Molto Spaziosa"
MAILBOX "example.com!user.gianni^ferromagnetic.  Cartella Molto Spaziosa"
APPEND "example.com!user.gianni^ferromagnetic.  Cartella Molto 
Spaziosa.Sottocartella"
MAILBOX "example.com!user.gianni^ferromagnetic.  Cartella Molto 
Spaziosa.Sottocartella"
MAILBOX "example.com!user.gianni^ferromagnetic.  Cartella Molto 
Spaziosa.Sottocartella"

APPEND example.com!user.gianni^ferromagnetic.10
MAILBOX example.com!user.gianni^ferromagnetic.10
MAILBOX example.com!user.gianni^ferromagnetic.10
APPEND example.com!user.gianni^ferromagnetic.Abbcc
MAILBOX example.com!user.gianni^ferromagnetic.Abbcc
MAILBOX example.com!user.gianni^ferromagnetic.Abbcc
APPEND example.com!user.gianni^ferromagnetic.Abc
MAILBOX example.com!user.gianni^ferromagnetic.Abc
MAILBOX example.com!user.gianni^ferromagnetic.Abc
MAILBOX "example.com!user.gianni^ferromagnetic.Cartella 1"
MAILBOX "example.com!user.gianni^ferromagnetic.Cartella 1"
APPEND "example.com!user.gianni^ferromagnetic.Cartella 1.Cestino"
MAILBOX "example.com!user.gianni^ferromagnetic.Cartella 1.Cestino"
MAILBOX "example.com!user.gianni^ferromagnetic.Cartella 1.Cestino"
APPEND "example.com!user.gianni^ferromagnetic.Cartella 1.Cestino.Test"
MAILBOX "example.com!user.gianni^ferromagnetic.Cartella 1.Cestino.Test"
MAILBOX "example.com!user.gianni^ferromagnetic.Cartella 1.Cestino.Test"
MAILBOX "example.com!user.gianni^ferromagnetic.Cartella 1.Spam"
MAILBOX "example.com!user.gianni^ferromagnetic.Cartella 1.Spam"
APPEND "example.com!user.gianni^ferromagnetic.Cartella 1.ma,cia"
MAILBOX "example.com!user.gianni^ferromagnetic.Cartella 1.ma,cia"
MAILBOX "example.com!user.gianni^ferromagnetic.Cartella 1.ma,cia"
MAILBOX "example.com!user.gianni^ferromagnetic.Cartella 1.ma,cia.Archivio"
MAILBOX "example.com!user.gianni^ferromagnetic.Cartella 1.ma,cia.Archivio"
APPEND "example.com!user.gianni^ferromagnetic.Cartella Spaziosa"
MAILBOX "example.com!user.gianni^ferromagnetic.Cartella Spaziosa"
MAILBOX "example.com!user.gianni^ferromagnetic.Cartella Spaziosa"

The log-run has the same last-modified date of the first syslog error 
message of syntax error.



Other strange folder names I created are

MAILBOX example.com!user.baraccone.prova:prova:
MAILBOX example.com!user.baraccone.prova:prova:
MAILBOX example.com!user.baraccone.prova^1
MAILBOX example.com!user.baraccone.prova^1


I suspect that some folder name breaks the backup replication...

Thank you very much

Cheers
Marco

Cyrus Home Page: http://www.cyrusimap.org/
List Archives/Info: http://lists.andrew.cmu.edu/pipermail/info-cyrus/
To Unsubscribe:
https://lists.andrew.cmu.edu/mailman/listinfo/info-cyrus




Cyrus Home Page: http://www.cyrusimap.org/
List Archives/Info: http://lists.andrew.cmu.edu/pipermail/info-cyrus/
To Unsubscribe:
https://lists.andrew.cmu.edu/mailman/listinfo/info-cyrus