DB Error

General support regarding TimeTrex, such as
configuring policies/taxes or processing payroll.
Post Reply
bobloblian
Posts: 19
Joined: Fri Nov 14, 2014 9:38 am

DB Error

Post by bobloblian »

Hi,

My community edition timetrex installation, according to the timetrex logs, did an unattended upgrade. Since then, I haven't been able to get logged in.

my first thing to try was enabling the installer and re-running that, but at the database part (using postgres) I got a local cache error message. From there my investigation led me to find in the apache logs:

PHP Warning: pg_query_params(): Query failed: ERROR: invalid input syntax for integer: "00000000-0000-0000-0000-000000000000" in /var/www/time.computerisms.ca/classes/adodb/drivers/adodb-postgres7.inc.php on line 255

I tried downloading a new copy of the software, but I am getting the same error in the apache logs with that code as well.

I tried taking a look at the adodb-postgres7.inc.php file, but I haven't been able to trace the problem yet.

Wondering if I am the only one experiencing this problem? Perhaps someone has a suggestion on how I might fix this?
shaunw
Posts: 7839
Joined: Tue Sep 19, 2006 2:22 pm

Re: DB Error

Post by shaunw »

Are you able to attach a copy of the TimeTrex log here so we can see more context around the error message itself?
bobloblian
Posts: 19
Joined: Fri Nov 14, 2014 9:38 am

Re: DB Error

Post by bobloblian »

Hi,

Thank you for your response.

the log is a bit big, will see if it attaches successfully...

The interesting stuff, at least from my perspective, starts around line 5830...
Attachments
timetrex.log
(60.8 MiB) Downloaded 281 times
shaunw
Posts: 7839
Joined: Tue Sep 19, 2006 2:22 pm

Re: DB Error

Post by shaunw »

For some reason it seems like the TimeTrex files got updated to the latest version but the database hasn't been upgraded...

Can you also attach a copy of the includes/global.inc.php file from inside the TimeTrex directory?
bobloblian
Posts: 19
Joined: Fri Nov 14, 2014 9:38 am

Re: DB Error

Post by bobloblian »

Hi Shaun,

Thanks for checking on this, super appreciated.

had to rename the file to upload it here, sure you will figure that part out.

FWIW, I ran a diff on the file that existed before I replaced the system with a fresh download and it is the same.

Is there a command I can run to do the db upgrade? I am using postgres in this installation, and 9.1 is installed on the server, if this has an impact...
Attachments
global.inc.php.log
(22.43 KiB) Downloaded 202 times
shaunw
Posts: 7839
Joined: Tue Sep 19, 2006 2:22 pm

Re: DB Error

Post by shaunw »

That file looks fine to me, one last file I would like to check, which is the database.inc.php file. Can you attach it here too please?
bobloblian
Posts: 19
Joined: Fri Nov 14, 2014 9:38 am

Re: DB Error

Post by bobloblian »

Hi Shaun,

Thanks for sticking with me on this. Unfortunately I cannot find a file by this name:

find / -name database.inc.php

returns no files, and that would include a copy of the files I just downloaded...
shaunw
Posts: 7839
Joined: Tue Sep 19, 2006 2:22 pm

Re: DB Error

Post by shaunw »

Sorry, the exact name is Database.inc.php, it's in the same directory as global.inc.php.
bobloblian
Posts: 19
Joined: Fri Nov 14, 2014 9:38 am

Re: DB Error

Post by bobloblian »

oh, my bad, should have seen that, sorry...

files are attached, and here is a diff of the file before I replaced everything with newly downloaded code:

165c165,166
< if ( isset($config_vars['other']['installer_enabled']) AND $config_vars['other']['installer_enabled'] == TRUE ) {
---
>
> if ( ( isset($config_vars['other']['installer_enabled']) AND $config_vars['other']['installer_enabled'] == TRUE ) OR ( isset($_SERVER['SCRIPT_FILENAME']) AND stripos( $_SERVER['SCRIPT_FILENAME'], 'unattended_upgrade' ) !== FALSE ) ) { //Make sure we always check the schema versions when run from unattended_upgrade, just in case the upgrade failed and we need to determine if we are in UUID mode or not.
Attachments
Database.inc.php.old.log
(11.87 KiB) Downloaded 209 times
Database.inc.php.new.log
(12.16 KiB) Downloaded 215 times
shaunw
Posts: 7839
Joined: Tue Sep 19, 2006 2:22 pm

Re: DB Error

Post by shaunw »

Can you try downloading the install file from our server again and try the upgrade once more time?
bobloblian
Posts: 19
Joined: Fri Nov 14, 2014 9:38 am

Re: DB Error

Post by bobloblian »

Hi Shaun,

I obtained a new copy of the software and tried the upgrade again, no joy. fwiw, I am running debian, but because I like to set my server environment up a bit off of the standard way, I am downloading the zip file:

cd /usr/src
wget https://www.timetrex.com/direct_downloa ... taller.zip
mv /var/www/time.computerisms.ca /var/www/time.computerisms.ca.2017.11.26
unzip TimeTrex_Community_Edition-manual-installer.zip
cp -ra TimeTrex_Community_Edition_v11.0.0 /var/www/time.computerisms.ca
cp /var/www/time.computerisms.ca.2017.11.24/timetrex.ini.php /var/www/time.computerisms.ca/
chown -R time:time /var/www/time.computerisms.ca
su - time -c "php /var/www/time.computerisms.ca/tools/unattended_upgrade.php"
No directory, logging in with HOME=/
Already running latest version: 11.0.0

The log file shows nothing more interesting, as far as I can tell, says it is up to date based on the given parameters. Accessing the web interface gives a blank white page, and apache logs still give the following error:

PHP Warning: pg_query_params(): Query failed: ERROR: invalid input syntax for integer: &quot;00000000-0000-0000-0000-000000000000&quot; in /var/www/time.computerisms.ca/classes/adodb/drivers/adodb-postgres7.inc.php on line 255

I have confirmed that the database is accessible, I am using peer authentication and mpm-itk to ensure the web app runs under the correct user. I have confirmed I have php7.0-pgsql installed. so can't see it being an access issue.

I have been sifting through code, but my programming skills are pretty limited, could take me weeks to narrow in on the problem. Based on your previous feed back about the database not being updated and the apache error, I am guessing if I knew which table I could adjust it to take the input, assuming the input is correct? is it possible to find the commands being run to upgrade the database? maybe if I ran just those manually it would correct the problem?
shaunw
Posts: 7839
Joined: Tue Sep 19, 2006 2:22 pm

Re: DB Error

Post by shaunw »

Could you email us a zipped copy of your database dump to support@timetrex.com, we will take a closer look at it to see what exactly the problem is.
bobloblian
Posts: 19
Joined: Fri Nov 14, 2014 9:38 am

Re: DB Error

Post by bobloblian »

Hi Shaun,

Continued thanks and appreciation. I have emailed the psql file...
shaunw
Posts: 7839
Joined: Tue Sep 19, 2006 2:22 pm

Re: DB Error

Post by shaunw »

I loaded your database into our test system, and went to http://<domain>/install/install.php and was able to perform the upgrade without any problems. However if you try navigating to the login screen or any other screen you would receive a SQL error until the database is fully upgraded.

You mentioned in your first post that you received a "local cache" error message when you tried running the installer? Could you try that again and send us a full uncropped screenshot showing the error?
bobloblian
Posts: 19
Joined: Fri Nov 14, 2014 9:38 am

Re: DB Error

Post by bobloblian »

Hi Shaun,

Thank you again for sticking with me on this, I have sent a video capture of what happens on my screen to the support address.

For the sake of completeness, I did clear my cache, and tried firefox in safe mode, and can replicate the browser symptoms on other computers.

Since you said you loaded up in your system fine, I copied all the files over to another server, installed postgres on there and loaded the database, and started the install procedure there. The difference is that if I have anything entered into the hostname field, it will give a connection error, but when I clear the hostname field, it still gives the local cache error. so maybe there is something about my environment that is blocking the upgrade?
shaunw
Posts: 7839
Joined: Tue Sep 19, 2006 2:22 pm

Re: DB Error

Post by shaunw »

I received an update from my colleague who spoke with you, he mentioned that setting "enable_display = FALSE" in your timetrex.ini.php under [debug] allowed the web-based installer to complete and you are up and running again as normal. Enjoy!
bobloblian
Posts: 19
Joined: Fri Nov 14, 2014 9:38 am

Re: DB Error

Post by bobloblian »

Huge thanks to the timetrex support team. pretty sure that setting was FALSE originally, but regardless the problem is resolved and my employees got paid today, so everybody is pretty happy around here. Beers are on us if you ever come this way, thank you so much :)
Post Reply