Rails app - ERROR No such file or directory (os error 2) logs

We have a pretty simple rails app deployed and every request starts with a log:

[info]ERROR No such file or directory (os error 2)

Machine: app[9185411c24d148] ord

This does not seem to cause any issues, but we are more so curious to what is causing this error message.


1 Like

Not solved yet, but here’s another thread with this issue: i get this error in the logs of my rails api

Thanks! Will follow the other thread.

1 Like


Copied the answer to other thread, thanks

Hey I too recently deployed a rails app, it too has this issue.

tldr; the error is the app fails to open temp files

I investigated further,
I’m getting the error just before when I’m trying to access specific route

Like I have noticed this happed multiple times

2023-06-16T13:03:40Z app[<useful-id>] atl [info]ERROR No such file or directory (os error 2)
2023-06-16T13:03:40Z app[<useful-id>] atl [info]I, [2023-06-16T13:03:40.735309 #521]  INFO -- : [86fb280c-08dc-4116-a11c-1120e2095593] Started GET "/route" for <useful-ip>at 2023-06-16 13:03:40 +0000

So I tried to run the app in local and observe the logs
here are the logs that are generated when I try visiting the same route

xdg-open /home/user/app-name/tmp/tmpfile
...<Irrelavent conetens of file>

Started GET "/route" for at 2023-06-16 18:45:25 +0530

and you can google xdg-open is for opening files

so I think its unable to open some temporary files and hence giving the error.
As we can understand most of the functionality does not require /tmp files
which explains why app is running fine
But we get an error while trying to open some non-existent tmp files
which seems the issue as you can google (os error 2) is raised when there is No such file or directory is found.

what do you guys say.

Hope this helps, peace

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