Files in Render disk are being lost with Starter service

I upgraded to Starter service but files in Render disk are being lost when it next restarts (e.g. spun down if on free instance type, next deploy, manual restart, etc.). Shouldn’t they be in persistent store with Starter service?

1 Like

Hey Product2023,
I am also facing the same issue like i am storing the data in a python list attribute soo when i make anychanges to the it starts a deploy and lost all my data running in the list soo what i have done is that used a POSTGRESQL service and starts storing data in that and loading from it when my codes start and make it dynamic soo that it can store the latest update of the data list.

so the same way you can do, if you need any assistance contact me(Can help me in Python only).

1 Like

Hi there,

By default, the filesystem your service uses is ephemeral, meaning any changes made during the runtime of your service will be lost when your service is restarted. If you need to persist file between restarts you need to use a disk: https://render.com/docs/disks.

Regards,

Keith
Render Support, UTC+10 :australia:

1 Like

Thank you @Keith. But I did set the mount path to /data/. This should persist data correct? Or do i have to use databases?

Hi there,

Yes, you should be able to write files to the /data directory, and they should persist between restarts of your service. You can use the Shell tab of your service from our dashboard to inspect the contents of this directory.

Regards,

Keith
Render Support, UTC+10 :australia:

I see the files in shell as well but when I redeploy the app, all the data is gone, it is not being persisted. Do I have to use /project/src/data instead of /data ? I am 100% sure I don’t have any relative paths in my script.

Also my disk is being charged.

But no disk is being used in this graphic.

Hi there,

Let me follow this up on the internal ticket you created.

Regards,

Keith
Render Support, UTC+10 :australia:

After 2 days of struggle and help from Keith I figured out the solution. I just have to provide this direct path to set the persistent disk.

/opt/render/project/src

For example. if you have all you data in a folder called data in your root directory then your mount path of the Disk would be /opt/render/project/src/data

You can also find this path by accessing shell env and print the cwd from your data folder.

This is not very clear in the documentation and also no video in youtube can explain this and several questions in this community regarding setting up persistent disk hit dead end. Hope this helps.

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