Installation Fails - Cannot change owner and permissions of ‘/shared/redis_data’: No such file or directory


(Sashrika Waidyarathna) #1

I am installing Discourse on a Cent OS 7 server. I am installing it in 3 different containers. After editing 3 .yml files I did

cd /var/discourse
./launcher bootstrap redis

But it gives me the following error. Can you please help me to sort this out. below is the full log. Thanks! Any help will be appreciated.

[isauser@discourse discourse]$ sudo ./launcher bootstrap redis
which: no docker.io in (/sbin:/bin:/usr/sbin:/usr/bin)
cd /pups && git pull && /pups/bin/pups --stdin
Already up-to-date.
I, [2016-01-25T10:25:37.841253 #36]  INFO -- : Loading --stdin
I, [2016-01-25T10:25:37.844193 #36]  INFO -- : Skipped missing before_code hook
I, [2016-01-25T10:25:37.844248 #36]  INFO -- : Skipped missing after_code hook
I, [2016-01-25T10:25:37.849694 #36]  INFO -- : File > /etc/service/redis/run  chmod: +x
I, [2016-01-25T10:25:37.853527 #36]  INFO -- : File > /etc/runit/3.d/10-redis  chmod: +x
I, [2016-01-25T10:25:37.853989 #36]  INFO -- : Replacing daemonize yes with  in /etc/redis/redis.conf
I, [2016-01-25T10:25:37.854588 #36]  INFO -- : Replacing (?-mix:^pidfile.*$) with  in /etc/redis/redis.conf
I, [2016-01-25T10:25:37.980491 #36]  INFO -- : > install -d -m 0755 -o redis -g redis /shared/redis_data
install: cannot change owner and permissions of ‘/shared/redis_data’: No such file or directory
I, [2016-01-25T10:25:37.986631 #36]  INFO -- : 


FAILED
--------------------
RuntimeError: install -d -m 0755 -o redis -g redis /shared/redis_data failed with return #<Process::Status: pid 42 exit 1>
Location of failure: /pups/lib/pups/exec_command.rb:105:in `spawn'
exec failed with the params {"cmd"=>["install -d -m 0755 -o redis -g redis /shared/redis_data"]}
7a7e9cc62623ddc0697c7f5657b715d6dd35ce54304e9024ba339495286c0679
** FAILED TO BOOTSTRAP ** please scroll up and look for earlier error messages, there may be more than one
[isauser@discourse discourse]$

I did sudo ./launcher bootstrap data and got something similar to the above.

[isauser@discourse discourse]$ sudo ./launcher bootstrap data
which: no docker.io in (/sbin:/bin:/usr/sbin:/usr/bin)
cd /pups && git pull && /pups/bin/pups --stdin
Already up-to-date.
I, [2016-01-25T11:11:57.231571 #37]  INFO -- : Loading --stdin
I, [2016-01-25T11:11:57.238669 #37]  INFO -- : Skipped missing before_code hook
I, [2016-01-25T11:11:57.238755 #37]  INFO -- : Skipped missing after_code hook
I, [2016-01-25T11:11:57.239370 #37]  INFO -- : > mkdir -p /shared/postgres_run
mkdir: cannot create directory ‘/shared/postgres_run’: Permission denied
I, [2016-01-25T11:11:57.248869 #37]  INFO -- : 


FAILED
--------------------
RuntimeError: mkdir -p /shared/postgres_run failed with return #<Process::Status: pid 39 exit 1>
Location of failure: /pups/lib/pups/exec_command.rb:105:in `spawn'
exec failed with the params "mkdir -p /shared/postgres_run"
1693d71e40524726af55162d80f2306367f2a19acae1f28ac74d7913861e19b7
** FAILED TO BOOTSTRAP ** please scroll up and look for earlier error messages, there may be more than one
[isauser@discourse discourse]$

(Wes Osborn) #2

Just guessing here, but did you check to make sure that there wasn’t already an instance of postgres on that machine? If you cd to those directories are they already there?


(Sashrika Waidyarathna) #3

Hi Wes, Thanks for the reply.
No, the redis_data directory had not created. we manually created it, but didn’t work. And the server doesn’t have any other postgres instance.


(Paolo G. Giarrusso) #4
  1. Can you check permissions of /shared inside the container?
  2. Is which: no docker.io in (/sbin:/bin:/usr/sbin:/usr/bin) normal?
  3. Could you include the container config (obscuring private info)?
  4. But a standard docker container contains its own postgres inside the cotainer, no?