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

Silent failure with permission issues #769

Open
aaronrudkin opened this issue Aug 9, 2021 · 5 comments
Open

Silent failure with permission issues #769

aaronrudkin opened this issue Aug 9, 2021 · 5 comments

Comments

@aaronrudkin
Copy link

I recently ran into an error where I searched for subtitles for a file that was located in a folder that the Plex account did not have write access to. I would imagine, in this case, that one of two things would happen:

  1. Lacking write access, Sub-Zero would not search for subtitles for the file
  2. Sub-Zero would search for subtitles, but would indicate some kind of error in the Kitana history log

Instead, what happens is the following:

  1. Sub-Zero searches for subtitles, it does download them (using quota/credit on the site it's downloading from), but it then silently errors, writing nothing to the history log; the error can be seen by downloading the more detailed log, but not otherwise.

This seems like the worst of all worlds. I understand that Kitana might not currently be flexible enough to include error metadata in the history log, but given that there's going to be an error, the error should not consume quota on the sites it's searching. This suggests adding logic before the subtitle search to check for write permission to the folder where Sub-Zero thinks it will write the subtitles, and if it finds it has no permission, skip the search altogether for that file.

@pannal
Copy link
Owner

pannal commented Aug 9, 2021

This seems like the worst of all worlds.

Well. SZ checks for permissions on plugin start, but only for the library root folders.
Usually permission errors don't occur "inside" a library, but for the whole path. It's pretty rare that single folders have the wrong permissions when the libraries are properly managed, which is why there's no sanity check for every action taken.

I agree, though, that the error reporting and handling could be better. For the former my hands are a little tied due to the nature of the (discontinued) Plex plugin system and its age.

@aaronrudkin
Copy link
Author

Hmm, is it possible the permission check is wrong? The issue I had was precisely that: I have two root folders, and permissions were correct on one and incorrect on the other (set read-only, not read-write). The sanity check you describe seems right, it just didn't work that way for me haha.

@pannal
Copy link
Owner

pannal commented Aug 10, 2021

Which OS and filesystem are you using?

@aaronrudkin
Copy link
Author

Synology DSM 6.2x and BTRFS

@pannal
Copy link
Owner

pannal commented Aug 13, 2021

Interesting. This is the function that's used for the library root folders.

For non-Windows this is usually straight forward. Somehow it fails. Can you simulate that by adding a new library and posting DEBUG logs?

Edit: I could make the more explicit Windows check optional for non-windows systems.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants