-
-
Notifications
You must be signed in to change notification settings - Fork 274
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
[Bug]: Dependencies cannot be installed in Bottles due to outdated hashes! #3558
Comments
Okay, I am now sure that the bug is that Bottles doesn't download new dependency hashes until you do the following routine:
I know this because the following process works. I just verified it:
This means that the real bug is that the hashes for the dependencies are not correctly updated in Bottles during the application lifetime. It must attempt to do an install (which probably fetches the new hashes), and then Bottles must be restarted to load the latest dependency download verification hashes. Furthermore, you must try to install a dependency that frequently updates the binary on the server, so that the old hashes mismatch. VCRedist is a good candidate. The reason I associated this bug with "newly created bottles" is that I only try to install dependencies after creating new bottles. ;) So the fix is: After downloading the latest dependency hashes, LOAD THEM. ;) |
Prior hash mismatch issues for Your hashes for the downloaded files on failed attempts seem to match the prior ones. Bottles essentially clones https://github.com/bottlesdevs/dependencies on startup and uses that as its source of truth. You can override this by setting the In this case, it seems like Bottles' temp dependency installer cache is populated with an old binary. When Bottles tries to install
So this seems to be a cache invalidation bug. |
Relevant lines: Bottles/bottles/backend/managers/installer.py Lines 176 to 184 in e93cd18
Bottles/bottles/backend/managers/component.py Lines 154 to 164 in e93cd18
Bottles/bottles/backend/globals.py Lines 27 to 40 in e93cd18
This seems to be the state on disk:
Fix probably requires changing the cache to be a content-addressable store instead where files have their hash (which should be switched from md5 to sha256 or something else to reduce the probability of collisions) somewhere in the path (either a parent directory name or in the file name). Unsure if the maintainers are interested in reworking this given the current focus on Bottles Next. |
@commiterate Ah thank you for your work investigating and fixing the hash URL issue. I found something else that's super weird in this behavior. Look at my "Troubleshooting Logs". I didn't notice it until now:
Anyway, I disagree that hashes would need to be part of the paths (content-addressable storage). Because Bottles lacks any way to install older versions of dependencies anyway. All we really need to do to solve the bug is to change this:
To this:
|
Switching to a CAS is more to remove the current mechanism of dependency manifests needing to rename files to prevent collisions inside With the way For example, both If the manifest maintainer forgets to add a Invalidating the file in There's a slight problem with switching to a CAS since it changes checksums from optional to required in |
That's true, Bottles could just give each dependency recipe its own subdirectory, like |
Describe the bug
Dependencies can never be installed in newly created Bottles without restarting Bottles first.
Update: See first comment below this. I found more details to track down the bug and have clarified.
To Reproduce
Package
Flatpak from Flathub
Distribution
Fedora Workstation 40
Debugging Information
Troubleshooting Logs
Log when it failed:
Log when you retry during the same failed session:
Log after Bottles restart, when it always succeeds:
Additional context
This is 100% reproducible in all new bottles. Leading me to believe that Bottles is hashing the wrong file or path when you have newly created a bottle.
Edit: Googling the downloaded hashes actually seems to bring up references to VCredist, so it seems more like Bottles is using the wrong hashes when verifying the downloads. But it's weird that it's only a problem for newly created bottles, and that it works after a Bottles restart.
The text was updated successfully, but these errors were encountered: