Aug 08 2007

Internal error: pcfg_openfile() called with NULL filename

Published by pj at 11:07 am under apache2,bugs,opensource,subversion

While upgrading Apache to version 2.2.4-2 for a subversion upgrade (version 1.4.4dfsg1-1) I ran into errors with my auth_pgsql (or any other auth_mysql, auth_ldap or auth_* module) setup:

“Internal error: pcfg_openfile() called with NULL filename”

This is caused by auth_basic and stops the authentication and authorisation process. Adding the following directive to your auth_pgsql or auth_ldap config file solves the problem:

“AuthBasicAuthoritative Off”
It disables basic authorisation being authoritive for the authorisation process. The errors will still be visible in your logfiles, but the authorisation scheme works as normal.

Other tags:

  • Apache 2.2 error
  • Apache 2.2 subversion 1.4.4 error
  • mod_pgsql pcfg_openfile errors

http://gforge.org/forum/message.php?msg_id=10926&group_id=128

11 responses so far

11 Responses to “Internal error: pcfg_openfile() called with NULL filename”

  1. David Goodwinon 05 Oct 2007 at 3:10 pm

    Thanks! That was a quick google to fix my problem :)

    David.

  2. Aurélien Gâteauon 03 Nov 2007 at 12:43 am

    Thanks a lot! I had the same problem with mod_auth_imap.

  3. Sashaon 21 May 2008 at 1:15 pm

    Thanks!! Solved issue…

  4. Shaneon 26 Oct 2008 at 10:06 pm

    You can get rid of the errors by addding

    AuthUserFile /dev/null

    to your configuration file. I found this over here: http://readthefuckingmanual.net/error/1387/ (sorry for the website name–not mine!)

    And thanks for the post–hard to find solutions sometimes for simple stuff like this.

    -Shane

  5. Rick van der Zweton 08 Dec 2008 at 9:32 pm

    Thanks, fixed my issue :-) .

    FYI, also found this line in my logs “(9)Bad file descriptor: Could not open password file: (null)” which was also caused by this error.

  6. phoenixon 19 Dec 2008 at 9:42 am

    thx 4 ur info ;)

  7. Queegon 05 Jan 2009 at 5:01 am

    Thanks for the solution.

    To avoid the entries in the error log, I created an empty password file (by creating a one user file and then deleting the user), then pointed apache to it.

    htpasswd -c /home/test/emptypw testuser
    htpasswd -D /home/test/emptypw testuser

    # patch for ‘Internal error: pcfg_openfile() called with NULL filename’
    # empty password file ‘emptypw’ prevents error messages
    AuthBasicAuthoritative Off
    AuthUserFile /home/test/emptypw

  8. Dmitriyon 21 Jul 2009 at 11:35 am

    Thanks a lot!
    I seek the answer for a one month!!!

  9. Amilon 12 Jan 2010 at 11:58 am

    It has nothing to do with htpasswd.

    The solution is to have `AuthBasicAuthoritative Off`.

    But Apache error log keeps claiming `Internal error: pcfg_openfile() called with NULL filename` and `(9)Bad file descriptor: Could not open password file: (null)`.

    To get rid of that error too add `AuthUserFile /dev/null`.

    Thus my `httpd.conf` extract
    .
    .

    DAV svn
    SVNParentPath /var/svn

    # To get rid of
    # 1. `Internal error: pcfg_openfile() called with NULL filename`
    # 2. `user … not found`
    AuthUserFile /dev/null
    AuthBasicAuthoritative Off
    .
    .
    .
    require valid-user

    .
    .
    .

    My environment:
    Red Hat Enterprise Linux Server release 5.2 (Kernel 2.6.18-92.el5)
    Apache 2.2.11
    Subversion 1.6.3

    Note: I’m authenticating using mod_auth_mysql v3.0.0.

  10. Ben Johnsonon 06 Jul 2010 at 6:36 pm

    Windows users do not have the ability to specify “AuthUserFile /dev/null”. Furthermore, that is an undesirable solution. This is the appropriate method (which is described in the rtfm.net document referenced earlier in this thread), provided as a complete example:

    Options FollowSymLinks
    AllowOverride None
    Order deny,allow
    Deny from all
    Satisfy all
    AuthBasicProvider dbm
    AuthDBMType SDBM
    AuthBasicAuthoritative Off
    AuthName “Protected Area”
    AuthType Basic
    AuthDBMUserFile “D:/Program Files/Apache/passwords.dat”
    require valid-user

    Obviously, “AuthBasicProvider” and “AuthDBMType” must reflect the correct values for your system (available types for “AuthDBMType” are: default|SDBM|GDBM|NDBM|DB). See http://httpd.apache.org/docs/2.0/mod/mod_auth_dbm.html and http://httpd.apache.org/docs/2.1/mod/mod_auth_basic.html for additional information.

    The above example functions as expected with Berkeley DB (11gR2) and Apache 2.0.48 on Windows 7 x86. “passwords.dat” should be created with something like this:

    > D:\Program Files\apache\bin>htdbm -cs “D:\Program Files\Apache\passwords.dat” yourname

    Be good!

  11. Ben Johnsonon 06 Jul 2010 at 6:56 pm

    Moderator, you may wish to replace my earlier comment with the following, which contains a few corrections and has extraneous information removed. Thanks!

    =================================================

    Windows users do not have the ability to specify “AuthUserFile /dev/null”. Furthermore, that is an undesirable solution (as others have noted). This is the appropriate method, provided as a complete example (these directives would go inside a tag within httpd.conf, a .htaccess file, etc.):

    Options FollowSymLinks
    AllowOverride None
    Order deny,allow
    Deny from all
    Satisfy all
    AuthBasicProvider dbm
    AuthDBMType SDBM
    AuthName “Protected Area”
    AuthType Basic
    AuthDBMUserFile “D:/Program Files/Apache/passwords.dat”
    require valid-user

    Obviously, “AuthBasicProvider” and “AuthDBMType” must reflect the correct values for your system (available types for “AuthDBMType” are: default|SDBM|GDBM|NDBM|DB). See http://httpd.apache.org/docs/2.0/mod/mod_auth_dbm.html and http://httpd.apache.org/docs/2.1/mod/mod_auth_basic.html for additional information.

    The above example functions as expected with Apache 2.2.6 on Windows 7 x86. “passwords.dat” should be created with something like this:

    > D:\Program Files\apache\bin>htdbm -cs “D:\Program Files\Apache\passwords.dat” yourname

    Note also that, according to the mod_auth_basic manual page (cited above), setting “AuthBasicAuthoritative” to “Off” “… should only be necessary when combining mod_auth_basic with third-party modules that are not configured with the AuthBasicProvider directive.”

    Thanks to everyone here for the assistance in getting this to work properly (under Windows, no less).

Trackback URI | Comments RSS

Leave a Reply