cyrusimap / cyrus-imapd

Cyrus IMAP is an email, contacts and calendar server
http://cyrusimap.org
Other
528 stars 145 forks source link

httpd segfaults when executing JMAP method getMessageList #1849

Closed iNPUTmice closed 7 years ago

iNPUTmice commented 7 years ago

Hi,

I have troubles getting JMAP to work on cyrus 3.0 (current HEAD)

Steps to reproduce:

Feb 22 11:29:12 localhost http[25757]: login: localhost.localdomain [127.0.0.1] admin@ltt.rs Basic User logged in SESSIONID=<kepler-25757-1487759352-1-17543219013468123407>
Feb 22 11:29:12 localhost http[25757]: Folder ltt.rs!user.admin: running folder scan subquery: (true)
Feb 22 11:29:12 localhost http[25757]: Folder ltt.rs!user.admin: loading MsgData for sort criteria REVERSE ARRIVAL
Feb 22 11:29:12 localhost http[25757]: Folder ltt.rs!user.admin.#calendars: running folder scan subquery: (true)
Feb 22 11:29:12 localhost http[25757]: Folder ltt.rs!user.admin.#calendars: loading MsgData for sort criteria REVERSE ARRIVAL
Feb 22 11:29:12 localhost http[25757]: Folder ltt.rs!user.admin.#calendars.Attachments: running folder scan subquery: (true)
Feb 22 11:29:12 localhost http[25757]: Folder ltt.rs!user.admin.#calendars.Attachments: loading MsgData for sort criteria REVERSE ARRIVAL
Feb 22 11:29:12 localhost http[25757]: Folder ltt.rs!user.admin.#calendars.Default: running folder scan subquery: (true)
Feb 22 11:29:12 localhost http[25757]: Folder ltt.rs!user.admin.#calendars.Default: loading MsgData for sort criteria REVERSE ARRIVAL
Feb 22 11:29:12 localhost http[25757]: Folder ltt.rs!user.admin.#calendars.Inbox: running folder scan subquery: (true)
Feb 22 11:29:12 localhost kernel: [7352053.770942] httpd[25757]: segfault at 0 ip 0000000000453fbf sp 00007ffceb2be340 error 4 in httpd[400000+b6000]
Feb 22 11:29:12 localhost http[25757]: Folder ltt.rs!user.admin.#calendars.Inbox: loading MsgData for sort criteria REVERSE ARRIVAL
Feb 22 11:29:12 localhost http[25757]: Folder ltt.rs!user.admin.#calendars.Outbox: running folder scan subquery: (true)
Feb 22 11:29:12 localhost http[25757]: Folder ltt.rs!user.admin.#calendars.Outbox: loading MsgData for sort criteria REVERSE ARRIVAL
Feb 22 11:29:12 localhost http[25757]: Folder ltt.rs!user.admin.#notifications: running folder scan subquery: (true)
Feb 22 11:29:12 localhost http[25757]: Folder ltt.rs!user.admin.#notifications: loading MsgData for sort criteria REVERSE ARRIVAL

So in summary; JMAP kinda works in general. For example call getMailboxes works. However getMessageList does not.

Edit: Just to be clear. I can repeat that with newly created mailboxes as well. It's not just that one mailbox that's broken.

rsto commented 7 years ago

Most probably cause of error: You haven't built Cyrus with Xapian support (--enable-xapian) or haven't set it as search_engine in imapd.conf (see the search_engine option).

JMAP mail, and especially getMessageList, requires Xapian but we haven't clearly documented that yet (sorry). Even more so, we haven't yet decided if JMAP should become optional, or Xapian a mandatory dependency for Cyrus in general (see https://github.com/cyrusimap/cyrus-imapd/issues/1847).

Does enabling Xapian resolve your issue?

iNPUTmice commented 7 years ago

Here is my imapd.conf

configdirectory: /var/imap
partition-default: /var/spool/imap
admins: cyrusadm cyrusadm@localdomain
sasl_pwcheck_method: auxprop
sasldb_path: /etc/sasldb2
sasl_mech_list: PLAIN LOGIN EXTERNAL
allowplaintext: yes
virtdomains: yes
defaultdomain: kepler
httpmodules: caldav jmap tzdist
search_engine: xapian
search_index_headers: no
search_batchsize: 8192
defaultpartition: default
defaultsearchtier: t1
t1searchpartition-default: /var/spool/search
conversations: on
conversations_db: twoskip

I invoked ./configure with the --enable-xapian flag (and it also appeared in the configure 'summary' in the search engine section.

Can I check if cyrus actually uses xapian with that configuration?

Edit: To keep up with what has been discussed on IRC.

rsto commented 7 years ago

You can check if Cyrus is built with Xapian by running

$ cyr_buildinfo flat | grep xapian
search.xapian=true

Although by your description it seems as if Xapian is properly built into Cyrus.

Do you have indexed messages, have you run squatter?

E.g. how does your xapian directory look like?

$ ls 1200461/search/c/user/cassandane/xapian/
cyrus.indexed.db  flintlock  iamglass  position.glass  postlist.glass  termlist.glass

Since we happen to be in the same timezone, we can move this also to IRC. I'm rsto in channel #cyrus on irc://irc.freenode.net/cyrus

iNPUTmice commented 7 years ago

Newly created mailbox work fine after adding the conversations: on config parameter. Old mailboxes (that were created before adding the parameter) will still segfault httpd. Which I guess shouldn't happen :-)

rsto commented 7 years ago

Closing this one as no-fix. Let's see if this was a one-time hiccup due to a half-baked installation or will be a recurring thing.