dbdimp.c:3478: error: syntax error before "if" for DBD::mysql install

aerospex

Member
Nov 20, 2006
9
0
151
A few days ago, cpanel updated and [checkperlmodules] told me via email "[checkperlmodules] perl version too old (v5.8.8 required, v5.8.5 is installed.)".

I went ahead and followed the instructions and successfully brought it up to 5.8.8.

Since then though I started getting tailwatchd errors.

tailwatchd failed @ Thu Apr 5 23:35:02 2012. A restart was attempted automagically.
Service Check Method: [check command] tailwatchd is not running
After reading a few posts and checking some logs, I found in the /usr/local/cpanel/logs/tailwatchd_log the following message:

!!
ATTENTION ATTENTION ATTENTION ATTENTION

The tailwatchd driver 'Cpanel::TailWatch::Eximstats' (Cpanel/TailWatch/Eximstats.pm) could not create an object.

More specifically:

Can't locate DBD/mysql.pm in @INC (@INC contains: /usr/local/cpanel /usr/local/cpanel/Cpanel/CPAN/overload/__Time /usr/local/lib/perl5/5.8.8/i686-linux /usr/local/lib/perl5/5.8.8 /usr/local/lib/perl5/site_perl/5.8.8/i686-linux /usr/local/lib/perl5/site_perl/5.8.8 /usr/local/lib/perl5/site_perl .) at (eval 7) line 3.
So it seemed DBD::mysql didn't install correctly. Further investigations got me to run /usr/local/cpanel/bin/checkperlmodules, which output the following: (was a lot more than this, but I believe this is the important part)

Checking if your kit is complete...
Looks good
Using DBI 1.618 (for perl 5.008008 on i686-linux) installed in /usr/local/lib/perl5/site_perl/5.8.8/i686-linux/auto/DBI/
Writing Makefile for DBD::mysql
Writing MYMETA.yml and MYMETA.json
cp lib/DBD/mysql.pm blib/lib/DBD/mysql.pm
cp lib/DBD/mysql/GetInfo.pm blib/lib/DBD/mysql/GetInfo.pm
cp lib/DBD/mysql/INSTALL.pod blib/lib/DBD/mysql/INSTALL.pod
cp lib/Bundle/DBD/mysql.pm blib/lib/Bundle/DBD/mysql.pm
cc -c -I/usr/local/lib/perl5/site_perl/5.8.8/i686-linux/auto/DBI -I/usr/include/mysql -g -pipe -march=i386 -mcpu=i686 -DDBD_MYSQL_INSERT_ID_IS_GOOD -g -fno-strict-aliasing -pipe -Wdeclaration-after-statement -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -I/usr/include/gdbm -Os -DVERSION=\"4.020\" -DXS_VERSION=\"4.020\" -fpic "-I/usr/local/lib/perl5/5.8.8/i686-linux/CORE" dbdimp.c
dbdimp.c:3478: error: syntax error before "if"
dbdimp.c:3492: error: syntax error before '->' token
dbdimp.c:3507: error: syntax error before '(' token
dbdimp.c:3507: error: conflicting types for 'PerlIO_printf'
dbdimp.c:3507: note: a parameter list with an ellipsis can't match an empty parameter name list declaration
/usr/local/lib/perl5/5.8.8/i686-linux/CORE/perlio.h:284: error: previous declaration of 'PerlIO_printf' was here
dbdimp.c:3507: error: conflicting types for 'PerlIO_printf'
dbdimp.c:3507: note: a parameter list with an ellipsis can't match an empty parameter name list declaration
/usr/local/lib/perl5/5.8.8/i686-linux/CORE/perlio.h:284: error: previous declaration of 'PerlIO_printf' was here
gmake: *** [dbdimp.o] Error 1
CAPTTOFU/DBD-mysql-4.020.tar.gz
/usr/bin/gmake -- NOT OK

CPAN: YAML loaded ok (v0.80)
Running make install
Make had returned bad status, install seems impossible
perlmod--Install done
Tested 137, 136 ok, 1 failed.
Failed install: DBD::mysql
Using fast module check.....checked 5 modules in 1 second(s)
Cpanel::FastMath: [INSTALLED=1] [VERSION=0.3]
Cpanel::POSIX::Tiny: [INSTALLED=1] [VERSION=1.1]
Cpanel::Cleanup: [INSTALLED=1] [VERSION=0.4]
Cpanel::Class: [INSTALLED=1] [VERSION=1.0.5]
Cpanel::TaskQueue: [INSTALLED=1] [VERSION=0.307]

I've tried installing the module through the cpanel interface, via the CPAN shell, and through /usr/local/cpanel/bin/checkperlmodules all to no avail.

Can I get some advice on how I can fix this problem? Everything I've tried doesn't seem to work. I've thought about forcing the compiler to gcc, but read in a few places it's not recommended to switch compilers for perl.

This seems to be impacting our customers ability to authenticate and send emails through our server, as well as smart relays. Please help!
 

cPanelTristan

Quality Assurance Analyst
Staff member
Oct 2, 2010
7,607
38
248
somewhere over the rainbow
cPanel Access Level
Root Administrator
Please check the following:

Code:
ls -lah /usr/bin/perl /usr/local/bin/perl
You should get a return where /usr/bin/perl is symlinked to /usr/local/bin/perl binary. If you do not, then please provide the output so we can see what is happening.
 

aerospex

Member
Nov 20, 2006
9
0
151
Yes, looks like it's symlinked as expected

lrwxrwxrwx 1 root root 17 Apr 3 16:15 /usr/bin/perl -> ../local/bin/perl*
-rwxr-xr-x 2 root root 13K Apr 3 16:14 /usr/local/bin/perl*
 

cPanelTristan

Quality Assurance Analyst
Staff member
Oct 2, 2010
7,607
38
248
somewhere over the rainbow
cPanel Access Level
Root Administrator
The typical reason this would happen would be to the wrong or two perl binaries. Can you open up a ticket in WHM > Support Center > Contact cPanel or using the link in my signature? If you could post that ticket number here afterward, that would be appreciated. Thanks!
 

aerospex

Member
Nov 20, 2006
9
0
151
In case anyone else has this issue, this is how we resolved it.

It seems the issue was caused due to the fact the server was running mysql 4.0.20, which was too old for the required libraries to work. The people at cPanel recommended I upgrade which I did via WHM > Software > MySQL Upgrade, and the module installed fine.

Unfortunately once the MySQL upgrade was completed and the module installed, the upgrade to Apache/PHP failed, but that's a whole other story.

In summary, if you hit this issue, try and bring up your versions of software to something relatively recent!