Storage volume not working for single app with 2 processes

Hello.
I created a volume, and added this to my fly.toml:

[mounts]
source="storage"
destination="/var/www/html/storage"

Now, during the deploy, I get this error message

Error not enough volumes named storage (1) to run 2 processes

I’m running 2 processes:

[processes]
web = "supervisord -c /etc/supervisord.web.conf"
worker = "supervisord -c /etc/supervisord.worker.conf"

Can the error be related to this?
From the doc I know that a storage volume can only be attached to a single app. But in this case I have a single app with 2 processes.

Do you have a need to scale out web and worker independently of each other? If not:

  1. Use multi-process Machines if your (secondary) worker process is really only a sidecar.
  2. Or, use a process supervisor to run the sidecars alongside the main process.

Multi-process Fly apps are a hit and a miss, like you just found out.

Thanks @ignoramous. The issue is that I want to access the same storage volume from the 2 processes.

Given the way multi-process Fly apps work (each process gets its own VM on possibly different hosts), I don’t think the two processes can mount the same Fly volume. You’d have either use multi-process Machines or supervise multiple processes within a single Fly app, yourself.

In your [mounts] you need to specify which process that’s for, e.g.,

[mounts]
processes = ['web']
"""same as original"""
1 Like