When trying to add new Qualification -> Unable to connect DB

General support regarding TimeTrex, such as
configuring policies/taxes or processing payroll.
Post Reply
benigno
Posts: 5
Joined: Thu May 04, 2017 4:01 am

When trying to add new Qualification -> Unable to connect DB

Post by benigno » Thu May 04, 2017 4:41 am

When trying to add, edit or delete a register in HR Qualifications the system gives the following error: "Timetrex is unable to connect to its database, please make sure that the database service on your own local Timetrex server has been started and it's running. If you are unsure, try rebooting your server".
All other transactions can be done without any problem, only this one is giving problems.
We have tried rebooting the server with no success.

ImageTimetrex_screenshot_1 by Benigno Calvo

Community version 10.5.0 running on a windows 7 PC. Running on postgresql 9.5 I believe. It was all installed with the auto installer. And we haven't had any problems adding Qualifications until now.

What can we do to fix this ?. I have tried to check if there were any locks on tables through pg_admin and it doesn't detect any locks. But then my knowledge of pg is very limited so I haven't wanted to touch anything.

shaunw
Posts: 7346
Joined: Tue Sep 19, 2006 2:22 pm

Re: When trying to add new Qualification -> Unable to connec

Post by shaunw » Thu May 04, 2017 8:01 am

Please attach a copy of your TimeTrex log file so we can see specifically what error is being triggered. You can find instructions on how to do that here:
http://forums.timetrex.com/viewtopic.php?f=6&t=89

benigno
Posts: 5
Joined: Thu May 04, 2017 4:01 am

Re: When trying to add new Qualification -> Unable to connec

Post by benigno » Thu May 04, 2017 8:28 am

Hello, find here the error log.

I have done several one to add a new entry, another to modify and another to delete. Both modify and add with description Test de erreur. The one for deletion on a Qualification named Selection.

Thank you for looking into it, Benigno.
Attachments
timetrex.log
Error Log
(1.15 MiB) Downloaded 39 times

shaunw
Posts: 7346
Joined: Tue Sep 19, 2006 2:22 pm

Re: When trying to add new Qualification -> Unable to connec

Post by shaunw » Thu May 04, 2017 8:53 am

I see the error in your log, but problem appears like it may be coming from your operating system or database, it unfortunately is not saying what the specific problem is though. So we would need see if we can get any other error messages.

Could you attach the c:\timetrex\apache2\logs\error.log, as well as take a look in your Windows event viewer for any errors related to PostgreSQL?

benigno
Posts: 5
Joined: Thu May 04, 2017 4:01 am

Re: When trying to add new Qualification -> Unable to connec

Post by benigno » Fri May 05, 2017 12:57 am

Hello reproduced the error today with same name Test de Erreur

Attaching both timetrex log and apache log

Thank you for looking into it,
Benigno.
Attachments
error.log
Apache log
(695.7 KiB) Downloaded 38 times
timetrex.zip
Timetrex log
(1.01 MiB) Downloaded 38 times

benigno
Posts: 5
Joined: Thu May 04, 2017 4:01 am

Re: When trying to add new Qualification -> Unable to connec

Post by benigno » Mon May 08, 2017 4:19 am

Sorry I was not sure how to add the Windows events. Please find them all here, I exported the events to a file.
This are the 2 errors at the event window just in case you cannot open the file sent:

It would look as if the table columns have been changed as visibility_type_id is not in the table any more.
.....................................................................
La description de l’ID d’événement 0 dans la source PostgreSQL est introuvable. Le composant qui a déclenché cet événement n’est pas installé sur l’ordinateur local ou l’installation est endommagée. Vous pouvez installer ou réparer le composant sur l’ordinateur local.

Si l’événement provient d’un autre ordinateur, les informations d’affichage doivent être enregistrées avec l’événement.

Les informations suivantes étaient incluses avec l’événement :

ERROR: current transaction is aborted, commands ignored until end of transaction block
STATEMENT:
SELECT
a.attname,
CASE
WHEN x.sequence_name != ''
THEN 'SERIAL'
ELSE t.typname
END AS typname,
a.attlen, a.atttypmod, a.attnotnull, a.atthasdef, a.attnum
FROM
pg_class c,
pg_attribute a
JOIN pg_type t ON a.atttypid = t.oid
LEFT JOIN (
SELECT
c.relname as sequence_name,
c1.relname as related_table,
a.attname as related_column
FROM pg_class c
JOIN pg_depend d ON d.objid = c.oid
LEFT JOIN pg_class c1 ON d.refobjid = c1.oid
LEFT JOIN pg_attribute a ON (d.refobjid, d.refobjsubid) = (a.attrelid, a.attnum)
WHERE c.relkind = 'S' AND c1.relname = 'qualification'
) x ON x.related_column= a.attname
WHERE
c.relkind in ('r','v')
AND (c.relname='qualification' or c.relname = lower(''))
AND a.attname not like '....%'
AND a.attnum > 0
AND a.attrelid = c.oid
ORDER BY
a.attnum
......................................................................
La description de l’ID d’événement 0 dans la source PostgreSQL est introuvable. Le composant qui a déclenché cet événement n’est pas installé sur l’ordinateur local ou l’installation est endommagée. Vous pouvez installer ou réparer le composant sur l’ordinateur local.

Si l’événement provient d’un autre ordinateur, les informations d’affichage doivent être enregistrées avec l’événement.

Les informations suivantes étaient incluses avec l’événement :

ERROR: column "visibility_type_id" does not exist at character 19
STATEMENT: select id,type_id,visibility_type_id,source_type_id,company_id,group_id,name,name_metaphone,description,updated_date,updated_by from qualification where id = -1
................................................................................

It would look as if the table columns have been changed as visibility_type_id is not in the table any more.
Attachments
windows events.zip
Windows events
(110.37 KiB) Downloaded 34 times

shaunw
Posts: 7346
Joined: Tue Sep 19, 2006 2:22 pm

Re: When trying to add new Qualification -> Unable to connec

Post by shaunw » Mon May 08, 2017 9:43 am

Yeah, for some reason your database schema appears to be out-of-sync.

You will need to run the following queries manually at the PostgreSQL console:

Code: Select all

CREATE INDEX schedule_replaced_id ON schedule(replaced_id);
ALTER TABLE qualification ADD COLUMN source_type_id integer NOT NULL DEFAULT 10;
ALTER TABLE qualification ADD COLUMN visibility_type_id integer NOT NULL DEFAULT 10;
That should bring it back in sync and everything should start working again.

benigno
Posts: 5
Joined: Thu May 04, 2017 4:01 am

Re: When trying to add new Qualification -> Unable to connec

Post by benigno » Tue May 09, 2017 12:37 am

Thank you very much Shaunw,

It does indeed fix the problem.

Best regards,
Benigno.

PS: Let me know if you come by Tunisia or Spain, to get you guys a beer.

Thanks again.

Post Reply