[ckan-dev] [Errno 13] Permission denied: '/var/lib/ckan/ (no solution works)

Biz Tweets optweets at gmail.com
Fri Nov 9 07:54:48 UTC 2018


Solution:
https://blog.lysender.com/2015/07/centos-7-selinux-php-apache-cannot-writeaccess-file-no-matter-what/

On Fri, Nov 9, 2018 at 1:30 AM Biz Tweets <optweets at gmail.com> wrote:

> Well it worked!
>
> After a whole day of struggling. Thanks for pointing this out.
>
> Its interesting that this happened on Azure but not on  a local VM
> instance.
>
> Thank you!
>
> On Fri, Nov 9, 2018 at 1:14 AM Alex Gartner <
> alexandru.gartner+ckan at gmail.com> wrote:
>
>> Do you have maybe SELinux enabled on CentOS? That could block apache from
>> writing to non-default folders. You could use 'sestatus' to see if it's
>> enabled.
>> More info here https://wiki.centos.org/HowTos/SELinux
>>
>> On Fri, 9 Nov 2018 at 02:43, Biz Tweets <optweets at gmail.com> wrote:
>>
>>> I am just running it on apache on centos otherwise known as httpd.
>>>
>>> I have this exact install on 2 other VMs and it has no issue like this.
>>> I did the same install.
>>>
>>> wsgi runs the python.
>>>
>>> here is the output of var  and var/lib
>>>
>>> drwxr-xr-x.  22 root root 4096 Nov  8 14:59 var
>>>
>>> drwxr-xr-x. 38 root root 4096 Nov  8 14:43 lib
>>>
>>>
>>>
>>>
>>> On Thu, Nov 8, 2018 at 7:29 PM Karen Turner <karen at catalyst.net.nz>
>>> wrote:
>>>
>>>> Hi
>>>>
>>>> One option is the execute bit is not set on the parent directories.
>>>> /var and /var/lib have x  set?
>>>>
>>>> What is running the python code?  We use gunicorn and that runs as a
>>>> different user to the nginx that forwards the requests.
>>>>
>>>> Cheers
>>>>    Karen
>>>>
>>>> On 9/11/18 1:08 PM, Biz Tweets wrote:
>>>> > As you can see my httpd is running as the user apache. Not sure whats
>>>> > going on here.
>>>> >
>>>> > |root 23020 0.0 0.0 239820 5992 ? Ss Nov08 0:00 /usr/sbin/httpd
>>>> > -DFOREGROUND apache 23021 0.8 0.6 820676 113512 ? Sl Nov08 0:03
>>>> > ckan_default -DFOREGROUND apache 23022 0.6 0.6 814476 107620 ? Sl
>>>> Nov08
>>>> > 0:03 ckan_default -DFOREGROUND apache 23023 0.0 0.0 514548 8872 ? Sl
>>>> > Nov08 0:00 demo -DFOREGROUND apache 23024 0.0 0.0 244104 7724 ? S
>>>> Nov08
>>>> > 0:00 /usr/sbin/httpd -DFOREGROUND apache 23025 0.0 0.0 244104 7464 ? S
>>>> > Nov08 0:00 /usr/sbin/httpd -DFOREGROUND apache 23026 0.0 0.0 244104
>>>> 6960
>>>> > ? S Nov08 0:00 /usr/sbin/httpd -DFOREGROUND apache 23027 0.0 0.0
>>>> 244104
>>>> > 6960 ? S Nov08 0:00 /usr/sbin/httpd -DFOREGROUND apache 23028 0.0 0.0
>>>> > 244104 6960 ? S Nov08 0:00 /usr/sbin/httpd -DFOREGROUND apache 23091
>>>> 0.0
>>>> > 0.0 244104 6960 ? S Nov08 0:00 /usr/sbin/httpd -DFOREGROUND|
>>>> >
>>>> >
>>>> > On Thu, Nov 8, 2018 at 7:05 PM Biz Tweets <optweets at gmail.com
>>>> > <mailto:optweets at gmail.com>> wrote:
>>>> >
>>>> >     I set my storage folder as /var/lib/ckan.
>>>> >
>>>> >     Everytime i try to upload a file through resource create i get
>>>> this
>>>> >     error
>>>> >
>>>> >     [Thu Nov 08 23:59:50.286522 2018] [:error] [pid 23021] [remote
>>>> >     10.172.24.4:76 <http://10.172.24.4:76>] Error - <type
>>>> >     'exceptions.OSError'>: [Errno 13] Permission denied:
>>>> >     '/var/lib/ckan/resources/ecf'
>>>> >
>>>> >     Now i tried everything.
>>>> >
>>>> >     I ran all of these commands and nothing has helped.
>>>> >
>>>> >     My httpd runs on the user apache.
>>>> >     sudo chown -R apache /var/lib/ckan
>>>> >     sudo chmod -R u+rwx /var/lib/ckan
>>>> >     sudo chmod 777 -R /var/lib/ckan
>>>> >
>>>> >     But nothing works. Do I have some funky permissions issue going on
>>>> >     here??
>>>> >
>>>> >     [user at ckanserverckan]$ ls -l
>>>> >     drwxr-xr-x. 2 apache apache 4096 Nov 8 23:45 resources
>>>> >     drwxr-xr-x. 2 apache apache 4096 Nov 8 23:57 storage
>>>> >
>>>> >
>>>> > _______________________________________________
>>>> > 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
>>>> >
>>>> _______________________________________________
>>>> 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
>>>>
>>> _______________________________________________
>>> 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
>>>
>> _______________________________________________
>> 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
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.okfn.org/pipermail/ckan-dev/attachments/20181109/02a0d445/attachment-0002.html>


More information about the ckan-dev mailing list