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

SQLite database is busy -- warning or error? #6656

Open
bjornfor opened this issue Jun 12, 2022 · 6 comments · May be fixed by #10319
Open

SQLite database is busy -- warning or error? #6656

bjornfor opened this issue Jun 12, 2022 · 6 comments · May be fixed by #10319
Labels

Comments

@bjornfor
Copy link
Contributor

Describe the bug
In Nix 2.3 you might see a warning: SQLite database '/nix/var/nix/db/db.sqlite' is busy when the database is busy. But in Nix >=2.8 (and possibly earlier?) you get a more confusing message:

warning: error: SQLite database '/nix/var/nix/db/db.sqlite' is busy

I've been asked about this more than once at $dayjob: "Is this message a warning or an error?". I'm pretty sure it's just a warning, and if that's correct, we should probably remove the error: part from that message.

Steps To Reproduce

  1. Run many build actions at once.
  2. See warning. (Or error :-) )

Expected behavior

I expect messages to be either warning or error, not both.

@bjornfor bjornfor added the bug label Jun 12, 2022
@fxcl
Copy link

fxcl commented Oct 13, 2022

warning: ignoring untrusted substituter 'https://mirrors.tuna.tsinghua.edu.cn/nix-channels/store'
warning: ignoring untrusted substituter 'https://mirrors.tuna.tsinghua.edu.cn/nix-channels/store'
error (ignored): error: SQLite database '/Users/kelvin/.cache/nix/eval-cache-v2/7942c12f17b7d7df4f7337c8024bd0045b3dfafd7e1afe035da25545ecb3c6ee.sqlite' is busy

@pmiddend
Copy link

I have to agree. Currently, for me, it's:

error (ignored): error: SQLite database '/home/gitlab-runner/.cache/nix/eval-cache-v4/7890a1703b64585540ff4a0e1dd18e705c16565d1f2cadfe3d98a9760d807b77.sqlite' is busy

Which, again, duplicates "error", and "(ignored)" doesn't really help in my opinion.

@bjornfor
Copy link
Contributor Author

bjornfor commented Mar 8, 2023

Related: #7998

@Ericson2314
Copy link
Member

The specific rendering issue would be fixed by #7865

@9999years
Copy link
Contributor

IMO this shouldn't be a warning or an error, but a (verbose) notice: waiting for lock on build cache.

@roberth
Copy link
Member

roberth commented Oct 26, 2023

The frequency of this message has been greatly reduced since

However, the message prefix issue has not been solved. It seems that the error: part comes from e.what() call in

.msg = hintfmt(e.what())

We have more instances where we're logging an e.what() that may be subject to this issue. We could either provide an extra method that prints the message without prefix, or we could mutate it to a warning so that it can log itself correctly.

jfroche added a commit to jfroche/nix that referenced this issue Mar 25, 2024
Avoid the confusing error message "warning: error: ..." when SQLite is
busy.  Instead, just print "warning: ..." as the message.

Fixes NixOS#6656
@jfroche jfroche linked a pull request Mar 25, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants