Cannot connect Volumes - Rails 7

Just created a Volume on my machine, but when I put the below command on my fly.toml I receive an error:


Error: machine [app] does not have a volume configured and fly.toml expects one with destination /data; remove the [mounts] configuration in fly.toml or use the machines API to add a volume to this machine

I notice that the Volumes documentation does not refere anymore to [mounts]. Has anything changed on this procedure?

Fly Apps still use the [mounts] section for volume mounting.

However, volumes and Machines are fussy together because they have to exist on the same physical server. To the best of my knowledge there’s no way to mount an existing volume to an existing Machine – the volume has to exist before the Machine; the Machine must be created in the same region; and the volume must become attached when the Machine gets created.

I wonder if that could be the source of the issue.

You can check your app’s existing volumes with fly volumes list, and the app’s Machines with fly machines list, to get a sense of the status quo.

Usage of volumes with Machines directly is different from use with regular Fly Apps (“platform” apps you release with fly deploy), so there’s a doc specific to using volumes with Fly Apps: Add Volume Storage · Fly Docs.

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