Bugzilla – Bug 8449
web service does not respond if simple file not readable
Last modified: 2009-01-21 16:42:01 UTC
It is possible to bundle simple files with plugins that SqueezeCenter will serve as-is by putting them in a directory like Plugins/MyPlugin/HTML/EN/plugins/MyPlugin/html/ and referencing them with URLs like /plugins/MyPlugin/html/somefile.js But if the file is not readable by the SqueezeCenter process, SC7.2 will not respond to the request. This can lead to long delays in page rendering as the browser waits for a response. Instead of hanging, SC7 should quickly return an HTTP 500 Server Error with a helpful message stating that the file was not readable.
Did you get some log entries when this happened? If not, can you turn on some http (or whatever needed) debugging to see whether this issue is reported in the log?
I got the following message in server.log [08-06-20 15:03:57.7439] Slim::Web::HTTP::_generateContentFromFile (2309) Error: file error - : not found and the browser immediately displayed an empty page. What were the permissions on that file? What browser were you using?
Parent directory perms are 0755. File perms when the problem occurs -- 0700 (yeah, I know, it shouldn't be executable) but owned by a diff user. Change the file perms to 0744 and it works again.
Created attachment 3471 [details] patch to make SC7 send 404 if bad file perms Here's a patch that makes SC7 send a simple 404 error if the file is not readable, and log a WARN message suggesting the user check the file permissions. The core problem is that Slim/Web/HTTP.pm has at least one spot where it isn't checking the return code from a call to open() -- it blindly assumes that it can read the appropriate file. So this isn't the best fix, but it's an improvement, and perhaps good enough given that only 3rd party web content should ever be installed with bad permissions. Thanks.
Created attachment 3472 [details] beter patch? doesn't discriminate against old (pre-Epoch) files
will take a look at this for 7.2 - thanks!
Punting post 7.2
Peter - Could you please upload a server.log file with debugging for http enabled? I'd like to better understand why this is locking up anything for you. It doesn't do this on my system. Thanks!
Peter - any news?
No new news?