Bug 35652 - Improve error message: "pcfg_openfile: unable to check htaccess file, ensure it is readable"
Summary: Improve error message: "pcfg_openfile: unable to check htaccess file, ensure ...
Alias: None
Product: Apache httpd-2
Classification: Unclassified
Component: Runtime Config (show other bugs)
Version: 2.0.54
Hardware: All other
: P2 minor (vote)
Target Milestone: ---
Assignee: Apache HTTPD Bugs Mailing List
Keywords: ErrorMessage, FixedInTrunk
Depends on:
Reported: 2005-07-07 19:46 UTC by Alan Pinstein
Modified: 2011-08-06 23:36 UTC (History)
0 users


Note You need to log in before you can comment on or make changes to this bug.
Description Alan Pinstein 2005-07-07 19:46:43 UTC
During a recent install of awstats there was a config problem which manifested itself via this error 

Permission denied: /opt/showcase/awstats/.htaccess pcfg_openfile: unable to check htaccess file, 
ensure it is readable

The error message is a little misleading, as it implies that .htaccess exists and is not readable. There is 
no .htaccess file in that location. However, /opt/showcase/awstats was chmod 700 and thus httpd 
couldn't CHECK to see if the .htaccess file was there.

The error message would be more helpful if it said:

Permission denied: <path> pcfg_openfile: unable to check for existence of htaccess file or read it if it 
does exist; make sure <path> is readable by httpd.

Something along those lines. Since the message implied that .htaccess existed, it really threw me for a 
loop trying to figure out the problem.
Comment 1 Joe Orton 2005-09-07 17:15:51 UTC
Well, it is not readable if the containing directory is not readable; the error
is not inaccurate per se, I don't think the more verbose error message is much

The 2.1 FAQ has a section on EPERM errors which might help:
Comment 2 Alan Pinstein 2005-09-07 17:44:05 UTC
Hmm. While I agree that the data in the FAQ entry would've probably helped me solve the problem 
faster, the actual error I got did not suceed in leading me to that FAQ entry, so that's kindof a moot 

Also, simply check out this google query:

to see how many people are having this same problem. I don't think it's unusually stupid of me to have 
had so much trouble tracking it down, even if it is something that'd be obvious to an expert.

It makes perfect sense to check perms along the path if an EXISTING file cannot be read. However, it 
doesn't really make sense that a NON-EXISTING FILE cannot be read due to permissions. That's why the 
error message is confusing. 

While I certainly understand not wanting to get more granular with the error messages (because it'd 
take more code and performance to supply the more granular info), is there a good reason not to 
inlcude a link to the FAQ entry in the error message? Or to put some more text in the error message to 
remind people of what to check in case of permission denied?

The simple fact that the answer to this question lies in an FAQ IMHO is ample evidence to support the 
improvement of the error message! If the error message were better, the FAQ entry would not be 
Comment 3 Eric Covener 2011-08-06 23:36:02 UTC
The message is a bit longer now in trunk

[Sat Aug 06 19:34:20.087359 2011] [core:crit] [pid 17061:tid 2860051312] (13)Permission denied: [client] /tmp/a/.htaccess pcfg_openfile: unable to check htaccess file, ensure it is readable and that '/tmp/a/' is executable.