[Catalyst] DBI SQLite driver missing after Catalyst update.

Collin Condray ccondray at gmail.com
Thu Aug 20 23:04:09 GMT 2009


Matt, thanks for helping me out. Comments below:

On Thu, Aug 20, 2009 at 3:47 PM, Matt Whipple <matt at mattwhipple.com> wrote:

> Collin Condray wrote:
>
>> I have recently updated my Catalyst installation from 5.71001 to version
>> 5.80007 and have made one of my websites completely unusable. I followed=
 the
>> instructions in the tutorial (
>> http://search.cpan.org/~hkclark/Catalyst-Manual-5.8000/lib/Catalyst/Manu=
al/Tutorial/04_BasicCRUD.pod<http://search.cpan.org/%7Ehkclark/Catalyst-Man=
ual-5.8000/lib/Catalyst/Manual/Tutorial/04_BasicCRUD.pod><
>> http://search.cpan.org/%7Ehkclark/Catalyst-Manual-5.8000/lib/Catalyst/Ma=
nual/Tutorial/04_BasicCRUD.pod>)
>> to update the database to use load_components and have updated my schema
>> files to match. However, when I go to my site I get the following error
>> message:
>>
>> DBIx::Class::ResultSet::next(): DBI Connection failed: Can't connect to
>> data source 'HASH(0x9e139e0)' because I can't work out what driver to use
>> (it doesn't seem to contain a 'dbi:driver:' prefix and the DBI_DRIVER env
>> var is not set) at /home/me/local/share/perl/5.8.4/DBIx/Class/Storage/DB=
I.pm
>> line 840
>>
> The error message there would seem to say that the dsn isn't being
> retrieved properly out of the config info
>

Agreed.


>
>> My connection string looks OK and matches the tutorial's example code:
>>
>> __PACKAGE__->config(
>>    schema_class =3D> 'wppig::Schema',
>>    connect_info =3D> [
>>        'dbi:SQLite:wppig.db3',
>>    ],
>> );
>>
> I'd opt for the more explicit and scalable key/value option of:
>
>   connect_info =3D> {
>      dsn =3D> 'dbi:SQLite:wppig.db3',
>   },
>
>
> But judging from the docs (which confusing do say arrayref)
>
> http://search.cpan.org:80/~mstrout/Catalyst-Model-DBIC-Schema-0.26/lib/Ca=
talyst/Model/DBIC/Schema.pm#connect_info<http://search.cpan.org:80/%7Emstro=
ut/Catalyst-Model-DBIC-Schema-0.26/lib/Catalyst/Model/DBIC/Schema.pm#connec=
t_info>
>
> I'd say you'd be looking for
>   connect_info =3D> 'dbi:SQLite:wppig.db3',
>
>
>
I've tried both formulations of the config string

__PACKAGE__->config(
   schema_class =3D> 'wppig::Schema',
   connect_info =3D> {
      dsn =3D>  'dbi:SQLite:wppig.db3',
   },
);

__PACKAGE__->config(
   schema_class =3D> 'wppig::Schema',
   connect_info =3D>  'dbi:SQLite:wppig.db3',
);

and even from the docs that you cite

__PACKAGE__->config(
   schema_class =3D> 'wppig::Schema',
   connect_info =3D>  {
      dsn =3D>  'dbi:SQLite:dbname=3Dwppig.db3',
   },
 );

But I still get the same error message. No matter if I've got a hashref or a
string set for connect_info I still see the "Can't connect to data source
'HASH(0x9e139e0)' " error.

Interestingly, when I remove the connect_info line I see this in the logs:
" Couldn't instantiate component "wppig::Model::wppigDB", Either
->config->{connect_info} must be defined for wppig::Model::wppigDB or
wppig::Schema must have connect info defined on it."

Since the the wppig/Schema.pm file has no config information in it, it must
mean there's probably no other config file squirreled away affecting the
connection.

As a side not you may want to meditate on the fact that you apparently
> simultaneously introduced instability into a development and a production
> environment (according to the other reply thread)
>
>
Guilty as charged, I'll fix it as soon as I can get to it.


>
>> Debugging says the piece of code that it's hanging on looks like this:
>>
>> my $result =3D $c->model('DB::Result::Tag')->search(
>>    { },
>>            { join      =3D> { 'items_tag' =3D> 'tag' } }
>> );
>>
>> while ( my $tag =3D $result->next ) { # Hangs here
>>    $tag_count{ $tag->tag }++;
>> }
>>
>> So it looks like the class is loading but I can't do anything with the
>> ResultSet.
>>
>> Any idea of why this is failing? Did I miss a step somewhere in the
>> conversion? I'd be happy to provide more information if needed.
>>
>> Thanks in advance for your help.
>>
>> Collin Condray
>> @ccondray
>> condray.net <http://condray.net>
>> ------------------------------------------------------------------------
>>
>> _______________________________________________
>> List: Catalyst at lists.scsys.co.uk
>> Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
>> Searchable archive:
>> http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
>> Dev site: http://dev.catalyst.perl.org/
>>
>>
>
>
> _______________________________________________
> List: Catalyst at lists.scsys.co.uk
> Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
> Searchable archive:
> http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
> Dev site: http://dev.catalyst.perl.org/
>


If there's something else about my app that I can show you to help solve
this problem, please let me know. Thanks again for your help.


Collin Condray
@ccondray
condray.net
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.scsys.co.uk/pipermail/catalyst/attachments/20090820/19cc6=
8a6/attachment.htm


More information about the Catalyst mailing list