Volume emptied after redeployment of service
vintage2190
HOBBYOP

a month ago

Hello. I am deploying a service with a volume. The thing is, after I need to redeploy it (for a simple change in the cron job command), all the files in the volume associated with the service are deleted.

My question is: Is this the regular pattern of railway volume or am I doing something wrong?

$10 Bounty

5 Replies

Railway
BOT

a month ago

Hey there! We've found the following might help you get unblocked faster:

If you find the answer from one of these, please let us know by solving the thread!


Are you 100% sure that you're saving the files to the directory the volume is mounted on?


samgordon

Are you 100% sure that you're saving the files to the directory the volume is mounted on?

vintage2190
HOBBYOP

a month ago

Currently, my volume mount path is "/Boletos" and the code of the service associated with is:

filename = f"{name} {date}.pdf"

file_path = os.path.join("Boletos", filename)

save_pdf(file_path)

I assume that the files are being written in the volume, because my code sends me an e-mail every day with all the files saved in the directory "Boletos", and the files increases every day - meaning that the files are persistent. I suppose that if I wasn't saving in the volume, I wouldn't receive the e-mail with older files.

I tried to use the filebrowser template to see the files. However, when I try to deploy, with the mount path as "/Boletos" or "Data", and both shows this error: /orchestrator.RouterLegacyService/CreateDeployment UNKNOWN: error creating container: could not parse throttle device at /dev/zvol/railway_0/vol_2nikq9z68xzijdwu: no such file or directory


vintage2190

Currently, my volume mount path is "/Boletos" and the code of the service associated with is:filename = f"{name} {date}.pdf"file_path = os.path.join("Boletos", filename)save_pdf(file_path)I assume that the files are being written in the volume, because my code sends me an e-mail every day with all the files saved in the directory "Boletos", and the files increases every day - meaning that the files are persistent. I suppose that if I wasn't saving in the volume, I wouldn't receive the e-mail with older files.I tried to use the filebrowser template to see the files. However, when I try to deploy, with the mount path as "/Boletos" or "Data", and both shows this error: /orchestrator.RouterLegacyService/CreateDeployment UNKNOWN: error creating container: could not parse throttle device at /dev/zvol/railway_0/vol_2nikq9z68xzijdwu: no such file or directory

Your file path is actually just pointing to ./Boletos, when your volume is at /Boletos.

You just need to change your file_path to:

file_path = os.path.join("/Boletos", filename)


Regarding that error when using the mount path... can you screenshot that? Is it during build? When does it happen?


Loading...