Remote sql server w/ ssl RT make upgrade-database problem

Trying to upgrade from RT 4.2.1 to 4.2.4 with a remote SSL required Mysql
server. I’ve had the current version working fine for months by modifying
/opt/rt/lib/RT/Handle.pm as such, where ++ denotes added lines.

sub BuildDSN {

my $self = shift;

# Unless the database port is a positive integer, we really don't want

to pass it.

my $db_port = RT->Config->Get('DatabasePort');

$db_port = undef unless (defined $db_port && $db_port =~ /^(\d+)$/);

my $db_host = RT->Config->Get('DatabaseHost');

$db_host = undef unless $db_host;

my $db_name = RT->Config->Get('DatabaseName');

my $db_type = RT->Config->Get('DatabaseType');

$db_name = File::Spec->catfile($RT::VarPath, $db_name)

    if $db_type eq 'SQLite' &&

!File::Spec->file_name_is_absolute($db_name);

++ my $DBDriver = $RT::DatabaseType;

++$DBDriver .= ":mysql_read_default_file=$RT::MySQLClientConfigFile" if

 ++(defined $RT::MySQLClientConfigFile);

my %args = (

    Host       => $db_host,

    Database   => $db_name,

    Port       => $db_port,

    ++Driver     => $DBDriver,

    RequireSSL => RT->Config->Get('DatabaseRequireSSL'),

I have already run make upgrade, copied my changes to Handle.pm and verified
that the connection works using the web interface. Make upgrade-database
fails however saying “access denied for user@RTwebhostname (using
password: YES)”

Can anyone think of a way to:

  1.    For the make upgrade-database script to use the connection
    

specified in RT_SiteConfig that works. or

  1.   Do a manual database upgrade using a manual connection via mysql -D
    

… Etc. etc.

I’d very much appreciate any assistance!

Jim

Jim Pollard

IT Coordinator

Department of Biomedical Engineering

University of Texas at Austin

mailto:it@bme.utexas.edu it@bme.utexas.edu

512.471.7576

“It’s a strange thing about determined seekers-after-wisdom that, no matter
where they happen to be, they’ll always seek that wisdom which is a long way
off. Wisdom is one of the few things that looks bigger the farther away it
is.”

Terry Pratchett

smime.p7s (6.06 KB)

Trying to upgrade from RT 4.2.1 to 4.2.4 with a remote SSL required Mysql server. I’ve had
the current version working fine for months by modifying /opt/rt/lib/RT/Handle.pm as such,
where ++ denotes added lines.

This seems like the sort of thing that could be contributed to core,
assuming it worked on upgrades…

I have already run make upgrade, copied my changes to Handle.pm and verified that the
connection works using the web interface. Make upgrade-database fails however saying “access
denied for user@RTwebhostname (using password: YES)”

Unfortunately, you cut the important parts, seeing the connection
details printed by make upgrade-database and which step bailed out,
since there are schema changes and content changes.

  1.   Do a manual database upgrade using a manual connection via mysql -D .... Etc. etc.
    

Not possible, since there are changes that require RT to execute perl
code in those (and future) upgrade steps.

I assume you’re tripping over RT trying to get a privileged handle for
schema changes and failing somewhere.

-kevin

Got it. Hopefully this will be much more useful:

/usr/bin/perl -I/opt/rt4/local/lib -I/opt/rt4/lib sbin/rt-setup-database
–action upgrade --prompt-for-dba-password
In order to create or update your RT database, this script needs to connect
to your mysql instance on mysqldb02.company.site (port ‘’) as root
Please specify that user’s database password below. If the user has no
database
password, just press return.

Password:
Working with:
Type: mysql
Host: mysqldb02.company.site
Port:
Name: database_rt4
User: username
DBA: root
Enter RT version you’re upgrading from:
Going to apply following upgrades:

  • 4.2.2
  • 4.2.4

Enter RT version if you want to stop upgrade at some point,
or leave it blank if you want apply above upgrades:
IT’S VERY IMPORTANT TO BACK UP BEFORE THIS STEP

Proceed [y/N]:
[32426] [Mon Jun 2 18:26:23 2014] [warning]: DBI
connect(‘dbname=database_rt4;host=mysqldb02.company.site’,‘username’,…)
failed: Access denied for user ‘username’@‘RT.webhost.companysite’ (using
password: YES) at /usr/local/share/perl5/DBIx/SearchBuilder/Handle.pm li
ne 105. (/usr/local/share/perl5/Carp.pm:168)
[32426] [Mon Jun 2 18:26:23 2014] [critical]: Connect Failed Access denied
for user ‘username’@‘RT.webhost.companysite’ (using password: YES)
at /home/admin/rt-4.2.4/sbin/…/lib/RT.pm line 212.
(/home/admin/rt-4.2.4/sbin/…/lib/RT.pm:393)
Connect Failed Access denied for user ‘username’@‘RT.webhost.companysite’
(using password: YES)
at /home/admin/rt-4.2.4/sbin/…/lib/RT.pm line 212.
make: *** [upgrade-database] Error 255

Of Kevin FalconeSent: Friday, May 30, 2014 3:24 PM
To: rt-users@lists.bestpractical.com
Subject: Re: [rt-users] remote sql server w/ ssl RT make upgrade-database
problem

Trying to upgrade from RT 4.2.1 to 4.2.4 with a remote SSL required
Mysql server. I’ve had
the current version working fine for months by modifying
/opt/rt/lib/RT/Handle.pm as such,
where ++ denotes added lines.

This seems like the sort of thing that could be contributed to core,
assuming it worked on upgrades…

I have already run make upgrade, copied my changes to Handle.pm and
verified that the
connection works using the web interface. Make upgrade-database fails
however saying “access
denied for user@RTwebhostname (using password: YES)”

Unfortunately, you cut the important parts, seeing the connection details
printed by make upgrade-database and which step bailed out, since there are
schema changes and content changes.

  1.   Do a manual database upgrade using a manual connection via
    

mysql -D … Etc. etc.

Not possible, since there are changes that require RT to execute perl code
in those (and future) upgrade steps.

I assume you’re tripping over RT trying to get a privileged handle for
schema changes and failing somewhere.

-kevin

smime.p7s (6.06 KB)

I had the same problem.

As I find out the update-database task was trying to connect to the DB using
root user, which I don’t have access to instead of my RT database user. The
upgrade-database was asking for password, but it did not asked for a user
which should be used. So made a change in /sbin/rt-setup-database:

my $dba_user = my_rt_database_user_name.

View this message in context: http://requesttracker.8502.n7.nabble.com/remote-sql-server-w-ssl-RT-make-upgrade-database-problem-tp57521p57585.html

Thanks very much for this! I’m still having trouble but haven’t been able
to put enough time in it yet to figure out what’s going on. I’ll keep ya’ll
posted.

Jim-----Original Message-----
From: rt-users [mailto:rt-users-bounces@lists.bestpractical.com] On Behalf
Of andkulb
Sent: Wednesday, June 04, 2014 12:55 AM
To: rt-users@lists.bestpractical.com
Subject: Re: [rt-users] remote sql server w/ ssl RT make upgrade-database
problem

I had the same problem.

As I find out the update-database task was trying to connect to the DB using
root user, which I don’t have access to instead of my RT database user. The
upgrade-database was asking for password, but it did not asked for a user
which should be used. So made a change in /sbin/rt-setup-database:

my $dba_user = my_rt_database_user_name.

View this message in context:
http://requesttracker.8502.n7.nabble.com/remote-sql-server-w-ssl-RT-make-upg
rade-database-problem-tp57521p57585.html
RT Training - Boston, September 9-10

smime.p7s (6.06 KB)

I had the same problem.

As I find out the update-database task was trying to connect to the DB using
root user, which I don’t have access to instead of my RT database user. The
upgrade-database was asking for password, but it did not asked for a user
which should be used. So made a change in /sbin/rt-setup-database:

my $dba_user = my_rt_database_user_name.

I don’t think this is directly related to the OP’s problem, but that’s
fixable during configure (and on new enough RT versions, in the
Config)

./configure --help | grep dba
–with-db-dba=DBA name of database administrator (default: root or

-kevin

My bad for miss reading :slight_smile:
2014-06-06 20:28, Kevin Falcone ras(e.:> On Tue, Jun 03, 2014 at 10:54:52PM -0700, andkulb wrote:

I had the same problem.

As I find out the update-database task was trying to connect to the DB using
root user, which I don’t have access to instead of my RT database user. The
upgrade-database was asking for password, but it did not asked for a user
which should be used. So made a change in /sbin/rt-setup-database:

my $dba_user = my_rt_database_user_name.
I don’t think this is directly related to the OP’s problem, but that’s
fixable during configure (and on new enough RT versions, in the
Config)

./configure --help | grep dba
–with-db-dba=DBA name of database administrator (default: root or

-kevin

smime.p7s (3.19 KB)