Rails fly.toml file generated look wrong or incomplete,

:wave:
thanks in advance for the help

I have an app, it has never been dpeloyed before

I ran fly launch and went through the questions

the toml generated looks like the one below

# fly.toml file generated for arc-platform on 2023-03-24T14:21:44+01:00

app = "arc-platform"
kill_signal = "SIGINT"
kill_timeout = 5
primary_region = "jnb"
processes = []

[env]

[experimental]
  auto_rollback = true

[[services]]
  http_checks = []
  internal_port = 3000
  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 = "/rails/public"
  url_prefix = "/"

Please let me know if i’m missing something :pray:

What looks wrong or incomplete in that file?

Does fly deploy work?

fly deploy does not work, it gives me errors

Error failed to fetch an image or build from source: error building: executor failed running [/bin/sh -c SECRET_KEY_BASE=DUMMY ./bin/rails assets:precompile]: exit code: 1

SECRET_KEY_BASE might be the issue here, removing it doesn’t work either

When i see other rails app from tutroails and videos, the generated toml incodes a lot more than the one posted, for example i see we are missing this info

[deploy]
  release_command = "bin/rails db:migrate"

[env]
  PORT = "8080"
  RAILS_ENV = "production"
  SERVER_COMMAND = "bundle exec puma -C config/puma.rb"

Basically, just want to make sure i’m not missing anything

I’ve spent a lot of time in the past few months simplifying and streamlining things. It amuses me that your first thought was that the configuration was incomplete - trust me that part is correct.

Your problem is with the assets:precompile step. Typically this is due to not having access to some secret that turns out only to be needed at runtime. The next step is to look at the logs to identify the true error. See: Existing Rails Apps · Fly Docs; generally accessing the logs from the monitoring tab on the dashboard produces better results.

Also take a look at ERROR [build 9/9] RUN SECRET_KEY_BASE=DUMMY ./bin/rails assets:precompile when running fly deploy - #3 by munandres for what might be a similar situation. If you have an initializer that accesses a credential that is only needed when you deploy, add an if statement around that code.

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.