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

Applications settings lost after moving from stable to git #4835

Closed
yan12125 opened this issue Jun 8, 2020 · 7 comments
Closed

Applications settings lost after moving from stable to git #4835

yan12125 opened this issue Jun 8, 2020 · 7 comments

Comments

@yan12125
Copy link
Contributor

yan12125 commented Jun 8, 2020

Overview

With recent git commits, the configuration file is moved from ~/.config/keepassxc/keepassxc.ini to ~/.config/KeePassXC/keepassxc.ini (changed cases), but there is no migration path. As a result, application settings are lost.

I didn't run git bisect, but I believe the cause is #4665. See #4835 (comment)

Steps to Reproduce

  1. Backup and remove all of ~/{.cache,.config}/{KeePassXC,keepassxc}/*.ini to make sure nothing can interfere
  2. Install KeePassXC 2.5.4
  3. Change some settings. For example, I enable "Show a system tray icon"
  4. Uninstall KeePassXC 2.5.4 and install git. Here I use 1ad0184.

Expected Behavior

Application settings remain. I can still get a system tray icon.

Actual Behavior

Application settings are lost. I don't see a system tray icon and the "Show a system tray icon" option is unchecked.

And from strace log, ~/.config/keepassxc/keepassxc.ini is not consulted:

660558 access("/home/yen/.cache/KeePassXC/keepassxc.ini", F_OK) = -1 ENOENT (No such file or directory)
660558 access("/home/yen/.config/KeePassXC/keepassxc.ini", F_OK) = -1 ENOENT (No such file or directory)
660558 statx(AT_FDCWD, "/home/yen/.config/KeePassXC/keepassxc.ini", AT_STATX_SYNC_AS_STAT, STATX_ALL, 0x7ffda8154650) = -1 ENOENT (No such file or directory)
660558 statx(AT_FDCWD, "/home/yen/.config/KeePassXC/keepassxc.ini", AT_STATX_SYNC_AS_STAT, STATX_ALL, 0x7ffda81545f0) = -1 ENOENT (No such file or directory)
660558 access("/home/yen/.cache/KeePassXC/keepassxc.ini", F_OK) = -1 ENOENT (No such file or directory)
660558 statx(AT_FDCWD, "/home/yen/.cache/KeePassXC/keepassxc.ini", AT_STATX_SYNC_AS_STAT, STATX_ALL, 0x7ffda8154650) = -1 ENOENT (No such file or directory)
660558 statx(AT_FDCWD, "/home/yen/.cache/KeePassXC/keepassxc.ini", AT_STATX_SYNC_AS_STAT, STATX_ALL, 0x7ffda81545f0) = -1 ENOENT (No such file or directory)
660558 access("/home/yen/.config/KeePassXC/keepassxc.ini", F_OK) = -1 ENOENT (No such file or directory)
660558 openat(AT_FDCWD, "/home/yen/.config/KeePassXC/keepassxc.ini.lock", O_RDWR|O_CREAT|O_EXCL|O_CLOEXEC, 0666) = 18
660558 access("/home/yen/.config/KeePassXC/keepassxc.ini", F_OK) = -1 ENOENT (No such file or directory)
660558 statx(AT_FDCWD, "/home/yen/.config/KeePassXC/keepassxc.ini", AT_STATX_SYNC_AS_STAT, STATX_ALL, 0x7ffda81545b0) = -1 ENOENT (No such file or directory)
660558 access("/home/yen/.config/KeePassXC/keepassxc.ini", F_OK) = -1 ENOENT (No such file or directory)
660558 statx(AT_FDCWD, "/home/yen/.config/KeePassXC/keepassxc.ini", AT_STATX_SYNC_AS_STAT, STATX_ALL, 0x7ffda8154510) = -1 ENOENT (No such file or directory)
660558 statx(AT_FDCWD, "/home/yen/.config/KeePassXC/keepassxc.ini", AT_STATX_SYNC_AS_STAT|AT_SYMLINK_NOFOLLOW, STATX_ALL, 0x7ffda8154500) = -1 ENOENT (No such file or directory)
660558 linkat(AT_FDCWD, "/proc/self/fd/19", AT_FDCWD, "/home/yen/.config/KeePassXC/keepassxc.ini", AT_SYMLINK_FOLLOW) = 0
660558 statx(AT_FDCWD, "/home/yen/.config/KeePassXC/keepassxc.ini", AT_STATX_SYNC_AS_STAT, STATX_ALL, {stx_mask=STATX_ALL, stx_attributes=0, stx_mode=S_IFREG|0644, stx_size=26, ...}) = 0
660558 statx(AT_FDCWD, "/home/yen/.config/KeePassXC/keepassxc.ini", AT_STATX_SYNC_AS_STAT, STATX_ALL, {stx_mask=STATX_ALL, stx_attributes=0, stx_mode=S_IFREG|0644, stx_size=26, ...}) = 0
660558 access("/home/yen/.config/KeePassXC/keepassxc.ini", R_OK) = 0
660558 access("/home/yen/.config/KeePassXC/keepassxc.ini", W_OK) = 0
660558 access("/home/yen/.config/KeePassXC/keepassxc.ini", X_OK) = -1 EACCES (Permission denied)
660558 chmod("/home/yen/.config/KeePassXC/keepassxc.ini", 0644) = 0
660558 unlink("/home/yen/.config/KeePassXC/keepassxc.ini.lock") = 0
660558 access("/home/yen/.cache/KeePassXC/keepassxc.ini", F_OK) = -1 ENOENT (No such file or directory)
660558 statx(AT_FDCWD, "/home/yen/.cache/KeePassXC/keepassxc.ini", AT_STATX_SYNC_AS_STAT, STATX_ALL, 0x7ffda8154680) = -1 ENOENT (No such file or directory)
660558 statx(AT_FDCWD, "/home/yen/.cache/KeePassXC/keepassxc.ini", AT_STATX_SYNC_AS_STAT, STATX_ALL, 0x7ffda8154620) = -1 ENOENT (No such file or directory)

Context

KeePassXC - Version 2.6.0-snapshot
Build Type: Snapshot
Revision: 1ad0184

Qt 5.15.0
Debugging mode is disabled.

Operating system: Arch Linux
CPU architecture: x86_64
Kernel: linux 5.6.15-arch1-1

Enabled extensions:

  • Auto-Type
  • Browser Integration
  • SSH Agent
  • KeeShare (signed and unsigned sharing)
  • YubiKey
  • Secret Service Integration

Cryptographic libraries:
libgcrypt 1.8.5

Operating System: Arch Linux
Desktop Env: LXQt
Windowing System: X11
Package sources: the stable version from official Arch package and the git version from AUR
Filesystem: ext4, case-sensitive

@yan12125 yan12125 added the bug label Jun 8, 2020
@phoerious
Copy link
Member

I wonder why Qt is capitalising the folder name all of a sudden. This is pretty inconsistent on their side.

@yan12125
Copy link
Contributor Author

yan12125 commented Jun 8, 2020

I think I found the actual cause. Here are some commits in keepassxc related to case changes (older to newer)

  1. 6339d61 That commit changes the application name from keepassxc to KeePassXC.
  2. 596d2cf Before that commit, the configuration path uses hard-coded folder name /keepassxc/ [1]. After that commit, QStandardPaths::AppConfigLocation is used, and the latter uses the application name as the folder name.
  3. 2073f2d Before that commit, the first call to Config::instance() happens in the constructor of Application in src/gui/Application.cpp [2], which is before setApplicationName in src/main.cpp. At that time, the application name is not set and thus Qt uses the binary name [3], which is keepassxc on Linux.

Overall, the intended config path is now ~/.config/KeePassXC/keepassxc.ini.

[1] 596d2cf#diff-461928dbf0b7b4c50bab629bfe990c75L155
[2] 2073f2d#diff-3b26d22744b00bff24a5e19c5acc3542L71
[3] https://doc.qt.io/qt-5/qcoreapplication.html#applicationName-prop

@droidmonkey
Copy link
Member

droidmonkey commented Jun 8, 2020

This should be fixed prior to release.

@droidmonkey droidmonkey added this to the v2.6.0 milestone Jun 8, 2020
@phoerious
Copy link
Member

Shall we stick with lowercase keepassxc? I think KeePassXC makes sense, but Linux configs tend to be all-lowercase.

@droidmonkey
Copy link
Member

droidmonkey commented Jun 8, 2020

IMO revert that change and stick with lowercase... or do an explicit move of the old settings to the new directory, then process the migration.

droidmonkey added a commit that referenced this issue Jun 11, 2020
* Use the native application name for the config folder versus the camel-case name defined later
* Fixes #4835
droidmonkey added a commit that referenced this issue Jun 11, 2020
* Use the native application name for the config folder versus the camel-case name defined later
* Fixes #4835
droidmonkey added a commit that referenced this issue Jun 11, 2020
* Use the native application name for the config folder versus the camel-case name defined later
* Fixes #4835
@yan12125
Copy link
Contributor Author

Thanks a lot for fixing this! Somehow GitHub insists the fixing commit should be merged to the develop branch before auto closing this issue. As it's already fixed, I will just close it manually.

@droidmonkey
Copy link
Member

Yah it's a silly github bug, issues should close with the linked pr

lerignoux pushed a commit to lerignoux/keepassxc that referenced this issue Jul 20, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants