Attempted to run a Prune Database program and got the following fatal error.
Anyone seen this before and know a fix. My workflow automates fine.
Tue Aug 28 14:50:37 2018 [6897][1][FATAL] Query Failed: INSERT INTO tracker (monitor_id,user_id,module_name,item_id,item_summary,date_modified,action,session_id,visible ) VALUES ( â16e199f0-c025-4f13-2101-5b8561255b8bâ,â1â,âSchedulersâ,â64732703-42d2-d2fb-c6ab-5b855b1588c0â,âPrune Tracker Tables 2â,â2018-08-28 14:50:37â,âdetailviewâ,â2b1f63de5a250bafdd9797c92f23547dâ,â1â): MySQL error 1364: Field âidâ doesnât have a default value
Sorry for the late reply I was off sick for a bit. You are right the table is not set to Auto Increment.
I have to use MySQL WorkBench to define it as Auto Increment (by using the spanner icon next to the table and selected AI.
When I set it I got error âERROR 1075: Incorrect table definition; there can be only one auto column and it must be defined as a keyâ
I then defined it as Primary Key and Auto Increment and it did not throw up an error.
I did a quick Repair and Rebuild from the Admin Centre.
After that I checked by running the a test Prune Tracker Tables (I did this by duplicated the Prune Tracker Tables and setting the date) and it still shows no successful runs.
Checked my error logs just MqSQL Error 1146 but did not match the times I was attempting to Prune.
Currently Unresolved.
Question PGR do I need to change all the tables IDâs to have Primary Key and Auto Increment, as in Surveys, Opportuntities Audit etc?
You shouldnât change anything else, it is even strange that this table was not set correctly - as I said, the installer takes care of all of that.
You can simply change the Schedule of the Prune Tables job to run more frequently, for tests.
If the error doesnât come up when the job runs, then this particular issue seems to be fixed. If you have another issue keeping the job from finishing successfully, you should have a different error there.
My CRON Instructions at the bottom of Schedulers is
In order to run SuiteCRM Schedulers, edit your web server userâs crontab file with this command:
sudo crontab -e -u apache
⌠and add the following line to the crontab file:
cd /var/www/html; php -f cron.php > /dev/null 2>&1
I am already in as root so I do not use sudo but when I type in the command it looks like it is working. I have taken a screenshot of the current command.
Do you see any errors in your logs about Scheduler jobs or cron? Check both
suitecrm.log
php_errors.log
Also give this command
php -i | grep "'_'"
Use copy-paste to put that in, otherwise itâs hard not to mess up. That should be double-quote, single-quote, underscore, single_quote, double_quote.
[root@server ~]# php -i | grep ââ_ââ
-bash: php: command not found
It does that all the time with commands, I then resheduled a job.
SuiteCRM.log - has no errors at the time the job failed, nothing at all for an hour before.
php_errors.log - I do not think I have one set up. My php.ini file states
; Log errors to specified file. PHPâs default behavior is to leave this value
; empty.
; http://php.net/error-log
; Example:
;error_log = php_errors.log
; Log errors to syslog (Event Log on Windows).
;error_log = syslog
Prior to above.
I used whereis PHP and changed all the permissions on the stated folders to allow write access.
Yes, definitely set up php_errors.log. I usually put it on my SuiteCRM root directory so I can check it on the same place as suitecrn.log. Restart your web server.
You donât have the âpathâ set up so you can call PHP from the command-line. That is why crontab doesnât run PHP correctly.
So, check that your PHP is where I think it is by doing:
/usr/bin/php -i | grep php.ini
/usr/share/php -i | grep php.ini
One of these should work, and it will also tell you where your php.ini file is.
(you shouldnât have changed permissions on those folders, by the way)
Thatâs not a good way to tell, you just know that the system is issuing the command, you donât know if it is failing (it is!)
To set up the php_errors.log all you have to do is uncomment that line in php.ini. To uncomment a line just remove the ; from the beginning. So it will look like
error_log = /var/www/html/php_errors.log
Then restart your web server.
We really need to find your php executable. How about any of these places, can you execute it?
/usr/share/php/bin/php -i | grep php.ini
Now, if that works, I want to know which php.ini path it reports. It doesnât matter that you found a php.ini somewhere, there is more than one.
If that doesnât work, then go inside SuiteCRM, Admin / diagnostics, select only âphpinfoâ, download, unzip, open it, and get the executable path from there.
The user you need to be concerned about is not the user youâre using to login; it is your web server user. By giving filesâ ownership to root you are making them invisible to SuiteCRM. So stay calm, follow instructions, letâs do one thing at a time⌠:ohmy:
I am getting really lost.The php.ini file is /etc/php.ini. The command didnât I am having massive problems having my SSH respond to commands, it appears to use a different language! (Something simple takes forever)
Configuration File (php.ini) Path /etc
Loaded Configuration File /etc/php.ini
Scan this dir for additional .ini files /etc/php.d
When I attempt to set file permissions I get invalid user for www-data
One of the reasons this seems complicated is because our communication is a bit chaotic; I would prefer if you would always pair up which command you gave, and what it answered. Even for the failed commands. The messages might mean something to me, even if they donât mean much to you.
Another thing: donât lose hope, this is actually a simple problem, only you (apparently) donât have much experience as a sysadmin, and I have to make guesses and work from a distance, which makes things complicated.
But you simply have a bash shell that doesnât have a properly set âpathâ, so it doesnât find commands easily; and you need to set SuiteCRM permissions but first you have to find out some details about your system.
If âapacheâ is the user name your Web server is running under (and not just the brand of the server like you wrote: âThe webserver name is apacheâ), then issue all these commands from the root of your SuiteCRM installation:
The company which is hosting my package kindly stepped in when I asked why the command above was not working. You had rightly pointed out it was a permissions issue. They fixed it and Cron so it now runs my scheduled jobs. (The web company is really awesome)
The issue has been resolved and I do not know what they did to fix it. I have asked them for the details so I can list them here in the forum, but they may not come back to me with the nitty gritty stuff. (for which I am sorry to anyone who reads this in future)
I will keep chasing them as I really want to know how to fix it.
Thank you for your help PGR do you have a email I can send the PHP info to?