Dokku on Ubuntu refusing connection

1.6k views Asked by At

I've installed a fresh image of Dokku v0.2.3 on 14.04 (w/ Docker 1.2.0) on a 512MB droplet in DigitalOcean. To avoid memory issues I create a swap file as usual.

I deployed two apps for testing, one on a subdomain an another with a custom domain and they worked great.

That was just a test server, just to see how it works, if it works and overall to see if I can make it work.

So. Next thing was destroying that droplet and create a new one to deploy there some apps. I have, like at the first time everything worked, done these steps here in this article.

Basically:

  1. SSH keys generation (this obviously works fine)

  2. Access to server (http://) to do dokku's setup (here I activated use virtualhost naming for apps)

  3. Update the dokku deploy step

    cd ~/dokku git pull origin master make install

  4. Install the dokku postgresql plugin

    cd /var/lib/dokku/plugins git clone https://github.com/Kloadut/dokku-pg-plugin postgresql dokku plugins-install

  5. Pushed a rails test app to the server This is the ouput:

    git push dokku master
    Counting objects: 6, done.
    Delta compression using up to 4 threads.
    Compressing objects: 100% (5/5), done.
    Writing objects: 100% (6/6), 491 bytes | 0 bytes/s, done.
    Total 6 (delta 2), reused 3 (delta 0)
    -----> Cleaning up ...
    -----> Building rails-sample ...
           Ruby app detected
    -----> Compiling Ruby/Rails
    -----> Using Ruby version: ruby-2.1.2
    -----> Installing dependencies using 1.6.3
           Running: bundle install --without development:test --path vendor/bundle --binstubs vendor/bundle/bin -j4 --    deployment
           Don't run Bundler as root. Bundler can ask for sudo if it is needed, and
           installing your bundle as root will break this application for all non-root
           users on this machine.
           Using rake 10.1.1
           Using i18n 0.6.9
           Using minitest 4.7.5
           Using multi_json 1.8.4
           Using tzinfo 0.3.38
           Using builder 3.1.4
           Using erubis 2.7.0
           Using atomic 1.1.15
           Using rack 1.5.2
           Using polyglot 0.3.4
           Using activerecord-deprecated_finders 1.0.3
           Using arel 4.0.2
           Using coffee-script-source 1.7.0
           Using mime-types 1.25.1
           Using execjs 2.0.2
           Using hike 1.2.3
           Using thor 0.18.1
           Using kgio 2.9.2
           Using json 1.8.1
           Using tilt 1.4.1
           Using bundler 1.6.3
           Using pg 0.17.1
           Using raindrops 0.13.0
           Using rails_serve_static_assets 0.0.2
           Using rails_stdout_logging 0.0.3
           Using sass 3.2.14
           Using thread_safe 0.2.0
           Using rack-test 0.6.2
           Using treetop 1.4.15
           Using coffee-script 2.2.0
           Using sprockets 2.11.0
           Using uglifier 2.4.0
           Using rails_12factor 0.0.2
           Using unicorn 4.8.2
           Using rdoc 4.1.1
           Using activesupport 4.0.3
           Using sdoc 0.4.0
           Using mail 2.5.4
           Using actionpack 4.0.3
           Using activemodel 4.0.3
           Using jbuilder 1.5.3
           Using actionmailer 4.0.3
           Using railties 4.0.3
           Using coffee-rails 4.0.1
           Using sprockets-rails 2.0.1
           Using jquery-rails 3.1.0
           Using turbolinks 2.2.1
           Using activerecord 4.0.3
           Using sass-rails 4.0.1
           Using rails 4.0.3
           Your bundle is complete!
           Gems in the groups development and test were not installed.
           It was installed into ./vendor/bundle
           Bundle completed (1.64s)
           Cleaning up the bundler cache.
    -----> Writing config/database.yml to read from DATABASE_URL
    -----> Preparing app for Rails asset pipeline
           Running: rake assets:precompile
           Asset precompilation completed (2.47s)
           Cleaning assets
           Running: rake assets:clean
    
    -----> Discovering process types
           Procfile declares types -> web
           Default process types for Ruby -> rake, console, web, worker
    -----> Releasing rails-sample ...
    -----> Deploying rails-sample ...
    -----> Checking status of PostgreSQL
           Found image postgresql/rails-sample database
           Checking status... ok.
    -----> Running pre-flight checks
           check-deploy: /home/dokku/rails-sample/CHECKS not found. attempting to retrieve it from container ...
           CHECKS file not found in container. skipping checks.
    -----> Running post-deploy
    -----> Creating non-ssl nginx.conf
    -----> Running nginx-pre-reload
           Reloading nginx
    -----> Shutting down old container in 60 seconds
    =====> Application deployed:
           http://rails-sample.domain.com
    
  6. And finally back to the server, created the database and run the rake migration

    dokku postgresql:create rails-sample docker run -i -t dokku/rails-sample /bin/bash export HOME=/app for file in /app/.profile.d/*; do source $file; done hash -r cd /app RAILS_ENV=production rake db:migrate

Now web I access to rails-sample.domain.com it just doesn't do anything. On Chrome I get ERR_CONNECTION_REFUSED error.

The domain resolves well to the server's IP address. There's even an A record with a wildcard pointed to the server.

Haven't seen this kind of error on Google. Even have a clue where to look what could be wrong. Dokku logs are almost empty. There're just the starting log part:

INFO -- : Refreshing Gem list
INFO -- : listening on addr=0.0.0.0:5000 fd=9
INFO -- : master process ready
INFO -- : worker=0 ready
INFO -- : worker=1 ready
INFO -- : worker=2 ready

So obviously there are never have been an access to the app.

docker ps output:

CONTAINER ID        IMAGE                            COMMAND                CREATED             STATUS              PORTS                     NAMES
ce2d9d46f769        dokku/rails-sample:latest        "/bin/bash -c '/star   About an hour ago   Up About an hour    0.0.0.0:49156->5000/tcp   dreamy_curie        
89a111191b6a        postgresql/rails-sample:latest   "/usr/bin/start_pgsq   About an hour ago   Up About an hour    0.0.0.0:49154->5432/tcp   focused_mayer   

Where can I have a look to see what's wrong with it? I have done the creating process about five times (on new droplets) and there's always the same error, but I can't figure out what is wrong. It's even more frustrating because the first time it worked all great.

Thanks.

UPDATE When I access to domain.com:49158 the app seems to work fine.

UPDATE II So domain configuration seems to be fine. It runs with the subdomain also but just if a specify the port after it. Seems like port 80 is refusing connections. But don't know how. nginx configuration files seems all ok (ips/ports/hostnames/etc)

0

There are 0 answers