dokku: nginx-pre-reload syntax error for Dockerfile deploy

Description of problem:

We are seeing this when deploying a Dockerfile-based project:

-----> Creating http nginx.conf -----> Running nginx-pre-reload remote: /tmp/bashenv.738885525: line 134: syntax error near unexpected token (' remote: /tmp/bashenv.738885525: line 134: eval "$1() { ’ remote: /home/dokku/.basher/bash: main: command not found

Output of the following commands

-----> uname: Linux XXX 4.4.0-42-generic #62-Ubuntu SMP Fri Oct 7 23:11:45 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux -----> memory: total used free shared buff/cache available Mem: 257853 13658 147154 162 97039 242474 Swap: 262031 45 261986 -----> docker version: Client: Version: 1.10.2 API version: 1.22 Go version: go1.5.3 Git commit: c3959b1 Built: Mon Feb 22 21:40:35 2016 OS/Arch: linux/amd64

Server: Version: 1.10.2 API version: 1.22 Go version: go1.5.3 Git commit: c3959b1 Built: Mon Feb 22 21:40:35 2016 OS/Arch: linux/amd64 -----> docker daemon info: Containers: 18 Running: 7 Paused: 0 Stopped: 11 Images: 176 Server Version: 1.10.2 Storage Driver: aufs Root Dir: /var/lib/docker/aufs Backing Filesystem: extfs Dirs: 159 Dirperm1 Supported: true Execution Driver: native-0.2 Logging Driver: json-file Plugins: Volume: local Network: bridge null host Kernel Version: 4.4.0-42-generic Operating System: Ubuntu 16.04.1 LTS OSType: linux Architecture: x86_64 CPUs: 16 Total Memory: 251.8 GiB Name: XXX ID: SRU6:EQHD:5UUY:KKH5:6ZNU:E4WS:VTDN:TXQA:QVLS:V5W4:XXXX Http Proxy: http://XXX:XXX Https Proxy: http://XXX:XXX WARNING: No swap limit support -----> sigil version: 0.4.0 -----> herokuish version: herokuish: 0.3.27 buildpacks: heroku-buildpack-multi v1.0.0 heroku-buildpack-ruby v155 heroku-buildpack-nodejs v98 heroku-buildpack-clojure v76 heroku-buildpack-python v99 heroku-buildpack-java v51 heroku-buildpack-gradle v21 heroku-buildpack-grails v21 heroku-buildpack-scala v76 heroku-buildpack-play v26 heroku-buildpack-php v120 heroku-buildpack-go v62 heroku-buildpack-erlang fa17af9 buildpack-nginx v8 -----> dokku version: 0.8.2 -----> dokku plugins: ! Deprecated: Please use plugin:list plugn: 0.3.0 00_dokku-standard 0.8.2 enabled dokku core standard plugin 20_events 0.8.2 enabled dokku core events logging plugin apps 0.8.2 enabled dokku core apps plugin build-env 0.8.2 enabled dokku core build-env plugin certs 0.8.2 enabled dokku core certificate management plugin checks 0.8.2 enabled dokku core checks plugin common 0.8.2 enabled dokku core common plugin config 0.8.2 enabled dokku core config plugin docker-options 0.8.2 enabled dokku core docker-options plugin domains 0.8.2 enabled dokku core domains plugin enter 0.8.2 enabled dokku core enter plugin git 0.8.2 enabled dokku core git plugin logs 0.8.2 enabled dokku core logs plugin named-containers 0.8.2 enabled dokku core named containers plugin nginx-vhosts 0.8.2 enabled dokku core nginx-vhosts plugin plugin 0.8.2 enabled dokku core plugin plugin proxy 0.8.2 enabled dokku core proxy plugin ps 0.8.2 enabled dokku core ps plugin repo 0.8.2 enabled dokku core repo plugin shell 0.8.2 enabled dokku core shell plugin ssh-keys 0.8.2 enabled dokku core ssh-keys plugin storage 0.8.2 enabled dokku core storage plugin tags 0.8.2 enabled dokku core tags plugin tar 0.8.2 enabled dokku core tar plugin

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

Physical hardware running Ubuntu 16.0.4.1 LTS.

How was Dokku installed?:

http://dokku.viewdocs.io/dokku/#install-apt

How reproducible:

100%

Steps to Reproduce:

  1. dokku apps:destroy foobar && dokku apps:create foobar
  2. git push dokku release/example:master # dokku remote points to foobar

Actual Results:

Successfully built 2ec6f4f7f08e -----> Releasing foobar (dokku/foobar:latest)… -----> Deploying foobar (dokku/foobar:latest)… -----> Attempting to run scripts.dokku.predeploy from app.json (if defined) -----> No Procfile found in app image -----> DOKKU_SCALE file not found in app image. Generating one based on Procfile… -----> New DOKKU_SCALE file generated =====> web=1 -----> Attempting pre-flight checks For more efficient zero downtime deployments, create a file CHECKS. See http://dokku.viewdocs.io/dokku/deployment/zero-downtime-deploys/ for examples CHECKS file not found in container: Running simple container check… -----> Waiting for 10 seconds … -----> Default container check successful! -----> Running post-deploy =====> renaming container (925735c36ce8) trusting_wright to foobar.web.1 =====> no global VHOST set. disabling vhost support -----> Unsetting foobar -----> Unsetting DOKKU_NGINX_PORT -----> Unsetting DOKKU_NGINX_SSL_PORT -----> Unsetting DOKKU_PROXY_PORT_MAP -----> Setting config vars NO_VHOST: 1 -----> Setting config vars DOKKU_PROXY_PORT_MAP: http:27017:27017 -----> Creating http nginx.conf -----> Running nginx-pre-reload remote: /tmp/bashenv.738885525: line 134: syntax error near unexpected token (' remote: /tmp/bashenv.738885525: line 134: eval "$1() { ’ remote: /home/dokku/.basher/bash: main: command not found

Expected Results:

I imagine nginx-pre-reload should successfully complete.

Additional info:

Thanks for any tips!

About this issue

  • Original URL
  • State: closed
  • Created 7 years ago
  • Comments: 25 (15 by maintainers)

Commits related to this issue

Most upvoted comments

In case anyone got this problem, here is what worked for me.

  1. I had written my CMD as a multiline command (which docker build doesn’t seem to mind)
  2. On first push to dokku, it tried to set its DOKKU_DOCKERFILE_CMD config by (i assume) sedding the line where CMD appears in the dockerfile. In my case it set DOKKU_DOCKERFILE_CMD="CMD [ \" which in turn made some stuff go crazy in the generated bash scripts afterwards
  3. After fixing my Dockerfile to have a simpler CMD entry, the problem persisted as the config was now set and took precedence.
  4. After unsetting the config entry and repushing the repo, it worked better (well not the same problem at least 😉

In 0.22.0, we’ll be removing DOKKU_DOCKERFILE_CMD and DOKKU_DOCKERFILE_ENTRYPOINT, so that should go away completely 😃