toml: key processes should be a table, not a value

I’m having an issue deploying my Django app all of a sudden where I get an error :

Error: failed loading app config from /home/runner/work/Teahookup/Teahookup/app/fly.toml: toml: key processes should be a table, not a value

I’m not sure why, as I have had successful deployments with this .toml file using GitHub Actions just a week ago. Did something change?

The action:

- run: flyctl deploy --remote-only
        env:
          FLY_API_TOKEN: ${{ secrets.FLY_API_TOKEN }}

The .toml:

# fly.toml file generated for tealist on 2023-03-11T10:14:22-06:00

app = "tealist"
kill_signal = "SIGINT"
kill_timeout = 5
primary_region = "ord"
processes = []

[deploy]
  release_command = "python manage.py migrate"

[env]
  PORT = "8000"

[experimental]
  auto_rollback = true

[processes]
  web = "sh /code/scripts/web.sh"

[[services]]
  http_checks = []
  internal_port = 8000
  processes = ["web"]
  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 = "/code/static"
  url_prefix = "/static/"

I did update the processes a few weeks ago per this article but I have had 2-3 successful deployments since. I haven’t made any additional changes to the .toml, but did make changes to the app files.

Edit: I get the same error when trying to run fly ssh console from the app directory w/ the .toml file.

Hi… This line is the culprit, I think.

flyctl’s TOML handling did change recently, and it may now be stricter about some things.

From General to Build debugging

Added flyctl

It looks essentially the same as an example in the official docs - Running Multiple Processes Inside A Fly.io App · Fly Docs

I’ve done some testing and if I remove:

[processes]
  web = "sh /code/scripts/web.sh"

And change

processes = ["web"]

to

processes = ["app"]

Then it starts to validate correctly. However, if I only change processes to app and leave the the [processes] table in, it still fails to validate.

And if I try to skip the processes assignment and declare the script directly under the service, then it tells me to update a [processes] table like I was doing.

processes = ["sh /code/scripts/web.sh"]

Service specifies ‘sh /code/scripts/web.sh’ as one of its processes, but no processes are defined with that name; update fly.toml [processes] to add ‘sh /code/scripts/web.sh’ process or remove it from service’s processes list

I may have figured it out… I had a processes = at the top of the .toml so I’m guessing it read a blank processes table first, then failed. Deleting that resolves the validation locally, I’ll try to deploy again.

Edit: Yup, the redundant processes = was the issue. I guess the new .toml validation changed that behavior.

1 Like

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