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

KeepassXC persist not working #614

Closed
dsbert opened this issue Oct 26, 2017 · 8 comments
Closed

KeepassXC persist not working #614

dsbert opened this issue Oct 26, 2017 · 8 comments

Comments

@dsbert
Copy link
Contributor

dsbert commented Oct 26, 2017

KeepassXC has keepassxc.ini set as a persisted file. However, when upgrading, the file is replaced with the new version and all settings are back to default.

@r15ch13
Copy link
Member

r15ch13 commented Oct 26, 2017

From which version did you upgrade?
I upgraded just now from version 2.2.1 to 2.2.2 and it worked like it should.

@dsbert
Copy link
Contributor Author

dsbert commented Oct 26, 2017

I upgraded the same version. The same thing happened the last time I upgraded, although I'm not sure when the persist was added in relation to the last release.

While attempting to recreate this issue, I've run into some new problems that may or may not be related.

I just tried uninstalling keepassxc and deleting the persist\keepassxc directory. After installing keepassxc again, I now see a directory under persist called keepass.ini with nothing in it, instead of the actual keepassxc.ini file. I also see a linked directory in the current\keepassxc directory with the same name. It looks like keepassxc does not create the configuration file until after the first run. When I launch the program I see error accessing config file. After deleting current\keepass.ini\ and launching the program again, the keepass.ini file is created.

So it looks like if the persisted file is not found at install time, scoop is actually creating a directory with the same name. keepassxc treats this directory as the configuration file and then errors when it tries to open it for reading.

I'm using the latest version of scoop.

@r15ch13
Copy link
Member

r15ch13 commented Oct 26, 2017

Version 2.2.2 doesn't come with a keepassxc.ini, which caused the creation of an empty keepassxc.ini directory on reinstallation.

This update should fix this problem: ScoopInstaller/Scoop@c15d8e2
Scoop now tries to detect if it's a file or a directory before just creating a new empty directory.

@dsbert
Copy link
Contributor Author

dsbert commented Oct 27, 2017

I tried uninstall and installing again - this time I received the following message. This was with nothing in the persist directory.

Persisting keepassxc.ini
The system cannot find the file specified.

The second test I attempted was to uninstall, manually edit the current version to a lower number then install again. I received the same message as above. I then manually copied over keepassxc.ini to the current folder, updated the current version and ran scoop update keepassxc. This resulted in the same error again. The persist/keepassxc directory is still empty and the keepassxc/current directory does not contain keepassxc.ini although I can still see it in the previous version folder.

So it looks like your update prevented a bad file from being created. However, it did not correct the issue where files not created until first launch are not being persisted.

It looks like scoop runs the persist operation at install time but does not check again at update or uninstall time when the file is actually needed.

@r15ch13
Copy link
Member

r15ch13 commented Oct 27, 2017

Do you mean you lowered the version by changing the directory name? If so, this will break the symlink to the current directory and scoop is unable to find the file.

There is no real way to downgrade a version.
But for you could try to replicate the update behavior like so:

  • scoop uninstall keepassxc
  • delete keepassxc.ini from perist directory
  • scoop install keepassxc@2.2.1
  • change the content of the ini file
  • scoop install keepassxc@2.2.2
  • validate the content of the ini file

This keepassxc installation can not be updated with scoop update keepassxc, so you have to reinstall it normally again.

The logic for persistence can be found in the persist_data() function.

@dsbert
Copy link
Contributor Author

dsbert commented Oct 27, 2017

No,

I lowered the version by editing the keepassxc.json file in scoop/buckets/extras and doing a scoop install. Then I reverted the manifest back to the current version and did a scoop update keepassxc.

@r15ch13
Copy link
Member

r15ch13 commented Oct 27, 2017

The ini file is missing in the 2.2.2 release: keepassxreboot/keepassxc#1134

@r15ch13
Copy link
Member

r15ch13 commented Oct 29, 2017

It should now work as intended.

cilq pushed a commit to cilq/scoop-extras that referenced this issue Oct 30, 2017
@r15ch13 r15ch13 closed this as completed Dec 30, 2017
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

2 participants