Today one of my customers was having a very strange issue with some static files. He was uploading static files (gif, jpg, css, etc) to his website that runs on Nginx webserver. And the problem was that from time to time, the changes he did were not reflected while browing the files online. Investigating the Nginx logs I found this error:
pread() read only xxxx of xxxx from “/var/www/website.com/page.html” while sending response to client
This were the complete logs:
2014/06/26 12:44:47 [alert] 9743#0: *192873 pread() read only 12133 of 12135 from "/var/www/website.com/page.html" while sending response to client, client: 190.247.xx.xx, server: www.website.com, request: "GET /people/jessie.html HTTP/1.1", host: "www.website.com", referrer: "http://www.website.com/" 2014/06/26 12:46:27 [alert] 9743#0: *196302 pread() read only 12537 of 12540 from "/var/www/website.com/page.html" while sending response to client, client: 85.59.xx.xx, server: www.website.com, request: "GET /people/myluv.html HTTP/1.1", host: "www.website.com", referrer: "http://www.website.com/"
Investigating my Nginx configuration I found this may be related to the files cached using open_file_cache option on Nginx. According to Igor Sysoev (creator of Nginx) on this forum it was caused because the file was not updated atomically.
Temporary disabling open_file_cache fixed the issue.
Popular search terms:
- pread() read only
- debian nginx error 13 upstream post -apache -php
- https://www scalescale com/tips/nginx/nginx-pread-read-only-of-from-errors/