Images loading randomly

Hi guys,

I have a small app with 2 machines and each machine has it’s own volume. User images which are stored on the volume are sometimes loading properly but not always. We’re talking about same images here. So, for example, user profile image sometimes load and sometimes it shows 404, when refreshing the page, sometimes it will load, but not always, it’s completely random. When I take the image URL and try to open it directly in the browser, same thing, sometimes it loads, sometimes it doesn’t. There are no errors in the logs.

Do you have any idea what could be causing this?

Edit: It looks like the problem are two volumes and the fact that the data is not replicated between them. Is there a recommended way to handle volume replication? Volume is used for user files, not database.

As you’ve found out: Fly Volumes overview · Fly Docs

You can use Tigris or R2 directly. Or you can do the replication yourself, eg when you’re writing to the volume, you need to also forward/propagate the upload request to your other instances via .flycast (this might get expensive since you’re charged for all the extra bandwidth.)

imo just use R2