Content
Docker install: can't upload files
Added by Rob BreakEats almost 6 years ago
I am having a problem with my docker installation for 8.2.0. I cannot upload files, either to my avatar or to my work packages. I receive the following errors:
When trying to upload a new avatar: "Error saving the image." When uploading attachments to a work package: "An internal error has occurred. Http failure response for https://<website>/api/v3/work_packages/17/attachments: 500 OK"
Looking at the "information" tab as the admin I see that the "Attachments directory writable" is a bug/alien so clearly there is an issue. The openproject/static/files directory is owned by a user not in my host machine's /etc/passwd. When I go into the docker container I see that the owner is the user and the group 'app'. The permissions are 750. When I change the permissions of the files directory to 777 it does not fix the problems.
I verified that the container environment variable ATTACHMENTS_STORAGE_PATH points to the correct directory of /var/db/openproject/files.
Here is the error message I see in the openproject/logs/web-stdout.log (I removed my IP address):
App 441 output: Started PUT "/my/avatar" for [MyIPAddr] at 2019-01-29 04:18:31 +0000
App 441 output: Processing by Avatars::MyAvatarController#update as JSON
App 441 output: Parameters: {"metadata"=>"{\"fileName\":\"HouseFace.jpg\"}", "file"=>#<ActionDispatch::Http::UploadedFile:0x00007f6a3eaf3bb0 @tempfile=#<Tempfile:/tmp/RackMultipart20190129-441-6ndlsd.jpg>, @original_filename="HouseFace.jpg", @content_type="image/jpeg", @headers="Content-Disposition: form-data; name=\"file\"; filename=\"HouseFace.jpg\"\r\nContent-Type: image/jpeg\r\n">}
App 441 output: Failed to update avatar of Niels Lindenthal: Permission denied @ dir_s_mkdir - /var/db/openproject/files
Any help greatly appreciated!
-Rob
Replies (4)
Well I appear to have fixed the issue. The problem appears to be with the parent directory: /var/db/openproject which was not accessible by the container user 'app'. I changed the owner of the directory to 'app' and things are fine now.
same issue. seem like create folder with user id = 1000, on Centos, 1000 is centos user
This was a bug with the seeding inside of the docker image which created the
/var/openproject/assets/files
folder as root. It has been fixed. Pull the latest image to prevent the issue for new containers. Existing containers will just have to fix the permissions as pointed out by Rob. Just run:Thanks very much!
Markus Kahl wrote: