RT-extension-RepeatTicket Problem

During installation the command make initdb leads to following error message:


Now inserting data
Couldn’t finish ‘insert’ step.

ERROR: Couldn’t load data from ‘etc/initialdaza’:
ERROR:Can’t locate etc/initialdata in @INC (@INC contains: …) at /usr/share/request-tracker4/lib/RT/Handle.pm line 917.

Trying the following command (compare link):

rt-setup-database --action insert /usr/share/request-tracker4/etc/initialdata

does not solve my problem:

[warning]: Use of uninitialized value $args{“datadir”} in concatenation (.) or string at /usr/sbin/rt-setup-database line 369.
[warning]: Unable to open /content: No such file or directory at /usr/sbin/rt-setup-database line 381.
[warning]: readline() on closed filehandle $handle at /usr/sbin/rt-setup-database line 382
[critical]: Cannot open initialdata file ‘/content’ for read: at /usr/share/request-tracker4/lib/RT/Handle.pm line 867.
Cannot open initialdata file ‘/content’ for read: at /usr/share/request-tracker4/lib/RT/Handle.pm line 867.

Anny ideas what’s wrong?


I successfully installed RT-Extension-PriorityAsString in RT 4.4.3 on Debian Buster (kernel 4.19).

If you want to manually point to a file you need the --datafile flag:

rt-setup-database --action insert --datafile /usr/share/request-tracker4/etc/initialdata

Still not working when using the flag --datafile:

rt-setup-database --action insert --datafile /usr/share/request-tracker4/etc/initialdata

Another strange thing is the ownership of the package. When extracting the tar-file I see the ownership 501:staff.
(However, UID 501 is obviously not defined in Debian).
Is there anything else missing?

One thing to mention, are you pointing —data file to the extensions initial data file? In the examples above it looks like we are using RT 4 s initial data

I was searching for a folder initialdata and only found the above mentioned.

Do I need to create my own initialdata? How would I do this?

There should be one in the extension you un-packed:

 rt-extension-repeatticket/etc/initialdata

Ok, I found it - the following command fixed my problem:

rt-setup-database --action insert --datafile /usr/share/request-tracker4/plugins/RT-Extension-RepeatTicket-1.11/etc/initialdata

RT-Extension-RepeatTicket is now running fine - thanks a lot.


There is still the problem with the strange ownership 501:staff. Any suggestions here?

I assume that is just the user who grabbed the extension from the web

501 is the UID of the person who built the tar file,
I’m assuming you’re unpacking with ‘tar -xpof RTTARBALL…tar’ or something similar. Some distros start counting users at 500, some start at 1000.

I used

tar -xpof RT-Extension-RepeatTicket-1.11.tar.gz

which is extracting with ownership root:root.

Extension-RepeatTicket seems to work.
It looks like that within the first few minutes (after installation) creating new tickets as well as just changing to another (already existing) ticket takes quite some time (compared to previous setup).
Maybe this is related to the fact that I cleared the cache with

rm -rf /var/cache/request-tracker4/mason_data/obj/*

However, after some time this problem is gone.
Thanks a lot for all your help.

These type of errors are due to the new perl versions which ignore the current directory in path. Can be tweaked by

export PERL5LIB=.:$PERL5LIB

before running any setup. Older setups in plugins not updated for some time are not aware of that.

A new problem pops up when using MySQL instead of SQLite.
When running the command make initdb I get the following prompt:

In order to create or update your RT database, this script needs to connect to your mysql instance on localhost (port ‘3306’) as postgres
Please specify that user’s database password below. If the user has no database
password, just press return.

I always get here an error message like this:

Password:
Working with:
Type: mysql
Host: localhost
Port: 3306
Name: rtdb
User: rtuser
DBA: postgres
Failed to connect to dbi:mysql:dbname=rtdb;host=localhost;port=3306 as user ‘postgres’: Access denied for user ‘postgres’@‘localhost’ (using password: YES)…returned with error: 65280
make: *** [Makefile:825: initdb] Error 2

I tried to add a user ‘postgres’ (including prvileges and password) to MySQL which somehow solves this problem (during installation) … but later when running RT I can not add tickets to the system (internal error):

[13539] [Thu Mar 11 11:20:39 2021] [critical]: Couldn’t create a ticket: Internal Error: Couldn’t execute the query 'INSERT INTO Tickets (LastUpdated, Started, Creator, LastUpdatedBy, Created, Starts, Due, Subject, Queue, Status, InitialPriority, SLA, Priority, Resolved, Type) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)'Incorrect integer value: ‘Critical’ for column rtdb.Tickets.InitialPriority at row 1 (/usr/share/request-tracker4/lib/RT/Ticket.pm:421)
[13539] [Thu Mar 11 11:20:39 2021] [error]: Ticket could not be created due to an internal error (/usr/share/request-tracker4/html/Elements/Error:78)

Any ideas, how to solve this problem?

Do you have RT configured to use a db or dba user called Postgres? You can check the Admin->Tools->System configuration page or your RT_SiteConfig.pm file. Also check the ./configure line you ran.

My guess is the user RT try’s to connect to the DB with isn’t setup correctly somehow

After adding user ‘postgres’ to MySQL (during installation) I saw the following message:

Working with:
Type: mysql
Host: localhost
Post: 3306
Name: rtdb
User: rtuser
DBA: postgres
Now inserting data
Couldn’t finish ‘insert’ step.

ERROR: Couldn’t load data from ‘etc/initialdaza’:
ERROR:Can’t locate etc/initialdata in @INC (@INC contains: …) at /usr/share/request-tracker4/lib/RT/Handle.pm line 917.

Do you have the correct initialdata in RT_Config for this type of file?

…returned with error: 65280
make: *** [Makefile:825: initdb] Error 2

which was a known problem (see above) and could be solved with the command:

rt-setup-database --action insert --datafile /usr/share/request-tracker4/plugins/RT-Extension-RepeatTicket-1.11/etc/initialdata

Concerning your question I was not able to find any further information within Admin->Tools->System configuration.
The file RT_SiteConfig.pm only contains information for the plugins:

Set($MaxInlineBody, 4194304);
Plugin(‘RT::Extension::RepeatTicket’);

Plugin(‘RT::Extension::PriorityAsString’);
Set(%PriorityAsString, (None >= 0, Low => 10, Normal => 30, High => 60, Critical => 80));

Plugin(‘RT::Extension::MandatoryFields’);
Set(%MandatoryFields, (
‘Subject’ => ‘true’,
‘Content’ => ‘true’,
‘Queue’ => ‘true’,
‘InitialPriority’ => ‘true’,
));

There should be a bunch of database settings on the system config page:

DatabaseAdmin
DatabaseExtraDSN
DatabaseHost
DatabaseName
DatabasePassword
DatabasePort
DatabaseRTHost
DatabaseType
DatabaseUser

Here is the configuration:

DatabaseAdmin → ‘postgres’
DatabaseExtraDSN → {}
DatabaseHost → ‘localhost’
DatabaseName → ‘rtdb’
DatabasePassword → Password not printed
DatabasePort → ‘3306’
DatabaseRTHost → ‘localhost’
DatabaseType → ‘mysql’
DatabaseUser → ‘rtuser’|

Ah I see the real error isn’t database connectivity ( Its early for me still ):

[13539] [Thu Mar 11 11:20:39 2021] [critical]: Couldn’t create a ticket: Internal Error: Couldn’t execute the query 'INSERT INTO Tickets (LastUpdated, Started, Creator, LastUpdatedBy, Created, Starts, Due, Subject, Queue, Status, InitialPriority, SLA, Priority, Resolved, Type) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)'Incorrect integer value: ‘Critical’ for column rtdb.Tickets.InitialPriority at row 1 

It seems “Critical” is a priority value that is trying to be set when creating a ticket. I believe RT should handle converting that string into a integer value based on the PriorityAsString config value. How are you trying to create this ticket that is failing? Are you selecting a priority value on the create “details” page?

Yes, I jumped to the “detail” page in order to set an initial priority.
However, when choosing a predefined priority from the selection … only numbers (instead of letters, e.g. ‘High’ or ‘Critical’) are displayed which is different from a previous setup with SQLite.

So it looks like I have now two problems … and RT_Extensions in general behave different when using MySQL instead of SQLite …

1.) Do you think that the problem (during installation) with RT-Extension-RepeatTicket was properly resolved here? (If yes someone should add a note to the installation manual that the Extension need special treatment when using MySQL).
2.) Should I open a new ticket for the problem with RT-Extension-PriorityAsString … or can it be discussed within this ticket?

I probably found (at least) one reason for the problems.

My setup contained the following line:

Set(%PriorityAsString, (None >= 0, Low => 10, Normal => 30, High => 60, Critical => 80));

However, it looks like " >= " is not allowed here. With the following line

Set(%PriorityAsString, (None => 0, Low => 10, Normal => 30, High => 60, Critical => 80));

… PriorityAsString seems to work better now.

I can confirm that the problem with RT-Extension-PriorityAsString was just a typo.

Concerning the plugin RT-Extension-RepeatTicket I found the following.
When starting a new RT installation (without plugings) I see following output:

populating database via scriptfile… Working with:
Type: mysql
Host: localhost
Port: 3306
Name: rtdb
User: rtuser
DBA: rtuser (No DBA)

which clearly states that no additional DatabaseAdmin (DBA) is defined.
However, when looking into the “System Configuration” I can see that DatabaseAdmin is defined as ‘postgres’ … which might be a bug.

My solution is to add the following line into RT_SiteConfig.pm:
Set($DatabaseAdmin , 'rtuser');

Doing this the installation (including all extension) is performing fine.
Dont’ forget to use the command export PERL5LIB=.:$PERL5LIB as recomended in the manual.