Portainer 2.21.5 keeps lock on db even when not being used. #12450
Description
Before you start please confirm the following.
- Yes, I've searched similar issues on GitHub.
- Yes, I've checked whether this issue is covered in the Portainer documentation or knowledge base.
Problem Description
Until version 2.21.5, portainer did not keep a persistent lock on portainer db and useractivity db. That allowed me to schedule autoamted cloud backup (using duplicati but it would be issue for any other software too) which took backup of full data folder of portainer. However, starting version 2.21.5, it keeps the db connection open which prevents any backup (since file is open). Portainer comes with it's own backup but that doesn't allow scheduling and storing to a local folder. Currently portainer backup allows trigger a backup from browser and it downloads it on client machine. External software allows scheduled trigger and backsup files to cloud directly without requiring manual download and upload to cloud.
Expected Behavior
As pervious version, the connection should not be kept open to db file. that will allow for external backup software to backup the portainer data folder.
Actual Behavior
connection is kept open which makes the backup fail.
Steps to Reproduce
- install portainer version 2.21.5
- try to take backup of data folder. No UI open or no active operations.
- backup fails since portainer.db and useractivity.db is locked.
Portainer logs or screenshots
Following errors are seen in backup software (not portainer)
[Warning-Duplicati.Library.Main.Operation.Backup.FileBlockProcessor.FileEntry-PathProcessingFailed]: Failed to process path: /data/portrainer/portainer.db
IOException: The process cannot access the file '/data/portrainer/portainer.db' because it is being used by another process.
and
[Warning-Duplicati.Library.Main.Operation.Backup.FileBlockProcessor.FileEntry-PathProcessingFailed]: Failed to process path: /data/portrainer/useractivity.db
IOException: The process cannot access the file '/data/portrainer/useractivity.db' because it is being used by another process.
Portainer version
2.21.5
Portainer Edition
Business Edition (BE/EE) with 5NF / 3NF license
Platform and Version
Docker 27.4.1
OS and Architecture
Ubuntu 22.04 AMD64
Browser
No response
What command did you use to deploy Portainer?
No response
Additional Information
No response