[squid-users] log_db_daemon errors

Brendan Kearney bpk678 at gmail.com
Thu Nov 2 19:04:44 UTC 2023


On 11/2/23 2:51 PM, Brendan Kearney wrote:
> On 11/2/23 2:49 PM, Francesco Chemolli wrote:
>> Hi Robert,
>>   are you sure that you have the required packages on your system?
>> You'll need perl-DBD-MariaDB and what it depends on
>>
>>
>>
>> On Thu, Nov 2, 2023 at 6:41 PM Brendan Kearney <bpk678 at gmail.com> wrote:
>>
>>     On 11/2/23 2:14 PM, Robert 'Bobby' Zenz wrote:
>>     >>> Use of uninitialized value $DBI::errstr in concatenation (.) or
>>     >>> string at /usr/lib64/squid/log_db_daemon line 403.
>>     >> You're trying to use an uninitialized variable when
>>     outputting(?) the
>>     >> error message. Fix that first. I'm guessing you're using the
>>     `errstr`
>>     >> function wrong there, see the official documentation for hints:
>>     >> https://metacpan.org/pod/DBD::MariaDB
>>     >>
>>     >>> Cannot connect to database:  at
>>     /usr/lib64/squid/log_db_daemon line
>>     >>> 403.
>>     >> And then you should see what error you're actually getting
>>     here. My
>>     >> guess is that it will be a permission issue. User not allowed to
>>     >> connect from this host, or process not allowed to access the
>>     socket or
>>     >> something similar.
>>     > My apologies, I missed that that might not be a script you've
>>     written.
>>     > I guess it is a ready-made script?
>>     > _______________________________________________
>>     > squid-users mailing list
>>     > squid-users at lists.squid-cache.org
>>     > https://lists.squid-cache.org/listinfo/squid-users
>>
>>     yes, this is the script packaged with squid from the fedora
>>     repos.  i
>>     will try to correct the script, which i believe may be victim to
>>     newer
>>     syntax in an updated perl version or something like that. we'll see
>>     what comes of it...
>>
>>     thanks,
>>
>>     brendan
>>
>>     _______________________________________________
>>     squid-users mailing list
>>     squid-users at lists.squid-cache.org
>>     https://lists.squid-cache.org/listinfo/squid-users
>>
>>
>>
>> -- 
>>     Francesco
>
> got that...
>
> [root at server3 bin]# rpm -qa |grep perl |grep -i maria
>
> perl-DBD-MariaDB-1.22-4.fc38.x86_64

original script:

# perform db connection
my $dsn = "DBI:mysql:database=$database" . ($host ne "localhost" ? 
":$host" : "");
my $dbh;
my $sth;
eval {
     warn "Connecting... dsn='$dsn', username='$user', password='...'";
     $dbh = DBI->connect($dsn, $user, $pass, { AutoCommit => 1, 
RaiseError => 1, PrintError => 1 });
     };
if ($EVAL_ERROR) {
     die "Cannot connect to database: $DBI::errstr";
}

hacked up, but seemingly working, mods:

# perform db connection
     # my $dsn = "DBI:mysql:database=$database" . ($host ne "localhost" 
? ":$host" : "");
my $dsn = "DBI:MariaDB:database=$database;host=$host";
my $dbh;
my $sth;
eval {
         # warn "Connecting... dsn='$dsn', username='$user', 
password='...'";
     $dbh = DBI->connect($dsn, $user, $pass, { AutoCommit => 1, 
RaiseError => 1, PrintError => 1 });
     };
if ($EVAL_ERROR) {
         # die "Cannot connect to database: $DBI::errstr";
         die;
}

i am by far not a developer, so i cannot say what should be in the 
script.  brute forcing it got me to the mods shown above.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.squid-cache.org/pipermail/squid-users/attachments/20231102/db9b7dce/attachment-0001.htm>


More information about the squid-users mailing list