power outage now down for maintenance

General support regarding TimeTrex, such as
configuring policies/taxes or processing payroll.
Locked
centaur5
Posts: 15
Joined: Sat May 26, 2007 11:28 am

power outage now down for maintenance

Post by centaur5 »

I'm using Ubuntu 7.10, apache2, and postgresql 8.3.

Weather caused the power to go out longer than the battery backups last and now Timetrex will start but it complains saying:

pg_ctl.bin: another server may be running; trying to start server anyway
pg_ctl.bin: could not start server
Examine the log output.

Here is the log output:

---------------[ Sun, 30 Mar 2008 19:58:57 -0600 (PID: 8589) ]---------------
DEBUG [259]: <b>[Function]()</b>: URI: /interface/<br>
DEBUG [261]: <b>[Function]()</b>: Version: 2.2.7 Edition: 10 Production: 1 De
mo Mode: 0<br>
DEBUG [73]: <b>[Function]()</b>: Error connecting to the database!<br>
DEBUG [39]: <b>DBError::__construct()</b>: postgres7 error: [-1: Database co
nnection failed] in CONNECT(localhost:5433, 'timetrex', '****', timetrex)
<br>
---------------[ Sun, 30 Mar 2008 19:58:57 -0600 (PID: 8589) ]---------------
---------------[ Sun, 30 Mar 2008 19:58:58 -0600 (PID: 8589) ]---------------
DEBUG [259]: <b>[Function]()</b>: URI: /interface/DownForMaintenance.php?exception=DBError<br>
DEBUG [261]: <b>[Function]()</b>: Version: 2.2.7 Edition: 10 Production: 1 Demo Mode: 0<br>
DEBUG [107]: <b>TTDate::setTimeZone()</b>: Setting TimeZone: America/Denver<br>
DEBUG [53]: <b>[Function]()</b>: Bypassing Authentication<br>
DEBUG [400]: <b>TTi18n::chooseBestLocale()</b>: Choosing Best Locale...<br>
DEBUG [371]: <b>TTi18n::getBrowserLanguage()</b>: HTTP_ACCEPT_LANGUAGE: en-us,en;q=0.5<br>
DEBUG [454]: <b>TTi18n::chooseBestLocale()</b>: cSetting Locale: en_US<br>
DEBUG [318]: <b>TTi18n::setLocale()</b>: Generated/Passed In Locale: en_US<br>
DEBUG [252]: <b>TTi18n::generateLocale()</b>: Array of Locales to try in order: en_US,en_US.UTF-8,en,en.UTF-8<br>
DEBUG [211]: <b>TTi18n::tryLocale()</b>: Found valid locale: en_US.UTF-8<br>
DEBUG [324]: <b>TTi18n::setLocale()</b>: Attempting to set Locale(s) to: en_US.UTF-8 Category: 6 Current Locale: <br>
DEBUG [327]: <b>TTi18n::setLocale()</b>: Setting currency/numeric Locale to: en_US.UTF-8<br>
DEBUG [340]: <b>TTi18n::setLocale()</b>: Setting translator locale to: en_US<br>
DEBUG [357]: <b>TTi18n::setLocale()</b>: Set Master Locale To: en_US.UTF-8<br>
DEBUG [463]: <b>TTi18n::chooseBestLocale()</b>: Using Locale: en_US.UTF-8<br>
---------------[ Sun, 30 Mar 2008 19:58:58 -0600 (PID: 8589) ]---------------
---------------[ Sun, 30 Mar 2008 19:58:58 -0600 (PID: 8589) ]---------------
DEBUG [259]: <b>[Function]()</b>: URI: /interface//send_file.php?object_type=primary_company_logo<br>
DEBUG [261]: <b>[Function]()</b>: Version: 2.2.7 Edition: 10 Production: 1 Demo Mode: 0<br>
DEBUG [73]: <b>[Function]()</b>: Error connecting to the database!<br>
DEBUG [39]: <b>DBError::__construct()</b>: postgres7 error: [-1: Database connection failed] in CONNECT(localhost:5433, 'timetrex', '****', timetrex)
<br>
---------------[ Sun, 30 Mar 2008 19:58:58 -0600 (PID: 8589) ]---------------
---------------[ Sun, 30 Mar 2008 19:58:59 -0600 (PID: 8589) ]---------------
DEBUG [259]: <b>[Function]()</b>: URI: /interface/DownForMaintenance.php?exception=DBError<br>
DEBUG [261]: <b>[Function]()</b>: Version: 2.2.7 Edition: 10 Production: 1 Demo Mode: 0<br>
DEBUG [107]: <b>TTDate::setTimeZone()</b>: Setting TimeZone: America/Denver<br>
DEBUG [53]: <b>[Function]()</b>: Bypassing Authentication<br>
DEBUG [400]: <b>TTi18n::chooseBestLocale()</b>: Choosing Best Locale...<br>
DEBUG [371]: <b>TTi18n::getBrowserLanguage()</b>: HTTP_ACCEPT_LANGUAGE: en-us,en;q=0.5<br>
DEBUG [454]: <b>TTi18n::chooseBestLocale()</b>: cSetting Locale: en_US<br>
DEBUG [318]: <b>TTi18n::setLocale()</b>: Generated/Passed In Locale: en_US<br>
DEBUG [252]: <b>TTi18n::generateLocale()</b>: Array of Locales to try in order: en_US,en_US.UTF-8,en,en.UTF-8<br>
DEBUG [211]: <b>TTi18n::tryLocale()</b>: Found valid locale: en_US.UTF-8<br>
DEBUG [324]: <b>TTi18n::setLocale()</b>: Attempting to set Locale(s) to: en_US.UTF-8 Category: 6 Current Locale: <br>
DEBUG [327]: <b>TTi18n::setLocale()</b>: Setting currency/numeric Locale to: en_US.UTF-8<br>
DEBUG [340]: <b>TTi18n::setLocale()</b>: Setting translator locale to: en_US<br>
DEBUG [357]: <b>TTi18n::setLocale()</b>: Set Master Locale To: en_US.UTF-8<br>
DEBUG [463]: <b>TTi18n::chooseBestLocale()</b>: Using Locale: en_US.UTF-8<br>
---------------[ Sun, 30 Mar 2008 19:58:59 -0600 (PID: 8589) ]---------------
shaunw
Posts: 7839
Joined: Tue Sep 19, 2006 2:22 pm

Post by shaunw »

The issue is with your database.

Try stopping it and starting it again. You may have to remove the .PID file so it can start cleanly again if the server wasn't shut down properly.
centaur5
Posts: 15
Joined: Sat May 26, 2007 11:28 am

Post by centaur5 »

Thanks for the fast reply. When I tried stopping it I was constantly getting an error so I deleted the .pid file as you suggested and now it started successfully. Now that I'm almost done configuring everything I'm a little worried about losing the data I input. The maintenance jobs aren't running although I did run the ./install_cron script so I'm wondering if there is something else I'm supposed to do to make those jobs run? Most forums I searched everybody is using windows so I haven't found anything to help me with this problem.
shaunw
Posts: 7839
Joined: Tue Sep 19, 2006 2:22 pm

Post by shaunw »

If you run:

crontab -e

as the user you installed TimeTrex as, do you see a line in their that belongs to TimeTrex? If so, what is it?
centaur5
Posts: 15
Joined: Sat May 26, 2007 11:28 am

Post by centaur5 »

I noticed that the install_cron script wasn't successfully writing to the user's crontab for some reason and it was putting a file in /tmp instead. I then copied and pasted the line that was recorded in that file into my user's crontab. I now have the following when I do crontab -e:

* * * * * /opt/timetrex/TimeTrex/php/bin/php /opt/timetrex/TimeTrex/timetrex/maint/cron.php >> /dev/null 2>&1

Does it take time for the first maintenance job to run cause if I understand correctly it's supposed to be running every minute? I still have the warning that the jobs aren't running though.
shaunw
Posts: 7839
Joined: Tue Sep 19, 2006 2:22 pm

Post by shaunw »

In some cases it can take 24-48hrs for the warning to disappear.

I would try running this command manually as the user you installed TimeTrex as:

Code: Select all

/opt/timetrex/TimeTrex/php/bin/php /opt/timetrex/TimeTrex/timetrex/maint/cron.php
Does it return any output?
centaur5
Posts: 15
Joined: Sat May 26, 2007 11:28 am

Post by centaur5 »

Result of that line is:

NOTE: Jobs are scheduled to run at specific times, therefore only some jobs are executed each time this file is run.
Jobs Executed: 0 of 11
shaunw
Posts: 7839
Joined: Tue Sep 19, 2006 2:22 pm

Post by shaunw »

Okay, so that looks normal.

I would just check your crontab logs to ensure that it is in fact executing that command each minute and if so the error message should disappear in 24hours or so.
centaur5
Posts: 15
Joined: Sat May 26, 2007 11:28 am

Post by centaur5 »

Maintenance error messages do not show up today so it appears everything is working perfectly. Thanks for your help!
Locked