Another "assets:precompile" error in rails app deployment

Hi there,

I’m new to deploying Rails apps in general, and after really struggling with AWS EB and skipping over Heroku, I’m giving Fly.io a try! It seems so much simpler than EB so far, thank goodness.

I’ve worked my way through a couple of errors, but I’m getting stuck at this one:

#24 3.005 rails aborted!
#24 3.005 Don't know how to build task 'assets:precompile' (See the list of available tasks with `rails --tasks`)
#24 3.005 /app/vendor/bundle/ruby/2.7.0/gems/rake-13.0.6/lib/rake/task_manager.rb:59:in `[]'
#24 3.005 /app/vendor/bundle/ruby/2.7.0/gems/rake-13.0.6/lib/rake/task.rb:66:in `lookup_prerequisite'
#24 3.005 /app/vendor/bundle/ruby/2.7.0/gems/rake-13.0.6/lib/rake/task.rb:62:in `block in prerequisite_tasks'
#24 3.005 /app/vendor/bundle/ruby/2.7.0/gems/rake-13.0.6/lib/rake/task.rb:62:in `map'
#24 3.005 /app/vendor/bundle/ruby/2.7.0/gems/rake-13.0.6/lib/rake/task.rb:62:in `prerequisite_tasks'
#24 3.005 /app/vendor/bundle/ruby/2.7.0/gems/rake-13.0.6/lib/rake/task.rb:241:in `invoke_prerequisites'
#24 3.005 /app/vendor/bundle/ruby/2.7.0/gems/rake-13.0.6/lib/rake/task.rb:218:in `block in invoke_with_call_chain'
#24 3.005 /app/vendor/bundle/ruby/2.7.0/gems/rake-13.0.6/lib/rake/task.rb:199:in `synchronize'
#24 3.005 /app/vendor/bundle/ruby/2.7.0/gems/rake-13.0.6/lib/rake/task.rb:199:in `invoke_with_call_chain'
#24 3.005 /app/vendor/bundle/ruby/2.7.0/gems/rake-13.0.6/lib/rake/task.rb:188:in `invoke'
#24 3.005 /app/vendor/bundle/ruby/2.7.0/gems/rake-13.0.6/lib/rake/application.rb:160:in `invoke_task'
#24 3.005 /app/vendor/bundle/ruby/2.7.0/gems/rake-13.0.6/lib/rake/application.rb:116:in `block (2 levels) in top_level'
#24 3.005 /app/vendor/bundle/ruby/2.7.0/gems/rake-13.0.6/lib/rake/application.rb:116:in `each'
#24 3.005 /app/vendor/bundle/ruby/2.7.0/gems/rake-13.0.6/lib/rake/application.rb:116:in `block in top_level'
#24 3.005 /app/vendor/bundle/ruby/2.7.0/gems/rake-13.0.6/lib/rake/application.rb:125:in `run_with_threads'
#24 3.005 /app/vendor/bundle/ruby/2.7.0/gems/rake-13.0.6/lib/rake/application.rb:110:in `top_level'
#24 3.005 /app/vendor/bundle/ruby/2.7.0/gems/railties-7.0.4/lib/rails/commands/rake/rake_command.rb:24:in `block (2 levels) in perform'
#24 3.005 /app/vendor/bundle/ruby/2.7.0/gems/rake-13.0.6/lib/rake/application.rb:186:in `standard_exception_handling'
#24 3.005 /app/vendor/bundle/ruby/2.7.0/gems/railties-7.0.4/lib/rails/commands/rake/rake_command.rb:24:in `block in perform'
#24 3.005 /app/vendor/bundle/ruby/2.7.0/gems/rake-13.0.6/lib/rake/rake_module.rb:59:in `with_application'
#24 3.005 /app/vendor/bundle/ruby/2.7.0/gems/railties-7.0.4/lib/rails/commands/rake/rake_command.rb:18:in `perform'
#24 3.005 /app/vendor/bundle/ruby/2.7.0/gems/railties-7.0.4/lib/rails/command.rb:51:in `invoke'
#24 3.005 /app/vendor/bundle/ruby/2.7.0/gems/railties-7.0.4/lib/rails/commands.rb:18:in `<main>'
#24 3.005 /app/vendor/bundle/ruby/2.7.0/gems/bootsnap-1.15.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:32:in `require'
#24 3.005 /app/vendor/bundle/ruby/2.7.0/gems/bootsnap-1.15.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:32:in `require'
#24 3.005 Tasks: TOP => fly:build
#24 3.005 (See full trace by running task with --trace)
------
Error failed to fetch an image or build from source: error building: executor failed running [/bin/bash -o pipefail -c ${BUILD_COMMAND}]: exit code: 1

  • I’ve looked through all of the rest of the similar “assets:precompile” errors in this forum and I don’t any of those threads are particularly relevant. I’m using Rails 7, NodeJS, React for my front end.
  • I’m not building an API so I think it would be helpful to precompile.
  • I got the starter Rails app to deploy correctly, so I don’t think it’s some overall problem with my computer.
  • I just started trying to deploy today, and I haven’t reconfigured my Dockerfile, so it should be the same as the current automatic build, although I am using Node 16.17.1, Bundler 2.3.26, Yarn latest, Ruby 2.7.7
  • I also tried giving it more memory, up to the Dedicated-CPU 2GB - no help

Really appreciate any tips or advice, thanks for the help!

can you show the Dockerfile?

And your fly.toml, please :pray:

Can you verify:

  • Do you have an app/assets directory?
  • Is sprockets_rails in your Gemfile
  • Can you run rails console on your development machine and print out the value of Rails.application.config.api_only ?

assets:precompile is defined not by fly.io but by rails/sprockets-rails.

1 Like

Ah well I guess the biggest issue here is that I don’t really know anything about the asset pipeline!

I checked the value of Rails.application.config.api_only and it returned true - I think whatever template I started from set it up that way.

In that case, I don’t have an app/assets directory, and I don’t have sprockets_rails in my Gemfile, which explains why it doesn’t recognize the task!

All of my JavaScript/HTML/CSS is contained in a “client” folder inside the main directory.

Before I try to reconfigure all of this with an assets directory, would it be easier to change the task :build => 'assets:precompile' line in the fly.rake file to something else? I’ve figured out that this might result in a slower site, but I’m not sure that my site is big enough to make a noticeable difference.

FWIW, here’s the Dockerfile:

# syntax = docker/dockerfile:experimental

# Dockerfile used to build a deployable image for a Rails application.
# Adjust as required.
#
# Common adjustments you may need to make over time:
#  * Modify version numbers for Ruby, Bundler, and other products.
#  * Add library packages needed at build time for your gems, node modules.
#  * Add deployment packages needed by your application
#  * Add (often fake) secrets needed to compile your assets

#######################################################################

# Learn more about the chosen Ruby stack, Fullstaq Ruby, here:
#   https://github.com/evilmartians/fullstaq-ruby-docker.
#
# We recommend using the highest patch level for better security and
# performance.

ARG RUBY_VERSION=2.7.7
ARG VARIANT=jemalloc-slim
FROM quay.io/evl.ms/fullstaq-ruby:${RUBY_VERSION}-${VARIANT} as base

LABEL fly_launch_runtime="rails"

ARG NODE_VERSION=16.17.1
ARG YARN_VERSION=latest
ARG BUNDLER_VERSION=2.3.26

ARG RAILS_ENV=production
ENV RAILS_ENV=${RAILS_ENV}

ENV RAILS_SERVE_STATIC_FILES true
ENV RAILS_LOG_TO_STDOUT true

ARG BUNDLE_WITHOUT=development:test
ARG BUNDLE_PATH=vendor/bundle
ENV BUNDLE_PATH ${BUNDLE_PATH}
ENV BUNDLE_WITHOUT ${BUNDLE_WITHOUT}

RUN mkdir /app
WORKDIR /app
RUN mkdir -p tmp/pids

RUN curl https://get.volta.sh | bash
ENV VOLTA_HOME /root/.volta
ENV PATH $VOLTA_HOME/bin:/usr/local/bin:$PATH
RUN volta install node@${NODE_VERSION} yarn@${YARN_VERSION} && \
    gem update --system --no-document && \
    gem install -N bundler -v ${BUNDLER_VERSION}

#######################################################################

# install packages only needed at build time

FROM base as build_deps

ARG BUILD_PACKAGES="git build-essential libpq-dev wget vim curl gzip xz-utils libsqlite3-dev"
ENV BUILD_PACKAGES ${BUILD_PACKAGES}

RUN --mount=type=cache,id=dev-apt-cache,sharing=locked,target=/var/cache/apt \
    --mount=type=cache,id=dev-apt-lib,sharing=locked,target=/var/lib/apt \
    apt-get update -qq && \
    apt-get install --no-install-recommends -y ${BUILD_PACKAGES} \
    && rm -rf /var/lib/apt/lists /var/cache/apt/archives

#######################################################################

# install gems

FROM build_deps as gems

COPY Gemfile* ./
RUN bundle install && rm -rf vendor/bundle/ruby/*/cache

#######################################################################

# install node modules

FROM build_deps as node_modules

COPY package*json ./
RUN npm install

#######################################################################

# install deployment packages

FROM base

ARG DEPLOY_PACKAGES="postgresql-client file vim curl gzip libsqlite3-0"
ENV DEPLOY_PACKAGES=${DEPLOY_PACKAGES}

RUN --mount=type=cache,id=prod-apt-cache,sharing=locked,target=/var/cache/apt \
    --mount=type=cache,id=prod-apt-lib,sharing=locked,target=/var/lib/apt \
    apt-get update -qq && \
    apt-get install --no-install-recommends -y \
    ${DEPLOY_PACKAGES} \
    && rm -rf /var/lib/apt/lists /var/cache/apt/archives

# copy installed gems
COPY --from=gems /app /app
COPY --from=gems /usr/lib/fullstaq-ruby/versions /usr/lib/fullstaq-ruby/versions
COPY --from=gems /usr/local/bundle /usr/local/bundle

# copy installed node modules
COPY --from=node_modules /app/node_modules /app/node_modules

#######################################################################

# Deploy your application
COPY . .

# Adjust binstubs to run on Linux and set current working directory
RUN chmod +x /app/bin/* && \
    sed -i 's/ruby.exe\r*/ruby/' /app/bin/* && \
    sed -i 's/ruby\r*/ruby/' /app/bin/* && \
    sed -i '/^#!/aDir.chdir File.expand_path("..", __dir__)' /app/bin/*

# The following enable assets to precompile on the build server.  Adjust
# as necessary.  If no combination works for you, see:
# https://fly.io/docs/rails/getting-started/existing/#access-to-environment-variables-at-build-time
ENV SECRET_KEY_BASE 1
# ENV AWS_ACCESS_KEY_ID=1
# ENV AWS_SECRET_ACCESS_KEY=1

# Run build task defined in lib/tasks/fly.rake
ARG BUILD_COMMAND="bin/rails fly:build"
RUN ${BUILD_COMMAND}

# Default server start instructions.  Generally Overridden by fly.toml.
ENV PORT 8080
ARG SERVER_COMMAND="bin/rails fly:server"
ENV SERVER_COMMAND ${SERVER_COMMAND}
CMD ${SERVER_COMMAND}

and the fly.toml:

# fly.toml file generated for fs-test on 2023-01-01T20:53:59-08:00

app = "fs-test"
kill_signal = "SIGINT"
kill_timeout = 5
processes = []

[build]
  [build.args]
    BUILD_COMMAND = "bin/rails fly:build"
    SERVER_COMMAND = "bin/rails fly:server"

[deploy]
  release_command = "bin/rails fly:release"

[env]
  PORT = "8080"

[experimental]
  allowed_public_ports = []
  auto_rollback = true

[[services]]
  http_checks = []
  internal_port = 8080
  processes = ["app"]
  protocol = "tcp"
  script_checks = []
  [services.concurrency]
    hard_limit = 25
    soft_limit = 20
    type = "connections"

  [[services.ports]]
    force_https = true
    handlers = ["http"]
    port = 80

  [[services.ports]]
    handlers = ["tls", "http"]
    port = 443

  [[services.tcp_checks]]
    grace_period = "1s"
    interval = "15s"
    restart_limit = 0
    timeout = "2s"

[[statics]]
  guest_path = "/app/public"
  url_prefix = "/"

Yes. Just change it to:

task :build

In other words, remove the dependency on assets:precompile.

Don’t worry about speed of assets - you don’t have any to optimize.

2 Likes

thanks for the speedy replies! not just to this thread but all the other threads I read through :relieved:

Great, so I got through the migrations and apparently I successfully deployed, but I’m running into another issue:

When I run fly open I get “this page can’t be found” - looking through the fly logs, I get an ActionController::RoutingError No route matches [GET] "/" .

I haven’t needed to define a root route to get my app to run locally… I can just run rails s to start the server and npm start --prefix client to get my front end going from my “client” directory.

I’m using React Router to route inside my main App.js, and I have a <Route path="/" element={<Homepage />} /> which shows when I navigate to http://localhost:4000/ where everything is running.

Do I need to make a new Controller with an index route defined, and add that route to routes.rb ?

First, try explicitly adding /index.html to your website to see if it comes up.

There is a chance that adding the following to the Dockerfile, perhaps immediately after the ENV PORT 8080 line, will solve your problem:

ENV RAILS_SERVE_STATIC_FILES="true"

What is going on is that you are using webpacker (or, less likely, rollup or esbuild) to bundle your js, and the [[statics]] section in your fly.toml will handle most of these files with one notable exception: index.html. See App Configuration (fly.toml) · Fly Docs for details.

Okay, I’ve tried

  • adding /index.html
  • adding that ENV line to my Dockerfile after the PORT 8080 line (and also checking to see if adding /index.html works)
    and neither of those worked

I read over the App Configuration link you sent - because my index.html is inside a “client” folder inside my home directory, I changed the guest_path to “/app/client/public”. Now when I go to (website)/index.html and inspect the page, it is displaying my index.html, but none of the React stuff is displayed.

Feels like I’m getting very close!

Posting some logs because it feels like I’m missing something:

2023-01-02T21:51:37Z runner[78472395] sea [info]Starting instance
2023-01-02T21:51:38Z runner[78472395] sea [info]Configuring virtual machine
2023-01-02T21:51:38Z runner[78472395] sea [info]Pulling container image
2023-01-02T21:51:38Z runner[78472395] sea [info]Unpacking image
2023-01-02T21:51:38Z runner[78472395] sea [info]Preparing kernel init
2023-01-02T21:51:38Z runner[78472395] sea [info]Configuring firecracker
2023-01-02T21:51:38Z runner[78472395] sea [info]Starting virtual machine
2023-01-02T21:51:39Z app[78472395] sea [info]Starting init (commit: f447594)...
2023-01-02T21:51:39Z app[78472395] sea [info]Setting up swapspace version 1, size = 512 MiB (536866816 bytes)
2023-01-02T21:51:39Z app[78472395] sea [info]no label, UUID=9ecaced7-f586-4071-9027-92868e87920a
2023-01-02T21:51:39Z app[78472395] sea [info]Preparing to run: `bin/rails fly:release` as root
2023-01-02T21:51:39Z app[78472395] sea [info]2023/01/02 21:51:39 listening on [fdaa:1:17cd:a7b:bcab:7847:2395:2]:22 (DNS: [fdaa::3]:53)
2023-01-02T21:51:42Z app[78472395] sea [info]Starting clean up.
2023-01-02T21:51:45Z runner[a34f97c5] sea [info]Starting instance
2023-01-02T21:51:46Z runner[a34f97c5] sea [info]Configuring virtual machine
2023-01-02T21:51:46Z runner[a34f97c5] sea [info]Pulling container image
2023-01-02T21:51:46Z runner[a34f97c5] sea [info]Unpacking image
2023-01-02T21:51:46Z runner[a34f97c5] sea [info]Preparing kernel init
2023-01-02T21:51:47Z runner[a34f97c5] sea [info]Configuring firecracker
2023-01-02T21:51:47Z runner[a34f97c5] sea [info]Starting virtual machine
2023-01-02T21:51:47Z app[a34f97c5] sea [info]Starting init (commit: f447594)...
2023-01-02T21:51:47Z app[a34f97c5] sea [info]Preparing to run: `/bin/bash -o pipefail -c ${SERVER_COMMAND}` as root
2023-01-02T21:51:47Z app[a34f97c5] sea [info]2023/01/02 21:51:47 listening on [fdaa:1:17cd:a7b:bcab:a34f:97c5:2]:22 (DNS: [fdaa::3]:53)
2023-01-02T21:51:49Z app[a34f97c5] sea [info]fallocate -l 512M /swapfile
2023-01-02T21:51:49Z app[a34f97c5] sea [info]chmod 0600 /swapfile
2023-01-02T21:51:49Z app[a34f97c5] sea [info]mkswap /swapfile
2023-01-02T21:51:49Z app[a34f97c5] sea [info]Setting up swapspace version 1, size = 512 MiB (536866816 bytes)
2023-01-02T21:51:49Z app[a34f97c5] sea [info]no label, UUID=43950586-3e28-46d2-a0e9-99cdb1ceb8cb
2023-01-02T21:51:49Z app[a34f97c5] sea [info]echo 10 > /proc/sys/vm/swappiness
2023-01-02T21:51:49Z app[a34f97c5] sea [info]swapon /swapfile
2023-01-02T21:51:49Z app[a34f97c5] sea [info]bin/rails server
2023-01-02T21:51:49Z app[a34f97c5] sea [info]=> Booting Puma
2023-01-02T21:51:49Z app[a34f97c5] sea [info]=> Rails 7.0.4 application starting in production
2023-01-02T21:51:49Z app[a34f97c5] sea [info]=> Run `bin/rails server --help` for more startup options
2023-01-02T21:51:51Z app[a34f97c5] sea [info]Puma starting in single mode...
2023-01-02T21:51:51Z app[a34f97c5] sea [info]* Puma version: 5.6.5 (ruby 2.7.7-p221) ("Birdie's Version")
2023-01-02T21:51:51Z app[a34f97c5] sea [info]*  Min threads: 5
2023-01-02T21:51:51Z app[a34f97c5] sea [info]*  Max threads: 5
2023-01-02T21:51:51Z app[a34f97c5] sea [info]*  Environment: production
2023-01-02T21:51:51Z app[a34f97c5] sea [info]*          PID: 532
2023-01-02T21:51:51Z app[a34f97c5] sea [info]* Listening on http://0.0.0.0:8080
2023-01-02T21:51:51Z app[a34f97c5] sea [info]Use Ctrl-C to stop
2023-01-02T21:52:21Z runner[9d87b65f] sea [info]Shutting down virtual machine
2023-01-02T21:52:21Z app[9d87b65f] sea [info]Sending signal SIGINT to main child process w/ PID 521
2023-01-02T21:52:21Z app[9d87b65f] sea [info]rails aborted!
2023-01-02T21:52:21Z app[9d87b65f] sea [info]Interrupt:
2023-01-02T21:52:21Z app[9d87b65f] sea [info]/app/vendor/bundle/ruby/2.7.0/gems/rake-13.0.6/lib/rake/file_utils.rb:54:in `system'
2023-01-02T21:52:21Z app[9d87b65f] sea [info]/app/vendor/bundle/ruby/2.7.0/gems/rake-13.0.6/lib/rake/file_utils.rb:54:in `sh'
2023-01-02T21:52:21Z app[9d87b65f] sea [info]/app/lib/tasks/fly.rake:21:in `block (2 levels) in <main>'
2023-01-02T21:52:21Z app[9d87b65f] sea [info]/app/vendor/bundle/ruby/2.7.0/gems/rake-13.0.6/lib/rake/task.rb:281:in `block in execute'
2023-01-02T21:52:21Z app[9d87b65f] sea [info]/app/vendor/bundle/ruby/2.7.0/gems/rake-13.0.6/lib/rake/task.rb:281:in `each'
2023-01-02T21:52:21Z app[9d87b65f] sea [info]/app/vendor/bundle/ruby/2.7.0/gems/rake-13.0.6/lib/rake/task.rb:281:in `execute'
2023-01-02T21:52:21Z app[9d87b65f] sea [info]/app/vendor/bundle/ruby/2.7.0/gems/rake-13.0.6/lib/rake/task.rb:219:in `block in invoke_with_call_chain'
2023-01-02T21:52:21Z app[9d87b65f] sea [info]/app/vendor/bundle/ruby/2.7.0/gems/rake-13.0.6/lib/rake/task.rb:199:in `synchronize'
2023-01-02T21:52:21Z app[9d87b65f] sea [info]/app/vendor/bundle/ruby/2.7.0/gems/rake-13.0.6/lib/rake/task.rb:199:in `invoke_with_call_chain'
2023-01-02T21:52:21Z app[9d87b65f] sea [info]/app/vendor/bundle/ruby/2.7.0/gems/rake-13.0.6/lib/rake/task.rb:188:in `invoke'
2023-01-02T21:52:21Z app[9d87b65f] sea [info]/app/vendor/bundle/ruby/2.7.0/gems/rake-13.0.6/lib/rake/application.rb:160:in `invoke_task'
2023-01-02T21:52:21Z app[9d87b65f] sea [info]/app/vendor/bundle/ruby/2.7.0/gems/rake-13.0.6/lib/rake/application.rb:116:in `block (2 levels) in top_level'
2023-01-02T21:52:21Z app[9d87b65f] sea [info]/app/vendor/bundle/ruby/2.7.0/gems/rake-13.0.6/lib/rake/application.rb:116:in `each'
2023-01-02T21:52:21Z app[9d87b65f] sea [info]/app/vendor/bundle/ruby/2.7.0/gems/rake-13.0.6/lib/rake/application.rb:116:in `block in top_level'
2023-01-02T21:52:21Z app[9d87b65f] sea [info]/app/vendor/bundle/ruby/2.7.0/gems/rake-13.0.6/lib/rake/application.rb:125:in `run_with_threads'
2023-01-02T21:52:21Z app[9d87b65f] sea [info]/app/vendor/bundle/ruby/2.7.0/gems/rake-13.0.6/lib/rake/application.rb:110:in `top_level'
2023-01-02T21:52:21Z app[9d87b65f] sea [info]/app/vendor/bundle/ruby/2.7.0/gems/railties-7.0.4/lib/rails/commands/rake/rake_command.rb:24:in `block (2 levels) in perform'
2023-01-02T21:52:21Z app[9d87b65f] sea [info]/app/vendor/bundle/ruby/2.7.0/gems/rake-13.0.6/lib/rake/application.rb:186:in `standard_exception_handling'
2023-01-02T21:52:21Z app[9d87b65f] sea [info]/app/vendor/bundle/ruby/2.7.0/gems/railties-7.0.4/lib/rails/commands/rake/rake_command.rb:24:in `block in perform'
2023-01-02T21:52:21Z app[9d87b65f] sea [info]/app/vendor/bundle/ruby/2.7.0/gems/rake-13.0.6/lib/rake/rake_module.rb:59:in `with_application'
2023-01-02T21:52:21Z app[9d87b65f] sea [info]/app/vendor/bundle/ruby/2.7.0/gems/railties-7.0.4/lib/rails/commands/rake/rake_command.rb:18:in `perform'
2023-01-02T21:52:21Z app[9d87b65f] sea [info]/app/vendor/bundle/ruby/2.7.0/gems/railties-7.0.4/lib/rails/command.rb:51:in `invoke'
2023-01-02T21:52:21Z app[9d87b65f] sea [info]/app/vendor/bundle/ruby/2.7.0/gems/railties-7.0.4/lib/rails/commands.rb:18:in `<main>'
2023-01-02T21:52:21Z app[9d87b65f] sea [info]/app/vendor/bundle/ruby/2.7.0/gems/bootsnap-1.15.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:32:in `require'
2023-01-02T21:52:21Z app[9d87b65f] sea [info]/app/vendor/bundle/ruby/2.7.0/gems/bootsnap-1.15.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:32:in `require'
2023-01-02T21:52:21Z app[9d87b65f] sea [info]Tasks: TOP => fly:server
2023-01-02T21:52:21Z app[9d87b65f] sea [info](See full trace by running task with --trace)
2023-01-02T21:52:21Z app[9d87b65f] sea [info]Starting clean up.

You are definitely close.

The logs look fine. They show app[a34f97c5] starting cleanly after which point app[9d87b65f] (the previous vm) is shut down.

Now let’s try to match your development environment more closely. First find the bundle install line in your Dockerfile and change it to bundle install && gem install foreman. Apparently it is not a good idea to bundle foreman, so let’s not do that.

RUN bundle install && gem install foreman && rm -rf vendor/bundle/ruby/*/cache

You already are using foreman on your development machine - that’s what bin/dev runs, and you have a Procfile.dev. Now let’s create a Procfile.fly and put the following into it:

api: bin/rails fly:server
client: npm start --prefix client

Now in your Dockerfile, change:

ENV PORT 8080
ARG SERVER_COMMAND="bin/rails fly:server"

To:

ARG SERVER_COMMAND="foreman start -f Procfile.fly

In other words, delete the setting of PORT, and replace the running of the rails server with invoking foreman.

One final change, go into fly.toml. You will see two occurrences of the number 8080. Change both to 4000.

Hmm okay I made all of those changes and I can’t really tell if anything changed. The Procfile.fly I created should just be in the home directory where all of the other files and folders for this app live, right?

I’m still getting a No route matches [GET] "/" error whenever I try to navigate either to the main page or (page)/index.html .

some more logs - I tried to go to (page)/index.html around 00:09

023-01-02T23:59:31Z runner[aca78733] sea [info]Starting instance
2023-01-02T23:59:32Z runner[aca78733] sea [info]Configuring virtual machine
2023-01-02T23:59:32Z runner[aca78733] sea [info]Pulling container image
2023-01-02T23:59:35Z runner[aca78733] sea [info]Unpacking image
2023-01-02T23:59:48Z runner[aca78733] sea [info]Preparing kernel init
2023-01-02T23:59:49Z runner[aca78733] sea [info]Configuring firecracker
2023-01-02T23:59:49Z runner[aca78733] sea [info]Starting virtual machine
2023-01-02T23:59:49Z app[aca78733] sea [info]Starting init (commit: f447594)...
2023-01-02T23:59:49Z app[aca78733] sea [info]Setting up swapspace version 1, size = 512 MiB (536866816 bytes)
2023-01-02T23:59:49Z app[aca78733] sea [info]no label, UUID=d0148ef0-4f3e-44b3-9aff-88ab63fb3161
2023-01-02T23:59:49Z app[aca78733] sea [info]Preparing to run: `bin/rails fly:release` as root
2023-01-02T23:59:49Z app[aca78733] sea [info]2023/01/02 23:59:49 listening on [fdaa:1:17cd:a7b:bcab:aca7:8733:2]:22 (DNS: [fdaa::3]:53)
2023-01-02T23:59:52Z app[aca78733] sea [info]Starting clean up.
2023-01-03T00:00:02Z runner[70ab90e9] sea [info]Starting instance
2023-01-03T00:00:02Z runner[70ab90e9] sea [info]Configuring virtual machine
2023-01-03T00:00:02Z runner[70ab90e9] sea [info]Pulling container image
2023-01-03T00:00:03Z runner[70ab90e9] sea [info]Unpacking image
2023-01-03T00:00:03Z runner[70ab90e9] sea [info]Preparing kernel init
2023-01-03T00:00:03Z runner[70ab90e9] sea [info]Configuring firecracker
2023-01-03T00:00:03Z runner[70ab90e9] sea [info]Starting virtual machine
2023-01-03T00:00:04Z app[70ab90e9] sea [info]Starting init (commit: f447594)...
2023-01-03T00:00:04Z app[70ab90e9] sea [info]Preparing to run: `/bin/bash -o pipefail -c ${SERVER_COMMAND}` as root
2023-01-03T00:00:04Z app[70ab90e9] sea [info]2023/01/03 00:00:04 listening on [fdaa:1:17cd:a7b:bcab:70ab:90e9:2]:22 (DNS: [fdaa::3]:53)
2023-01-03T00:00:05Z app[70ab90e9] sea [info]fallocate -l 512M /swapfile
2023-01-03T00:00:05Z app[70ab90e9] sea [info]chmod 0600 /swapfile
2023-01-03T00:00:05Z app[70ab90e9] sea [info]mkswap /swapfile
2023-01-03T00:00:05Z app[70ab90e9] sea [info]Setting up swapspace version 1, size = 512 MiB (536866816 bytes)
2023-01-03T00:00:05Z app[70ab90e9] sea [info]no label, UUID=71116e72-e0c4-4e81-af7f-7b97b7df9c20
2023-01-03T00:00:05Z app[70ab90e9] sea [info]echo 10 > /proc/sys/vm/swappiness
2023-01-03T00:00:05Z app[70ab90e9] sea [info]swapon /swapfile
2023-01-03T00:00:05Z app[70ab90e9] sea [info]bin/rails server
2023-01-03T00:00:06Z app[70ab90e9] sea [info]=> Booting Puma
2023-01-03T00:00:06Z app[70ab90e9] sea [info]=> Rails 7.0.4 application starting in production
2023-01-03T00:00:06Z app[70ab90e9] sea [info]=> Run `bin/rails server --help` for more startup options
2023-01-03T00:00:07Z app[70ab90e9] sea [info]Puma starting in single mode...
2023-01-03T00:00:07Z app[70ab90e9] sea [info]* Puma version: 5.6.5 (ruby 2.7.7-p221) ("Birdie's Version")
2023-01-03T00:00:07Z app[70ab90e9] sea [info]*  Min threads: 5
2023-01-03T00:00:07Z app[70ab90e9] sea [info]*  Max threads: 5
2023-01-03T00:00:07Z app[70ab90e9] sea [info]*          PID: 532
uction
2023-01-03T00:00:07Z app[70ab90e9] sea [info]*          PID: 532
2023-01-03T00:00:07Z app[70ab90e9] sea [info]* Listening on http://0.0.0.0:4000
2023-01-03T00:00:07Z app[70ab90e9] sea [info]Use Ctrl-C to stop
2023-01-03T00:00:46Z runner[f157795f] sea [info]Shutting down virtual machine
2023-01-03T00:00:48Z app[f157795f] sea [info]Sending signal SIGINT to main child process w/ PID 521
2023-01-03T00:00:48Z app[f157795f] sea [info]rails aborted!
2023-01-03T00:00:48Z app[f157795f] sea [info]Interrupt:
2023-01-03T00:00:48Z app[f157795f] sea [info]/app/vendor/bundle/ruby/2.7.0/gems/rake-13.0.6/lib/rake/file_utils.rb:54:in `system'
2023-01-03T00:00:48Z app[f157795f] sea [info]/app/vendor/bundle/ruby/2.7.0/gems/rake-13.0.6/lib/rake/file_utils.rb:54:in `sh'
2023-01-03T00:00:48Z app[f157795f] sea [info]/app/lib/tasks/fly.rake:21:in `block (2 levels) in <main>'
2023-01-03T00:00:48Z app[f157795f] sea [info]/app/vendor/bundle/ruby/2.7.0/gems/rake-13.0.6/lib/rake/task.rb:281:in `block in execute'
2023-01-03T00:00:48Z app[f157795f] sea [info]/app/vendor/bundle/ruby/2.7.0/gems/rake-13.0.6/lib/rake/task.rb:281:in `each'
2023-01-03T00:00:48Z app[f157795f] sea [info]/app/vendor/bundle/ruby/2.7.0/gems/rake-13.0.6/lib/rake/task.rb:281:in `execute'
2023-01-03T00:00:48Z app[f157795f] sea [info]/app/vendor/bundle/ruby/2.7.0/gems/rake-13.0.6/lib/rake/task.rb:219:in `block in invoke_with_call_chain'
2023-01-03T00:00:48Z app[f157795f] sea [info]/app/vendor/bundle/ruby/2.7.0/gems/rake-13.0.6/lib/rake/task.rb:199:in `synchronize'
2023-01-03T00:00:48Z app[f157795f] sea [info]/app/vendor/bundle/ruby/2.7.0/gems/rake-13.0.6/lib/rake/task.rb:199:in `invoke_with_call_chain'
2023-01-03T00:00:48Z app[f157795f] sea [info]/app/vendor/bundle/ruby/2.7.0/gems/rake-13.0.6/lib/rake/task.rb:188:in `invoke'
2023-01-03T00:00:48Z app[f157795f] sea [info]/app/vendor/bundle/ruby/2.7.0/gems/rake-13.0.6/lib/rake/application.rb:160:in `invoke_task'
2023-01-03T00:00:48Z app[f157795f] sea [info]/app/vendor/bundle/ruby/2.7.0/gems/rake-13.0.6/lib/rake/application.rb:116:in `block (2 levels) in top_level'
2023-01-03T00:00:48Z app[f157795f] sea [info]/app/vendor/bundle/ruby/2.7.0/gems/rake-13.0.6/lib/rake/application.rb:116:in `each'
2023-01-03T00:00:48Z app[f157795f] sea [info]/app/vendor/bundle/ruby/2.7.0/gems/rake-13.0.6/lib/rake/application.rb:116:in `block in top_level'
2023-01-03T00:00:48Z app[f157795f] sea [info]/app/vendor/bundle/ruby/2.7.0/gems/rake-13.0.6/lib/rake/application.rb:125:in `run_with_threads'
2023-01-03T00:00:48Z app[f157795f] sea [info]/app/vendor/bundle/ruby/2.7.0/gems/rake-13.0.6/lib/rake/application.rb:110:in `top_level'
2023-01-03T00:00:48Z app[f157795f] sea [info]/app/vendor/bundle/ruby/2.7.0/gems/railties-7.0.4/lib/rails/commands/rake/rake_command.rb:24:in `block (2 levels) in perform'
2023-01-03T00:00:48Z app[f157795f] sea [info]/app/vendor/bundle/ruby/2.7.0/gems/rake-13.0.6/lib/rake/application.rb:186:in `standard_exception_handling'
2023-01-03T00:00:48Z app[f157795f] sea [info]/app/vendor/bundle/ruby/2.7.0/gems/railties-7.0.4/lib/rails/commands/rake/rake_command.rb:24:in `block in perform'
2023-01-03T00:00:48Z app[f157795f] sea [info]/app/vendor/bundle/ruby/2.7.0/gems/rake-13.0.6/lib/rake/rake_module.rb:59:in `with_application'
2023-01-03T00:00:48Z app[f157795f] sea [info]/app/vendor/bundle/ruby/2.7.0/gems/railties-7.0.4/lib/rails/commands/rake/rake_command.rb:18:in `perform'
2023-01-03T00:00:48Z app[f157795f] sea [info]/app/vendor/bundle/ruby/2.7.0/gems/railties-7.0.4/lib/rails/command.rb:51:in `invoke'
2023-01-03T00:00:48Z app[f157795f] sea [info]/app/vendor/bundle/ruby/2.7.0/gems/railties-7.0.4/lib/rails/commands.rb:18:in `<main>'
2023-01-03T00:00:48Z app[f157795f] sea [info]/app/vendor/bundle/ruby/2.7.0/gems/bootsnap-1.15.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:32:in `require'
2023-01-03T00:00:48Z app[f157795f] sea [info]/app/vendor/bundle/ruby/2.7.0/gems/bootsnap-1.15.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:32:in `require'
2023-01-03T00:00:48Z app[f157795f] sea [info]Tasks: TOP => fly:server
2023-01-03T00:00:48Z app[f157795f] sea [info](See full trace by running task with --trace)
2023-01-03T00:00:49Z app[f157795f] sea [info]Starting clean up.
2023-01-03T00:09:15Z app[70ab90e9] sea [info]I, [2023-01-03T00:09:15.551463 #532]  INFO -- : [7c2b812c-06cd-488a-ad4b-9941ead44214] Started GET "/" for 66.241.125.224 at 2023-01-03 00:09:15 +0000
2023-01-03T00:09:15Z app[70ab90e9] sea [info]F, [2023-01-03T00:09:15.552054 #532] FATAL -- : [7c2b812c-06cd-488a-ad4b-9941ead44214]
2023-01-03T00:09:15Z app[70ab90e9] sea [info][7c2b812c-06cd-488a-ad4b-9941ead44214] ActionController::RoutingError (No route matches [GET] "/"):
2023-01-03T00:09:15Z app[70ab90e9] sea [info][7c2b812c-06cd-488a-ad4b-9941ead44214]

here’s my repo on GitHub if that helps for some reason

thanks again for all of the help so far!

That’s because I missed a change. Looking at the logs, Procfile.fly is not being run, you are continuing to run only your rails server. Try this: run the procfile, not just the Rails server by rubys · Pull Request #7 · mason-lynass/FS-final-project · GitHub

Well that’s a new one, I got to the health checks and then it failed after two restarts:

Failed Instances

Failure #1

Instance
ID              PROCESS VERSION REGION  DESIRED STATUS  HEALTH CHECKS   RESTARTS        CREATED 
078fe4dc        app     11      sea     stop    failed  1 total         2               32s ago

Recent Events
TIMESTAMP               TYPE            MESSAGE                                                         
2023-01-03T00:35:43Z    Received        Task received by client                                        
2023-01-03T00:35:43Z    Task Setup      Building Task Directory                                        
2023-01-03T00:36:02Z    Started         Task started by client                                         
2023-01-03T00:36:06Z    Terminated      Exit Code: 126                                                 
2023-01-03T00:36:06Z    Restarting      Task restarting in 1.087864147s                                
2023-01-03T00:36:13Z    Started         Task started by client                                         
2023-01-03T00:36:17Z    Terminated      Exit Code: 126                                                 
2023-01-03T00:36:17Z    Restarting      Task restarting in 1.145869034s                                
2023-01-03T00:36:23Z    Started         Task started by client                                         
2023-01-03T00:36:27Z    Terminated      Exit Code: 126                                                 
2023-01-03T00:36:27Z    Not Restarting  Exceeded allowed attempts 2 in interval 5m0s and mode is "fail"
2023-01-03T00:36:27Z    Alloc Unhealthy Unhealthy because of failed task                               
2023-01-03T00:36:28Z    Killing         Sent interrupt. Waiting 5s before force killing                

2023-01-03T00:36:23.806 app[078fe4dc] sea [info] Starting init (commit: f447594)...
2023-01-03T00:36:23.828 app[078fe4dc] sea [info] Preparing to run: `/bin/bash -o pipefail -c ${SERVER_COMMAND}` as root
2023-01-03T00:36:23.847 app[078fe4dc] sea [info] 2023/01/03 00:36:23 listening on [fdaa:1:17cd:a7b:a6:78f:e4dc:2]:22 (DNS: [fdaa::3]:53)
2023-01-03T00:36:24.121 app[078fe4dc] sea [info] 00:36:24 api.1 | started with pid 526
2023-01-03T00:36:24.121 app[078fe4dc] sea [info] 00:36:24 client.1 | started with pid 527
2023-01-03T00:36:25.195 app[078fe4dc] sea [info] 00:36:25 client.1 |
2023-01-03T00:36:25.195 app[078fe4dc] sea [info] 00:36:25 client.1 | > client@0.1.0 start
2023-01-03T00:36:25.195 app[078fe4dc] sea [info] 00:36:25 client.1 | > PORT=4000 react-scripts start
2023-01-03T00:36:25.195 app[078fe4dc] sea [info] 00:36:25 client.1 |
2023-01-03T00:36:25.217 app[078fe4dc] sea [info] 00:36:25 client.1 | /usr/bin/env: ‘node’: Permission denied
2023-01-03T00:36:25.498 app[078fe4dc] sea [info] 00:36:25 api.1 | fallocate -l 512M /swapfile
2023-01-03T00:36:25.507 app[078fe4dc] sea [info] 00:36:25 api.1 | chmod 0600 /swapfile
2023-01-03T00:36:25.510 app[078fe4dc] sea [info] 00:36:25 api.1 | mkswap /swapfile
2023-01-03T00:36:25.518 app[078fe4dc] sea [info] 00:36:25 api.1 | Setting up swapspace version 1, size = 512 MiB (536866816 bytes)
2023-01-03T00:36:25.518 app[078fe4dc] sea [info] 00:36:25 api.1 | no label, UUID=969feee0-211b-42aa-b59e-dfef0a9e32f6
2023-01-03T00:36:25.520 app[078fe4dc] sea [info] 00:36:25 api.1 | echo 10 > /proc/sys/vm/swappiness
2023-01-03T00:36:25.522 app[078fe4dc] sea [info] 00:36:25 api.1 | swapon /swapfile
2023-01-03T00:36:25.528 app[078fe4dc] sea [info] 00:36:25 api.1 | bin/rails server
2023-01-03T00:36:26.002 app[078fe4dc] sea [info] 00:36:26 api.1 | => Booting Puma
2023-01-03T00:36:26.003 app[078fe4dc] sea [info] 00:36:26 api.1 | => Rails 7.0.4 application starting in production
2023-01-03T00:36:26.003 app[078fe4dc] sea [info] 00:36:26 api.1 | => Run `bin/rails server --help` for more startup options
2023-01-03T00:36:26.223 app[078fe4dc] sea [info] 00:36:26 client.1 | exited with code 126
2023-01-03T00:36:26.223 app[078fe4dc] sea [info] 00:36:26 system | sending SIGTERM to all processes
2023-01-03T00:36:26.224 app[078fe4dc] sea [info] 00:36:26 api.1 | rails aborted!
2023-01-03T00:36:26Z   [info]00:36:26 api.1    | SignalException: SIGTERM
2023-01-03T00:36:26Z   [info]00:36:26 api.1    | /app/vendor/bundle/ruby/2.7.0/gems/rake-13.0.6/lib/rake/file_utils.rb:54:in `system'
2023-01-03T00:36:26Z   [info]00:36:26 api.1    | /app/vendor/bundle/ruby/2.7.0/gems/rake-13.0.6/lib/rake/file_utils.rb:54:in `sh'
2023-01-03T00:36:26Z   [info]00:36:26 api.1    | /app/lib/tasks/fly.rake:21:in `block (2 levels) in <main>'
2023-01-03T00:36:26Z   [info]00:36:26 api.1    | /app/vendor/bundle/ruby/2.7.0/gems/rake-13.0.6/lib/rake/task.rb:281:in `block in execute'
2023-01-03T00:36:26Z   [info]00:36:26 api.1    | /app/vendor/bundle/ruby/2.7.0/gems/rake-13.0.6/lib/rake/task.rb:281:in `each'
2023-01-03T00:36:26Z   [info]00:36:26 api.1    | /app/vendor/bundle/ruby/2.7.0/gems/rake-13.0.6/lib/rake/task.rb:281:in `execute'
2023-01-03T00:36:26Z   [info]00:36:26 api.1    | /app/vendor/bundle/ruby/2.7.0/gems/rake-13.0.6/lib/rake/task.rb:219:in `block in invoke_with_call_chain'
2023-01-03T00:36:26Z   [info]00:36:26 api.1    | /app/vendor/bundle/ruby/2.7.0/gems/rake-13.0.6/lib/rake/task.rb:199:in `synchronize'
2023-01-03T00:36:26Z   [info]00:36:26 api.1    | /app/vendor/bundle/ruby/2.7.0/gems/rake-13.0.6/lib/rake/task.rb:199:in `invoke_with_call_chain'
2023-01-03T00:36:26Z   [info]00:36:26 api.1    | /app/vendor/bundle/ruby/2.7.0/gems/rake-13.0.6/lib/rake/task.rb:188:in `invoke'
2023-01-03T00:36:26Z   [info]00:36:26 api.1    | /app/vendor/bundle/ruby/2.7.0/gems/rake-13.0.6/lib/rake/application.rb:160:in `invoke_task'
2023-01-03T00:36:26Z   [info]00:36:26 api.1    | /app/vendor/bundle/ruby/2.7.0/gems/rake-13.0.6/lib/rake/application.rb:116:in `block (2 levels) in top_level'
2023-01-03T00:36:26Z   [info]00:36:26 api.1    | /app/vendor/bundle/ruby/2.7.0/gems/rake-13.0.6/lib/rake/application.rb:116:in `each'
2023-01-03T00:36:26Z   [info]00:36:26 api.1    | /app/vendor/bundle/ruby/2.7.0/gems/rake-13.0.6/lib/rake/application.rb:116:in `block in top_level'
2023-01-03T00:36:26Z   [info]00:36:26 api.1    | /app/vendor/bundle/ruby/2.7.0/gems/rake-13.0.6/lib/rake/application.rb:125:in `run_with_threads'
2023-01-03T00:36:26Z   [info]00:36:26 api.1    | /app/vendor/bundle/ruby/2.7.0/gems/rake-13.0.6/lib/rake/application.rb:110:in `top_level'
2023-01-03T00:36:26Z   [info]00:36:26 api.1    | /app/vendor/bundle/ruby/2.7.0/gems/railties-7.0.4/lib/rails/commands/rake/rake_command.rb:24:in `block (2 levels) in perform'
2023-01-03T00:36:26Z   [info]00:36:26 api.1    | /app/vendor/bundle/ruby/2.7.0/gems/rake-13.0.6/lib/rake/application.rb:186:in `standard_exception_handling'
2023-01-03T00:36:26Z   [info]00:36:26 api.1    | /app/vendor/bundle/ruby/2.7.0/gems/railties-7.0.4/lib/rails/commands/rake/rake_command.rb:24:in `block in perform'
2023-01-03T00:36:26Z   [info]00:36:26 api.1    | /app/vendor/bundle/ruby/2.7.0/gems/rake-13.0.6/lib/rake/rake_module.rb:59:in `with_application'
2023-01-03T00:36:26Z   [info]00:36:26 api.1    | /app/vendor/bundle/ruby/2.7.0/gems/railties-7.0.4/lib/rails/commands/rake/rake_command.rb:18:in `perform'
2023-01-03T00:36:26Z   [info]00:36:26 api.1    | /app/vendor/bundle/ruby/2.7.0/gems/railties-7.0.4/lib/rails/command.rb:51:in `invoke'
2023-01-03T00:36:26Z   [info]00:36:26 api.1    | /app/vendor/bundle/ruby/2.7.0/gems/railties-7.0.4/lib/rails/commands.rb:18:in `<main>'
2023-01-03T00:36:26Z   [info]00:36:26 api.1    | /app/vendor/bundle/ruby/2.7.0/gems/bootsnap-1.15.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:32:in `require'
2023-01-03T00:36:26Z   [info]00:36:26 api.1    | /app/vendor/bundle/ruby/2.7.0/gems/bootsnap-1.15.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:32:in `require'
2023-01-03T00:36:26Z   [info]00:36:26 api.1    | Tasks: TOP => fly:server
2023-01-03T00:36:26Z   [info]00:36:26 api.1    | (See full trace by running task with --trace)
2023-01-03T00:36:26Z   [info]00:36:26 api.1    | exited with code 1
2023-01-03T00:36:26Z   [info]Starting clean up.
--> v11 failed - Failed due to unhealthy allocations - rolling back to job version 10 and deploying as v12 

--> Troubleshooting guide at https://fly.io/docs/getting-started/troubleshooting/
Error abort

I guess something to do with that line "usr/bin/env: ‘node’ : Permission denied ?

This is indeed a new one. Yes, unless all of the processes start successfully, foreman will shut everything down. And clearly the node process didn’t start.

Substituting a different node install process got me a different error message, and from there I determined that react-scripts needs to be installed. So a diff:

diff --git a/Dockerfile b/Dockerfile
index 847f834..c4d2862 100755
--- a/Dockerfile
+++ b/Dockerfile
@@ -45,10 +45,14 @@ RUN mkdir -p tmp/pids
 RUN curl https://get.volta.sh | bash
 ENV VOLTA_HOME /root/.volta
 ENV PATH $VOLTA_HOME/bin:/usr/local/bin:$PATH
-RUN volta install node@${NODE_VERSION} yarn@${YARN_VERSION} && \
+RUN curl -sL https://deb.nodesource.com/setup_current.x | bash - &&\
+    apt-get install --yes --no-install-recommends nodejs && \
+    npm install -g yarn && \
+    npm install --save react-scripts && \
     gem update --system --no-document && \
     gem install -N bundler -v ${BUNDLER_VERSION}

Nice that definitely did something! I could see it take some time to successfully run the stuff you added, and run bundle install, gem install, and npm install.

Now I’m getting some error about the 4000 port already in use:

2023-01-03T04:29:08Z runner[1a95017e] sea [info]Starting virtual machine
2023-01-03T04:29:09Z app[1a95017e] sea [info]Starting init (commit: f447594)...
2023-01-03T04:29:09Z app[1a95017e] sea [info]Preparing to run: `/bin/bash -o pipefail -c ${SERVER_COMMAND}` as root
2023-01-03T04:29:09Z app[1a95017e] sea [info]2023/01/03 04:29:09 listening on [fdaa:1:17cd:a7b:a6:1a95:17e:2]:22 (DNS: [fdaa::3]:53)
2023-01-03T04:29:09Z app[1a95017e] sea [info]04:29:09 api.1    | started with pid 526
2023-01-03T04:29:09Z app[1a95017e] sea [info]04:29:09 client.1 | started with pid 527
2023-01-03T04:29:10Z app[1a95017e] sea [info]04:29:10 client.1 |
2023-01-03T04:29:10Z app[1a95017e] sea [info]04:29:10 client.1 | > client@0.1.0 start
2023-01-03T04:29:10Z app[1a95017e] sea [info]04:29:10 client.1 | > PORT=4000 react-scripts start
2023-01-03T04:29:10Z app[1a95017e] sea [info]04:29:10 client.1 |
2023-01-03T04:29:11Z app[1a95017e] sea [info]04:29:11 api.1    | fallocate -l 512M /swapfile
2023-01-03T04:29:11Z app[1a95017e] sea [info]04:29:11 api.1    | chmod 0600 /swapfile
2023-01-03T04:29:11Z app[1a95017e] sea [info]04:29:11 api.1    | mkswap /swapfile
2023-01-03T04:29:11Z app[1a95017e] sea [info]04:29:11 api.1    | Setting up swapspace version 1, size = 512 MiB (536866816 bytes)
2023-01-03T04:29:11Z app[1a95017e] sea [info]04:29:11 api.1    | no label, UUID=1fff6c14-b640-4055-9020-0f8b4a0dc1a8
2023-01-03T04:29:11Z app[1a95017e] sea [info]04:29:11 api.1    | echo 10 > /proc/sys/vm/swappiness
2023-01-03T04:29:11Z app[1a95017e] sea [info]04:29:11 api.1    | swapon /swapfile
2023-01-03T04:29:11Z app[1a95017e] sea [info]04:29:11 api.1    | bin/rails server
2023-01-03T04:29:12Z app[1a95017e] sea [info]04:29:12 api.1    | => Booting Puma
2023-01-03T04:29:12Z app[1a95017e] sea [info]04:29:12 api.1    | => Rails 7.0.4 application starting in production
2023-01-03T04:29:12Z app[1a95017e] sea [info]04:29:12 api.1    | => Run `bin/rails server --help` for more startup options
2023-01-03T04:29:15Z app[1a95017e] sea [info]04:29:15 api.1    | Puma starting in single mode...
2023-01-03T04:29:15Z app[1a95017e] sea [info]04:29:15 api.1    | * Puma version: 5.6.5 (ruby 2.7.7-p221) ("Birdie's Version")
2023-01-03T04:29:15Z app[1a95017e] sea [info]04:29:15 api.1    | *  Min threads: 5
2023-01-03T04:29:15Z app[1a95017e] sea [info]04:29:15 api.1    | *  Max threads: 5
2023-01-03T04:29:15Z app[1a95017e] sea [info]04:29:15 api.1    | *  Environment: production
2023-01-03T04:29:15Z app[1a95017e] sea [info]04:29:15 api.1    | *          PID: 562
2023-01-03T04:29:15Z app[1a95017e] sea [info]04:29:15 api.1    | * Listening on http://0.0.0.0:4000
2023-01-03T04:29:15Z app[1a95017e] sea [info]04:29:15 api.1    | Use Ctrl-C to stop
2023-01-03T04:29:15Z app[1a95017e] sea [info]04:29:15 client.1 | (node:550) [DEP_WEBPACK_DEV_SERVER_ON_AFTER_SETUP_MIDDLEWARE] DeprecationWarning: 'onAfterSetupMiddleware' option is deprecated. Please use the 'setupMiddlewares' option.
2023-01-03T04:29:15Z app[1a95017e] sea [info]04:29:15 client.1 | (Use `node --trace-deprecation ...` to show where the warning was created)
2023-01-03T04:29:15Z app[1a95017e] sea [info]04:29:15 client.1 | (node:550) [DEP_WEBPACK_DEV_SERVER_ON_BEFORE_SETUP_MIDDLEWARE] DeprecationWarning: 'onBeforeSetupMiddleware' option is deprecated. Please use the 'setupMiddlewares' option.
2023-01-03T04:29:15Z app[1a95017e] sea [info]04:29:15 client.1 | /app/client/node_modules/webpack-dev-server/lib/Server.js:2472
2023-01-03T04:29:15Z app[1a95017e] sea [info]04:29:15 client.1 |         throw error;
2023-01-03T04:29:15Z app[1a95017e] sea [info]04:29:15 client.1 |         ^
2023-01-03T04:29:15Z app[1a95017e] sea [info]04:29:15 client.1 |
2023-01-03T04:29:15Z app[1a95017e] sea [info]04:29:15 client.1 | Error: listen EADDRINUSE: address already in use 0.0.0.0:4000
2023-01-03T04:29:15Z app[1a95017e] sea [info]04:29:15 client.1 |     at Server.setupListenHandle [as _listen2] (node:net:1717:16)
2023-01-03T04:29:15Z app[1a95017e] sea [info]04:29:15 client.1 |     at listenInCluster (node:net:1765:12)
2023-01-03T04:29:15Z app[1a95017e] sea [info]04:29:15 client.1 |     at doListen (node:net:1914:7)
2023-01-03T04:29:15Z app[1a95017e] sea [info]04:29:15 client.1 |     at process.processTicksAndRejections (node:internal/process/task_queues:83:21) {
2023-01-03T04:29:15Z app[1a95017e] sea [info]04:29:15 client.1 |   code: 'EADDRINUSE',
2023-01-03T04:29:15Z app[1a95017e] sea [info]04:29:15 client.1 |   errno: -98,
2023-01-03T04:29:15Z app[1a95017e] sea [info]04:29:15 client.1 |   syscall: 'listen',
2023-01-03T04:29:15Z app[1a95017e] sea [info]04:29:15 client.1 |   address: '0.0.0.0',
2023-01-03T04:29:15Z app[1a95017e] sea [info]04:29:15 client.1 |   port: 4000
2023-01-03T04:29:15Z app[1a95017e] sea [info]04:29:15 client.1 | }
2023-01-03T04:29:15Z app[1a95017e] sea [info]04:29:15 client.1 |
2023-01-03T04:29:15Z app[1a95017e] sea [info]04:29:15 client.1 | Node.js v19.3.0
2023-01-03T04:29:15Z app[1a95017e] sea [info]04:29:15 client.1 | exited with code 1
2023-01-03T04:29:15Z app[1a95017e] sea [info]04:29:15 system   | sending SIGTERM to all processes
2023-01-03T04:29:15Z app[1a95017e] sea [info]04:29:15 api.1    | rails aborted!
2023-01-03T04:29:15Z app[1a95017e] sea [info]04:29:15 api.1    | SignalException: SIGTERM
2023-01-03T04:29:15Z app[1a95017e] sea [info]04:29:15 api.1    | /app/vendor/bundle/ruby/2.7.0/gems/rake-13.0.6/lib/rake/file_utils.rb:54:in `system'
2023-01-03T04:29:15Z app[1a95017e] sea [info]04:29:15 api.1    | /app/vendor/bundle/ruby/2.7.0/gems/rake-13.0.6/lib/rake/file_utils.rb:54:in `sh'
2023-01-03T04:29:15Z app[1a95017e] sea [info]04:29:15 api.1    | /app/lib/tasks/fly.rake:21:in `block (2 levels) in <main>'
2023-01-03T04:29:15Z app[1a95017e] sea [info]04:29:15 api.1    | /app/vendor/bundle/ruby/2.7.0/gems/rake-13.0.6/lib/rake/task.rb:281:in `block in execute'
2023-01-03T04:29:15Z app[1a95017e] sea [info]04:29:15 api.1    | /app/vendor/bundle/ruby/2.7.0/gems/rake-13.0.6/lib/rake/task.rb:281:in `each'
2023-01-03T04:29:15Z app[1a95017e] sea [info]04:29:15 api.1    | /app/vendor/bundle/ruby/2.7.0/gems/rake-13.0.6/lib/rake/task.rb:281:in `execute'
2023-01-03T04:29:15Z app[1a95017e] sea [info]04:29:15 api.1    | /app/vendor/bundle/ruby/2.7.0/gems/rake-13.0.6/lib/rake/task.rb:219:in `block in invoke_with_call_chain'
2023-01-03T04:29:15Z app[1a95017e] sea [info]04:29:15 api.1    | /app/vendor/bundle/ruby/2.7.0/gems/rake-13.0.6/lib/rake/task.rb:199:in `synchronize'
2023-01-03T04:29:15Z app[1a95017e] sea [info]04:29:15 api.1    | /app/vendor/bundle/ruby/2.7.0/gems/rake-13.0.6/lib/rake/task.rb:199:in `invoke_with_call_chain'
2023-01-03T04:29:15Z app[1a95017e] sea [info]04:29:15 api.1    | /app/vendor/bundle/ruby/2.7.0/gems/rake-13.0.6/lib/rake/task.rb:188:in `invoke'
2023-01-03T04:29:15Z app[1a95017e] sea [info]04:29:15 api.1    | /app/vendor/bundle/ruby/2.7.0/gems/rake-13.0.6/lib/rake/application.rb:160:in `invoke_task'
2023-01-03T04:29:15Z app[1a95017e] sea [info]04:29:15 api.1    | /app/vendor/bundle/ruby/2.7.0/gems/rake-13.0.6/lib/rake/application.rb:116:in `block (2 levels) in top_level'
2023-01-03T04:29:15Z app[1a95017e] sea [info]04:29:15 api.1    | /app/vendor/bundle/ruby/2.7.0/gems/rake-13.0.6/lib/rake/application.rb:116:in `each'
2023-01-03T04:29:15Z app[1a95017e] sea [info]04:29:15 api.1    | /app/vendor/bundle/ruby/2.7.0/gems/rake-13.0.6/lib/rake/application.rb:116:in `block in top_level'
2023-01-03T04:29:15Z app[1a95017e] sea [info]04:29:15 api.1    | /app/vendor/bundle/ruby/2.7.0/gems/rake-13.0.6/lib/rake/application.rb:125:in `run_with_threads'
2023-01-03T04:29:15Z app[1a95017e] sea [info]04:29:15 api.1    | /app/vendor/bundle/ruby/2.7.0/gems/rake-13.0.6/lib/rake/application.rb:110:in `top_level'
2023-01-03T04:29:15Z app[1a95017e] sea [info]04:29:15 api.1    | /app/vendor/bundle/ruby/2.7.0/gems/railties-7.0.4/lib/rails/commands/rake/rake_command.rb:24:in `block (2 levels) in perform'
2023-01-03T04:29:15Z app[1a95017e] sea [info]04:29:15 api.1    | /app/vendor/bundle/ruby/2.7.0/gems/rake-13.0.6/lib/rake/application.rb:186:in `standard_exception_handling'
2023-01-03T04:29:15Z app[1a95017e] sea [info]04:29:15 api.1    | /app/vendor/bundle/ruby/2.7.0/gems/railties-7.0.4/lib/rails/commands/rake/rake_command.rb:24:in `block in perform'
2023-01-03T04:29:15Z app[1a95017e] sea [info]04:29:15 api.1    | /app/vendor/bundle/ruby/2.7.0/gems/rake-13.0.6/lib/rake/rake_module.rb:59:in `with_application'
2023-01-03T04:29:15Z app[1a95017e] sea [info]04:29:15 api.1    | /app/vendor/bundle/ruby/2.7.0/gems/railties-7.0.4/lib/rails/commands/rake/rake_command.rb:18:in `perform'
2023-01-03T04:29:15Z app[1a95017e] sea [info]04:29:15 api.1    | /app/vendor/bundle/ruby/2.7.0/gems/railties-7.0.4/lib/rails/command.rb:51:in `invoke'
2023-01-03T04:29:15Z app[1a95017e] sea [info]04:29:15 api.1    | /app/vendor/bundle/ruby/2.7.0/gems/railties-7.0.4/lib/rails/commands.rb:18:in `<main>'
2023-01-03T04:29:15Z app[1a95017e] sea [info]04:29:15 api.1    | /app/vendor/bundle/ruby/2.7.0/gems/bootsnap-1.15.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:32:in `require'
2023-01-03T04:29:15Z app[1a95017e] sea [info]04:29:15 api.1    | /app/vendor/bundle/ruby/2.7.0/gems/bootsnap-1.15.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:32:in `require'
2023-01-03T04:29:15Z app[1a95017e] sea [info]04:29:15 api.1    | Tasks: TOP => fly:server
2023-01-03T04:29:15Z app[1a95017e] sea [info]04:29:15 api.1    | (See full trace by running task with --trace)
2023-01-03T04:29:15Z app[1a95017e] sea [info]04:29:15 api.1    | exited with code 1
2023-01-03T04:29:16Z app[1a95017e] sea [info]Starting clean up.

both Puma and React are listening on port 4000. You are gonna need to use different ports for each one.

I think the biggest problem here is that the env var PORT is used by both apps as you can see it here too.

2 Likes

Nice catch! Earlier I did change the ENV variable in the Dockerfile from 8080 to 4000 - I changed it back to 8080 in both places and it looks like that change only affects the port Puma runs on, React still runs on 4000, so that took care of that error!

Now I’m getting some feedback in the logs from client about “useEffect is defined but never used,” “img elements must have an alt prop,” so I can tell that it’s getting to all of the .js - this is the first time any of those warnings have shown up.

Still getting some “Rails aborted!” notice and “Page can’t be found” when I run fly open. I can’t tell why it’s happening and I don’t have any guesses, except I’m still getting a "No route matches GET “/” when I try to navigate to (page)/index.html

2023-01-03T18:15:25.761 runner[7ee67d42] sea [info] Starting virtual machine

2023-01-03T18:15:26.248 app[7ee67d42] sea [info] Starting init (commit: f447594)...

2023-01-03T18:15:26.275 app[7ee67d42] sea [info] Preparing to run: `/bin/bash -o pipefail -c ${SERVER_COMMAND}` as root

2023-01-03T18:15:26.306 app[7ee67d42] sea [info] 2023/01/03 18:15:26 listening on [fdaa:1:17cd:a7b:bcab:7ee6:7d42:2]:22 (DNS: [fdaa::3]:53)

2023-01-03T18:15:26.629 app[7ee67d42] sea [info] 18:15:26 api.1 | started with pid 526

2023-01-03T18:15:26.630 app[7ee67d42] sea [info] 18:15:26 client.1 | started with pid 527

2023-01-03T18:15:28.046 app[7ee67d42] sea [info] 18:15:28 client.1 |

2023-01-03T18:15:28.046 app[7ee67d42] sea [info] 18:15:28 client.1 | > client@0.1.0 start

2023-01-03T18:15:28.046 app[7ee67d42] sea [info] 18:15:28 client.1 | > PORT=4000 react-scripts start

2023-01-03T18:15:28.046 app[7ee67d42] sea [info] 18:15:28 client.1 |

2023-01-03T18:15:28.455 app[7ee67d42] sea [info] 18:15:28 api.1 | fallocate -l 512M /swapfile

2023-01-03T18:15:28.480 app[7ee67d42] sea [info] 18:15:28 api.1 | chmod 0600 /swapfile

2023-01-03T18:15:28.486 app[7ee67d42] sea [info] 18:15:28 api.1 | mkswap /swapfile

2023-01-03T18:15:28.501 app[7ee67d42] sea [info] 18:15:28 api.1 | Setting up swapspace version 1, size = 512 MiB (536866816 bytes)

2023-01-03T18:15:28.501 app[7ee67d42] sea [info] 18:15:28 api.1 | no label, UUID=2f3a501d-dcba-4ae8-bb19-31ff5cee7781

2023-01-03T18:15:28.505 app[7ee67d42] sea [info] 18:15:28 api.1 | echo 10 > /proc/sys/vm/swappiness

2023-01-03T18:15:28.507 app[7ee67d42] sea [info] 18:15:28 api.1 | swapon /swapfile

2023-01-03T18:15:28.522 app[7ee67d42] sea [info] 18:15:28 api.1 | bin/rails server

2023-01-03T18:15:29.716 app[7ee67d42] sea [info] 18:15:29 api.1 | => Booting Puma

2023-01-03T18:15:29.716 app[7ee67d42] sea [info] 18:15:29 api.1 | => Rails 7.0.4 application starting in production

2023-01-03T18:15:29.716 app[7ee67d42] sea [info] 18:15:29 api.1 | => Run `bin/rails server --help` for more startup options

2023-01-03T18:15:32.906 app[7ee67d42] sea [info] 18:15:32 api.1 | Puma starting in single mode...

2023-01-03T18:15:32.907 app[7ee67d42] sea [info] 18:15:32 api.1 | * Puma version: 5.6.5 (ruby 2.7.7-p221) ("Birdie's Version")

2023-01-03T18:15:32.907 app[7ee67d42] sea [info] 18:15:32 api.1 | * Min threads: 5

2023-01-03T18:15:32.908 app[7ee67d42] sea [info] 18:15:32 api.1 | * Max threads: 5

2023-01-03T18:15:32.908 app[7ee67d42] sea [info] 18:15:32 api.1 | * Environment: production

2023-01-03T18:15:32.908 app[7ee67d42] sea [info] 18:15:32 api.1 | * PID: 562

2023-01-03T18:15:32.909 app[7ee67d42] sea [info] 18:15:32 api.1 | * Listening on http://0.0.0.0:8080

2023-01-03T18:15:32.920 app[7ee67d42] sea [info] 18:15:32 api.1 | Use Ctrl-C to stop

2023-01-03T18:15:33.424 app[7ee67d42] sea [info] 18:15:33 client.1 | (node:550) [DEP_WEBPACK_DEV_SERVER_ON_AFTER_SETUP_MIDDLEWARE] DeprecationWarning: 'onAfterSetupMiddleware' option is deprecated. Please use the 'setupMiddlewares' option.

2023-01-03T18:15:33.424 app[7ee67d42] sea [info] 18:15:33 client.1 | (Use `node --trace-deprecation ...` to show where the warning was created)

2023-01-03T18:15:33.424 app[7ee67d42] sea [info] 18:15:33 client.1 | (node:550) [DEP_WEBPACK_DEV_SERVER_ON_BEFORE_SETUP_MIDDLEWARE] DeprecationWarning: 'onBeforeSetupMiddleware' option is deprecated. Please use the 'setupMiddlewares' option.

2023-01-03T18:15:33.853 app[7ee67d42] sea [info] 18:15:33 client.1 | Starting the development server...

2023-01-03T18:15:33.853 app[7ee67d42] sea [info] 18:15:33 client.1 |

2023-01-03T18:15:46.624 app[7ee67d42] sea [info] 18:15:46 client.1 | Compiled with warnings.

2023-01-03T18:15:46.624 app[7ee67d42] sea [info] 18:15:46 client.1 |

2023-01-03T18:15:46.624 app[7ee67d42] sea [info] 18:15:46 client.1 | [eslint]

2023-01-03T18:15:46.624 app[7ee67d42] sea [info] 18:15:46 client.1 | src/Draft.js

2023-01-03T18:15:46.624 app[7ee67d42] sea [info] 18:15:46 client.1 | Line 78:8: React Hook useEffect has missing dependencies: 'filterBySearch' and 'rikishi'. Either include them or remove the dependency array react-hooks/exhaustive-deps

2023-01-03T18:15:46.624 app[7ee67d42] sea [info] 18:15:46 client.1 |

2023-01-03T18:15:46.624 app[7ee67d42] sea [info] 18:15:46 client.1 | src/components/StatsAndInfo.js

2023-01-03T18:15:46.624 app[7ee67d42] sea [info] 18:15:46 client.1 | Line 6:23: 'setSIRikishi' is assigned a value but never used no-unused-vars

2023-01-03T18:15:46.624 app[7ee67d42] sea [info] 18:15:46 client.1 |

2023-01-03T18:15:46.624 app[7ee67d42] sea [info] 18:15:46 client.1 | Search for the keywords to learn more about each warning.

2023-01-03T18:15:46.625 app[7ee67d42] sea [info] 18:15:46 client.1 | To ignore, add // eslint-disable-next-line to the line before.

2023-01-03T18:15:46.625 app[7ee67d42] sea [info] 18:15:46 client.1 |

2023-01-03T18:15:46.633 app[7ee67d42] sea [info] 18:15:46 client.1 | WARNING in [eslint]

2023-01-03T18:15:46.633 app[7ee67d42] sea [info] 18:15:46 client.1 | src/Draft.js

2023-01-03T18:15:46.633 app[7ee67d42] sea [info] 18:15:46 client.1 | Line 78:8: React Hook useEffect has missing dependencies: 'filterBySearch' and 'rikishi'. Either include them or remove the dependency array react-hooks/exhaustive-deps

2023-01-03T18:15:46.633 app[7ee67d42] sea [info] 18:15:46 client.1 |

2023-01-03T18:15:46.633 app[7ee67d42] sea [info] 18:15:46 client.1 | src/components/StatsAndInfo.js

2023-01-03T18:15:46.633 app[7ee67d42] sea [info] 18:15:46 client.1 | Line 6:23: 'setSIRikishi' is assigned a value but never used no-unused-vars

2023-01-03T18:15:46.633 app[7ee67d42] sea [info] 18:15:46 client.1 |

2023-01-03T18:15:46.633 app[7ee67d42] sea [info] 18:15:46 client.1 | webpack compiled with 1 warning

2023-01-03T18:16:01.407 runner[58c31141] sea [info] Shutting down virtual machine

2023-01-03T18:16:01.562 app[58c31141] sea [info] Sending signal SIGINT to main child process w/ PID 521

2023-01-03T18:16:01.563 app[58c31141] sea [info] 18:16:01 system | SIGINT received, starting shutdown

2023-01-03T18:16:01.594 app[58c31141] sea [info] 18:16:01 system | sending SIGTERM to all processes

2023-01-03T18:16:01.594 app[58c31141] sea [info] 18:16:01 api.1 | rails aborted!

2023-01-03T18:16:01.594 app[58c31141] sea [info] 18:16:01 api.1 | SignalException: SIGTERM

2023-01-03T18:16:01.594 app[58c31141] sea [info] 18:16:01 api.1 | /app/vendor/bundle/ruby/2.7.0/gems/rake-13.0.6/lib/rake/file_utils.rb:54:in `system'

2023-01-03T18:16:01.594 app[58c31141] sea [info] 18:16:01 api.1 | /app/vendor/bundle/ruby/2.7.0/gems/rake-13.0.6/lib/rake/file_utils.rb:54:in `sh'

2023-01-03T18:16:01.594 app[58c31141] sea [info] 18:16:01 api.1 | /app/lib/tasks/fly.rake:21:in `block (2 levels) in <main>'

2023-01-03T18:16:01.594 app[58c31141] sea [info] 18:16:01 api.1 | /app/vendor/bundle/ruby/2.7.0/gems/rake-13.0.6/lib/rake/task.rb:281:in `block in execute'

2023-01-03T18:16:01.594 app[58c31141] sea [info] 18:16:01 api.1 | /app/vendor/bundle/ruby/2.7.0/gems/rake-13.0.6/lib/rake/task.rb:281:in `each'

2023-01-03T18:16:01.594 app[58c31141] sea [info] 18:16:01 api.1 | /app/vendor/bundle/ruby/2.7.0/gems/rake-13.0.6/lib/rake/task.rb:281:in `execute'

2023-01-03T18:16:01.594 app[58c31141] sea [info] 18:16:01 api.1 | /app/vendor/bundle/ruby/2.7.0/gems/rake-13.0.6/lib/rake/task.rb:219:in `block in invoke_with_call_chain'

2023-01-03T18:16:01.594 app[58c31141] sea [info] 18:16:01 api.1 | /app/vendor/bundle/ruby/2.7.0/gems/rake-13.0.6/lib/rake/task.rb:199:in `synchronize'

2023-01-03T18:16:01.594 app[58c31141] sea [info] 18:16:01 api.1 | /app/vendor/bundle/ruby/2.7.0/gems/rake-13.0.6/lib/rake/task.rb:199:in `invoke_with_call_chain'

2023-01-03T18:16:01.594 app[58c31141] sea [info] 18:16:01 api.1 | /app/vendor/bundle/ruby/2.7.0/gems/rake-13.0.6/lib/rake/task.rb:188:in `invoke'

2023-01-03T18:16:01.594 app[58c31141] sea [info] 18:16:01 api.1 | /app/vendor/bundle/ruby/2.7.0/gems/rake-13.0.6/lib/rake/application.rb:160:in `invoke_task'

2023-01-03T18:16:01.594 app[58c31141] sea [info] 18:16:01 api.1 | /app/vendor/bundle/ruby/2.7.0/gems/rake-13.0.6/lib/rake/application.rb:116:in `block (2 levels) in top_level'

2023-01-03T18:16:01.594 app[58c31141] sea [info] 18:16:01 api.1 | /app/vendor/bundle/ruby/2.7.0/gems/rake-13.0.6/lib/rake/application.rb:116:in `each'

2023-01-03T18:16:01.594 app[58c31141] sea [info] 18:16:01 api.1 | /app/vendor/bundle/ruby/2.7.0/gems/rake-13.0.6/lib/rake/application.rb:116:in `block in top_level'

2023-01-03T18:16:01.594 app[58c31141] sea [info] 18:16:01 api.1 | /app/vendor/bundle/ruby/2.7.0/gems/rake-13.0.6/lib/rake/application.rb:125:in `run_with_threads'

2023-01-03T18:16:01.594 app[58c31141] sea [info] 18:16:01 api.1 | /app/vendor/bundle/ruby/2.7.0/gems/rake-13.0.6/lib/rake/application.rb:110:in `top_level'

2023-01-03T18:16:01.594 app[58c31141] sea [info] 18:16:01 api.1 | /app/vendor/bundle/ruby/2.7.0/gems/railties-7.0.4/lib/rails/commands/rake/rake_command.rb:24:in `block (2 levels) in perform'

2023-01-03T18:16:01.594 app[58c31141] sea [info] 18:16:01 api.1 | /app/vendor/bundle/ruby/2.7.0/gems/rake-13.0.6/lib/rake/application.rb:186:in `standard_exception_handling'

2023-01-03T18:16:01.594 app[58c31141] sea [info] 18:16:01 api.1 | /app/vendor/bundle/ruby/2.7.0/gems/railties-7.0.4/lib/rails/commands/rake/rake_command.rb:24:in `block in perform'

2023-01-03T18:16:01.594 app[58c31141] sea [info] 18:16:01 api.1 | /app/vendor/bundle/ruby/2.7.0/gems/rake-13.0.6/lib/rake/rake_module.rb:59:in `with_application'

2023-01-03T18:16:01.594 app[58c31141] sea [info] 18:16:01 api.1 | /app/vendor/bundle/ruby/2.7.0/gems/railties-7.0.4/lib/rails/commands/rake/rake_command.rb:18:in `perform'

2023-01-03T18:16:01.594 app[58c31141] sea [info] 18:16:01 api.1 | /app/vendor/bundle/ruby/2.7.0/gems/railties-7.0.4/lib/rails/command.rb:51:in `invoke'

2023-01-03T18:16:01.594 app[58c31141] sea [info] 18:16:01 api.1 | /app/vendor/bundle/ruby/2.7.0/gems/railties-7.0.4/lib/rails/commands.rb:18:in `<main>'

2023-01-03T18:16:01.594 app[58c31141] sea [info] 18:16:01 api.1 | /app/vendor/bundle/ruby/2.7.0/gems/bootsnap-1.15.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:32:in `require'

2023-01-03T18:16:01.594 app[58c31141] sea [info] 18:16:01 api.1 | /app/vendor/bundle/ruby/2.7.0/gems/bootsnap-1.15.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:32:in `require'

2023-01-03T18:16:01.594 app[58c31141] sea [info] 18:16:01 api.1 | Tasks: TOP => fly:server

2023-01-03T18:16:01.594 app[58c31141] sea [info] 18:16:01 api.1 | (See full trace by running task with --trace)

2023-01-03T18:16:01.691 app[58c31141] sea [info] 18:16:01 api.1 | exited with code 1

2023-01-03T18:16:01.791 app[58c31141] sea [info] 18:16:01 client.1 | terminated by SIGTERM

2023-01-03T18:16:02.271 app[58c31141] sea [info] Starting clean up.

Okay it really feels like I am getting very close. I know I’ve said that already.

I hadn’t set a root route (so obvious), so that’s explains the "No route matches GET “/” error.

I’m still running into a problem somewhere, and I think what is happening is that the Rails server (Puma) starts, the webpack successfully compiles all of the React stuff (because I get warnings about unused variables)… and then for some reason things start to shut down and I can’t figure out why!

2023-01-03T22:53:58Z runner[fa92f9cc] sea [info]Starting virtual machine
2023-01-03T22:53:58Z app[fa92f9cc] sea [info]Starting init (commit: f447594)...
2023-01-03T22:53:58Z app[fa92f9cc] sea [info]Preparing to run: `/bin/bash -o pipefail -c ${SERVER_COMMAND}` as root
2023-01-03T22:53:58Z app[fa92f9cc] sea [info]2023/01/03 22:53:58 listening on [fdaa:1:17cd:a7b:bcab:fa92:f9cc:2]:22 (DNS: [fdaa::3]:53)
2023-01-03T22:53:59Z app[fa92f9cc] sea [info]22:53:59 api.1    | started with pid 526
2023-01-03T22:53:59Z app[fa92f9cc] sea [info]22:53:59 client.1 | started with pid 527
2023-01-03T22:54:00Z app[fa92f9cc] sea [info]22:54:00 client.1 |
2023-01-03T22:54:00Z app[fa92f9cc] sea [info]22:54:00 client.1 | > client@0.1.0 start
2023-01-03T22:54:00Z app[fa92f9cc] sea [info]22:54:00 client.1 | > PORT=4000 react-scripts start
2023-01-03T22:54:00Z app[fa92f9cc] sea [info]22:54:00 client.1 |
2023-01-03T22:54:01Z app[fa92f9cc] sea [info]22:54:01 api.1    | fallocate -l 512M /swapfile
2023-01-03T22:54:01Z app[fa92f9cc] sea [info]22:54:01 api.1    | chmod 0600 /swapfile
2023-01-03T22:54:01Z app[fa92f9cc] sea [info]22:54:01 api.1    | mkswap /swapfile
2023-01-03T22:54:01Z app[fa92f9cc] sea [info]22:54:01 api.1    | Setting up swapspace version 1, size = 512 MiB (536866816 bytes)
2023-01-03T22:54:01Z app[fa92f9cc] sea [info]22:54:01 api.1    | no label, UUID=ca7efbb7-0d8a-45e8-803c-92af97a3d15b
2023-01-03T22:54:01Z app[fa92f9cc] sea [info]22:54:01 api.1    | echo 10 > /proc/sys/vm/swappiness
2023-01-03T22:54:01Z app[fa92f9cc] sea [info]22:54:01 api.1    | swapon /swapfile
2023-01-03T22:54:01Z app[fa92f9cc] sea [info]22:54:01 api.1    | bin/rails server
2023-01-03T22:54:02Z app[fa92f9cc] sea [info]22:54:02 api.1    | => Booting Puma
2023-01-03T22:54:02Z app[fa92f9cc] sea [info]22:54:02 api.1    | => Rails 7.0.4 application starting in production
2023-01-03T22:54:02Z app[fa92f9cc] sea [info]22:54:02 api.1    | => Run `bin/rails server --help` for more startup options
2023-01-03T22:54:05Z app[fa92f9cc] sea [info]22:54:05 api.1    | Puma starting in single mode...
2023-01-03T22:54:05Z app[fa92f9cc] sea [info]22:54:05 api.1    | * Puma version: 5.6.5 (ruby 2.7.7-p221) ("Birdie's Version")
2023-01-03T22:54:05Z app[fa92f9cc] sea [info]22:54:05 api.1    | *  Min threads: 5
2023-01-03T22:54:05Z app[fa92f9cc] sea [info]22:54:05 api.1    | *  Max threads: 5
2023-01-03T22:54:05Z app[fa92f9cc] sea [info]22:54:05 api.1    | *  Environment: production
2023-01-03T22:54:05Z app[fa92f9cc] sea [info]22:54:05 api.1    | *          PID: 562
2023-01-03T22:54:05Z app[fa92f9cc] sea [info]22:54:05 api.1    | * Listening on http://0.0.0.0:8080
2023-01-03T22:54:05Z app[fa92f9cc] sea [info]22:54:05 api.1    | Use Ctrl-C to stop
2023-01-03T22:54:05Z app[fa92f9cc] sea [info]22:54:05 client.1 | (node:550) [DEP_WEBPACK_DEV_SERVER_ON_AFTER_SETUP_MIDDLEWARE] DeprecationWarning: 'onAfterSetupMiddleware' option is deprecated. Please use the 'setupMiddlewares' option.
2023-01-03T22:54:05Z app[fa92f9cc] sea [info]22:54:05 client.1 | (Use `node --trace-deprecation ...` to show where the warning was created)
2023-01-03T22:54:05Z app[fa92f9cc] sea [info]22:54:05 client.1 | (node:550) [DEP_WEBPACK_DEV_SERVER_ON_BEFORE_SETUP_MIDDLEWARE] DeprecationWarning: 'onBeforeSetupMiddleware' option is deprecated. Please use the 'setupMiddlewares' option.
2023-01-03T22:54:06Z app[fa92f9cc] sea [info]22:54:06 client.1 | Starting the development server...
2023-01-03T22:54:06Z app[fa92f9cc] sea [info]22:54:06 client.1 |
2023-01-03T22:54:18Z app[fa92f9cc] sea [info]22:54:18 client.1 | Compiled with warnings.
2023-01-03T22:54:18Z app[fa92f9cc] sea [info]22:54:18 client.1 |
2023-01-03T22:54:18Z app[fa92f9cc] sea [info]22:54:18 client.1 | [eslint]
2023-01-03T22:54:18Z app[fa92f9cc] sea [info]22:54:18 client.1 | src/Draft.js
2023-01-03T22:54:18Z app[fa92f9cc] sea [info]22:54:18 client.1 |   Line 78:8:  React Hook useEffect has missing dependencies: 'filterBySearch' and 'rikishi'. Either include them or remove the dependency array  react-hooks/exhaustive-deps
2023-01-03T22:54:18Z app[fa92f9cc] sea [info]22:54:18 client.1 |
2023-01-03T22:54:18Z app[fa92f9cc] sea [info]22:54:18 client.1 | src/components/StatsAndInfo.js
2023-01-03T22:54:18Z app[fa92f9cc] sea [info]22:54:18 client.1 |   Line 6:23:  'setSIRikishi' is assigned a value but never used  no-unused-vars
2023-01-03T22:54:18Z app[fa92f9cc] sea [info]22:54:18 client.1 |
2023-01-03T22:54:18Z app[fa92f9cc] sea [info]22:54:18 client.1 | Search for the keywords to learn more about each warning.
2023-01-03T22:54:18Z app[fa92f9cc] sea [info]22:54:18 client.1 | To ignore, add // eslint-disable-next-line to the line before.
2023-01-03T22:54:18Z app[fa92f9cc] sea [info]22:54:18 client.1 |
2023-01-03T22:54:18Z app[fa92f9cc] sea [info]22:54:18 client.1 | WARNING in [eslint]
2023-01-03T22:54:18Z app[fa92f9cc] sea [info]22:54:18 client.1 | src/Draft.js
2023-01-03T22:54:18Z app[fa92f9cc] sea [info]22:54:18 client.1 |   Line 78:8:  React Hook useEffect has missing dependencies: 'filterBySearch' and 'rikishi'. Either include them or remove the dependency array  react-hooks/exhaustive-deps
2023-01-03T22:54:18Z app[fa92f9cc] sea [info]22:54:18 client.1 |
2023-01-03T22:54:18Z app[fa92f9cc] sea [info]22:54:18 client.1 | src/components/StatsAndInfo.js
2023-01-03T22:54:18Z app[fa92f9cc] sea [info]22:54:18 client.1 |   Line 6:23:  'setSIRikishi' is assigned a value but never used  no-unused-vars
2023-01-03T22:54:18Z app[fa92f9cc] sea [info]22:54:18 client.1 |
2023-01-03T22:54:18Z app[fa92f9cc] sea [info]22:54:18 client.1 | webpack compiled with 1 warning
2023-01-03T22:54:31Z runner[f3ffad5f] sea [info]Shutting down virtual machine
2023-01-03T22:54:31Z app[f3ffad5f] sea [info]Sending signal SIGINT to main child process w/ PID 521
2023-01-03T22:54:31Z app[f3ffad5f] sea [info]22:54:31 system   | SIGINT received, starting shutdown
2023-01-03T22:54:32Z app[f3ffad5f] sea [info]22:54:32 system   | sending SIGTERM to all processes
2023-01-03T22:54:32Z app[f3ffad5f] sea [info]22:54:32 api.1    | rails aborted!
2023-01-03T22:54:32Z app[f3ffad5f] sea [info]22:54:32 api.1    | SignalException: SIGTERM
2023-01-03T22:54:32Z app[f3ffad5f] sea [info]22:54:32 api.1    | /app/vendor/bundle/ruby/2.7.0/gems/rake-13.0.6/lib/rake/file_utils.rb:54:in `system'
2023-01-03T22:54:32Z app[f3ffad5f] sea [info]22:54:32 api.1    | /app/vendor/bundle/ruby/2.7.0/gems/rake-13.0.6/lib/rake/file_utils.rb:54:in `sh'
2023-01-03T22:54:32Z app[f3ffad5f] sea [info]22:54:32 api.1    | /app/lib/tasks/fly.rake:21:in `block (2 levels) in <main>'
2023-01-03T22:54:32Z app[f3ffad5f] sea [info]22:54:32 api.1    | /app/vendor/bundle/ruby/2.7.0/gems/rake-13.0.6/lib/rake/task.rb:281:in `block in execute'
2023-01-03T22:54:32Z app[f3ffad5f] sea [info]22:54:32 api.1    | /app/vendor/bundle/ruby/2.7.0/gems/rake-13.0.6/lib/rake/task.rb:281:in `each'
2023-01-03T22:54:32Z app[f3ffad5f] sea [info]22:54:32 api.1    | /app/vendor/bundle/ruby/2.7.0/gems/rake-13.0.6/lib/rake/task.rb:281:in `execute'