-
Notifications
You must be signed in to change notification settings - Fork 2
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 locked #45
Comments
I am dumb, the issue is because of the parsing of the password as mentioned in the readme and tmux automatically opens all session in the same folder as when the session was originally opened, aka a folder with a trusted .envrc |
Hey thanks for reporting this. I think this is still a valid issue. Or at least, a feature request. The app should probably handle the situation where there are concurrent attempts to read from the vault. Sqlite does have functionality for handling this but I'm not employing it evidently. I'll look into this. |
Is this only happening when you're resurrecting a tmux session and your rudric session token is expired? Rudric will delete expired keys from the database when this happens and I think Sqlite will lock the DB in this event. Can you paste the full error you're getting here? |
Sorry, I already uninstalled it because it was getting annoying and I could not work (literally could not use the terminal), tomorrow I will reinstall and try to reproduce and give more details into the issue, but it was more or less as follows:
Also about the sqlite, it has a WAL journal mode which AFAIK helps avoid this kind of db locked stuff, this example is from the use sqlx::ConnectOptions;
use sqlx::sqlite::{SqliteConnectOptions, SqliteJournalMode};
use std::str::FromStr;
let conn = SqliteConnectOptions::from_str("sqlite://data.db")?
.journal_mode(SqliteJournalMode::Wal)
.read_only(true)
.connect().await?; |
Cool thanks for the pointers. Something isn't playing nice between rudric and direnv and if you get prompted for a password, your keystrokes aren't getting passed into rudric so the process hangs. Though you should be able to abort it with ctrl-C. I'm on Fish so I'm able to set a universal variable for all terminal sessions once per day with this: set -Ux RUDRIC_SESSION (rudric session) From that point onward, I don't have to keep entering my password to interact with the vault until the key expires. I'm not sure if Zsh has a similar universal variable functionality. |
Hmmm... weird. I'm only getting a hanging terminal with You're also experiencing much different behavior than I am. For one, your password chars should be hidden. I'm not sure why they're showing for you. And two, the fact that you can enter chars at all but it only hangs when you hit enter is different. I wonder if rudric itself is getting stuck trying to unlock your vault. After you hit enter, when the terminal is frozen, can you open another pane and see if the Finally, what kind of system are you running on? |
Hope this helps a little bit more in trying to diagnose the issue, and thanks for the help |
Hi, when trying to open more than one terminal, I get an error saying my database is locked. I am also using it with direnv and tmux to open multiple panels, I am not sure what extra info I can provide to help debug/recreate the issue
direnv config
[global]
load_dotenv = true
rudric config
default_shell = "zsh"
session_lifetime = "6h"
The text was updated successfully, but these errors were encountered: