Can't resolve weekly errors

Ask your questions regarding TimeTrex installation here.
Post Reply
fullmoonguru
Posts: 106
Joined: Wed Jun 16, 2010 5:08 am

Can't resolve weekly errors

Post 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.
shaunw
Posts: 7839
Joined: Tue Sep 19, 2006 2:22 pm

Re: Can't resolve weekly errors

Post 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.
fullmoonguru
Posts: 106
Joined: Wed Jun 16, 2010 5:08 am

Re: Can't resolve weekly errors

Post 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?
shaunw
Posts: 7839
Joined: Tue Sep 19, 2006 2:22 pm

Re: Can't resolve weekly errors

Post by shaunw »

You can, however if the cache directory is accessible by the web server for reading it would compromise your security.
fullmoonguru
Posts: 106
Joined: Wed Jun 16, 2010 5:08 am

Re: Can't resolve weekly errors

Post by fullmoonguru »

Got it, thx-
fullmoonguru
Posts: 106
Joined: Wed Jun 16, 2010 5:08 am

Re: Can't resolve weekly errors

Post 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?
shaunw
Posts: 7839
Joined: Tue Sep 19, 2006 2:22 pm

Re: Can't resolve weekly errors

Post 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.
fullmoonguru
Posts: 106
Joined: Wed Jun 16, 2010 5:08 am

Re: Can't resolve weekly errors

Post by fullmoonguru »

So by web server user, you don't mean www-data. You mean the username that I use when I log in?
shaunw
Posts: 7839
Joined: Tue Sep 19, 2006 2:22 pm

Re: Can't resolve weekly errors

Post by shaunw »

I'm referring to www-data if thats what your Linux distribution uses.
fullmoonguru
Posts: 106
Joined: Wed Jun 16, 2010 5:08 am

Re: Can't resolve weekly errors

Post 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.
shaunw
Posts: 7839
Joined: Tue Sep 19, 2006 2:22 pm

Re: Can't resolve weekly errors

Post by shaunw »

What is the full and exact command that you run in your crontab to execute the TimeTrex maintenance jobs?
fullmoonguru
Posts: 106
Joined: Wed Jun 16, 2010 5:08 am

Re: Can't resolve weekly errors

Post by fullmoonguru »

Code: Select all

* * * * * su skye -c "php /var/www/timetrex/maint/cron.php" > /dev/null 2>&1
shaunw
Posts: 7839
Joined: Tue Sep 19, 2006 2:22 pm

Re: Can't resolve weekly errors

Post 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.
fullmoonguru
Posts: 106
Joined: Wed Jun 16, 2010 5:08 am

Re: Can't resolve weekly errors

Post by fullmoonguru »

That was it. Thanks!
Post Reply