Skip to content
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

Throw a more user-friendly error on permission denied when trying to to write a pack data file #4645

Merged
merged 6 commits into from
Apr 25, 2019

Conversation

Kami
Copy link
Member

@Kami Kami commented Apr 24, 2019

This pull request fixes a small issue I identified while testing latest st2flow packages.

Right now if pack permissions are not configured correctly and st2api doesn't have permission to write to the pack directory / sub-directory, Internal Server Error bubbles up all the way to st2flow.

This pull request fixes so we now throw a more user-friendly (non internal server error) error message.

Screenshot from 2019-04-24 12-30-25

From st2api.log:

...
IOError: [Errno 13] Permission denied: u'/opt/stackstorm/packs/fixtures/actions/aaa' (_exception_data={},_exception_class='IOError',_exception_message=u"[Errno 13] Permission denied: u'/opt/stackstorm/packs/fixtures/actions/aaa'")
...

@Kami Kami added this to the 3.0.0 milestone Apr 24, 2019
@Kami
Copy link
Member Author

Kami commented Apr 24, 2019

And the actual root cause for that error was fixed in this commit - 1342f74 (st2-self-check didn't set correct permissions).

I will cherry pick this into v3.0 branch once it's approved.

@@ -290,7 +290,7 @@ def apply_pack_owner_group(pack_path):

def apply_pack_permissions(pack_path):
"""
Recursively apply permission 770 to pack and its contents.
Recursively apply permission 775 to pack and its contents.
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This docstring was incorrect.

@Kami Kami merged commit 367e117 into master Apr 25, 2019
@Kami Kami deleted the permission_denied_error branch April 25, 2019 07:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant