Error when launcher bootstrapping (Permission denied)


(ponyfun) #1

When I run ./launcher bootstrap app , it is failed because Permission denied;

My Linux version is centOS7,the detial info is Linux localhost.localdomain 3.10.0-327.el7.x86_64 #1 SMP Thu Nov 19 22:10:57 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux;

The Error Info Detial is mkdir: cannot create directory ‘/shared/postgres_run’: Permission denied.

What to do with this?


(Mittineague) #2

Hi ponyfun welcome to the forum

Did you try

sudo ./launcher bootstrap app ?


(ponyfun) #3

@Mittineague Thanks,buddy.I tried,but it didn’t work yet.


(Joshua Rosenfeld) #4

Is that the only line displayed in the console after attempting to bootstrap, or is there more to the logs?


(ponyfun) #5

@jomaxro The total info here:

[root@localhost discourse]# sudo ./launcher bootstrap app
which: no docker.io in (/sbin:/bin:/usr/sbin:/usr/bin)
cd /pups && git pull && /pups/bin/pups --stdin
From https://github.com/SamSaffron/pups
   d72d1f3..7bde3d3  master     -> origin/master
 * [new tag]         v1.0.0     -> v1.0.0
 * [new tag]         v1.0.1     -> v1.0.1
Updating d72d1f3..7bde3d3
Fast-forward
 README.md                 |  2 +-
 lib/pups.rb               |  4 ++++
 lib/pups/cli.rb           |  1 -
 lib/pups/config.rb        | 33 +++++++++++++++++++++++----------
 lib/pups/exec_command.rb  |  6 +++++-
 lib/pups/version.rb       |  2 +-
 test/exec_command_test.rb |  2 +-
 7 files changed, 35 insertions(+), 15 deletions(-)
I, [2016-11-10T03:47:58.798825 #20]  INFO -- : Loading --stdin
I, [2016-11-10T03:47:58.811589 #20]  INFO -- : > mkdir -p /shared/postgres_run
mkdir: cannot create directory ‘/shared/postgres_run’: Permission denied
I, [2016-11-10T03:47:58.874253 #20]  INFO -- : 


FAILED
--------------------
Pups::ExecError: mkdir -p /shared/postgres_run failed with return #<Process::Status: pid 22 exit 1>
Location of failure: /pups/lib/pups/exec_command.rb:108:in `spawn'
exec failed with the params "mkdir -p /shared/postgres_run"
49b90bf4f3fb972acb054b98364f69785f469ee3a96e2c2de914f919deebe507
** FAILED TO BOOTSTRAP ** please scroll up and look for earlier error messages, there may be more than one

Is there other reason? Thanks.


(Mittineague) #6

Is this a docker install? Which install guide did you follow?


(ponyfun) #7

@Mittineague yep,I install docker in centOS7(through yum install -y docker;And the folder is /var/lib/docker) ;

The docker info is

Containers: 16
 Running: 0
 Paused: 0
 Stopped: 16
Images: 87
Server Version: 1.10.3
Storage Driver: devicemapper
 Pool Name: docker-253:0-105963435-pool
 Pool Blocksize: 65.54 kB
 Base Device Size: 10.74 GB
 Backing Filesystem: xfs
 Data file: /dev/loop0
 Metadata file: /dev/loop1
 Data Space Used: 7.315 GB
 Data Space Total: 107.4 GB
 Data Space Available: 13.86 GB
 Metadata Space Used: 9.04 MB
 Metadata Space Total: 2.147 GB
 Metadata Space Available: 2.138 GB
 Udev Sync Supported: true
 Deferred Removal Enabled: false
 Deferred Deletion Enabled: false
 Deferred Deleted Device Count: 0
 Data loop file: /var/lib/docker/devicemapper/devicemapper/data
 WARNING: Usage of loopback devices is strongly discouraged for production use. Either use `--storage-opt dm.thinpooldev` or use `--storage-opt dm.no_warn_on_loop_devices=true` to suppress this warning.
 Metadata loop file: /var/lib/docker/devicemapper/devicemapper/metadata
 Library Version: 1.02.107-RHEL7 (2015-10-14)
Execution Driver: native-0.2
Logging Driver: journald
Plugins: 
 Volume: local
 Network: bridge null host
Kernel Version: 3.10.0-327.el7.x86_64
Operating System: CentOS Linux 7 (Core)
OSType: linux
Architecture: x86_64
Number of Docker Hooks: 2
CPUs: 2
Total Memory: 3.695 GiB
Name: localhost
ID: D6GT:YSWY:RV6U:7OMC:PBNF:XUUN:43JC:PO6T:HA3P:X7J4:MPWS:OOIP
Username: ponyfun
Registry: https://index.docker.io/v1/
WARNING: bridge-nf-call-iptables is disabled
WARNING: bridge-nf-call-ip6tables is disabled
Registries: docker.io (secure)

I followed the guide(discourse/INSTALL-cloud.md at master · discourse/discourse · GitHub ;from the step Install Discourse)

Did I follow a wrong?

Thanks.


(Mittineague) #8

I din’t know how that got in there, maybe the guide needs to be updated.

But I have seen a few posts indicating it’s a problem eg.


(ponyfun) #9

I tried ln -s /usr/bin/docker /usr/bin/docker.io;

The result is

[root@localhost bin]# ln -s /usr/bin/docker /usr/bin/docker.io
[root@localhost bin]# cd /var/discourse/
[root@localhost discourse]# sudo ./launcher bootstrap app
cd /pups && git pull && /pups/bin/pups --stdin
From https://github.com/SamSaffron/pups
   d72d1f3..7bde3d3  master     -> origin/master
 * [new tag]         v1.0.0     -> v1.0.0
 * [new tag]         v1.0.1     -> v1.0.1
Updating d72d1f3..7bde3d3
Fast-forward
 README.md                 |  2 +-
 lib/pups.rb               |  4 ++++
 lib/pups/cli.rb           |  1 -
 lib/pups/config.rb        | 33 +++++++++++++++++++++++----------
 lib/pups/exec_command.rb  |  6 +++++-
 lib/pups/version.rb       |  2 +-
 test/exec_command_test.rb |  2 +-
 7 files changed, 35 insertions(+), 15 deletions(-)
I, [2016-11-10T07:16:21.887599 #20]  INFO -- : Loading --stdin
I, [2016-11-10T07:16:21.896226 #20]  INFO -- : > mkdir -p /shared/postgres_run


FAILED
--------------------
Pups::ExecError: mkdir -p /shared/postgres_run failed with return #<Process::Status: pid 22 exit 1>
Location of failure: /pups/lib/pups/exec_command.rb:108:in `spawn'
exec failed with the params "mkdir -p /shared/postgres_run"
mkdir: cannot create directory ‘/shared/postgres_run’: Permission denied
I, [2016-11-10T07:16:21.944979 #20]  INFO -- : 
c7707fd209e67c4e2d67cf58e2c58333456331aba6f7831efe41e186b72eb243
** FAILED TO BOOTSTRAP ** please scroll up and look for earlier error messages, there may be more than one

Let me see the links you offered.ha.


(ponyfun) #10

OK,I will try change the docker storage driver!

And the other way, I will install discourse on Ubuntu16.04:joy:


(Daniel Brooks) #11

For the record, this happens because the launcher script doesn’t properly configure docker when SELinux is enabled. Apply the patch from add the :Z option to all mounted volumes so that discourse works when selinux is enabled by db48x · Pull Request #366 · discourse/discourse_docker · GitHub and you’ll be fine. (Hopefully that patch, or something similar to it, will be accepted into the upstream and you won’t have to do this yourself.)


(Sam Saffron) #12

I just accepted the patch, seems reasonable to me, thanks :unicorn:


(Jeff Atwood) #13

This broke stuff, reverted