Dispatcher: Unable to create parent directory error

Avatar

Avatar
Validate 1
Level 2
Mayank_Arora
Level 2

Likes

9 likes

Total Posts

25 posts

Correct reply

0 solutions
Top badges earned
Validate 1
Boost 5
Boost 3
Boost 1
View profile

Avatar
Validate 1
Level 2
Mayank_Arora
Level 2

Likes

9 likes

Total Posts

25 posts

Correct reply

0 solutions
Top badges earned
Validate 1
Boost 5
Boost 3
Boost 1
View profile
Mayank_Arora
Level 2

15-10-2015

Hello,

I went through the available AEM documentation to configure a dispatcher. I was able to do so and mask my publisher behind a dispatcher. Rendering is working fine but the content is not getting cached and I get the below error in my dispatcher log.

I did the following steps at my end:

1. Defined a custom <docroot> location and did a 'chown' on it to change the owner to my custom user.

2. I start my apache (where disp is configured) as 'sudo service httpd start'. Since it's the sudo user, I assume it should be able to replicate the /content/..../... dir structure on the specified docroot location as is on the defined render/publisher. But I get the 'Unable to create parent directory <docroot>/content/abc: Permission denied' error and cache is not getting created.

3. Did a chmod 777 on <docroot> - just to test if it fixed the error but it did not.

Please advice.

cachefile does not exist or is a directory: <docroot>/content/abc/home.html
[Thu Jan 02 03:44:28 2014] [D] [18861(139751847729184)] try to create new cachefile: <docroot>/content/abc/home.html
[Thu Jan 02 03:44:28 2014] [D] [18861(139751847729184)] cache-action for [/content/abc/home.html]: CREATE
[Thu Jan 02 03:44:28 2014] [D] [18861(139751847729184)] connected to render rend01 (<render IP>)
[Thu Jan 02 03:44:28 2014] [D] [18861(139751847729184)] Spooling request header: Host
[Thu Jan 02 03:44:28 2014] [D] [18861(139751847729184)] Spooling request header: Cache-Control
[Thu Jan 02 03:44:28 2014] [D] [18861(139751847729184)] Spooling request header: Accept
[Thu Jan 02 03:44:28 2014] [D] [18861(139751847729184)] Spooling request header: User-Agent
[Thu Jan 02 03:44:28 2014] [D] [18861(139751847729184)] Spooling request header: Accept-Encoding
[Thu Jan 02 03:44:28 2014] [D] [18861(139751847729184)] Spooling request header: Accept-Language
[Thu Jan 02 03:44:28 2014] [D] [18861(139751847729184)] Spooling request header: Cookie
[Thu Jan 02 03:44:28 2014] [D] [18861(139751847729184)] Detected: chunked transfer encoding
[Thu Jan 02 03:44:28 2014] [E] [18861(139751847729184)] Unable to create parent directory <docroot>/content/abc: Permission denied

Accepted Solutions (1)

Accepted Solutions (1)

Avatar

Avatar
Boost 5
Level 3
sureshr19072451
Level 3

Likes

18 likes

Total Posts

31 posts

Correct reply

5 solutions
Top badges earned
Boost 5
Boost 3
Boost 10
Boost 1
Affirm 5
View profile

Avatar
Boost 5
Level 3
sureshr19072451
Level 3

Likes

18 likes

Total Posts

31 posts

Correct reply

5 solutions
Top badges earned
Boost 5
Boost 3
Boost 10
Boost 1
Affirm 5
View profile
sureshr19072451
Level 3

04-03-2018

It maybe helpful for those trying to figure this out on RHEL + Apache 2.4.6

Try this SELinux Prevents httpd Write Files - Unix & Linux Stack Exchange

Worked for me. The commands you have to run after making sure rw permissions are given for apache user on <docroot>

semanage fcontext -a -t httpd_modules_t /etc/httpd/modules/mod_dispatcher.so

setsebool -P httpd_can_network_connect on

chcon -R -t httpd_sys_rw_content_t /var/www/html/

semanage fcontext -a -t httpd_sys_rw_content_t "/var/www/html(/.*)?"

restorecon -Rv /var/www/html

Restart apache -

Answers (8)

Answers (8)

Avatar

Avatar
Validate 10
Level 3
Naveen_AEM_dev
Level 3

Likes

21 likes

Total Posts

70 posts

Correct reply

5 solutions
Top badges earned
Validate 10
Validate 1
Boost 5
Boost 3
Boost 10
View profile

Avatar
Validate 10
Level 3
Naveen_AEM_dev
Level 3

Likes

21 likes

Total Posts

70 posts

Correct reply

5 solutions
Top badges earned
Validate 10
Validate 1
Boost 5
Boost 3
Boost 10
View profile
Naveen_AEM_dev
Level 3

07-05-2017

I've got this exact same issue and I tried both suggestions mentioned here - changing the doc root ownership to apache user and also following the steps for SELinux from the docs but the issue still remains.

Thoughts?

Avatar

Avatar
Boost 1
Level 1
ajayt131015
Level 1

Like

1 like

Total Posts

1 post

Correct reply

0 solutions
Top badges earned
Boost 1
View profile

Avatar
Boost 1
Level 1
ajayt131015
Level 1

Like

1 like

Total Posts

1 post

Correct reply

0 solutions
Top badges earned
Boost 1
View profile
ajayt131015
Level 1

02-02-2021

It's clear from the mentioned logs dispatcher tried to create the cache, but was unable to create cache files or directory.   

cache-action for [/content/abc/home.html]: CREATE

Unable to create parent directory <docroot>/content/abc: Permission denied

Reason

Configured apache user does not have write access over docroot cache folder.

Solve

To identify the apache user open httpd.conf and search for "User _www". Usually it is present inside <IfModule unixd_module> section. Here _www is user name and cache directory can be checked under /cache section of dispatcher.any. Check /docroot property like /docroot "/usr/local/var/www".

Assign write permission to "_www" user over directory "/usr/local/var/www".

 

Step 1 : Set the ownership of your desired directory/file to the _www user

sudo chown -R _www:staff /usr/local/var/www

Step 2 : Set the permissions so that the _www can write in the directory/file without giving permissions to everyone else:

sudo chmod -R 755 /usr/local/var/www

 

Restart apache. Load the page again and check cache folder for cached content.

Avatar

Avatar
Validate 1
Level 1
ncansz
Level 1

Like

1 like

Total Posts

6 posts

Correct reply

0 solutions
Top badges earned
Validate 1
Boost 1
View profile

Avatar
Validate 1
Level 1
ncansz
Level 1

Like

1 like

Total Posts

6 posts

Correct reply

0 solutions
Top badges earned
Validate 1
Boost 1
View profile
ncansz
Level 1

27-02-2018

Have You been able to resolve the problem when none of the suggestion mentioned here work ??

Avatar

Avatar
Coach
Employee
Jörg_Hoh
Employee

Likes

1,134 likes

Total Posts

3,161 posts

Correct reply

1,079 solutions
Top badges earned
Coach
Give back 600
Ignite 5
Ignite 3
Ignite 1
View profile

Avatar
Coach
Employee
Jörg_Hoh
Employee

Likes

1,134 likes

Total Posts

3,161 posts

Correct reply

1,079 solutions
Top badges earned
Coach
Give back 600
Ignite 5
Ignite 3
Ignite 1
View profile
Jörg_Hoh
Employee

15-10-2015

Hi,

I guess that you have problems with Selinux. Please consult the dispatcher documentation [1] for this.

kind regards,
Jörg

[1] https://docs.adobe.com/docs/en/dispatcher/disp-install.html#Apache%20Web%20Server%20-%20Configure%20...

Avatar

Avatar
Boost 50
Level 10
Sham_HC
Level 10

Likes

161 likes

Total Posts

2,114 posts

Correct reply

1,204 solutions
Top badges earned
Boost 50
Boost 5
Boost 3
Boost 25
Boost 100
View profile

Avatar
Boost 50
Level 10
Sham_HC
Level 10

Likes

161 likes

Total Posts

2,114 posts

Correct reply

1,204 solutions
Top badges earned
Boost 50
Boost 5
Boost 3
Boost 25
Boost 100
View profile
Sham_HC
Level 10

15-10-2015

Avatar

Avatar
Validate 10
Level 3
Kanwaljit
Level 3

Likes

19 likes

Total Posts

52 posts

Correct reply

3 solutions
Top badges earned
Validate 10
Validate 1
Boost 5
Boost 3
Boost 10
View profile

Avatar
Validate 10
Level 3
Kanwaljit
Level 3

Likes

19 likes

Total Posts

52 posts

Correct reply

3 solutions
Top badges earned
Validate 10
Validate 1
Boost 5
Boost 3
Boost 10
View profile
Kanwaljit
Level 3

15-10-2015

ZygW / Mayank,

Is this OS specific within linux  ? I am on CentOS 7.0 Having tried all these options, I am still getting the same error

ERROR : [Sun Mar 08 19:28:07 2015] [E] [59848(140308474173504)] Unable to create parent directory /aem/dispatcher/docroot/etc/clientlibs: Permission denied

I have changed the user/group in httpd.conf which is used to start the apache instance. Still same issue...

I tried giving 777 permissions to the folders but didn't help

s/w used :  apache 2.4, Centos 7 , 64 bit

any thoughts ?

/KS

Avatar

Avatar
Validate 1
Level 2
Mayank_Arora
Level 2

Likes

9 likes

Total Posts

25 posts

Correct reply

0 solutions
Top badges earned
Validate 1
Boost 5
Boost 3
Boost 1
View profile

Avatar
Validate 1
Level 2
Mayank_Arora
Level 2

Likes

9 likes

Total Posts

25 posts

Correct reply

0 solutions
Top badges earned
Validate 1
Boost 5
Boost 3
Boost 1
View profile
Mayank_Arora
Level 2

15-10-2015

I did a 'sudo chown -R apache .' on the <docroot> and restarted apache - it worked. Thank you ZygW.

Avatar

Avatar
Boost 1
Level 2
ZygW
Level 2

Likes

2 likes

Total Posts

18 posts

Correct reply

4 solutions
Top badges earned
Boost 1
Affirm 3
Affirm 1
View profile

Avatar
Boost 1
Level 2
ZygW
Level 2

Likes

2 likes

Total Posts

18 posts

Correct reply

4 solutions
Top badges earned
Boost 1
Affirm 3
Affirm 1
View profile
ZygW
Level 2

15-10-2015

apache runs as the user configured in httpd.conf in the user directive, and by default is 'apache'.   It starts as root to bind to port 80/443 and immediately switches to the user defined in httpd.conf.  What user do you have apache running as? Make sure the <docroot> is writable by the user apache is running as (having it owned by that user is a good idea) and restart apache.