-
-
Notifications
You must be signed in to change notification settings - Fork 739
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
API: Rework PR #5304 support for action file deletion. #5348
Comments
@mahesh-orch Can you address the issues here? Please prioritize item 2 first and submit PR where there's error when deleting the files (due to permission error) and rollback the operation so the action isn't in an inconsistent state (database entry deleted but files are still on the filesystem). As for item 1, I think needs to finalize what the solution is and can address in a separate PR. |
@nzlosh Going thru your feedback from the original PR, I think changing |
@m4dcoder I'd be OK with the |
So with --remove-files are we proposing:
Would mean this would fail on UI on k8s - but i presume the create through the workflow composer also currently fails on k8s? And like not using pack install via UI for k8s, is discouraged on k8s deployment.
|
Points 1 & 2 are what I had in mind. Point 3: There will need to be a way for the user to communicate the expected behaviour when they click the delete button via the WebUI. Perhaps a delete confirmation form with a check box Point 4: If a As for the failures in an environment that had read only access to the packs, I think getting an appropriate "access denied" message via the API would be the correct response in the case file deletion was requested. If only database deletion was requested, it should respond OK if the database operation succeeded. |
|
Reopen issue because it was closed automatically when we pushed the partial fix. |
The second part of the rework is located at #5360. |
@nzlosh Can this be closed now, after the second PR was merged? |
Yes, all the issues have been addressed according to the points mentioned here. |
SUMMARY
PR #5304 added the ability to delete file content from disk for the action API. By altering the underlying behaviour of the
action
endpoint, we are breaking the contract with existing St2 installations. People using this endpoint will be confused by the new behaviour and potentially loose unsaved work in worst case scenarios. Beyond API contracts, the code is currently broken in two ways which are detailed in Expected ResultsThe code does not handle file removal on all nodes in StackStorm's HA installations. This problem is related to the core code being unaware of nodes operating in the HA solution and as such should be considered out of scope for the resolution of this issue. Another issue addressing HA awareness should be opened for a future release.
STACKSTORM VERSION
st2 v3.6dev
OS, environment, install method
N/A
Steps to reproduce the problem
Expected Results
1. Impossible to remove just the database entry
The CLI only allows action delete with file removal.
The API does not offer the means to remove the action only from the database. The PR maintains the API signature of an
action_ref
andrequester_user
which makes deleting files on disk a hard requirement for API calls to delete an action.https://github.com/orchestral-st2/st2/blob/e76573c99d5a1d403a5818fa853f0d4a8999fad1/st2api/st2api/controllers/v1/actions.py#L209
Since this changes existing API behaviour to become more destructive, the new implementation should be an explicit opt-in by the user. As suggested in #5304 a global option in
st2.conf
could be a solution. An API argument to delete disk content allows from more granular control. Perhaps both should be implemented: st2.conf for global policy and an API parameter for use cases where it need to be overridden?2. Inconsistent state when file access error encountered
As describe here #5304 (comment) when a delete operation encounters an error on disk, an http 500 internal error is reported, the database entry is removed but the disk content is left. If errors are encountered during the deletion process, St2 must remain in a consistent state or there will be an administrative burden added to running StackStorm which will degrade user experience.
The text was updated successfully, but these errors were encountered: