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

Database is locked by another process #1518

Closed
mac230 opened this issue Dec 3, 2019 · 7 comments
Closed

Database is locked by another process #1518

mac230 opened this issue Dec 3, 2019 · 7 comments

Comments

@mac230
Copy link

mac230 commented Dec 3, 2019

Expected or desired behavior

I would like to use mu4e to view/manage/read email.

Actual behavior

Calling 'mu4e' always yields the following error message (even after system and emacs restart):

error in process sentinel: mu4e~proc-sentinel: Database is locked by another process
error in process sentinel: Database is locked by another process

Steps to reproduce

Call 'mu4e' in emacs.

Versions of mu, mu4e/emacs, operating system etc.

mu/mu4e 1.2
GNU Emacs 25.3.50.2 (x86_64-pc-linux-gnu, GTK+ Version 3.22.30)
ubuntu 18.04

Any other detail

I followed the instructions at:
https://groups.google.com/forum/#!topic/mu-discuss/EncdNPKhUYo
#8

The solution:

rm -rf ~/.mu/xapian && mu index

didn't change anything for me.

I can run the following from the command line:

mu index -m 
mu index --rebuild -m 

w/o an error message.

I can also run 'mu4e-update-mail-and-index' w/o an error message.

So, basically, I can't get to the mu4e headers. I've been using mu4e on a mac for several years and am using essentially the same config on this system.

There were a couple of discussion of possible .lock files. Could you elaborate on what to look for. On my system:

find /home/ -iname "*\.lock*"

shows the following:

/home/mahlon/.emacs.d/.emacs.desktop.lock
/home/mahlon/anaconda3/pkgs/jupyterlab-1.1.4-pyhf63ae98_0/site-packages/jupyterlab/staging/yarn.lock
/home/mahlon/anaconda3/lib/python3.7/site-packages/jupyterlab/staging/yarn.lock

I don't think any of these are related to mu/mu4e.

Any help much appreciated. Thanks.

@djcb
Copy link
Owner

djcb commented Dec 3, 2019

Hmm, something must have opened the database, that's why you're getting that error message. What does

lsof  2>/dev/null | grep xapian

give you when you run it before you start mu4e?

@mac230
Copy link
Author

mac230 commented Dec 3, 2019

No output of that command before or after starting mu4e.

Forgot to mention that I'm using mbsync and msmtp w/ mu/mu4e as well.

Tried removing all messages and re-building the mail dir w/ no results after reading the discussion here:
#198

My command to make the mail dir:

mu mkdir ~/mail

@djcb
Copy link
Owner

djcb commented Dec 4, 2019

Rebuilding etc. won't really help here, I think.

It's about another process having the xapian database open for writing which makes mu4e error out. For instance you cannot run mu4e while running mu index (or vice-versa).

So perhaps try immediately after you get that error:
lsof +D /home/mahlon/.mu

Perhaps you have some other script running mu index in the background?

@mac230
Copy link
Author

mac230 commented Dec 4, 2019

No output from

lsof +D /home/mahlon/.mu

I tried:

lsof +D ~/.cache/mu

which returned the following:

COMMAND  PID   USER   FD   TYPE DEVICE SIZE/OFF     NODE NAME
bash    7335 mahlon  cwd    DIR  253,1     4096 10094321 .
lsof    8226 mahlon  cwd    DIR  253,1     4096 10094321 .
lsof    8227 mahlon  cwd    DIR  253,1     4096 10094321 .

Also, no other scripts running mu index.

@mac230
Copy link
Author

mac230 commented Dec 8, 2019

I deleted everything I could find related to mu and mu4e and rebuilt/reinstalled. It seems to be working now. I couldn't track what was actually causing the issue, but am closing since I have the desired behavior now. Thanks.

@mac230 mac230 closed this as completed Dec 8, 2019
@djcb
Copy link
Owner

djcb commented Dec 8, 2019

Hmm good that it works, even if we don't know why!

If it ever happens again, perhaps check if the .lock exists before starting mu4e.

@johnhamelink
Copy link
Contributor

johnhamelink commented Feb 8, 2022

lsof +D ~/.cache/mu

which returned the following:

COMMAND  PID   USER   FD   TYPE DEVICE SIZE/OFF     NODE NAME
bash    7335 mahlon  cwd    DIR  253,1     4096 10094321 .
lsof    8226 mahlon  cwd    DIR  253,1     4096 10094321 .
lsof    8227 mahlon  cwd    DIR  253,1     4096 10094321 .

Once I knew the process ID, all I had to do was kill it, run mbsync, and then run M-x mu4e as normal, and all was well again - I thought I'd add a comment here for anyone who comes across this issue in future.

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

No branches or pull requests

3 participants