Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cleaned up logging and replaced sprintf with snprintf #9

Closed
wants to merge 2 commits into from

Conversation

lluuaapp
Copy link
Contributor

No description provided.

@lluuaapp
Copy link
Contributor Author

lluuaapp commented Jan 21, 2019

I tried to fix the error

Jan 21 13:15:53 mail dovecot: indexer-worker(paul@iwascoding.de)<5012><cHQiF/m3RVyUEwAADYqDFA>: Error: FTS Xapian: Can not open RO index (private/important) /var/spool/mail/iwascoding/paul/mdbox/xapian-indexes/db_92e09535c5888a5658100000654d370e
Jan 21 13:15:53 mail dovecot: indexer-worker(paul@iwascoding.de)<5012><cHQiF/m3RVyUEwAADYqDFA>: Error: XapianError: Couldn't detect type of database
Jan 21 13:15:53 mail dovecot: indexer-worker(paul@iwascoding.de)<5012><cHQiF/m3RVyUEwAADYqDFA>: Error: FTS Xapian: get_last_uid: can not open DB /var/spool/mail/iwascoding/paul/mdbox/xapian-indexes/db_92e09535c5888a5658100000654d370e
Jan 21 13:15:53 mail dovecot: indexer-worker(paul@iwascoding.de)<5012><cHQiF/m3RVyUEwAADYqDFA>: Error: Mailbox private/important: Status lookup failed: Internal error occurred. Refer to server log for more information. [2019-01-21 13:15:53]

But could not fix it. Seems Xapian does not create the iamglass file in all cases and opening the DB read-only fails in fts_backend_xapian_check_read().

But I am not so sure that it is a real error, when a not existent DB could not be opened for read-only. Maybe the whole logging can be removed. Or should I create an issue for that?

@grosjo
Copy link
Owner

grosjo commented Jan 21, 2019

I tried to fix the error

Jan 21 13:15:53 mail dovecot: indexer-worker(paul@iwascoding.de)<5012><cHQiF/m3RVyUEwAADYqDFA>: Error: FTS Xapian: Can not open RO index (private/important) /var/spool/mail/iwascoding/paul/mdbox/xapian-indexes/db_92e09535c5888a5658100000654d370e
Jan 21 13:15:53 mail dovecot: indexer-worker(paul@iwascoding.de)<5012><cHQiF/m3RVyUEwAADYqDFA>: Error: XapianError: Couldn't detect type of database
Jan 21 13:15:53 mail dovecot: indexer-worker(paul@iwascoding.de)<5012><cHQiF/m3RVyUEwAADYqDFA>: Error: FTS Xapian: get_last_uid: can not open DB /var/spool/mail/iwascoding/paul/mdbox/xapian-indexes/db_92e09535c5888a5658100000654d370e
Jan 21 13:15:53 mail dovecot: indexer-worker(paul@iwascoding.de)<5012><cHQiF/m3RVyUEwAADYqDFA>: Error: Mailbox private/important: Status lookup failed: Internal error occurred. Refer to server log for more information. [2019-01-21 13:15:53]

But could not fix it. Seems Xapian does not create the iamglass file in all cases and opening the DB read-only fails in fts_backend_xapian_check_read().

But I am not so sure that it is a real error, when a not existent DB could not be opened for read-only. Maybe the whole logging can be removed. Or should I create an issue for that?

Can you try to remov completely the folder /var/spool/mail/iwascoding/paul/mdbox/xapian-indexes/db_92e09535c5888a5658100000654d370e and see if error comes back ?

@lluuaapp
Copy link
Contributor Author

lluuaapp commented Jan 21, 2019

I always remove all xapian-indexes folders before installing/testing a new plugin. As of the logs it is clear that

Xapian::WritableDatabase db(backend->db,Xapian::DB_CREATE_OR_OPEN);
db.close();

does not create the iamglass file. Most of the time the file is created properly, so maybe its just a timing issue. But should this be treated as an error?

@grosjo
Copy link
Owner

grosjo commented Jan 21, 2019 via email

@lluuaapp
Copy link
Contributor Author

Currently 1.4.3 again. But anyhow, it indexes the folder successfully in the same process, so maybe it can ignored.

@lluuaapp
Copy link
Contributor Author

Still the same error with 1.4.9 (backports for stretch).

@grosjo
Copy link
Owner

grosjo commented Jan 21, 2019

What is the need for snprintf ?

@lluuaapp
Copy link
Contributor Author

Its more secure and we have found the bug with the malloc-length much ealier.

@grosjo
Copy link
Owner

grosjo commented Jan 21, 2019 via email

@lluuaapp
Copy link
Contributor Author

lluuaapp commented Jan 21, 2019

No, the error still appears. But as I said, its only sometimes, most of the time the first index run and the creation of the database works just fine.

Can't we just ignore the error? As it is only the case when we want to search in a not existing DB. And when the indexer starts running the error is gone.

Additionally: currently it seems that only folders with no messages are affected by this error.

@grosjo
Copy link
Owner

grosjo commented Jan 21, 2019 via email

@grosjo grosjo closed this Jan 21, 2019
grosjo added a commit that referenced this pull request Apr 3, 2019
grosjo added a commit that referenced this pull request Apr 3, 2019
grosjo added a commit that referenced this pull request Apr 3, 2019
@smtalk smtalk mentioned this pull request Dec 16, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants