-
Notifications
You must be signed in to change notification settings - Fork 7
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
OCR fails on file drop (shared upload folder) #273
Comments
Thanks for this comprehensive report. I remember that in #110 we changed the behaviour of the app so that determines the user for running the OCR process by checking the file path. So when sharing a file internally in NC for a certain user, AFAIK the system will mount the file under the user, which is the receiver of the share. In your case user B should see the file unter workflow_ocr/lib/Operation.php Line 114 in 1f98f2b
If that's the case I'm not sure if we can do anything here. Because like you said, userB doesn't have permissions to manipulate the existing file. Using permissions of userA to do the OCR processing in this case is also questionable because it would impersonate userB to userA for the process, which is also not clean. What do you think? |
@R0Wi Thanks for clarifying the current approach.
Access rights to file:
Generally, I like the idea that the workflow runs in the name of the acting user (nice for activity and version history of the file). But at the same time, you set up a workflow to ocr files and probably the goal is that this workflow completes its task. Additionally, the owner of the file will never receive any information that the workflow failed for uploaded files. Approach to overcome this issue:
Of course this could even be more complex to add another per workflow setting to control this behavior (checkbox whether to allow this fallback). But as written above, there are other possibilities to control in which cases the workflow shall run. |
Describe the bug
If ocr is done on file creation and someone uploads a file to a file drop folder (create permissions only), ocr fails with error because of missing rights for file modification.
System
ocrmypdf
version: 13.4.0+dfsgHow to reproduce
Steps to reproduce the behavior:
Expected behavior:
OCR should finish task without error.
Actual behavior:
OCR fails with error because of missing rights for editing the file (which is expected for a file drop folder).
Screenshots
Workflow trigger condition:
Server log
Please paste relevant content of your
nextcloud.log
file here. It might make sense to first decrease the Loglevel. Also, since the OCR process runs asynchronously, run your cron.php before copying the logs here.Browser log
If you're observing Browser errors, please paste your developer tools logs here.
Help for Chrome: https://developer.chrome.com/docs/devtools/console/#view
Help for Firefox: https://firefox-source-docs.mozilla.org/devtools-user/browser_console/index.html
Additional context
Especially for shared folders, there's no guarantee that the user has the permissions to modify files. Thus, the owner should be used as backup to modify the file.
The text was updated successfully, but these errors were encountered: