Jillian Hoenig
Jillian Hoenig

Reputation: 247

Rails app successfully deployed to Dokku droplet but still not available

I'm trying to deploy a rails app to a digitalocean dokku droplet. I ran all the necessary command on the droplet, then successfully pushed from local. I even added a domain to see if that would help.

Visiting the domain shows a "This site can’t be reached" error, and visiting the IP shows:

Welcome to nginx! If you see this page, the nginx web server is successfully installed and working. Further configuration is required.

What am I missing?

Below are the commands ran on the droplet. The app is named "playlistbuilder" and the database is named that as well:

dokku apps:create playlistbuilder
dokku plugin:install https://github.com/dokku/dokku-postgres.git postgres
dokku postgres:create playlistbuilder
dokku postgres:link playlistbuilder playlistbuilder
dokku postgres:link playlistbuilder playlistbuilder
dokku domains:add playlistbuilder playlist.creator

Below is the output from running git push dokku master - I removed a handful of bundler output because it didn't seem relevant to my question. It seems successful..:

$ git push dokku master

Enumerating objects: 13, done.
Counting objects: 100% (13/13), done.
Delta compression using up to 8 threads
Compressing objects: 100% (7/7), done.
Writing objects: 100% (7/7), 777 bytes | 777.00 KiB/s, done.
Total 7 (delta 5), reused 0 (delta 0), pack-reused 0
remote: -----> Cleaning up...
remote: -----> Building playlistbuilder from herokuish
remote: -----> Adding BUILD_ENV to build environment...
remote:        BUILD_ENV added successfully
remote:        -----> Warning: Multiple default buildpacks reported the ability to handle this app. The first buildpack in the list below will be used.
remote:               Detected buildpacks: ruby nodejs
remote:        -----> Ruby app detected
remote: -----> Installing bundler 2.3.25
remote: -----> Removing BUNDLED WITH version in the Gemfile.lock
remote: -----> Compiling Ruby/Rails
remote: -----> Using Ruby version: ruby-3.1.2
remote:
remote:        ###### WARNING:
remote:
remote:        Removing `Gemfile.lock` because it was generated on Windows.
remote:        Bundler will do a full resolve so native gems are handled properly.
remote:        This may result in unexpected gem versions being used in your app.
remote:        In rare occasions Bundler may not be able to resolve your dependencies at all.
remote:
remote:        https://devcenter.heroku.com/articles/bundler-windows-gemfile
remote:
remote: -----> Installing dependencies using bundler 2.3.25
remote:        Running: BUNDLE_WITHOUT='development:test' BUNDLE_PATH=vendor/bundle BUNDLE_BIN=vendor/bundle/bin bundle install -j4
remote:        Fetching gem metadata from https://rubygems.org/...........
remote:        Resolving dependencies..........
remote:        Using rake 13.2.1
remote:        Using concurrent-ruby 1.3.4
...
remote:        Using aws-sdk-kms 1.95.0
remote:        Fetching aws-sdk-s3 1.170.0
remote:        Installing rails_12factor 0.0.3
remote:        Installing aws-sdk-s3 1.170.0
remote:        Bundle complete! 26 Gemfile dependencies, 92 gems now installed.
remote:        Gems in the groups 'development' and 'test' were not installed.
remote:        Bundled gems are installed into `./vendor/bundle`
remote:        Bundle completed (8.61s)
remote:        Cleaning up the bundler cache.
remote:        Removing aws-sdk-core (3.211.0)
remote:        Removing aws-sdk-s3 (1.169.0)
remote:        Removing timeout (0.4.1)
remote: -----> Installing node-v16.18.1-linux-x64
remote: -----> Detecting rake tasks
remote: -----> Preparing app for Rails asset pipeline
remote:        Running: rake assets:precompile
remote:        Asset precompilation completed (2.26s)
remote:        Cleaning assets
remote:        Running: rake assets:clean
remote: -----> Detecting rails configuration
remote:
remote:        ###### WARNING:
remote:
remote:        Removing `Gemfile.lock` because it was generated on Windows.
remote:        Bundler will do a full resolve so native gems are handled properly.
remote:        This may result in unexpected gem versions being used in your app.
remote:        In rare occasions Bundler may not be able to resolve your dependencies at all.
remote:
remote:        https://devcenter.heroku.com/articles/bundler-windows-gemfile
remote:
remote:        ###### WARNING:
remote:
remote:        There is a more recent Ruby version available for you to use:
remote:
remote:        3.1.6
remote:
remote:        The latest version will include security and bug fixes. We always recommend
remote:        running the latest version of your minor release.
remote:
remote:        Please upgrade your Ruby version.
remote:
remote:        For all available Ruby versions see:
remote:        https://devcenter.heroku.com/articles/ruby-support#supported-runtimes
remote:
remote:        ###### WARNING:
remote:
remote:        No Procfile detected, using the default web server.
remote:        We recommend explicitly declaring how to boot your server process via a Procfile.
remote:        https://devcenter.heroku.com/articles/ruby-default-web-server
remote:
remote:
remote:        -----> Discovering process types
remote:        Default types for  -> rake, console, web
remote: -----> Releasing playlistbuilder...
remote: -----> Checking for predeploy task
remote:        No predeploy task found, skipping
remote: -----> Checking for release task
remote:        No release task found, skipping
remote: =====> Processing deployment checks
remote:        No CHECKS file found. Simple container checks will be performed.
remote:        For more efficient zero downtime deployments, create a CHECKS file. See https://dokku.com/docs/deployment/zero-downtime-deploys/ for examples
remote: -----> Deploying playlistbuilder via the docker-local scheduler...
remote: -----> Deploying web (count=1)
remote:        Attempting pre-flight checks (web.1)
remote:        Waiting for 10 seconds (web.1)
remote:        Default container check successful (web.1)
remote:        Scheduling old container shutdown in 60 seconds (web.1)
remote: =====> Triggering early nginx proxy rebuild
remote: -----> Ensuring network configuration is in sync for playlistbuilder
remote: -----> Configuring playlist.creator...(using built-in template)
remote: -----> Configuring playlistbuilder.packer-6481b5fa-f32f-c6ab-b44d-a2621ac2dcee...(using built-in template)
remote: -----> Creating http nginx.conf
remote:        Reloading nginx
remote: -----> Running post-deploy
remote:  !     Detected IPv4 domain name with nginx proxy enabled.
remote:  !     Ensure the default nginx site is removed before continuing.
remote: -----> Ensuring network configuration is in sync for playlistbuilder
remote: -----> Configuring playlist.creator...(using built-in template)
remote: -----> Configuring playlistbuilder.packer-6481b5fa-f32f-c6ab-b44d-a2621ac2dcee...(using built-in template)
remote: -----> Creating http nginx.conf
remote:        Reloading nginx
remote: -----> Renaming containers
remote:        Found previous container(s) (2fbdab2249ce) named playlistbuilder.web.1
remote:        Renaming container (2fbdab2249ce) playlistbuilder.web.1 to playlistbuilder.web.1.1730987359
remote:        Renaming container playlistbuilder.web.1.upcoming-25604 (a33e595155ee) to playlistbuilder.web.1
remote: -----> Checking for postdeploy task
remote:        No postdeploy task found, skipping
remote: -----> Shutting down old containers in 60 seconds
remote: =====> Application deployed:
remote:        http://playlist.creator
remote:        http://playlistbuilder.packer-6481b5fa-f32f-c6ab-b44d-a2621ac2dcee
remote:
To 178.128.157.11:playlistbuilder
   a7e10a0..5045835  master -> master

Versions:
Ruby 3.1.2
Dokku 0.30.6
Ubuntu 22.04

Upvotes: 0

Views: 62

Answers (1)

Jillian Hoenig
Jillian Hoenig

Reputation: 247

Thanks you @dbugger for pointing me in the right direction. @Edmund's answer to this question was the solution to my issue:

https://stackoverflow.com/a/78882862/5161457

Remove the default site if it exists:

sudo rm /etc/nginx/sites-enabled/default

Test your Nginx configuration:

sudo nginx -t

If the test passes, reload Nginx:

sudo systemctl reload nginx

Then retry in 10 mins.

Upvotes: 1

Related Questions