Thread: [Cgi-session-user] \t(in cleanup) Can't connect to data source '' because I can't work out
Brought to you by:
sherzodr
From: <mim...@gm...> - 2013-07-30 23:13:22
|
I have CGI::Session wrapped up in the subroutine below, and this has always worked. sub initialise_session { # Establish our database connection. my $dbh = db_connect(); CGI::Session->name("token"); #my $session = new CGI::Session('driver:mysql;serializer:storable', undef, { Handle => $dbh}) or die CGI::Session->errstr; # use for purpose of testing only. Above to be used afterwards. my $session = new CGI::Session('driver:mysql', undef, { Handle => $dbh}) or die CGI::Session->errstr; return $session; $session->flush(); $dbh->disconnect(); } Since yesterday it started to error and it's no longer able to commit session to MySQL. [Tue Jul 30 04:40:37 2013] [error] [client 192.168.0.90] \t(in cleanup) Can't connect to data source '' 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 /usr/local/share/perl5/CGI/Session/Driver/DBI.pm line 26, referer: http://localhost/user.html No changes have been made to the subroutine, so I'm wondering why this sudden error. As you can see above, I have called flush() to commit the session before the db is connected. I also did the same else where in my program, but the error persist. Any ideas? Thanks Mimi |
From: <mim...@gm...> - 2013-07-30 23:41:55
|
Issue resolved by calling flush() before returning the object. Strangely enough, I have being using the code for over a year without calling flush() anywhere within the sub and it has always worked until yesterday. Mimi On 31 July 2013 00:13, mim...@gm... <mim...@gm...> wrote: > I have CGI::Session wrapped up in the subroutine below, and this has > always worked. > > sub initialise_session { > > # Establish our database connection. > my $dbh = db_connect(); > > CGI::Session->name("token"); > #my $session = new CGI::Session('driver:mysql;serializer:storable', > undef, { Handle => $dbh}) or die CGI::Session->errstr; > > # use for purpose of testing only. Above to be used afterwards. > my $session = new CGI::Session('driver:mysql', undef, { Handle => > $dbh}) or die CGI::Session->errstr; > > return $session; > $session->flush(); > $dbh->disconnect(); > } > > Since yesterday it started to error and it's no longer able to commit > session to MySQL. > > [Tue Jul 30 04:40:37 2013] [error] [client 192.168.0.90] \t(in cleanup) > Can't connect to data source '' 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 /usr/local/share/perl5/CGI/Session/Driver/DBI.pm line > 26, referer: http://localhost/user.html > > No changes have been made to the subroutine, so I'm wondering why this > sudden error. As you can see above, I have called flush() to commit the > session before the db is connected. I also did the same else where in my > program, but the error persist. > > Any ideas? > > Thanks > > Mimi > |
From: Jeffrey C. <jch...@gm...> - 2013-07-31 01:06:32
|
On 07/30/2013 04:41 PM, mim...@gm... wrote: > Issue resolved by calling flush() before returning the object. > Strangely enough, I have being using the code for over a year without > calling flush() anywhere within the sub and it has always worked until > yesterday. Your hosting provider changed something. If you have a local workstation, did the behavior change? I had to disable file locking on a system that had been stable > 2 yrs. because of changes by the hosting provided (Rackspace) eval { $session = CGI::Session->new( undef, CGI->new(), { *NoFlock => 1*, Directory => q?../session? } ) }; > > > > Mimi > > > On 31 July 2013 00:13, mim...@gm... <mailto:mim...@gm...> > <mim...@gm... <mailto:mim...@gm...>> wrote: > > I have CGI::Session wrapped up in the subroutine below, and this > has always worked. > > sub initialise_session { > > # Establish our database connection. > my $dbh = db_connect(); > > CGI::Session->name("token"); > #my $session = new > CGI::Session('driver:mysql;serializer:storable', undef, { Handle > => $dbh}) or die CGI::Session->errstr; > > # use for purpose of testing only. Above to be used > afterwards. > my $session = new CGI::Session('driver:mysql', undef, { > Handle => $dbh}) or die CGI::Session->errstr; > > return $session; > $session->flush(); > $dbh->disconnect(); > } > > Since yesterday it started to error and it's no longer able to > commit session to MySQL. > > [Tue Jul 30 04:40:37 2013] [error] [client 192.168.0.90] \t(in > cleanup) Can't connect to data source '' 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 > /usr/local/share/perl5/CGI/Session/Driver/DBI.pm line 26, referer: > http://localhost/user.html > > No changes have been made to the subroutine, so I'm wondering why > this sudden error. As you can see above, I have called flush() to > commit the session before the db is connected. I also did the same > else where in my program, but the error persist. > > Any ideas? > > Thanks > > Mimi > > > > > ------------------------------------------------------------------------------ > Get your SQL database under version control now! > Version control is standard for application code, but databases havent > caught up. So what steps can you take to put your SQL databases under > version control? Why should you start doing it? Read more to find out. > http://pubads.g.doubleclick.net/gampad/clk?id=49501711&iu=/4140/ostg.clktrk > > > _______________________________________________ > Cgi-session-user mailing list > Cgi...@li... > https://lists.sourceforge.net/lists/listinfo/cgi-session-user |
From: <mim...@gm...> - 2013-07-31 01:45:03
|
Yes, the problem was resolved by calling flush() before return(). The sub is in a separate library file and it always work without me calling flush() within it. Usually I commit session data to disk in my program and it was always fine, except from yesterday. The dev environment is a local vm box and nothing has changed as far as I'm concern, so I wonder why cgi-session sudden change in behaviour. The only changes I made are actually in my program. Even with that, session continued to work without problem at first. Anyway, thanks. Now I know better. Cheers Mimi On 31 July 2013 02:06, Jeffrey Chimene <jch...@gm...> wrote: > On 07/30/2013 04:41 PM, mim...@gm... wrote: > > Issue resolved by calling flush() before returning the object. Strangely > enough, I have being using the code for over a year without calling flush() > anywhere within the sub and it has always worked until yesterday. > > > Your hosting provider changed something. If you have a local workstation, > did the behavior change? > I had to disable file locking on a system that had been stable > 2 yrs. > because of changes by the hosting provided (Rackspace) > eval { $session = CGI::Session->new( undef, CGI->new(), { *NoFlock => 1*, > Directory => q?../session? } ) }; > > > > > Mimi > > > On 31 July 2013 00:13, mim...@gm... <mim...@gm...> wrote: > >> I have CGI::Session wrapped up in the subroutine below, and this has >> always worked. >> >> sub initialise_session { >> >> # Establish our database connection. >> my $dbh = db_connect(); >> >> CGI::Session->name("token"); >> #my $session = new CGI::Session('driver:mysql;serializer:storable', >> undef, { Handle => $dbh}) or die CGI::Session->errstr; >> >> # use for purpose of testing only. Above to be used afterwards. >> my $session = new CGI::Session('driver:mysql', undef, { Handle => >> $dbh}) or die CGI::Session->errstr; >> >> return $session; >> $session->flush(); >> $dbh->disconnect(); >> } >> >> Since yesterday it started to error and it's no longer able to commit >> session to MySQL. >> >> [Tue Jul 30 04:40:37 2013] [error] [client 192.168.0.90] \t(in cleanup) >> Can't connect to data source '' 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 /usr/local/share/perl5/CGI/Session/Driver/DBI.pm line >> 26, referer: http://localhost/user.html >> >> No changes have been made to the subroutine, so I'm wondering why this >> sudden error. As you can see above, I have called flush() to commit the >> session before the db is connected. I also did the same else where in my >> program, but the error persist. >> >> Any ideas? >> >> Thanks >> >> Mimi >> > > > > ------------------------------------------------------------------------------ > Get your SQL database under version control now! > Version control is standard for application code, but databases havent > caught up. So what steps can you take to put your SQL databases under > version control? Why should you start doing it? Read more to find out.http://pubads.g.doubleclick.net/gampad/clk?id=49501711&iu=/4140/ostg.clktrk > > > > _______________________________________________ > Cgi-session-user mailing lis...@li...https://lists.sourceforge.net/lists/listinfo/cgi-session-user > > > > > ------------------------------------------------------------------------------ > Get your SQL database under version control now! > Version control is standard for application code, but databases havent > caught up. So what steps can you take to put your SQL databases under > version control? Why should you start doing it? Read more to find out. > http://pubads.g.doubleclick.net/gampad/clk?id=49501711&iu=/4140/ostg.clktrk > _______________________________________________ > Cgi-session-user mailing list > Cgi...@li... > https://lists.sourceforge.net/lists/listinfo/cgi-session-user > > |