[ckan-dev] Problem creating resources after deploy

Stefan Oderbolz stefan.oderbolz at liip.ch
Mon Nov 21 10:49:36 UTC 2016


This is the very unfortunate behavior, that the CKAN instance is running
with the permissions of the Apache user (www-data in your case) when you
are using the web interface, but with your use "espona" when you are
running e.g. paster commands on the command line.
There are several ways to fix this.

I started to setup a separate user account for CKAN called "ckan", that I
use on the command line, so you I need to switch to this use to run paster
commands etc., once you get used to it, it's actually quite nice (e.g. you
have a separate bash history to look up your commands etc.). And I
configure Apache to run with the "ckan" user as well (you can do this using
the "User" and "Group" directives"). With this setup, I never had any
problems anymore with permissions.

But we have other setups where this is not possible for several reasons, so
we actually setup cronjobs to to "fix" the permissions several times a day.
Don't tell anyone. I'm just posting this here so no one else feels bad for
setting up similar hacks themselves ;)

- Stefan

On Mon, Nov 21, 2016 at 11:32 AM, <lucia.espona at wsl.ch> wrote:

> Dear all
>
> I just deployed my current CKAN instance following the instructions in
> http://docs.ckan.org/en/latest/maintaining/installing/deployment.html.
> Everything seems ok, except that I cannot create resources:
>
> [Mon Nov 21 11:15:28.580885 2016] OSError: [Errno 13] Permission denied:
> '/data/ckan/default/resources/fba/2f6'
>
> The parent folder has owner 'espona' (my user), should I change the
> ownership to 'www-data'?
> I found a similar wokaround here for an older version:
> https://github.com/datagovua/ckan-vagrant-chef/issues/6
>
> chown -R www-data /data/ckan/default
>
> Is it there some other directory I should change ownership or rights?
>
> Best,
>
> Lucia
>
> _________________________________________________________
> Dr. Lucia Espona Pernas
>
> Swiss Federal Institute for Forest, Snow and Landscape Research WSL
> Hauptgebäaude Labortrakt (HL C21)
> Zürcherstrasse 111
> 8903 Birmensdorf
> Switzerland
>
> +41 44 739 28 71 phone direct
> +41 44 739 21 11 reception
>
> www.wsl.ch
> _______________________________________________
> ckan-dev mailing list
> ckan-dev at lists.okfn.org
> https://lists.okfn.org/mailman/listinfo/ckan-dev
> Unsubscribe: https://lists.okfn.org/mailman/options/ckan-dev
>
>


-- 
Liip AG  // Limmatstrasse 183 //  CH-8005 Zürich
Tel +41 43 500 39 80 // GnuPG 0x7B588C67 // www.liip.ch
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.okfn.org/pipermail/ckan-dev/attachments/20161121/302d1958/attachment-0003.html>


More information about the ckan-dev mailing list