I've just updated from 1.0.14 to 1.1.1 (Maildirs). According to <URL:http://wiki.dovecot.org/Upgrading/1.1>, "dovecot-uidlist file is in a new format. The old format is automatically converted to new one." When I try to delete a message (which moves it to the IMAP Trash folder), I get the following looping sequence of errors until I cancel the delete operation in the mail client: ----- Jun 24 12:22:13 chicken-ac dovecot: IMAP(schmonz): fdatasync_path(/home/schmonz/Maildir/.Trash/cur) failed: Bad file descriptor Jun 24 12:22:13 chicken-ac dovecot: Panic: IMAP(schmonz): file maildir-uidlist.c: line 1217 (maildir_uidlist_sync_update): assertion failed: (ctx->first_unwritten_pos != (unsigned int)-1) Jun 24 12:22:13 chicken-ac dovecot: child 5170 (imap) killed with signal 6 Jun 24 12:22:14 chicken-ac dovecot: imap-login: Login: user=<schmonz>, method=PLAIN, rip=68.46.70.233, lip=160.39.240.17, TLS Jun 24 12:22:16 chicken-ac dovecot: IMAP(schmonz): fdatasync_path(/home/schmonz/Maildir/.Trash/cur) failed: Bad file descriptor Jun 24 12:22:16 chicken-ac dovecot: Panic: IMAP(schmonz): file maildir-uidlist.c: line 1217 (maildir_uidlist_sync_update): assertion failed: (ctx->first_unwritten_pos != (unsigned int)-1) Jun 24 12:22:16 chicken-ac dovecot: child 27601 (imap) killed with signal 6 Jun 24 12:22:17 chicken-ac dovecot: imap-login: Login: user=<schmonz>, method=PLAIN, rip=68.46.70.233, lip=160.39.240.17, TLS Jun 24 12:22:19 chicken-ac dovecot: IMAP(schmonz): fdatasync_path(/home/schmonz/Maildir/.Trash/cur) failed: Bad file descriptor Jun 24 12:22:19 chicken-ac dovecot: Panic: IMAP(schmonz): file maildir-uidlist.c: line 1217 (maildir_uidlist_sync_update): assertion failed: (ctx->first_unwritten_pos != (unsigned int)-1) Jun 24 12:22:19 chicken-ac dovecot: child 29637 (imap) killed with signal 6 Jun 24 12:22:20 chicken-ac dovecot: imap-login: Login: user=<schmonz>, method=PLAIN, rip=68.46.70.233, lip=160.39.240.17, TLS Jun 24 12:22:22 chicken-ac dovecot: IMAP(schmonz): fdatasync_path(/home/schmonz/Maildir/.Trash/cur) failed: Bad file descriptor Jun 24 12:22:22 chicken-ac dovecot: Panic: IMAP(schmonz): file maildir-uidlist.c: line 1217 (maildir_uidlist_sync_update): assertion failed: (ctx->first_unwritten_pos != (unsigned int)-1) Jun 24 12:22:22 chicken-ac dovecot: child 9143 (imap) killed with signal 6 Jun 24 12:22:22 chicken-ac dovecot: imap-login: Login: user=<schmonz>, method=PLAIN, rip=68.46.70.233, lip=160.39.240.17, TLS Jun 24 12:22:23 chicken-ac dovecot: IMAP(schmonz): Connection closed bytes=45/352132 Jun 24 12:24:23 chicken-ac dovecot: imap-login: Login: user=<schmonz>, method=PLAIN, rip=68.46.70.233, lip=160.39.240.17, TLS ----- Alternatively, sometimes I get an error dialog in the mail client: "The current command did not succeed. The mail server responded: BUG: Unknown internal error." Have I done something wrong? Can I provide more information to help narrow this down? Thanks, - Amitai
On Jun 24, 2008, at 7:31 PM, Amitai Schlair wrote:> I've just updated from 1.0.14 to 1.1.1 (Maildirs). According to <URL:http://wiki.dovecot.org/Upgrading/1.1 > >, "dovecot-uidlist file is in a new format. The old format is > automatically converted to new one." > > When I try to delete a message (which moves it to the IMAP Trash > folder), I get the following looping sequence of errors until I > cancel the delete operation in the mail client: > > ----- > > Jun 24 12:22:13 chicken-ac dovecot: IMAP(schmonz): fdatasync_path(/ > home/schmonz/Maildir/.Trash/cur) failed: Bad file descriptorWhat OS and filesystem do you use? Apparently it doesn't like that I try to fsync() a read-only directory file descriptor. But then again I don't know if there's another alternative than to just not fsync() the directory.> Jun 24 12:22:13 chicken-ac dovecot: Panic: IMAP(schmonz): file > maildir-uidlist.c: line 1217 (maildir_uidlist_sync_update): > assertion failed: (ctx->first_unwritten_pos != (unsigned int)-1)Still shouldn't crash even if the fsync fails, I'll see about fixing that. A workaround for now would be to se fsync_disable=yes -------------- next part -------------- A non-text attachment was scrubbed... Name: PGP.sig Type: application/pgp-signature Size: 194 bytes Desc: This is a digitally signed message part URL: <http://dovecot.org/pipermail/dovecot/attachments/20080624/c67fba62/attachment-0002.bin>
Timo Sirainen wrote:> On Jun 24, 2008, at 7:31 PM, Amitai Schlair wrote: > >> Jun 24 12:22:13 chicken-ac dovecot: IMAP(schmonz): >> fdatasync_path(/home/schmonz/Maildir/.Trash/cur) failed: Bad file >> descriptor > > What OS and filesystem do you use?NetBSD 4.0, FFS with soft updates.>> Jun 24 12:22:13 chicken-ac dovecot: Panic: IMAP(schmonz): file >> maildir-uidlist.c: line 1217 (maildir_uidlist_sync_update): assertion >> failed: (ctx->first_unwritten_pos != (unsigned int)-1) > > Still shouldn't crash even if the fsync fails, I'll see about fixing that. > > A workaround for now would be to se fsync_disable=yesWith the workaround, deleting works, and so copying sent messages to Sent will probably also work again (just about to find out :-). Thanks for the quick response! If you need a fix tested, I can do that. - Amitai
Same Problem here: both the failed fsync and the Panic.> What OS and filesystem do you use?NetBSD 4.0, Mails on NFS (server is a Debian box)> Still shouldn't crash even if the fsync fails, I'll see about > fixing that.Yes, please.> A workaround for now would be to se fsync_disable=yesSame workaround works for me. No need to hurry, it's just a test server (production just moved from 1.0rc18 to 1.0.13).
> Apparently it doesn't like that I try to fsync() a read-only > directory file descriptor.I would argue that NetBSD is correct in this. Posix says:> The fsync() function shall request that all data for the open file > descriptor named by fildes is to be transferred to the storage > device associated with the file described by fildes.I read this a being about the file descriptor, not the file. Which would imply that fsync()ing an O_RDONLY descriptor doesn't make sense. However, the wording for fdatasync() is slightly different and not as clear, whether intentional or not. But fdatasync() seems to be conceptually about regular files anyway. From an admittedly non-Linux perspective, I'm unsure why one would need to perform a flush on a directory in the first place.