Handling the “open() 11 resource temporarily unavailable” error with Nginx

While developing a website, I started receiving the error “open() 11 resource temporarily unavailable” after we migrated from Apache to Nginx. The symptom was that, after any change to a CSS or JS file (in fact, to any file directly served by Nginx) the first request would crash, but any subsequent request did work. However, after performing any kind of change in one of those files, the problem happened again.

One important thing to notice is that I was developing through Samba – more specifically, I had the Nginx server running on a local Linux box, and the files were being manipulated in a text editor in Windows.

What I found out is that, if I edited the files directly in the Linux box, the problem didn’t happen. Going a little bit further, it was clear that changing to another text editor in Windows would not trigger the problem. After some Googleing, a post in the Nginx users list mentioned that this issue may arrive due to the fact that some text editors perform some kind of temporary lock at Samba in the files being edited (although I couldn’t find anything visually, at least), which caused Nginx to not being able to open the file even for reading.

So, if you have an environment like mine and are running into this issue, try swapping to another editor. You may have luck.

Comments are closed.