Vapor on fly.io volumes problem

Hello

Im trying to seed my database with data from volume. Im sure that the file exist on volume because I made:

fly ssh console and cut my file and it prints everything.
Also I have added

[mounts]
  source = "storage_dir"
  destination = "/storage"

to my fly.toml file. And im trying to get to my file by absolute path let path = “/storage/ppla_formatted.json”

also I have added all permissions to file chmod 777 but this also didn’t help.

No im stuck :wink: Maybe someone had similar issue? or maybe it is because im using swift and vapor but I don’t won’t to use for now something else.

Have a nice day :wink:

Hi… It sounds like you might unknowingly have two machines, in which case each would inherently have independent and unsynchronized volumes.

(Two is the generic platform default, to avoid data loss when a physical host machine fails, :fried_egg:—among other surprises.)

What does fly m list show?


Aside: It’s best to avoid using volumes directly, if you can, since they are more of an advanced (or at least intermediate-level) feature on the Fly.io platform. If you just need key-value storage, for example, then Tigris is much easier.

(On the other hand, if you only require a single, read-only file, then you can separately place it manually on each volume, via --select.)

1 Like

Sorry i forgot to mention that I have removed the second volume.

I will try with —select

I have json file with my data and I want to populate my database with it. Maybe there is some better way but I don’t know it.