YetiForceCompany / YetiForceCRM

Our team created for you one of the most innovative CRM systems that supports mainly business processes and allows for customization according to your needs. Be ahead of your competition and implement YetiForce!
https://yetiforce.com
Other
1.73k stars 749 forks source link

[bug] Workflow notification emails #11972

Closed acoolov closed 4 years ago

acoolov commented 5 years ago

🐞 bug report

⁉️ Describe the bug

I've successfully configured smtp with a gmail account in the settings and when i saved, i successfully received a test email from Yetiforce.

Now when i enable a workflow for ticket comments to send notification when a comment is added to a ticket, i get no notification.

Am i missing any other piece of configuration or is it supposed to work since i received the test email from the system when configured smtp?

🔥 How to trigger the error

Configure smtp with gmail. Got a test email sent successfully to my email. Enabled workflow for ticket comments so that when a comment is added to a ticket, it will send email notification to ticket owner.

👎 Actual Behavior

Not sending email notification to ticket owner.

👍 Expected Behavior

Should send email notification to ticket owner.

Yetiforce 5.2.0 with the latest service pack. PHP requirements have been met during installation.

acoolov commented 5 years ago

Just noticed when I go to Settings - Mail Tools - Emails to send There is an email queue with all my workflow email notifications that are waiting there to be sent. Why are they not being sent when the action actually happens (in this situation new comment added on ticket)?

acoolov commented 5 years ago

Looks like i need to enable cron. I thought processes that don't require schedule don't need cron but looks like in Yetiforce all workflow processes need cron enabled.

I'm trying to enable cron by reading this: https://yetiforce.com/en/knowledge-base/documentation/implementer-documentation/item/enable-cron

First i checked if cron service is running which it is. Then I edit nano /etc/crontab and add the following lines in the current cron file

/5 root sh /var/www/html/cron/cron.sh > /var/www/html/cache/logs/cron.log 2>&1 /5 root php /var/www/html/cron.php > /var/www/html/cache/logs/cron.log 2>&1 /5 * root cd /var/www/html; /usr/local/bin/php -f cron.php > /var/www/html/cache/logs/cron.log 2>&1

I changed the path for the first two lines to the correct path of my Yetiforce, but I'm not sure what to do with the third line. I'm currently using php 7.2 on Ubuntu 18.04.

Does anyone know how to modify the third line?

So far my cron is still not running. I'm not sure what else I am missing.

Please help.

acoolov commented 5 years ago

I modified the third line by adding the correct path to my php7.2 executable file and here is how my 3 crontab lines are looking now:

/1 root sh /var/www/html/cron/cron.sh > /var/www/html/cache/logs/cron.log 2>&1 /1 root php /var/www/html/cron.php > /var/www/html/cache/logs/cron.log 2>&1 /1 * root cd /var/www/html; /usr/bin/php7.2 -f cron.php > /var/www/html/cache/logs/cron.log 2>&1

But cron is still not working. When I run this command manually sh /var/www/html/cron/cron.sh I get this output:

PHP Notice: Undefined variable: typeDb in /var/www/html/app/Db.php on line 153 --------------- 2019-11-07 21:11:01 | Start CRON ---------- 2019-11-07 21:11:01 | LBL_WORKFLOW - Not ready to run as the time to run again is not completed 2019-11-07 21:11:01 | LBL_SCHEDULED_IMPORT - Not ready to run as the time to run again is not completed 2019-11-07 21:11:01 | LBL_MAIL_SCANNER_ACTION - Start task 2019-11-07 21:11:01 | LBL_MAIL_SCANNER_ACTION - End task (0.03 s) 2019-11-07 21:11:01 | LBL_MAIL_SCANNER_VERIFICATION - Start task 2019-11-07 21:11:01 | LBL_MAIL_SCANNER_VERIFICATION - End task (0 s) 2019-11-07 21:11:01 | LBL_MAIL_SCANNER_BIND - Not ready to run as the time to run again is not completed 2019-11-07 21:11:01 | LBL_MAILER - Start task 2019-11-07 21:11:01 | LBL_MAILER - End task (0 s) 2019-11-07 21:11:01 | LBL_CARD_DAV - Start task 2019-11-07 21:11:01 | LBL_CARD_DAV - End task (0.02 s) 2019-11-07 21:11:01 | LBL_CAL_DAV - Start task 2019-11-07 21:11:01 | LBL_CAL_DAV - End task (0.03 s) 2019-11-07 21:11:01 | LBL_ACTIVITY_STATE - Not ready to run as the time to run again is not completed 2019-11-07 21:11:01 | LBL_SEND_REMINDER - Not ready to run as the time to run again is not completed 2019-11-07 21:11:01 | LBL_SEND_NOTIFICATIONS - Not ready to run as the time to run again is not completed 2019-11-07 21:11:01 | LBL_MULTI_REFERENCE_VALUE - Not ready to run as the time to run again is not completed 2019-11-07 21:11:01 | LBL_CRMACTIVITY_DAYS - Not ready to run as the time to run again is not completed 2019-11-07 21:11:01 | LBL_ASSETS_RENEWAL - Not ready to run as the time to run again is not completed 2019-11-07 21:11:01 | LBL_SOLD_SERVICES_RENEWAL - Not ready to run as the time to run again is not completed 2019-11-07 21:11:01 | LBL_RECORD_LABEL_UPDATER - Not ready to run as the time to run again is not completed 2019-11-07 21:11:01 | LBL_PRIVILEGES_UPDATER - Not ready to run as the time to run again is not completed 2019-11-07 21:11:01 | LBL_UPDATER_COORDINATES - Start task 2019-11-07 21:11:01 | LBL_UPDATER_COORDINATES - End task (0.01 s) 2019-11-07 21:11:01 | LBL_UPDATER_RECORDS_COORDINATES - Start task 2019-11-07 21:11:01 | LBL_UPDATER_RECORDS_COORDINATES - End task (0 s) 2019-11-07 21:11:01 | LBL_ADDRESS_BOOK - Not ready to run as the time to run again is not completed 2019-11-07 21:11:01 | LBL_MARK_RECORDS_AS_REVIEWED - Not ready to run as the time to run again is not completed 2019-11-07 21:11:01 | LBL_CACHE - Not ready to run as the time to run again is not completed 2019-11-07 21:11:01 | LBL_NEVER_ENDING_RECURRING_EVENTS - Not ready to run as the time to run again is not completed 2019-11-07 21:11:01 | LBL_CLEAR_FILE_UPLOAD_TEMP - Not ready to run as the time to run again is not completed 2019-11-07 21:11:02 | LBL_SMSNOTIFIER - Start task 2019-11-07 21:11:02 | LBL_SMSNOTIFIER - End task (0.01 s) 2019-11-07 21:11:02 | LBL_BROWSING_HISTORY - Not ready to run as the time to run again is not completed 2019-11-07 21:11:02 | LBK_SYSTEM_WARNINGS - Not ready to run as the time to run again is not completed 2019-11-07 21:11:02 | LBL_BATCH_PROCESSES - Not ready to run as the time to run again is not completed 2019-11-07 21:11:02 | LBL_BATCH_METHODS - Not ready to run as the time to run again is not completed 2019-11-07 21:11:02 | LBL_SESSION_CLEANER - Start task 2019-11-07 21:11:02 | LBL_SESSION_CLEANER - End task (0.01 s) 2019-11-07 21:11:02 | LBL_CURRENCY_UPDATE - Not ready to run as the time to run again is not completed =============== 2019-11-07 21:11:02 (0.15) | End CRON ==========

Can anyone help?

vovpff commented 5 years ago

@mariuszkrzaczkowski pls take a look for PHP notice in cron.sh output. Looks like variable name is wrong. @acoolov pls check google for correct CRON tuning and how it works. Usually there are should be only one line with command like this:

sh ...pathtosystem/cron/cron.sh > ...pathtosystem/cache/logs/cron.log

Correct path to php you need to put into cron/cron.sh file

Something going wrong with you cron and this is cause of Not ready to run as the time to run again is not completed messages

acoolov commented 5 years ago

I used Yetiforce knowledgebase and followed their instructions on how to tune cron and it doesn't work. Looks like their instructions are not complete. Yes i put the correct path to php in my cron.sh file which is this in my case /usr/bin/php7.2

Anyone else knows what to do at this point?

acoolov commented 5 years ago

Here is the variable from /var/www/html/app/Db.php on line 153

'typeDb' => $typeDb,

What should I do to fix it?

davide-alghi commented 5 years ago

As Vladimir said you, try to set only one call into crontab file

/5 * www-data sh /var/www/html/cron/cron.sh > /var/www/html/yetiforce/cache/logs/cron.log 2>&1

www-data is apache user with read/write privileges in var/www/html folder don't use root user for security my example runs every 5 minutes

mariuszkrzaczkowski commented 5 years ago
  1. attach a dump from the server configuration - this is the first step to fix any error. We will not write back without this point
  2. what value you have in the database parameter "version_comment". Sql query SHOW VARIABLES
  3. it is important that the cron call be on the same rights as CRM files. once you run with other permissions you can block crm or cron completely and only the server administrator will help you
  4. Check the crontab call logs
  5. Check the owner of all files
  6. the manual is sufficient and good but requires a certain level of knowledge in server administration. read carefully there are several ways to run cron
acoolov commented 5 years ago

Here is my version_comment variable

version | 5.7.27-0ubuntu0.18.04.1 | | version_comment | (Ubuntu)

Here is my server configuration

yetiforce_settings

mariuszkrzaczkowski commented 5 years ago

you have a lot of serious errors in server configuration, you have to fix it without it, the system will not work properly. what is your database engine

acoolov commented 5 years ago

It's MySQL

X-Wizard commented 4 years ago

Hi mariuszkrzaczkowski,

Any update on the cronjob issue?

please find attached the requested server configuration

yetiforce_settings-2

Hoop that you can solve this challenge :-)

Schermafbeelding 2019-11-26 om 23 35 50
mariuszkrzaczkowski commented 4 years ago

Check the queue of e-mails to be sent after calling workflow with sending mail https://gitdeveloper.yetiforce.com/index.php?module=Mail&parent=Settings&view=List&block=8&fieldid=104