Open ES-Alexander opened 9 months ago
I have reached the same problem.
In one of my Cockpit syncs, somewhat happened and the bag-of-holdings json file got broke, which caused the service to die till I stopped it and deleted it's cache.
This seems like a critical problem to me. Any service relying in the bag of holdings can and will be affected if anything goes wrong, and there's no user-friendly way to fix it.
Your posted json seems to be cut off early, so perhaps failed partway through writing or something?
As discussed in the meeting, it would be nice if the service keeps a temporary "always valid" backup file of the current state during request processing, and checks whether each attempted change to the state fails to be read back after saving, in which case it can roll back to the backup and reject the request.
If it restarts while writing or something then when it attempts to start up again it can load the backup file if it fails to load the primary file.
This seems like a critical problem to me.
I definitely agree - several other services rely on the bag, so having simple ways to break it is problematic.
Current behaviour
It's possible to break the bag by putting in a poorly formed
set
API call, e.g. by having a trailing slash on the path (e.g..../bag/v1.0/set/path/
), which results in things like(and causes failed subsequent
get
requests), instead of the desired.../bag/v1.0/set/path
->Expected or desired behaviour
Prerequisites