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

Possible regression on file upload #569

Open
dolsysmith opened this issue Oct 21, 2024 · 2 comments
Open

Possible regression on file upload #569

dolsysmith opened this issue Oct 21, 2024 · 2 comments
Assignees
Labels

Comments

@dolsysmith
Copy link
Contributor

dolsysmith commented Oct 21, 2024

I think I caught a regression on the latest GWSS release that breaks PDF uploads. Sheila was getting an error attempting to upload PDF's in the UI, at the point where you add them to the File tab in creating a new work.

  • I was able to replicate on test and prod , with various PDF's.
  • The error is about permissions to the tmp/cache/hyrax/uploaded_files/file folder: Errno::EACCES (Permission denied @ dir_s_mkdir - /opt/scholarspace/scholarspace-hyrax/tmp/cache/hyrax/uploaded_file/file/1729536544-189-0019-6326)
  • On test, I noticed that the .env file had the TEMP_FILE_BASE set to the scholarspace-hyrax/tmp directory, not scholarspace/scholarspace-tmp, so I changed that, restarted the containers, and saw that the problem was resolved.
  • However, on prod, the .env file has that variable set to scholarspace/scholarspace-tmp. But I noticed that the folders in tmp/cache/hyrax path were all set to root ownership.
  • I restarted the containers on prod (without making any configuration changes), and uploading files seems to work as expected.

So what's going on? My guess is that some other process is resetting the tmp directories to root access, whereas the upload action needs them to be owned by the scholarspace user. Could it be that Bulkrax or the ETD loader is doing this?

@dolsysmith dolsysmith added the bug label Oct 21, 2024
@kerchner
Copy link
Member

@dolsysmith I don't see any code in the ingest_bulkrax_prep task that would be affecting /opt/scholarspace/scholarspace-hyrax/tmp/cache/hyrax but it is worth observing this folder's ownership before and after running the task.

@dolsysmith
Copy link
Contributor Author

I did some testing on my dev instance, and when run inside the container, gwss:ingest_pq_etds does create temp folders with the appropriate (scholarspace user) permissions. But I also noticed that in Dan's write-up on the PR, it states, "Run the ingest_bulkrax_prep rake task inside the container (or from the outside using docker exec." If you run the rake task using docker exec and do not provide the --user scholarspace option, the task will be run as root, thus altering the permissions on the temp folder.

@kerchner Do you recall whether you ran this task using Docker exec on test/prod, and if so, whether you might have omitted the --user option? If so, I think that might have caused the issue with the uploads.

If not, I can continue poking.

@kerchner kerchner self-assigned this Dec 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants