Symptom: I deployed my app but I am getting the default nginx page
Most of the time it's caused by some defaults newer versions of nginx set. To make sure that's the issue you're having run the following:
If you get a similar error just edit /etc/nginx/nginx.conf and add the following line to your http section:
Note that the
server_names_hash_bucket_size setting defines the maximum domain name length.
A value of 64 would allow domains with up to 64 characters. Set it to 128 if you need longer ones.
Save the file and try stopping nginx and starting it again:
Symptom: I want to deploy my app, but while pushing I get the following error
! [remote rejected] master -> master (pre-receive hook declined)
remote rejected error does not give enough information. Anything could have failed.
To enable Dokku tracing, simply run the following command:
In versions older than 0.3.9, you can create a
/home/dokku/dokkurc file containing the following :
This will trace all of dokku's activity. If this does not help you, create a gist containing the full log, and create an issue.
Symptom: I get the aforementioned error in the build phase (after turning on Dokku tracing)
Most errors that happen in this phase are due to transient network issues (either locally or remotely) buildpack bugs.
Solution (Less solution, more helpful troubleshooting steps):
Find the failed phase's container image (077581956a92 in this example)
Start a new container with the failed image and poke around (i.e. ensure you can access the internet from within the container or attempt the failed command, if known)
Sometimes (especially on DO) deploying again seems to get past these seemingly transient issues Additionally we've seen issues if changing networks that have different DNS resolvers. In this case, you can run the following to update your resolv.conf
Please see https://github.com/dokku/dokku/issues/841 and https://github.com/dokku/dokku/issues/649
Symptom: I want to deploy my app but I am getting asked for the password of the git user and the error message
fatal: 'NAME' does not appear to be a git repository fatal: Could not read from remote repository.
You get asked for a password because your ssh secret key can't be found. This may happen if the private key corresponding to the public key you added with
sshcommand acl-add is not located in the default location
You have to point ssh to the correct secret key for your domain name. Add the following to your
Also see issue #116
Symptom: I successfully deployed my application with no deployment errors and receiving Bad Gateway when attempting to access the application
In many cases the application will require the a
process.env.PORT port opposed to a specified port.
When specifying your port you may want to use something similar to:
Please see https://github.com/dokku/dokku/issues/282
Symptom: Deployment fails because of slow internet connection, messages shows
gzip: stdin: unexpected end of file
If you see output similar this when deploying:
Command: 'set -o pipefail; curl --fail --retry 3 --retry-delay 1 --connect-timeout 3 --max-time 30 https://s3-external-1.amazonaws.com/heroku-buildpack-ruby/ruby-2.0.0-p451-default-cache.tgz -s -o - | tar zxf -' failed unexpectedly: ! ! gzip: stdin: unexpected end of file ! tar: Unexpected EOF in archive ! tar: Unexpected EOF in archive ! tar: Error is not recoverable: exiting now
it might that the curl command that is supposed to fetch the buildpack (anything in the low megabyte file size range) takes too long to finish, due to slowish connection. To overwrite the default values (connection timeout: 90 seconds, total maximum time for operation: 600 seconds), set the following environment variables:
Please see https://github.com/dokku/dokku/issues/509
Another reason for this error (although it may respond immediately ruling out a timeout issue) may be because you've set the config setting
SSL_CERT_FILE. Using a config setting with this key interferes with the buildpack's ability to download it's dependencies, so you must rename the config setting to something else, e.g.
Symptom: Build fails with
This generally occurs when the server runs out of memory. You can either add more ram to your server or setup swap space. The follow script will create 2gb of swap space.
Symptom: I successfully deployed my application with no deployment errors but I'm receiving Connection Timeout when attempting to access the application.
This can occur if Dokku is running on a system with a firewall like ufw enabled (some OS versions like Ubuntu 16.04 have this enabled by default). You can check if this is your case by running the following script:
If the previous script returned
Status: active and a list of ports, ufw is enabled and is probably the cause of the symptom described above. To disable it, run:
Symptom: I can't connect to my application because the server is sending an invalid response, or can't provide a secure connection.
This isn't usually an issue with Dokku, but rather an app config problem. This can happen when your application is configured to enforce secure connections/HSTS, but you don't have SSL set up for the app.
In Rails at least, if your
environmnents/production.rb include the line
configure.force_ssl = true, which includes HSTS try commenting that out and redeploying.
If this solves the issue temporarily, longer term you should consider configuring SSL.