Top Menu

Jump to content
Home
    Modules
      • Projects
      • Activity
      • Work packages
      • Gantt charts
      • Calendars
      • Team planners
      • Boards
      • News
    • Getting started
    • Introduction video
      Welcome to OpenProject Community
      Get a quick overview of project management and team collaboration with OpenProject. You can restart this video from the help menu.

    • Help and support
    • Upgrade to Enterprise edition
    • User guides
    • Videos
    • Shortcuts
    • Community forum
    • Enterprise support

    • Additional resources
    • Data privacy and security policy
    • Digital accessibility (DE)
    • OpenProject website
    • Security alerts / Newsletter
    • OpenProject blog
    • Release notes
    • Report a bug
    • Development roadmap
    • Add and edit translations
    • API documentation
  • Sign in
      Forgot your password?

      or sign in with your existing account

      Google

Side Menu

  • Overview
  • Activity
    Activity
  • Roadmap
  • Work packages
    Work packages
  • Gantt charts
    Gantt charts
  • Calendars
    Calendars
  • Team planners
    Team planners
  • Boards
    Boards
  • News
  • Forums

Content

Support Installation & Updates
  1. OpenProject
  2. Forums
  3. Support Installation & Updates
  4. Docker install: can't upload files

Docker install: can't upload files

Added by Rob BreakEats over 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)

RE: Docker install: can't upload files - Added by Rob BreakEats over 6 years ago

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.

RE: Docker install: can't upload files - Added by xin meng about 5 years ago

same issue. seem like create folder with user id = 1000, on Centos, 1000 is centos user

RE: Docker install: can't upload files - Added by Markus Kahl about 5 years ago

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:

docker exec -it $CONTAINER_NAME chown -R app:app /var/openproject/assets

RE: Docker install: can't upload files - Added by xin meng about 5 years ago

Thanks very much!

Markus Kahl wrote:

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:

docker exec -it $CONTAINER_NAME chown -R app:app /var/openproject/assets
  • (1 - 4/4)
Loading...