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

Can't save database as it is not "Initialized" #5515

Closed
maztan opened this issue Oct 6, 2020 · 3 comments
Closed

Can't save database as it is not "Initialized" #5515

maztan opened this issue Oct 6, 2020 · 3 comments
Labels

Comments

@maztan
Copy link

maztan commented Oct 6, 2020

I can't save the database and I am getting the error originating from this code:

// Never save an uninitialized database
    if (!isInitialized()) {
        if (error) {
            *error = tr("Could not save, database has not been initialized!");
        }
        return false;
    }

How do I initialize the database?

@maztan maztan added the bug label Oct 6, 2020
@maztan
Copy link
Author

maztan commented Oct 6, 2020

Ok, I added a key file to the database, now it works.
Based on this code:

bool Database::isInitialized() const
{
    return m_data.key && !m_data.key->isEmpty() && m_rootGroup;
}

I propose adding more informative error message ;)

@maztan maztan closed this as completed Oct 6, 2020
@droidmonkey
Copy link
Member

droidmonkey commented Oct 6, 2020

Thats not what that code means. That checks that a database key exists at all, meaning it can be amy combination of password, key file, and hardware key. The database key is what is used for encryption and decryption.

@Schroedingers-Cat
Copy link

This message is also shown when a user opens a kepass file created with keepassdx (Android) without any encryption. In such a case, the error message is not meaningful. It should show something like "Not saving unencrypted database file". Best to show that warning upfront when opening such a file.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants