You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by Tianyin Xu <ti...@cs.ucsd.edu> on 2016/05/06 01:22:56 UTC

[users@httpd] "DSO load failed" when using mod_authn_dbm for Berkeley DB

Hi,

I'm trying to use mod_authn_dbm, and referring to
https://httpd.apache.org/docs/current/mod/mod_authn_dbm.html

I used dbmmanger to generate the dbm file named dbm-auth-file.
$ file dbm-auth-file
dbm-auth-file: Berkeley DB (Hash, version 9, native byte-order)

According to the manual, the value of AuthDBMType could be
"default|SDBM|GDBM|NDBM|DB".

Is "DB" here refer to Berkeley DB?

I set "AuthDBMType DB" and see the following errors in my error_log:
[Thu May 05 18:12:29.915467 2016] [authn_dbm:error] [pid 9107:tid
140031532377856] (20019)DSO load failed: [client 127.0.0.1:54442] AH01754:
could not open dbm (type DB) auth file:
/home/tixu/httpd-2.4.20-bin/dbm-auth-file

(and the client gets 500 Internal Service Error as you can expected)

Does anyone know about this?

Thanks!
~t

Re: [users@httpd] "DSO load failed" when using mod_authn_dbm for Berkeley DB

Posted by Luca Toscano <to...@gmail.com>.
2016-05-14 1:29 GMT+02:00 Tianyin Xu <ti...@cs.ucsd.edu>:

> btw, after such diagnosis efforts, I really feel the logs need to be
> improved. It's so misleading right now. Look at the *only* error message,
>
> [Thu May 05 18:12:29.915467 2016] [authn_dbm:error] [pid 9107:tid
> 140031532377856] (20019)DSO load failed: [client 127.0.0.1:54442]
> AH01754: could not open dbm (type DB) auth file:
> /home/tixu/httpd-2.4.20-bin/dbm-auth-file
>
> It tells that the auth file cannot be opened. That's all the confusion...
>
> But it has nothing to do with the auth file. The error is caused by the
> failure of loading the DSO... At least, httpd should print out the DSO file
> it tried to load!
>
>
Opened https://bz.apache.org/bugzilla/show_bug.cgi?id=59558 to track the
next steps.

Thanks!

Luca

Re: [users@httpd] "DSO load failed" when using mod_authn_dbm for Berkeley DB

Posted by Tianyin Xu <ti...@cs.ucsd.edu>.
btw, after such diagnosis efforts, I really feel the logs need to be
improved. It's so misleading right now. Look at the *only* error message,

[Thu May 05 18:12:29.915467 2016] [authn_dbm:error] [pid 9107:tid
140031532377856] (20019)DSO load failed: [client 127.0.0.1:54442] AH01754:
could not open dbm (type DB) auth file: /home/tixu/httpd-2.4.20-bin/
dbm-auth-file

It tells that the auth file cannot be opened. That's all the confusion...

But it has nothing to do with the auth file. The error is caused by the
failure of loading the DSO... At least, httpd should print out the DSO file
it tried to load!

~t


On Fri, May 13, 2016 at 4:22 PM, Tianyin Xu <ti...@cs.ucsd.edu> wrote:

> Hi Yann and Luca,
>
> Yes, that fixes the problem...!!..
>
> $ ls lib/apr-util-1/
> apr_dbm_db-1.so  apr_dbm_db.a  apr_dbm_db.la  apr_dbm_db.so
>
> It's hard to believe --with-berkeley-db is even not present in
> "./configure --help"!
>
> @Luca, you are the maintainer of the httpd docs? The page of mod_authn_dbm
> really needs some more work.:-p
>
> ~t
>
>
>
> On Fri, May 13, 2016 at 3:41 PM, Luca Toscano <to...@gmail.com>
> wrote:
>
>> Hi Yann,
>>
>> 2016-05-13 22:35 GMT+02:00 Yann Ylavic <yl...@gmail.com>:
>>
>>> On Thu, May 12, 2016 at 10:22 PM, Tianyin Xu <ti...@cs.ucsd.edu> wrote:
>>> >
>>> > I'm using all the latest versions of httpd, apr, and apr-util:
>>> > httpd-2.4.20
>>> > apr-1.5.2
>>> > apr-util-1.5.4
>>> >
>>> > and I build the binaries using,
>>> > $ ./configure --with-included-apr --enable-load-all-modules
>>> >
>>> > It seems I failed to build "apr-util-1/apr_dbm_db-1.so"? Actually I
>>> don't
>>> > have the "apr-util-1" directory at all.
>>>
>>> You may need to install the package libdb-dev (or libdb-devel) on your
>>> system and then use --with-berkeley-db in the ./configure above.
>>>
>>
>> Quick question: I didn't find the --with-berkeley-db option executing
>> httpd's ./configure --help, but I found it only with the APR's one. How
>> does the configure work when you use "--with-included-apr" ? Just to have
>> an idea about how to fix the docs :)
>>
>> Thanks!
>>
>> Luca
>>
>>
>
>
> --
> Tianyin XU,
> http://cseweb.ucsd.edu/~tixu/
>



-- 
Tianyin XU,
http://cseweb.ucsd.edu/~tixu/

Re: [users@httpd] "DSO load failed" when using mod_authn_dbm for Berkeley DB

Posted by Tianyin Xu <ti...@cs.ucsd.edu>.
Hi Yann and Luca,

Yes, that fixes the problem...!!..

$ ls lib/apr-util-1/
apr_dbm_db-1.so  apr_dbm_db.a  apr_dbm_db.la  apr_dbm_db.so

It's hard to believe --with-berkeley-db is even not present in "./configure
--help"!

@Luca, you are the maintainer of the httpd docs? The page of mod_authn_dbm
really needs some more work.:-p

~t



On Fri, May 13, 2016 at 3:41 PM, Luca Toscano <to...@gmail.com>
wrote:

> Hi Yann,
>
> 2016-05-13 22:35 GMT+02:00 Yann Ylavic <yl...@gmail.com>:
>
>> On Thu, May 12, 2016 at 10:22 PM, Tianyin Xu <ti...@cs.ucsd.edu> wrote:
>> >
>> > I'm using all the latest versions of httpd, apr, and apr-util:
>> > httpd-2.4.20
>> > apr-1.5.2
>> > apr-util-1.5.4
>> >
>> > and I build the binaries using,
>> > $ ./configure --with-included-apr --enable-load-all-modules
>> >
>> > It seems I failed to build "apr-util-1/apr_dbm_db-1.so"? Actually I
>> don't
>> > have the "apr-util-1" directory at all.
>>
>> You may need to install the package libdb-dev (or libdb-devel) on your
>> system and then use --with-berkeley-db in the ./configure above.
>>
>
> Quick question: I didn't find the --with-berkeley-db option executing
> httpd's ./configure --help, but I found it only with the APR's one. How
> does the configure work when you use "--with-included-apr" ? Just to have
> an idea about how to fix the docs :)
>
> Thanks!
>
> Luca
>
>


-- 
Tianyin XU,
http://cseweb.ucsd.edu/~tixu/

Re: [users@httpd] "DSO load failed" when using mod_authn_dbm for Berkeley DB

Posted by Luca Toscano <to...@gmail.com>.
Hi Yann,

2016-05-13 22:35 GMT+02:00 Yann Ylavic <yl...@gmail.com>:

> On Thu, May 12, 2016 at 10:22 PM, Tianyin Xu <ti...@cs.ucsd.edu> wrote:
> >
> > I'm using all the latest versions of httpd, apr, and apr-util:
> > httpd-2.4.20
> > apr-1.5.2
> > apr-util-1.5.4
> >
> > and I build the binaries using,
> > $ ./configure --with-included-apr --enable-load-all-modules
> >
> > It seems I failed to build "apr-util-1/apr_dbm_db-1.so"? Actually I don't
> > have the "apr-util-1" directory at all.
>
> You may need to install the package libdb-dev (or libdb-devel) on your
> system and then use --with-berkeley-db in the ./configure above.
>

Quick question: I didn't find the --with-berkeley-db option executing
httpd's ./configure --help, but I found it only with the APR's one. How
does the configure work when you use "--with-included-apr" ? Just to have
an idea about how to fix the docs :)

Thanks!

Luca

Re: [users@httpd] "DSO load failed" when using mod_authn_dbm for Berkeley DB

Posted by Yann Ylavic <yl...@gmail.com>.
On Thu, May 12, 2016 at 10:22 PM, Tianyin Xu <ti...@cs.ucsd.edu> wrote:
>
> I'm using all the latest versions of httpd, apr, and apr-util:
> httpd-2.4.20
> apr-1.5.2
> apr-util-1.5.4
>
> and I build the binaries using,
> $ ./configure --with-included-apr --enable-load-all-modules
>
> It seems I failed to build "apr-util-1/apr_dbm_db-1.so"? Actually I don't
> have the "apr-util-1" directory at all.

You may need to install the package libdb-dev (or libdb-devel) on your
system and then use --with-berkeley-db in the ./configure above.

Regards,
Yann.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] "DSO load failed" when using mod_authn_dbm for Berkeley DB

Posted by Tianyin Xu <ti...@cs.ucsd.edu>.
Thanks a lot, Luca!

On Thu, May 12, 2016 at 1:04 AM, Luca Toscano <to...@gmail.com>
wrote:

>
>
> 2016-05-12 7:09 GMT+02:00 Tianyin Xu <ti...@cs.ucsd.edu>:
>
>> Sorry Luca, I misspelled your name in my last email. :-(
>>
>
> No problem at all :)
>
>
>>
>> On Wed, May 11, 2016 at 9:55 PM, Tianyin Xu <ti...@cs.ucsd.edu> wrote:
>>
>>> Thanks, Loca!
>>>
>>> Yes, I did set AuthDBMUserFile (the whole point for this module is to
>>> use a DBM file to do the authn control, isn't it?)
>>>
>>
> Thanks for the new info!
>
>
>>
>>> I generate the file called dbm-auth-file using dbmmanger
>>> $ file dbm-auth-file
>>> dbm-auth-file: Berkeley DB (Hash, version 9, native byte-order)
>>>
>>> and then I loaded the module and configured it in a <Directory> as
>>> follows,
>>>     AuthType Basic
>>>     AuthName Documents
>>>     AuthBasicProvider dbm
>>>     AuthDBMType DB
>>>     AuthDBMUserFile "/home/tixu/httpd-2.4.20-bin/dbm-auth-file"
>>>
>>
>>> and then I got the "DSO load failed" message:
>>> [Thu May 05 18:12:29.915467 2016] [authn_dbm:error] [pid 9107:tid
>>> 140031532377856] (20019)DSO load failed: [client 127.0.0.1:54442]
>>> AH01754: could not open dbm (type DB) auth file:
>>> /home/tixu/httpd-2.4.20-bin/dbm-auth-file
>>>
>>> I changed the AuthBasicProvider to be "default" and used "htdbm" to
>>> create the DBM files (in which can it generates a .dir and .pag file). And
>>> the module goes correctly.
>>>
>>> Thus, I'm sure there it the problem of the "AuthDBMType". But I'm not
>>> sure if this is a bug in the implementation of mod_authn_dbm or a problem
>>> of some native libs in my system or some incompatibility caused by the
>>> dbmmanger?
>>>
>>>
> mod_authn_dbm calls APR to open the DBM file, definitely supporting
> Berkeley DB but with the note "not all may be available at run time":
>
>
> https://apr.apache.org/docs/apr/2.0/group___a_p_r___util___d_b_m.html#gaf7295ba8157f487b78319e168e1344b4
>
> From what I can see, the error comes all the way from the
> function dbm_open_type or  in APR (apr_dbm.c).
>
> It might be a problem of the httpd/apr version that you are using and/or
> related configure flags needed. Could you please give us more details?
> After this issue is resolved I'll update the documentation with more
> details!
>
>

Yes, your understanding is absolutely correct.

I traced the failure point using GDB. The execution goes through
apr_dbm_open_ex() and failed inside dbm_open_type().

Precisely, it failed when trying to load the DSO:
176     rv = apu_dso_load(NULL, &symbol, modname, symname, pool);    /*
srclib/apr-util/dbm/apr_dbm.c */

Tracing inside, the APR operation to load the dso is here,

Breakpoint 5, apr_dso_load (res_handle=0x7fffe57e89d8, path=0x7fffe57e8a00
"/home/tixu/httpd-2.4.20-bin/lib/apr-util-1/apr_dbm_db-1.so",
pool=0x867108) at dso/unix/dso.c:126
126        int flags = RTLD_NOW | RTLD_GLOBAL;

We can see that it tries to load the DSO file,
"/home/tixu/httpd-2.4.20-bin/lib/apr-util-1/apr_dbm_db-1.so" (using dl_open
as I'm on Linux).

But I don't have this .so file at the referred path. Certainly, it fails.

I'm using all the latest versions of httpd, apr, and apr-util:
httpd-2.4.20
apr-1.5.2
apr-util-1.5.4

and I build the binaries using,
$ ./configure --with-included-apr --enable-load-all-modules

It seems I failed to build "apr-util-1/apr_dbm_db-1.so"? Actually I don't
have the "apr-util-1" directory at all.

Let me know if there's anything I can provide.

Thanks!


>
> Luca
>
>
>
>



-- 
Tianyin XU,
http://cseweb.ucsd.edu/~tixu/

Re: [users@httpd] "DSO load failed" when using mod_authn_dbm for Berkeley DB

Posted by Luca Toscano <to...@gmail.com>.
2016-05-12 7:09 GMT+02:00 Tianyin Xu <ti...@cs.ucsd.edu>:

> Sorry Luca, I misspelled your name in my last email. :-(
>

No problem at all :)


>
> On Wed, May 11, 2016 at 9:55 PM, Tianyin Xu <ti...@cs.ucsd.edu> wrote:
>
>> Thanks, Loca!
>>
>> Yes, I did set AuthDBMUserFile (the whole point for this module is to use
>> a DBM file to do the authn control, isn't it?)
>>
>
Thanks for the new info!


>
>> I generate the file called dbm-auth-file using dbmmanger
>> $ file dbm-auth-file
>> dbm-auth-file: Berkeley DB (Hash, version 9, native byte-order)
>>
>> and then I loaded the module and configured it in a <Directory> as
>> follows,
>>     AuthType Basic
>>     AuthName Documents
>>     AuthBasicProvider dbm
>>     AuthDBMType DB
>>     AuthDBMUserFile "/home/tixu/httpd-2.4.20-bin/dbm-auth-file"
>>
>
>> and then I got the "DSO load failed" message:
>> [Thu May 05 18:12:29.915467 2016] [authn_dbm:error] [pid 9107:tid
>> 140031532377856] (20019)DSO load failed: [client 127.0.0.1:54442]
>> AH01754: could not open dbm (type DB) auth file:
>> /home/tixu/httpd-2.4.20-bin/dbm-auth-file
>>
>> I changed the AuthBasicProvider to be "default" and used "htdbm" to
>> create the DBM files (in which can it generates a .dir and .pag file). And
>> the module goes correctly.
>>
>> Thus, I'm sure there it the problem of the "AuthDBMType". But I'm not
>> sure if this is a bug in the implementation of mod_authn_dbm or a problem
>> of some native libs in my system or some incompatibility caused by the
>> dbmmanger?
>>
>>
mod_authn_dbm calls APR to open the DBM file, definitely supporting
Berkeley DB but with the note "not all may be available at run time":

https://apr.apache.org/docs/apr/2.0/group___a_p_r___util___d_b_m.html#gaf7295ba8157f487b78319e168e1344b4

From what I can see, the error comes all the way from the
function dbm_open_type or  in APR (apr_dbm.c).

It might be a problem of the httpd/apr version that you are using and/or
related configure flags needed. Could you please give us more details?
After this issue is resolved I'll update the documentation with more
details!


Luca

Re: [users@httpd] "DSO load failed" when using mod_authn_dbm for Berkeley DB

Posted by Tianyin Xu <ti...@cs.ucsd.edu>.
Sorry Luca, I misspelled your name in my last email. :-(

On Wed, May 11, 2016 at 9:55 PM, Tianyin Xu <ti...@cs.ucsd.edu> wrote:

> Thanks, Loca!
>
> Yes, I did set AuthDBMUserFile (the whole point for this module is to use
> a DBM file to do the authn control, isn't it?)
>
> I generate the file called dbm-auth-file using dbmmanger
> $ file dbm-auth-file
> dbm-auth-file: Berkeley DB (Hash, version 9, native byte-order)
>
> and then I loaded the module and configured it in a <Directory> as follows,
>     AuthType Basic
>     AuthName Documents
>     AuthBasicProvider dbm
>     AuthDBMType DB
>     AuthDBMUserFile "/home/tixu/httpd-2.4.20-bin/dbm-auth-file"
>
> and then I got the "DSO load failed" message:
> [Thu May 05 18:12:29.915467 2016] [authn_dbm:error] [pid 9107:tid
> 140031532377856] (20019)DSO load failed: [client 127.0.0.1:54442]
> AH01754: could not open dbm (type DB) auth file:
> /home/tixu/httpd-2.4.20-bin/dbm-auth-file
>
> I changed the AuthBasicProvider to be "default" and used "htdbm" to
> create the DBM files (in which can it generates a .dir and .pag file). And
> the module goes correctly.
>
> Thus, I'm sure there it the problem of the "AuthDBMType". But I'm not
> sure if this is a bug in the implementation of mod_authn_dbm or a problem
> of some native libs in my system or some incompatibility caused by the
> dbmmanger?
>
> Thanks!
> Tianyin
>
>
>
>
>
>
> On Mon, May 9, 2016 at 11:41 PM, Luca Toscano <to...@gmail.com>
> wrote:
>
>> Hi Tianyin,
>>
>> 2016-05-06 3:22 GMT+02:00 Tianyin Xu <ti...@cs.ucsd.edu>:
>>
>>> Hi,
>>>
>>> I'm trying to use mod_authn_dbm, and referring to
>>> https://httpd.apache.org/docs/current/mod/mod_authn_dbm.html
>>>
>>> I used dbmmanger to generate the dbm file named dbm-auth-file.
>>> $ file dbm-auth-file
>>> dbm-auth-file: Berkeley DB (Hash, version 9, native byte-order)
>>>
>>> According to the manual, the value of AuthDBMType could be
>>> "default|SDBM|GDBM|NDBM|DB".
>>>
>>> Is "DB" here refer to Berkeley DB?
>>>
>>> I set "AuthDBMType DB" and see the following errors in my error_log:
>>> [Thu May 05 18:12:29.915467 2016] [authn_dbm:error] [pid 9107:tid
>>> 140031532377856] (20019)DSO load failed: [client 127.0.0.1:54442]
>>> AH01754: could not open dbm (type DB) auth file:
>>> /home/tixu/httpd-2.4.20-bin/dbm-auth-file
>>>
>>> (and the client gets 500 Internal Service Error as you can expected)
>>>
>>> Does anyone know about this?
>>>
>>
>> I am a bit ignorant about this module but it seems that you'd need to set
>> https://httpd.apache.org/docs/current/mod/mod_authn_dbm.html#authdbmuserfile
>> to avoid (what is seems) the default path.
>>
>> Let us know!
>>
>> Luca
>>
>>
>
>
> --
> Tianyin XU,
> http://cseweb.ucsd.edu/~tixu/
>



-- 
Tianyin XU,
http://cseweb.ucsd.edu/~tixu/

Re: [users@httpd] "DSO load failed" when using mod_authn_dbm for Berkeley DB

Posted by Tianyin Xu <ti...@cs.ucsd.edu>.
Thanks, Loca!

Yes, I did set AuthDBMUserFile (the whole point for this module is to use a
DBM file to do the authn control, isn't it?)

I generate the file called dbm-auth-file using dbmmanger
$ file dbm-auth-file
dbm-auth-file: Berkeley DB (Hash, version 9, native byte-order)

and then I loaded the module and configured it in a <Directory> as follows,
    AuthType Basic
    AuthName Documents
    AuthBasicProvider dbm
    AuthDBMType DB
    AuthDBMUserFile "/home/tixu/httpd-2.4.20-bin/dbm-auth-file"

and then I got the "DSO load failed" message:
[Thu May 05 18:12:29.915467 2016] [authn_dbm:error] [pid 9107:tid
140031532377856] (20019)DSO load failed: [client 127.0.0.1:54442] AH01754:
could not open dbm (type DB) auth file: /home/tixu/httpd-2.4.20-bin/
dbm-auth-file

I changed the AuthBasicProvider to be "default" and used "htdbm" to create
the DBM files (in which can it generates a .dir and .pag file). And the
module goes correctly.

Thus, I'm sure there it the problem of the "AuthDBMType". But I'm not sure
if this is a bug in the implementation of mod_authn_dbm or a problem of
some native libs in my system or some incompatibility caused by the
dbmmanger?

Thanks!
Tianyin






On Mon, May 9, 2016 at 11:41 PM, Luca Toscano <to...@gmail.com>
wrote:

> Hi Tianyin,
>
> 2016-05-06 3:22 GMT+02:00 Tianyin Xu <ti...@cs.ucsd.edu>:
>
>> Hi,
>>
>> I'm trying to use mod_authn_dbm, and referring to
>> https://httpd.apache.org/docs/current/mod/mod_authn_dbm.html
>>
>> I used dbmmanger to generate the dbm file named dbm-auth-file.
>> $ file dbm-auth-file
>> dbm-auth-file: Berkeley DB (Hash, version 9, native byte-order)
>>
>> According to the manual, the value of AuthDBMType could be
>> "default|SDBM|GDBM|NDBM|DB".
>>
>> Is "DB" here refer to Berkeley DB?
>>
>> I set "AuthDBMType DB" and see the following errors in my error_log:
>> [Thu May 05 18:12:29.915467 2016] [authn_dbm:error] [pid 9107:tid
>> 140031532377856] (20019)DSO load failed: [client 127.0.0.1:54442]
>> AH01754: could not open dbm (type DB) auth file:
>> /home/tixu/httpd-2.4.20-bin/dbm-auth-file
>>
>> (and the client gets 500 Internal Service Error as you can expected)
>>
>> Does anyone know about this?
>>
>
> I am a bit ignorant about this module but it seems that you'd need to set
> https://httpd.apache.org/docs/current/mod/mod_authn_dbm.html#authdbmuserfile
> to avoid (what is seems) the default path.
>
> Let us know!
>
> Luca
>
>


-- 
Tianyin XU,
http://cseweb.ucsd.edu/~tixu/

Re: [users@httpd] "DSO load failed" when using mod_authn_dbm for Berkeley DB

Posted by Luca Toscano <to...@gmail.com>.
Hi Tianyin,

2016-05-06 3:22 GMT+02:00 Tianyin Xu <ti...@cs.ucsd.edu>:

> Hi,
>
> I'm trying to use mod_authn_dbm, and referring to
> https://httpd.apache.org/docs/current/mod/mod_authn_dbm.html
>
> I used dbmmanger to generate the dbm file named dbm-auth-file.
> $ file dbm-auth-file
> dbm-auth-file: Berkeley DB (Hash, version 9, native byte-order)
>
> According to the manual, the value of AuthDBMType could be
> "default|SDBM|GDBM|NDBM|DB".
>
> Is "DB" here refer to Berkeley DB?
>
> I set "AuthDBMType DB" and see the following errors in my error_log:
> [Thu May 05 18:12:29.915467 2016] [authn_dbm:error] [pid 9107:tid
> 140031532377856] (20019)DSO load failed: [client 127.0.0.1:54442]
> AH01754: could not open dbm (type DB) auth file:
> /home/tixu/httpd-2.4.20-bin/dbm-auth-file
>
> (and the client gets 500 Internal Service Error as you can expected)
>
> Does anyone know about this?
>

I am a bit ignorant about this module but it seems that you'd need to set
https://httpd.apache.org/docs/current/mod/mod_authn_dbm.html#authdbmuserfile
to avoid (what is seems) the default path.

Let us know!

Luca