I am experiencing a weird issue, I have created a volume (Persistent storage) for my Storage folder as mentioned in docs. to keep my storage persistent. but I noticed a weird issue where I get "Exception Message:\n\nUnable to read key from file file:///var/www/html/storage/oauth-public.key"
This exception occurs intermittently.
Any clue what’s going on? and How to solve this issue?
But that shouldn’t be needed. Passport should make a file at the correct location, the default path. It’s more likely a permissions issue where the file is there, but can’t be read.
If you’re defining multiple processes (cron/queue other stuff might be under [processes] in your fly.toml), the VMs running those commands won’t have your volume attached, which could cause such an error.
Other debugging questions: Does the error happen during a deployment, or just randomly when running? Do you see it in the fly logs, or using an exception tracker? (Sentry, bugsnag, whatever).
I’ll give it a shot, but Why the volumes sometimes returns an 404 error code, if multiple requests made to a certain files at a time like ( 1000 Request ). any clue?
The volumes aren’t network based or anything, and it’s mounted before each VM starts so it SHOULD not be the case that a file is missing.
I suspect we’ll find out there’s something going on in the code (making assumptions about file path) or something else going on, like something configured (a background process via supervisord?) to run in a way that doesn’t pick up the right file path.
Now the biggest clue we have here I think is that you’re seeing an error in the browser, not on the server-side (is that correct?)
I’m not sure if you’re being literal with calling it a 404 code (that’s an HTTP response, not a file system error). Assuming you just mean the code is not finding that file and the server is responding with an error saying that file is not found, I’m a bit suspicious that you only see it from a request happening in the browser.
Any chance a client-side code is hard-coded to like localhost or something that just happens to work on your machine (bc you have the dev server running locally) or something funky like that?
It’s possible the deploy step (which runs a docker build... isn’t using the right hostname when building static assets that might point to a URL. If any javascript uses process.ENV.foo to pick up env vars, for example, that’ll need to be set as an env during build-time, usually via a build argument.