Subversion integration - Can’t locate DBD/mysql.pm

Keywords: Redmine - Virtual Machines - Technical issue - Application configuration

bnsupport ID: 60a61802-3fbc-c0df-f2e4-004d9e3b7732

bndiagnostic output:

? Resources: Found possible issues
? Connectivity: Found possible issues
? Apache: Found possible issues
https://docs.bitnami.com/general/faq/administration/use-firewall/
https://docs.bitnami.com/general/apps/wordpress/troubleshooting/debug-errors-apache/
https://docs.bitnami.com/bch/apps/moodle/troubleshooting/deny-connections-bots-apache/

bndiagnostic failure reason: The suggested guides are not related with my issue

Description:
I decided to post this guide as I’ve had issues in the past migrating to a newer Bitnami Redmine stack with subversion integration - the perl authentication failed with the error can’t locate DBD/mysql.pm

See this from Jan 2020

Others have had similar issues

And recommended to follow this post which had a solution

I finally had some time to revisit this and got it working with the help of the solution by @mandys.
Here are some detailed steps following that post, hopefully it will help @tonykao and others.

My use case is upgrading an old version of Bitnami (3.3.1) with the latest version (4.2.1)
so I followed this guide
https://docs.bitnami.com/general/apps/redmine/administration/upgrade/

Then this guide for advanced svn integration
https://docs.bitnami.com/general/apps/redmine/configuration/use-subversion/

Note that for my stack, the lines to add to /opt/bitnami/apache2/bin/envvars are

LD_LIBRARY_PATH="/opt/bitnami/perl/lib/5.32.1/x86_64-linux-thread-multi/CORE${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH}"
export LD_LIBRARY_PATH

And the Redmine.pm copy command is

sudo cp /opt/bitnami/apps/redmine/htdocs/extra/svn/Redmine.pm /opt/bitnami/perl/lib/site_perl/5.32.1/x86_64-linux-thread-multi/Apache2/

However, I found that I couldn’t view the repos I’d made or restored.

The following familar error was in the log
/opt/bitnami/apache2/logs/error_log

[perl:error] [pid 2671:tid 140009441007360] [client x.x.x.x:41082] install
_driver(mysql) failed: Can't locate DBD/mysql.pm in @INC (you may need to install the DBD::mysql module) (@INC 
contains: /opt/bitnami/git/lib/site_perl/5.32.1 /opt/bitnami/perl/lib/5.32.1/x86_64-linux-thread-multi /opt/bit
nami/perl/lib/5.32.1 /opt/bitnami/perl/lib/site_perl/5.32.1/x86_64-linux-thread-multi /opt/bitnami/perl/lib/sit
e_perl/5.32.1 /opt/bitnami/perl/lib/5.32.1/x86_64-linux-thread-multi /opt/bitnami/perl/lib/site_perl/5.32.1/x86
_64-linux-thread-multi /bitnami/ruby26mysqlstack-linux-x64/output/perl/lib/site_perl/5.32.1/x86_64-linux-thread
-multi /bitnami/ruby26mysqlstack-linux-x64/output/perl/lib/site_perl/5.32.1 /bitnami/ruby26mysqlstack-linux-x64
/output/perl/lib/5.32.1/x86_64-linux-thread-multi /bitnami/ruby26mysqlstack-linux-x64/output/perl/lib/5.32.1 /o
pt/bitnami/apache2) at (eval 9) line 3.\nPerhaps the DBD::mysql perl module hasn't been fully installed,\nor pe
rhaps the capitalisation of 'mysql' isn't right.\nAvailable drivers: DBM, ExampleP, File, Gofer, Proxy, Sponge.
\n at /opt/bitnami/perl/lib/site_perl/5.32.1/x86_64-linux-thread-multi/Apache2/Redmine.pm line 557.\n
``

To solve, following on from https://community.bitnami.com/t/cant-locate-dbd-mysql-pm/83117/6, I ran the following

Download and extract the DBI module

bitnami@hostname:~$ wget https://cpan.metacpan.org/authors/id/T/TI/TIMB/DBI-1.643.tar.gz
bitnami@hostname:~$ tar -xvzf DBI-1.643.tar.gz
bitnami@hostname:~$ cd DBI-1.643
bitnami@hostname:~/DBI-1.643$ perl Makefile.PL

This softlink is needed

sudo ln -s /usr/include/locale.h /usr/include/xlocale.h

We need to make install as sudo, and need these env variables

bitnami@hostname:~/DBI-1.643$ sudo LD_LIBRARY_PATH="/opt/bitnami/perl/lib/5.32.1/x86_64-linux-thread-multi/CORE/" PERL5LIB="/opt/bitnami/perl/lib/5.32.1" make install

Next the DBD mysql module, also need the Devel::CheckLib module

bitnami@hostname:~$ wget https://cpan.metacpan.org/authors/id/D/DV/DVEEDEN/DBD-mysql-4.050.tar.gz;
bitnami@hostname:~$ wget https://cpan.metacpan.org/authors/id/M/MA/MATTN/Devel-CheckLib-1.14.tar.gz;
bitnami@hostname:~$ tar -xvzf DBD-mysql-4.050.tar.gz;
bitnami@hostname:~$ tar -xvzf Devel-CheckLib-1.14.tar.gz;

bitnami@hostname:~$ cd Devel-CheckLib-1.14
bitnami@hostname:~/Devel-CheckLib-1.14$ perl Makefile.PL
bitnami@hostname:~/Devel-CheckLib-1.14$ sudo LD_LIBRARY_PATH="/opt/bitnami/perl/lib/5.32.1/x86_64-linux-thread-multi/CORE/" PERL5LIB="/opt/bitnami/perl/lib/5.32.1" make install

bitnami@hostname:~/Devel-CheckLib-1.14$ cd …/DBD-mysql-4.050
bitnami@hostname:~/DBD-mysql-4.050$ perl Makefile.PL
bitnami@hostname:~/DBD-mysql-4.050$ sudo LD_LIBRARY_PATH="/opt/bitnami/perl/lib/5.32.1/x86_64-linux-thread-multi/CORE/" PERL5LIB="/opt/bitnami/perl/lib/5.32.1" make install


I was now able to see my repos from the redmine webpage

I noticed when I was posting this that the bitnami stack has changed quite a lot and now uses MariaDB, so perhaps the above is redundant and svn integration works out of the box. The above uses 4.2.1-1.

Hope this helps someone

The formatting appeared to have been messed up by a typo here is the lower part formatted

To solve, following on from , I ran the following

Download and extract the DBI module

bitnami@hostname:~$ wget https://cpan.metacpan.org/authors/id/T/TI/TIMB/DBI-1.643.tar.gz
bitnami@hostname:~$ tar -xvzf DBI-1.643.tar.gz 
bitnami@hostname:~$ cd DBI-1.643
bitnami@hostname:~/DBI-1.643$ perl Makefile.PL 

This softlink is needed

sudo ln -s /usr/include/locale.h /usr/include/xlocale.h

We need to make install as sudo, and need these env variables

bitnami@hostname:~/DBI-1.643$ sudo LD_LIBRARY_PATH="/opt/bitnami/perl/lib/5.32.1/x86_64-linux-thread-multi/CORE/" PERL5LIB="/opt/bitnami/perl/lib/5.32.1" make install

Next the DBD mysql module, also need the Devel::CheckLib module

bitnami@hostname:~$ wget https://cpan.metacpan.org/authors/id/D/DV/DVEEDEN/DBD-mysql-4.050.tar.gz;
bitnami@hostname:~$ wget https://cpan.metacpan.org/authors/id/M/MA/MATTN/Devel-CheckLib-1.14.tar.gz;
bitnami@hostname:~$ tar -xvzf DBD-mysql-4.050.tar.gz;
bitnami@hostname:~$ tar -xvzf Devel-CheckLib-1.14.tar.gz;

bitnami@hostname:~$ cd Devel-CheckLib-1.14
bitnami@hostname:~/Devel-CheckLib-1.14$ perl Makefile.PL 
bitnami@hostname:~/Devel-CheckLib-1.14$ sudo LD_LIBRARY_PATH="/opt/bitnami/perl/lib/5.32.1/x86_64-linux-thread-multi/CORE/" PERL5LIB="/opt/bitnami/perl/lib/5.32.1" make install

bitnami@hostname:~/Devel-CheckLib-1.14$ cd ../DBD-mysql-4.050
bitnami@hostname:~/DBD-mysql-4.050$ perl Makefile.PL
bitnami@hostname:~/DBD-mysql-4.050$ sudo LD_LIBRARY_PATH="/opt/bitnami/perl/lib/5.32.1/x86_64-linux-thread-multi/CORE/" PERL5LIB="/opt/bitnami/perl/lib/5.32.1" make install

I was now able to see my repos from the redmine webpage

I noticed when I was posting this that the bitnami stack has changed quite a lot and now uses
MariaDB, so perhaps the above is redundant and svn integration works out of the box. The above uses 4.2.1-1.

Hello @ttgood,

Thanks for sharing your solution. We are glad you managed to make it work.

Regards

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.