Supplying database credentials to rt-fulltext-indexer

Hi all,
I completely forgot to set up rt-fulltext-indexer as a cron job after
initially enabling FTS. When I run it now, it complains that the database
credentials are wrong, and yes, they definitely are. How do I give it the
right ones? I hoped it would pick them up from rtrc, which I made for
rt-email-dashboards, but it doesn’t seem to be doing so. I know I’ve done
this once before, I just don’t remember (and can’t find) how I did it.
Thanks.

Alex Hall
Automatic Distributors, IT department
ahall@autodist.com

I still don’t have this working, so any input would be great. I just wanted
to add that, since my last email on the topic, I’ve tried putting an rtrc
file in /root, since I’m running this as root for the moment. It didn’t
help. I’ve also looked through the actual file, trying to find where it
gets its credentials from, but all I saw was some kind of database handler
function which I’ll have to try to track down. I’m really hoping someone
knows an easier way. After all, I can’t be the first to use my own database
name, username, and password who needs this tool to run.On Thu, Dec 8, 2016 at 10:38 AM, Alex Hall ahall@autodist.com wrote:

Hi all,
I completely forgot to set up rt-fulltext-indexer as a cron job after
initially enabling FTS. When I run it now, it complains that the database
credentials are wrong, and yes, they definitely are. How do I give it the
right ones? I hoped it would pick them up from rtrc, which I made for
rt-email-dashboards, but it doesn’t seem to be doing so. I know I’ve done
this once before, I just don’t remember (and can’t find) how I did it.
Thanks.


Alex Hall
Automatic Distributors, IT department
ahall@autodist.com

Alex Hall
Automatic Distributors, IT department
ahall@autodist.com

I still don’t have this working, so any input would be great. I just wanted to add that, since my last email on the topic, I’ve tried putting an rtrc file in /root, since I’m running this as root for the moment. It didn’t help. I’ve also looked through the actual file, trying to find where it gets its credentials from, but all I saw was some kind of database handler function which I’ll have to try to track down. I’m really hoping someone knows an easier way. After all, I can’t be the first to use my own database name, username, and password who needs this tool to run.

/opt/rt4/sbin/rt-setup-fulltext-index --dba root --dba-password secret

Source: https://docs.bestpractical.com/rt/4.2.12/full_text_indexing.html

Landon Stewart
Lead Analyst - Abuse and Security Management
INTERNAP ®
:e-mail: lstewart@internap.commailto:lstewart@internap.com
:earth_africa: www.internap.comhttp://www.internap.com

I thought the tool I had to run periodically was
/opt/rt4/sbin/rt-fulltext-indexer. That’s the one guides tell me to run;
the setup tool seems to be the initial database adjustment tool, but once
it runs once, I thought I had to run the indexer every so often. The
indexer is the tool that refuses database credentials. Unless the guides on
this are wrong, and the setup one is the one I have to run with cron?On Fri, Dec 9, 2016 at 4:40 PM, Landon Stewart lstewart@internap.com wrote:

On Dec 9, 2016, at 1:33 PM, Alex Hall ahall@autodist.com wrote:

I still don’t have this working, so any input would be great. I just
wanted to add that, since my last email on the topic, I’ve tried putting an
rtrc file in /root, since I’m running this as root for the moment. It
didn’t help. I’ve also looked through the actual file, trying to find where
it gets its credentials from, but all I saw was some kind of database
handler function which I’ll have to try to track down. I’m really hoping
someone knows an easier way. After all, I can’t be the first to use my own
database name, username, and password who needs this tool to run.

/opt/rt4/sbin/rt-setup-fulltext-index --dba root --dba-password secret

Source: https://docs.bestpractical.com/rt/4.2.12/full_text_indexing.html


Landon Stewart
Lead Analyst - Abuse and Security Management
INTERNAP ®
:e-mail: lstewart@internap.com
:earth_africa: www.internap.com

Alex Hall
Automatic Distributors, IT department
ahall@autodist.com

I thought the tool I had to run periodically was /opt/rt4/sbin/rt-fulltext-indexer. That’s the one guides tell me to run; the setup tool seems to be the initial database adjustment tool, but once it runs once, I thought I had to run the indexer every so often. The indexer is the tool that refuses database credentials. Unless the guides on this are wrong, and the setup one is the one I have to run with cron?

I haven’t enabled Full Text searching in RT before but I have set it up in MySQL for other uses. From my experiences with MySQL I believe you setup the indexes once only with the setup tool for RT and once they are setup there’s no need to ‘re-index’ anything regularly with any crontab or anything.

Above all though - do this on a copy of your RT installation/database and make sure it works before you potentially interrupt the flow of business in production.

Landon Stewart
Lead Analyst - Abuse and Security Management
INTERNAP ®
:e-mail: lstewart@internap.commailto:lstewart@internap.com
:earth_africa: www.internap.comhttp://www.internap.com

FTS is enabled and working, but it seems to be working only on tickets that
were set up when the setup tool was run. According to the docs
(rt4/docs/full_text_indexing.pod):

To keep the index up-to-date, you will need to run:

/opt/rt4/sbin/rt-fulltext-indexer

…at regular intervals. By default, this will only tokenize up to 200
tickets at a time; you can adjust this upwards by passing C<–limit
500>. Larger batch sizes will take longer and consume more memory.

What this file never says is how to tell the indexer tool how to connect to
the database. It clearly isn’t pulling from the RT configuration, nor from
/home/www-data/rtrc.On Fri, Dec 9, 2016 at 5:12 PM, Landon Stewart lstewart@internap.com wrote:

On Dec 9, 2016, at 2:06 PM, Alex Hall ahall@autodist.com wrote:

I thought the tool I had to run periodically was /opt/rt4/sbin/rt-fulltext-indexer.
That’s the one guides tell me to run; the setup tool seems to be the
initial database adjustment tool, but once it runs once, I thought I had to
run the indexer every so often. The indexer is the tool that refuses
database credentials. Unless the guides on this are wrong, and the setup
one is the one I have to run with cron?

I haven’t enabled Full Text searching in RT before but I have set it up in
MySQL for other uses. From my experiences with MySQL I believe you setup
the indexes once only with the setup tool for RT and once they are setup
there’s no need to ‘re-index’ anything regularly with any crontab or
anything.

Above all though - do this on a copy of your RT installation/database and
make sure it works before you potentially interrupt the flow of business in
production.


Landon Stewart
Lead Analyst - Abuse and Security Management
INTERNAP ®
:e-mail: lstewart@internap.com
:earth_africa: www.internap.com

Alex Hall
Automatic Distributors, IT department
ahall@autodist.com

What this file never says is how to tell the indexer tool how to connect to
the database. It clearly isn’t pulling from the RT configuration, nor from
/home/www-data/rtrc.

The indexer reads and uses the database configuration from
your /opt/rt4/etc/RT_Config.pm and /opt/rt4/tec/RT_SiteConfig.pm
files. rtrc files are only used by the “bin/rt” tool, which is meant
to be run from other machines than your RT host.

The rt-setup-fulltext-indexer wants to know your DBA username and
password because it needs to create new tables and indexes, which the
standard RT database user does not have permissions to do. Once the
index is set up, updates to the index are done as RT’s standard
database user.

  • Alex

I thought it would, but it doesn’t seem to be. My db credentials must be correct, because RT isn’t complaining of any db problems, and is working fine. Is it possible that there’s a bug in 4.4.1 that causes this indexer to get confused by the use of the RT_SiteConfig.d/* files? I use those instead of a single .pm file. I’ll have to try putting my database credentials in the actual PM file later today, once I’m awake, to see if that helps.> On Dec 10, 2016, at 03:47, Alex Vandiver alex@chmrr.net wrote:

On Fri, 9 Dec 2016 17:30:31 -0500 Alex Hall ahall@autodist.com wrote:

What this file never says is how to tell the indexer tool how to connect to
the database. It clearly isn’t pulling from the RT configuration, nor from
/home/www-data/rtrc.

The indexer reads and uses the database configuration from
your /opt/rt4/etc/RT_Config.pm and /opt/rt4/tec/RT_SiteConfig.pm
files. rtrc files are only used by the “bin/rt” tool, which is meant
to be run from other machines than your RT host.

The rt-setup-fulltext-indexer wants to know your DBA username and
password because it needs to create new tables and indexes, which the
standard RT database user does not have permissions to do. Once the
index is set up, updates to the index are done as RT’s standard
database user.

  • Alex

Hi all,
I think I can say definitely that this is a bug. I added the DB credentials
to RT_SiteConfig.pm and, suddenly, the indexer started working perfectly.
Yet RT itself pulls the exact same credentials from
RT_SiteConfig.d/03-DBInfo.pm with no trouble. I have all my settings in
multiple files under RT_SiteConfig.d, and they all work. It’s just
rt-fulltext-indexer that seems to have trouble accessing them. This
explains a lot, and hopefully gets fixed in the next release. Thanks for
everyone’s suggestions and help.On Sat, Dec 10, 2016 at 5:56 AM, Alex Hall ahall@autodist.com wrote:

I thought it would, but it doesn’t seem to be. My db credentials must be
correct, because RT isn’t complaining of any db problems, and is working
fine. Is it possible that there’s a bug in 4.4.1 that causes this indexer
to get confused by the use of the RT_SiteConfig.d/* files? I use those
instead of a single .pm file. I’ll have to try putting my database
credentials in the actual PM file later today, once I’m awake, to see if
that helps.

Sent from my iPhone

On Dec 10, 2016, at 03:47, Alex Vandiver alex@chmrr.net wrote:

On Fri, 9 Dec 2016 17:30:31 -0500 Alex Hall ahall@autodist.com wrote:

What this file never says is how to tell the indexer tool how to
connect to

the database. It clearly isn’t pulling from the RT configuration, nor
from

/home/www-data/rtrc.

The indexer reads and uses the database configuration from
your /opt/rt4/etc/RT_Config.pm and /opt/rt4/tec/RT_SiteConfig.pm
files. rtrc files are only used by the “bin/rt” tool, which is meant
to be run from other machines than your RT host.

The rt-setup-fulltext-indexer wants to know your DBA username and
password because it needs to create new tables and indexes, which the
standard RT database user does not have permissions to do. Once the
index is set up, updates to the index are done as RT’s standard
database user.

  • Alex

Alex Hall
Automatic Distributors, IT department
ahall@autodist.com

Hi all,
I think I can say definitely that this is a bug. I added the DB
credentials to RT_SiteConfig.pm and, suddenly, the indexer started
working perfectly. Yet RT itself pulls the exact same credentials from
RT_SiteConfig.d/03-DBInfo.pm with no trouble. I have all my settings
in multiple files under RT_SiteConfig.d, and they all work. It’s just
rt-fulltext-indexer that seems to have trouble accessing them. This
explains a lot, and hopefully gets fixed in the next release. Thanks
for everyone’s suggestions and help.
Permissions on RT_SiteConfig.d/03-DBInfo.pm are such that the user
running rt-fulltext-indexer can read them? Alternately you’re not
running rt-fulltext-indexer from an earlier release (4.2.x) that didn’t
support RT_SiteConfig.d?

Jeff

Neither. For the moment, root runs everything (yes, I know that’s enough to
get me slapped). 4.4.1 is the only version ever installed from source, thus
/opt/rt4/sbin/rt-fulltext-indexer has to be new. The only other version on
the server is indeed from 4.2, but is from a Debian package and thus lives
in some other sbin folder on the system and not this one.On Mon, Dec 12, 2016 at 1:12 PM, Jeff Voskamp javoskamp@uwaterloo.ca wrote:

On 12/12/16 10:42 AM, Alex Hall wrote:

Hi all,
I think I can say definitely that this is a bug. I added the DB
credentials to RT_SiteConfig.pm and, suddenly, the indexer started working
perfectly. Yet RT itself pulls the exact same credentials from
RT_SiteConfig.d/03-DBInfo.pm with no trouble. I have all my settings in
multiple files under RT_SiteConfig.d, and they all work. It’s just
rt-fulltext-indexer that seems to have trouble accessing them. This
explains a lot, and hopefully gets fixed in the next release. Thanks for
everyone’s suggestions and help.

Permissions on RT_SiteConfig.d/03-DBInfo.pm are such that the user running
rt-fulltext-indexer can read them? Alternately you’re not running
rt-fulltext-indexer from an earlier release (4.2.x) that didn’t support
RT_SiteConfig.d?

Jeff

Alex Hall
Automatic Distributors, IT department
ahall@autodist.com