You are here

KeePass Pro 2.56 update is buggy

12 posts / 0 new
Last post
MaximilianKohler
Offline
Last seen: 1 month 4 weeks ago
Joined: 2015-12-26 06:04
KeePass Pro 2.56 update is buggy

I updated from 2.55 and when I opened Keepass (from the Portableapps UI) I got this error:

HTTP Listener error message https://github.com/pfn/keepasshttp/blob/master/README.md#http-listener-error-message

I deleted the updated version, restored a backup, and ran the upgrade and it did it again.

I compared the new and old versions and the new version:

  1. DELETED a "location - username" folder in the \PortableApps\KeePassProPortable\App\KeePassPro directory which contains backups of the .kdbx files. This folder and files are created by the KeeAnywhere addon I think.

  2. It left the \PortableApps\KeePassProPortable\App\KeePassPro\KeeAnywhereOfflineCache folder intact, but DELETED the files inside.

  3. I use the extracted version of plugins so that there is no temporary folder & files created. Eg: in \PortableApps\KeePassProPortable\App\KeePassPro\Plugins I have a folder named "KeePassHttp" with two .dll files. This update created a new KeePassHttp.plgx file in \PortableApps\KeePassProPortable\App\KeePassPro\Plugins. And then subsequently created a new folder and files with the .dll files in \PortableApps\KeePassProPortable\Data\LocalPluginCache. These duplicates are what causes the error message.

#1 and #2 are huge. If not for this unrelated error leading me to compare the files & folders, this update would have caused permanent data loss.

John T. Haller
John T. Haller's picture
Offline
Last seen: 1 hour 13 min ago
AdminDeveloperModeratorTranslator
Joined: 2005-11-28 22:21
Saved in App Directory?

Is there some reason you saved something within the KeePassProPortable\App directory's sub-directories? In portable apps, those are wiped out on every upgrade and have been for about 15 years.

Sometimes, the impossible can become possible, if you're awesome!

MaximilianKohler
Offline
Last seen: 1 month 4 weeks ago
Joined: 2015-12-26 06:04
I did see the \PortableApps

I did see the \PortableApps\KeePassProPortable\App\ReadMe.txt which says:

This directory contains files used by the portable app. They should generally not be accessed directly by users.

User data or settings should not be stored within the App directory or its sub-directories. Any data stored here will likely be deleted on upgrades.

So I don't store custom files there, but it doesn't entirely make sense because the app and addons themselves create and store folders and files in there. And I've done many upgrades over the years without noticable issues (especially the ones mentioned in the OP). So I'm not sure what I'm supposed to do. Perhaps adding more info to that default ReadMe.txt would be good (IE: what folders we should be using instead).

I see a note of mine from 2020 that says:

There's a readme.txt saying not to store things in the App directory, but I tried the Data directory and it didn't work. It reads from the App directory. I tried putting everything inside and outside the Data\Settings folder.

John T. Haller
John T. Haller's picture
Offline
Last seen: 1 hour 13 min ago
AdminDeveloperModeratorTranslator
Joined: 2005-11-28 22:21
How Are You Launching?

It must be launched via KeePassProPortable.exe directly in Explorer, or via the PA.c Platform which will launch the same. If you want it in your Windows Start Menu or in the Windows Taskbar, you must use the PA.c Platform to create that shortcut otherwise it will run KeePass.exe directly.

Sometimes, the impossible can become possible, if you're awesome!

MaximilianKohler
Offline
Last seen: 1 month 4 weeks ago
Joined: 2015-12-26 06:04
I'm using the portableapps

I'm using the portableapps launcher. If it was my 2020 note that made you ask that, I'm not sure exactly what I was trying to put in the data directory. But by "everything" it was probably the .key and .kdbx and plugins.

As noted, I don't see any guidance on where to put that stuff. PortableApps seems to move stuff from/to the Data directory and its subfolders (https://portableapps.com/node/70143), so I don't know how safe that directory is either.

It seems like an important addition would be to include another ReadMe in the main app folder of most apps explaining folder behavior and what folders & files to use and avoid.

John T. Haller
John T. Haller's picture
Offline
Last seen: 1 hour 13 min ago
AdminDeveloperModeratorTranslator
Joined: 2005-11-28 22:21
Data, Always

Data has always been the appropriate place to store anything. It's what's backed up automatically when you ask the PA.c Platform to backup your app data. In some apps it is copied to/from a local APPDATA location or within the App directory while the app is running and copied backed after you close it. In apps where this is required, there is a directive within the app's installer.ini so that it will be preserve on the off chance the app crashes or is improperly shut down and is upgraded before being run again to be recovered. KeePass Pro Portable has directives in the installer.ini to ensure Plugins and PluginCache are preserved between upgrades. It even has extra logic for users who for some reason manually save a kdbx, xml, or key file in the KeePassPro directory.

Data is where a fresh install of KeePass Pro Portable will create its database by default when you click New. You'd have had to manually select putting it in App\KeePassPro for some reason and then manually create a subdirectory within that to place it in to even bypass the 'user made a mistake' backup directives within installer.ini.

Your post about an odd bug in Notepad++ is unrelated to this particular discussion and something I am unfamiliar with.

Sometimes, the impossible can become possible, if you're awesome!

MaximilianKohler
Offline
Last seen: 1 month 4 weeks ago
Joined: 2015-12-26 06:04
The relation to the notepad++

The relation to the notepad++ link is that it describes there how PortableApps dynamically moves files from/to the Data directory.

So if I'm storing things in the Data directory and I want to edit the file, it may or may not be there when I look for it...

Also, when I was experimenting with the Notepad++ folders & files I learned that directly editing or placing files into App\Notepad++64\plugins\config and/or directly running the notepad++.exe file from the App\Notepad++64 folder) can cause permanent data loss (such as the loss of custom dictionary data) due to incorrect/incomplete moving back and forth of the files & folders stored in the Data directory.

The ReadMe.txt warning about the App directory is good but is insufficient for us to know where to store files, what to avoid editing, and how to edit properly, particularly when files are being dynamically moved when you open the program.

Based on your comments, my understanding is that the Plugins folder, .key, .kdbx, and all other configs and custom files (including ones made by the plugins) should be stored in the Data folder. But when looking at the KeePassXCPortable install (which is mostly default and I don't use) I see the Plugins folder in the App directory.

>KeePass Pro Portable has directives in the installer.ini to ensure Plugins and PluginCache are preserved between upgrades.

So the bug I described in the OP is likely due to those directives?

John T. Haller
John T. Haller's picture
Offline
Last seen: 1 hour 13 min ago
AdminDeveloperModeratorTranslator
Joined: 2005-11-28 22:21
All Apps Are Different, Plugins Are Generally Not Data

All apps are different, so a bug in Notepad++ has nothing to do with our discussion on apps in general. Notepad++ is basically a disaster in its plugin handling due to non-standard behavior in all sorts of plugins. If you store user stuff in App, it'll likely get destroyed. Please refrain from further discussion here as it does not apply to our apps in general or KeePass Pro Portable.

The things I talked about moving are moved out of Data only while the app is in use unless something breaks (Windows crashes, drive unplugged, etc). Even in those cases, I often include directives in the installer.ini as a just in case so the launcher can recover from an improper shutdown on next run.

Plugins are an edge case and are often not considered user data. As such, they are often stored within App\AppName\Plugins or similar. In those cases, those directories are preserved on upgrade. This will vary app by app, however.

The plugins folder you refer to in KeePass XC Portable is a part of the app's directory structure as a Qt-based app. It has nothing to do with users. KeePass XC does not support plugins.

To alleviate some confusion with newer users, a standardized Readme.txt will be included within the App directory in all apps packaged with the PA.c Installer. This readme is also included with the updated PA.c Template:

This directory contains files used by the portable app and should generally not be accessed directly by users except in specific instances of using plugins or other documented additions to a given app.

User files, data, or settings should not be stored within the App directory or its subdirectories. Any data stored within the App directory structure will likely be deleted on upgrades.

Sometimes, the impossible can become possible, if you're awesome!

MaximilianKohler
Offline
Last seen: 1 month 4 weeks ago
Joined: 2015-12-26 06:04
Ok. So I left the Plugins

Ok. So I left the Plugins folder as is, and I moved one file and folder to the Data directory. There's nothing else custom in the App directory other than the KeeAnywhereOfflineCache folder which is automatically created by the addon and is not changeable.

I tried the upgrade again and it still did the same thing -- the KeeAnywhereOfflineCache folder was deleted and it somehow created a new created a new KeePassHttp.plgx file which causes an error.

An empty folder at C:\Users\User\AppData\Local\KeePass\PluginCache was also created. This folder didn't exist after previous times so I think it gets automatically deleted once KP Portable detects any .plgx file in the Plugins folder and creates a temporary directory in \KeePassProPortable\Data\LocalPluginCache. But this time I deleted the new KeePassHttp.plgx file before launching Keepass v2.56 to avoid the error, so I guess that's why the AppData folder didn't get deleted.

John T. Haller
John T. Haller's picture
Offline
Last seen: 1 hour 13 min ago
AdminDeveloperModeratorTranslator
Joined: 2005-11-28 22:21
Plugin Specific

Sounds like something is up with that specific plugin. No idea why it's creating its own random cache folder instead of properly using the PluginCache folder as it's suppose to. Since it mistakenly creates it within App\KeePass, it's gonna get wiped on every upgrade. This has always been the case with KeePass and KeePass Pro. Is this your first time using this specific plugin or did this plugin recently get an upgrade?

Sometimes, the impossible can become possible, if you're awesome!

MaximilianKohler
Offline
Last seen: 1 month 4 weeks ago
Joined: 2015-12-26 06:04
I've been using all the same

I've been using all the same stuff for quite a few years. This plugin has always created that folder there and I've made it through many Keepass updates without obvious issues.

The KeeAnywhereOfflineCache files/folder being deleted after the upgrade isn't a huge deal for me. The creation of the new KeePassHttp.plgx file is more bizarre.

John T. Haller
John T. Haller's picture
Offline
Last seen: 1 hour 13 min ago
AdminDeveloperModeratorTranslator
Joined: 2005-11-28 22:21
No Changes Here

KeePass Pro Portable has wiped the App directory and subdirectories with the exception of the plugins directory going back to the first release of KeePass Pro Portable 2.39 on 2020-11-23. I just checked. If there was a KeeAnywhereOfflineCache folder inside the App hierarchy that wasn't in plugins, it would be wiped on every upgrade.

There's nothing in any of our code or configurations to touch any .plgx files.

Sometimes, the impossible can become possible, if you're awesome!

Log in or register to post comments