Questions and discussion about developing processes and programming in PHP, JavaScript, web services & REST API.

Moderators: ArturoRobles, ArturoRobles

Forum rules: Please search to see if a question has already asked before creating a new topic. Please don't post the same question in multiple forums.
By marcosfpa
#790915
I'm having problems with CRON, it does not run automatically in any way. Manually I can run the commands (cron.php and etc ...) but the CRON automatically can not.
How could I trace what is happening? I already followed everything that is in WIKI ...

I noticed that the cron file saved in opt / processmaker / shared registers the execution (in my manual case) as if it were 1 hour less than the actual ... Would this have to do?
cronerror.png
cronerror.png (40.99 KiB) Viewed 3446 times
cronerror2.png
cronerror2.png (3.2 KiB) Viewed 3443 times
Last edited by marcosfpa on Wed May 31, 2017 12:21 pm, edited 1 time in total.
User avatar
By amosbatto
#790918
marcosfpa wrote:I'm having problems with CRON, it does not run automatically in any way. Manually I can run the commands (cron.php and etc ...) but the CRON automatically can not.
How could I trace what is happening? I already followed everything that is in WIKI ...
First, check the processmaker/shared/log/cron.log file to see if executing. In the same directory, you will find the error log file, so check it if it exists.

Make sure that everything on your server is using the time zone. You should have the same time zone set in these three places:
1. Your server running PM. To check, issue this command on your server:
# date
2. The date.timezone setting in your php.ini file.
3. The time zone selected in Admin > System (or in PM's env.ini file).

Remember that the user who executes the commands in your crontab file needs to have file permissions to access the ProcessMaker files (for example the "apache" user in Red Hat or "www-data" in Debian). Post your crontab file and maybe I can spot the problem.

Possibly a case executed by the cron script contains a trigger which has an error (such as trying to access a case variable which doesn't exist).
By marcosfpa
#791459
Dates are correct at all 3 locations. User this www-date, I check ...
I did not find the error LOG file as you directed me ...
And see below, when running cron.php manually it gives several errors ... this could be causing the problem in CRON? What do these errors mean?
erro_cron2.png
erro_cron2.png (31.31 KiB) Viewed 3430 times
erro_cron.png
erro_cron.png (39.22 KiB) Viewed 3430 times
User avatar
By amosbatto
#791461
The error messages indicate that the user doesn't have permission to write to the shared directory. Do this:
Code: Select all
su
chown -R www-data:www-data /opt/pm
When I execute the ProcessMaker cron scripts in /ect/crontab, I usually use the root user to avoid problems with file permissions, but that is now causing problems with the new logging introduced in PM 3.0.1.18 and later. I recommend creating a "cron" user and adding it to the "www-data" group:
Code: Select all
adduser cron
adduser cron www-data
Then, give "cron" access to the PM files:
Code: Select all
chmod -R g+rx  /opt/pm
chmod -R g+rwx /opt/pm/shared
Then you can use the "cron" user in your /etc/crontab file, in place of "root".

The second set of errors indicate that you might need to change your account settings in Email > Email Servers or maybe your email addresses are wrong.
By marcosfpa
#791485
I made these changes and created the user CRON, but how do I "active" the cron? I restarted the service but it did not activate ...
User avatar
By amosbatto
#791486
You can check if your system's cron is running with this command (executed as root or with sudo):
/etc/init.d/cron status
By marcosfpa
#791658
[email protected]:~# /etc/init.d/cron restart
[ ok ] Restarting cron (via systemctl): cron.service.
[email protected]:~# /etc/init.d/cron status
* cron.service - Regular background program processing daemon
Loaded: loaded (/lib/systemd/system/cron.service; enabled; vendor preset: enabled)
Active: active (running) since Ter 2017-05-30 15:06:19 BRT; 4s ago
Docs: man:cron(8)
Main PID: 32233 (cron)
CGroup: /system.slice/cron.service
`-32233 /usr/sbin/cron -f

Mai 30 15:06:19 SRV-OPTIMIZE systemd[1]: Started Regular background program ....
Mai 30 15:06:19 SRV-OPTIMIZE systemd[1]: Starting Regular background program....
Mai 30 15:06:19 SRV-OPTIMIZE cron[32233]: (CRON) INFO (pidfile fd = 3)
Mai 30 15:06:19 SRV-OPTIMIZE cron[32233]: (*system*) INSECURE MODE (group/ot...)
Mai 30 15:06:19 SRV-OPTIMIZE cron[32233]: (*system*anacron) INSECURE MODE (g...)
Mai 30 15:06:19 SRV-OPTIMIZE cron[32233]: (*system*php5) INSECURE MODE (grou...)
Mai 30 15:06:19 SRV-OPTIMIZE cron[32233]: (CRON) INFO (Skipping @reboot jobs...)
Hint: Some lines were ellipsized, use -l to show in full.


Any last ideas? I want to migrate from server and resolve, but the migration is not working, according to another post we are discussing ...
User avatar
By amosbatto
#791660
I talked to the developers and they tell me that in order for the cron scipts to work correctly, the same time zone has to be set in both the php.ini and the env.ini files on your server.

For example, in your processmaker/workflow/engine/config/env.ini file:
Code: Select all
time_zone = "America/New_York"
And in your php.ini file, you have:
Code: Select all
date.timezone = America/New_York
(Restart Apache or reboot for the changes to take effect.)

It is recommended to set your server's clock to also use same time zone in Linux or Windows.

I have a suggest where user have to select some do[…]

The 500 Internal Server Error is the general catch[…]

Really very nice blog information for this one and[…]

This is a long, lengthy and cumbersome process. T[…]