okfn / docker-ckan

Docker images and Docker Compose setup for CKAN [Not Maintained]
GNU Affero General Public License v3.0
81 stars 91 forks source link

fixed storagepath permissions #42

Closed hvwaldow closed 4 years ago

hvwaldow commented 5 years ago

Issue: In production, create an organization and upload an image. There will be a server-error:

File '/usr/lib/python2.7/os.py', line 157 in makedirs  
ckan          |   mkdir(name, mode)                        
ckan          | OSError: [Errno 13] Permission denied: '/var/lib/ckan/storage/uploads' 

This is because prerun.py, in which init_db() creates /var/lib/ckan/storage, runs as root. UWSGI in production however runs as ckan. That is also the reason this problem doesn't show in development.

This fix sets the permissions right.

starsinmypockets commented 5 years ago

🙏

adborden commented 4 years ago

Hey folks, anything holding up this PR? This resolves https://github.com/okfn/docker-ckan/issues/45 for me.

JGulic commented 4 years ago

@amercader can you have a look at this?

amercader commented 4 years ago

@JGulic @avdata99 @hvwaldow Apologies for the late reply on this I don't like running a chown command here, the permissions should be set at build time here. If the problem is that prerun.py is run by root let's fix that instead. Can you try if #46 fixes the issue for you? I gave it a try and worked for me.

amercader commented 4 years ago

Closed in favour of #46