dokku: PHP Buildpack: Permission denied on /tmp/heroku.fcgi.5000.sock

Description of problem:

Site is here: https://symfony-demo.dokku.mfyu.co.uk/

It’s just a base install of symfony 3 with a few things setup so I can run database migrations as a deploy step.

I’m getting a 502 bad gateway.

Running dokku logs symfony-demo gives the following line that I noticed:

2017/03/12 23:41:03 [crit] 260#0: *1 connect() to unix:/tmp/heroku.fcgi.5000.sock failed (13: Permission denied) while connecting to upstream, client: 172.17.0.1, server: localhost, request: "GET / HTTP/1.1", upstream: "fastcgi://unix:/tmp/heroku.fcgi.5000.sock:", host: "symfony-demo.dokku.mfyu.co.uk"

Then if I dokku enter symfony-demo and ls -lah /tmp I see the following:

total 64K
drwxrwxrwt 1 root          root          4.0K Mar 12 23:54 .
drwxr-xr-x 1 root          root          4.0K Mar 12 23:40 ..
-rw------- 1 root          root           16K Mar 12 23:40 bashenv.084526661
-rw------- 1 root          root           16K Mar 12 23:54 bashenv.912808672
drwxr-xr-x 1 herokuishuser herokuishuser 4.0K Mar 12 23:39 build
drwxr-xr-x 6 herokuishuser herokuishuser 4.0K Mar 12 23:39 buildpack1cTcG
drwxr-xr-x 1 herokuishuser herokuishuser 4.0K Feb 27 21:08 buildpacks
drwxr-xr-x 2 root          root          4.0K Feb 27 21:08 cache
drwxr-xr-x 1 herokuishuser herokuishuser 4.0K Mar 12 23:39 env
srw-rw---- 1 root          root             0 Mar 12 23:40 heroku.fcgi.5000.sock
prw-r--r-- 1 root          root             0 Mar 12 23:52 heroku.logspipe-162.yXRFEH
-rw-r--r-- 1 root          root          1.3K Mar 12 23:52 heroku.nginx_access.5000.log
-rw-r--r-- 1 root          root             0 Mar 12 23:40 heroku.php-fpm.5000.log
-rw-r--r-- 1 root          root             0 Mar 12 23:40 heroku.php-fpm.5000.www.slowlog
-rw-r--r-- 1 root          root             0 Mar 12 23:40 heroku.php-fpm.www.5000.log
prw-r--r-- 1 root          root             0 Mar 12 23:40 heroku.waitpipe-5000.NosPkd

heroku.fcgi.5000.sock is owned by root, hence the permission issue.

But, if I enter another app (where things are working) and do the same, I get this:

total 88K
drwxrwxrwt 1 root          root          4.0K Mar 12 23:55 .
drwxr-xr-x 1 root          root          4.0K Mar  9 09:51 ..
-rw------- 1 root          root           15K Mar  9 09:51 bashenv.330319371
-rw------- 1 root          root           15K Mar 12 23:55 bashenv.618219963
drwxr-xr-x 1 herokuishuser herokuishuser 4.0K Feb 28 23:55 build
drwxr-xr-x 6 herokuishuser herokuishuser 4.0K Feb 28 23:55 buildpackNpI9p
drwxr-xr-x 1 herokuishuser herokuishuser 4.0K Feb 27 21:08 buildpacks
drwxr-xr-x 2 root          root          4.0K Feb 27 21:08 cache
drwxr-xr-x 1 herokuishuser herokuishuser 4.0K Feb 28 23:55 env
srw-rw---- 1 herokuishuser herokuishuser    0 Mar  9 09:51 heroku.fcgi.5000.sock
prw-r--r-- 1 herokuishuser herokuishuser    0 Mar 12 23:40 heroku.logspipe-14.psfT7W
-rw-r--r-- 1 herokuishuser herokuishuser  23K Mar 12 23:40 heroku.nginx_access.5000.log
-rw-r--r-- 1 herokuishuser herokuishuser    0 Mar  9 09:51 heroku.php-fpm.5000.log
-rw-r--r-- 1 herokuishuser herokuishuser    0 Mar  9 09:51 heroku.php-fpm.5000.www.slowlog
-rw-r--r-- 1 herokuishuser herokuishuser    0 Mar  9 09:51 heroku.php-fpm.www.5000.log
prw-r--r-- 1 herokuishuser herokuishuser    0 Mar  9 09:51 heroku.waitpipe-5000.WLzVfs

Where it’s owned by herokuishuser which is fine.

Any ideas? I’m not sure why the file permission would be wrong as I’m using the same buildpack for both apps (the working app is a private repo)

dokku report

-----> uname: Linux dokku 4.4.38-std-1 #1 SMP Mon Dec 12 10:45:29 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux
-----> memory: 
              total        used        free      shared  buff/cache   available
Mem:           7976         356        1078         168        6541        7155
Swap:             0           0           0
-----> docker version: 
Client:
 Version:      1.13.1
 API version:  1.26
 Go version:   go1.7.5
 Git commit:   092cba3
 Built:        Wed Feb  8 06:50:14 2017
 OS/Arch:      linux/amd64

Server:
 Version:      1.13.1
 API version:  1.26 (minimum version 1.12)
 Go version:   go1.7.5
 Git commit:   092cba3
 Built:        Wed Feb  8 06:50:14 2017
 OS/Arch:      linux/amd64
 Experimental: false
-----> docker daemon info: 
Containers: 15
 Running: 7
 Paused: 0
 Stopped: 8
Images: 49
Server Version: 1.13.1
Storage Driver: overlay2
 Backing Filesystem: extfs
 Supports d_type: true
 Native Overlay Diff: true
Logging Driver: json-file
Cgroup Driver: cgroupfs
Plugins: 
 Volume: local
 Network: bridge host macvlan null overlay
Swarm: inactive
Runtimes: runc
Default Runtime: runc
Init Binary: docker-init
containerd version: aa8187dbd3b7ad67d8e5e3a15115d3eef43a7ed1
runc version: 9df8b306d01f59d3a8029be411de015b7304dd8f
init version: 949e6fa
Security Options:
 seccomp
  Profile: default
Kernel Version: 4.4.38-std-1
Operating System: Ubuntu 16.04.1 LTS
OSType: linux
Architecture: x86_64
CPUs: 6
Total Memory: 7.79 GiB
Name: dokku
ID: CUOY:N7GW:UM4A:EF6J:H4VC:WVIN:YDIM:5ZF5:SDHK:YRPH:6H5T:LE35
Docker Root Dir: /mnt/data/docker
Debug Mode (client): true
Debug Mode (server): false
Registry: https://index.docker.io/v1/
WARNING: No cpu cfs quota support
WARNING: No cpu cfs period support
Experimental: false
Insecure Registries:
 127.0.0.0/8
Live Restore Enabled: false
-----> sigil version: 0.4.0
-----> herokuish version: 
herokuish: 0.3.24
buildpacks:
  heroku-buildpack-multi     v1.0.0
  heroku-buildpack-ruby      v150
  heroku-buildpack-nodejs    v93
  heroku-buildpack-clojure   v75
  heroku-buildpack-python    v97
  heroku-buildpack-java      v48
  heroku-buildpack-gradle    v19
  heroku-buildpack-grails    v21
  heroku-buildpack-scala     v72
  heroku-buildpack-play      v26
  heroku-buildpack-php       v117
  heroku-buildpack-go        v54
  heroku-buildpack-erlang    fa17af9
  buildpack-nginx            v8
-----> dokku version: 0.8.0
-----> dokku plugins: 
plugn: 0.2.2
  00_dokku-standard    0.8.0 enabled    dokku core standard plugin
  20_events            0.8.0 enabled    dokku core events logging plugin
  apps                 0.8.0 enabled    dokku core apps plugin
  build-env            0.8.0 enabled    dokku core build-env plugin
  certs                0.8.0 enabled    dokku core certificate management plugin
  checks               0.8.0 enabled    dokku core checks plugin
  common               0.8.0 enabled    dokku core common plugin
  config               0.8.0 enabled    dokku core config plugin
  docker-options       0.8.0 enabled    dokku core docker-options plugin
  domains              0.8.0 enabled    dokku core domains plugin
  elasticsearch        1.0.0 enabled    dokku elasticsearch service plugin
  enter                0.8.0 enabled    dokku core enter plugin
  git                  0.8.0 enabled    dokku core git plugin
  letsencrypt          0.8.6 enabled    Automated installation of let's encrypt TLS certificates
  logs                 0.8.0 enabled    dokku core logs plugin
  maintenance          0.4.0 enabled    Maintenance mode for apps
  mariadb              1.0.0 enabled    dokku mariadb service plugin
  memcached            1.0.0 enabled    dokku memcached service plugin
  mysql                1.0.0 enabled    dokku mysql service plugin
  named-containers     0.8.0 enabled    dokku core named containers plugin
  nginx-vhosts         0.8.0 enabled    dokku core nginx-vhosts plugin
  plugin               0.8.0 enabled    dokku core plugin plugin
  postgres             1.0.0 enabled    dokku postgres service plugin
  proxy                0.8.0 enabled    dokku core proxy plugin
  ps                   0.8.0 enabled    dokku core ps plugin
  rabbitmq             1.0.0 enabled    dokku rabbitmq service plugin
  redis                1.0.0 enabled    dokku redis service plugin
  repo                 0.8.0 enabled    dokku core repo plugin
  shell                0.8.0 enabled    dokku core shell plugin
  ssh-keys             0.8.0 enabled    dokku core ssh-keys plugin
  storage              0.8.0 enabled    dokku core storage plugin
  tags                 0.8.0 enabled    dokku core tags plugin
  tar                  0.8.0 enabled    dokku core tar plugin

cat /home/dokku/symfony-demo/nginx.conf

server {
  listen      [::]:80;
  listen      80;
  server_name symfony-demo.dokku.mfyu.co.uk;
  access_log  /var/log/nginx/symfony-demo-access.log;
  error_log   /var/log/nginx/symfony-demo-error.log;

  return 301 https://$host:443$request_uri;

}

server {
  listen      [::]:443 ssl ;
  listen      443 ssl ;
  server_name symfony-demo.dokku.mfyu.co.uk;
  server_name symfony-demo.dokku.mfyu.co.uk;
  access_log  /var/log/nginx/symfony-demo-access.log;
  error_log   /var/log/nginx/symfony-demo-error.log;

  ssl_certificate     /home/dokku/symfony-demo/tls/server.crt;
  ssl_certificate_key /home/dokku/symfony-demo/tls/server.key;
  ssl_protocols       TLSv1 TLSv1.1 TLSv1.2;

  keepalive_timeout   70;


  location    / {

    gzip on;
    gzip_min_length  1100;
    gzip_buffers  4 32k;
    gzip_types    text/css text/javascript text/xml text/plain text/x-component application/javascript application/x-javascript application/json application/xml  application/rss+xml font/truetype application/x-font-ttf font/opentype application/vnd.ms-fontobject image/svg+xml;
    gzip_vary on;
    gzip_comp_level  6;

    proxy_pass  http://symfony-demo-5000;
    proxy_http_version 1.1;
    proxy_set_header Upgrade $http_upgrade;
    proxy_set_header Connection "upgrade";
    proxy_set_header Host $http_host;
    proxy_set_header X-Forwarded-Proto $scheme;
    proxy_set_header X-Forwarded-For $remote_addr;
    proxy_set_header X-Forwarded-Port $server_port;
    proxy_set_header X-Request-Start $msec;
  }
  include /home/dokku/symfony-demo/nginx.conf.d/*.conf;
}

upstream symfony-demo-5000 {

  server 172.17.0.6:5000;
}

Environment details (AWS, VirtualBox, physical, etc.): Scaleway VPS.

How was Dokku installed?: via instructions here: http://dokku.viewdocs.io/dokku/getting-started/installation/

About this issue

  • Original URL
  • State: closed
  • Created 7 years ago
  • Comments: 34 (14 by maintainers)

Most upvoted comments

We do buildpack detection the same way as heroku does, so I would let Dokku figure it out and then override with a .buildpacks file if you need something specific, or need multiple buildpacks.

I’ll try your repo out on a test server of mine.