Page 1 of 1

Can't resolve weekly errors

Posted: Wed Jun 11, 2014 11:16 am
by fullmoonguru
I've had TT installed on my local LAMP server for a couple of years (Ubuntu 12.04). For the last couple of months I have been getting a red banner error on Monday mornings that TT can't do it maintenence or whatever.

If I set the installer to True and get to the test screen I see this error in the PHP CLI requirements:

Code: Select all

Warning: PHP CLI requirements failed while executing
""/usr/bin/php" "/var/www/timetrex//tools/unattended_upgrade.php" --config "/var/www/timetrex/includes/../timetrex.ini.php" --requirements_only --web_installer"
Likely caused by having two PHP.INI files with different settings.
Then under the Writable Cache Directory, I get this:

Code: Select all

Warning: Not writable (/tmp/timetrex)
If I go look at the /tmp directory, the timetrex folder is gone. If I create the folder both errors go away, until the next Monday.

It does seem like the /tmp folder used to have a timetrex file in it, instead of a folder. It seems like this error started when the file changed to a folder, but I could be wrong about that.

I have tried all sorts of permissins changes but nothing has worked. I don't know anything about the double php.ini files. Not sure where I would look.

Anyway, something in Ubuntu or something in Timetrex has changed and I need help to resolve it.

Re: Can't resolve weekly errors

Posted: Wed Jun 11, 2014 11:32 am
by shaunw
Some distros (ubuntu/debian being some) clear out the /tmp folder after every reboot, so if you are using /tmp/timetrex as the cache folder every reboot you will need to recreate it, otherwise you will see that error.

It is recommended that you disable this /tmp clearing functionality if you decide to put TimeTrex files there, consult your distro documentation for more information on this.

Re: Can't resolve weekly errors

Posted: Mon Jun 16, 2014 12:15 pm
by fullmoonguru
Thanks Shaun. Is there a reason I shouldn't just make a cache folder in my timetrex directory, put the folder in there, and change the path in the timetrex.ini.php file?

Re: Can't resolve weekly errors

Posted: Mon Jun 16, 2014 12:44 pm
by shaunw
You can, however if the cache directory is accessible by the web server for reading it would compromise your security.

Re: Can't resolve weekly errors

Posted: Mon Jun 16, 2014 2:07 pm
by fullmoonguru
Got it, thx-

Re: Can't resolve weekly errors

Posted: Mon Jun 23, 2014 10:50 am
by fullmoonguru
I created a tmp2 directory. I got another error today, but the timetrex is there (it's just empty). Can you tell me what the ownership and permissions settings should be?

Re: Can't resolve weekly errors

Posted: Mon Jun 23, 2014 11:24 am
by shaunw
It must be owned/writable by your web server user. If you run the installer again, the system requirements page should let you know if the permissions are incorrect.

Re: Can't resolve weekly errors

Posted: Mon Jun 23, 2014 5:04 pm
by fullmoonguru
So by web server user, you don't mean www-data. You mean the username that I use when I log in?

Re: Can't resolve weekly errors

Posted: Mon Jun 23, 2014 5:07 pm
by shaunw
I'm referring to www-data if thats what your Linux distribution uses.

Re: Can't resolve weekly errors

Posted: Mon Jul 07, 2014 10:38 am
by fullmoonguru
Still getting this error. This is what I've done:

I created a folder, /tmp2, ten ran th teal:

Code: Select all

sudo chown -R www-data:www-data /tmp2
sudo chmod -R 775 /tmp2
sudo chmod g+s /tmp2 
I just tried running the install again & this time there is a difference. Everything is marked as OK.

Therror showing is:
WARNING: TimeTrex system requirement check has failed! Please contact your TimeTrex administrator immediately to re-run the TimeTrex installer to correct the issue.
I believe it's the same as before and it showed up after the weekend as usual.

Re: Can't resolve weekly errors

Posted: Tue Jul 08, 2014 8:01 am
by shaunw
What is the full and exact command that you run in your crontab to execute the TimeTrex maintenance jobs?

Re: Can't resolve weekly errors

Posted: Tue Jul 08, 2014 11:37 am
by fullmoonguru

Code: Select all

* * * * * su skye -c "php /var/www/timetrex/maint/cron.php" > /dev/null 2>&1

Re: Can't resolve weekly errors

Posted: Tue Jul 08, 2014 11:47 am
by shaunw
Above you mentioned that your web server runs as "www-data", but your cron job is running as "skye". This would cause permission conflicts and the error messages that you are seeing.

Instead of:
* * * * * su skye -c "php /var/www/timetrex/maint/cron.php" > /dev/null 2>&1
Try using:

Code: Select all

* * * * * su www-data -c "php /var/www/timetrex/maint/cron.php" > /dev/null 2>&1
After that is done, re-run the TimeTrex installer to clear the error message.

Re: Can't resolve weekly errors

Posted: Mon Jul 21, 2014 8:33 am
by fullmoonguru
That was it. Thanks!