Yetiforcecrm: Problem with CRON configuration

Created on 15 Mar 2019  ยท  10Comments  ยท  Source: YetiForceCompany/YetiForceCRM

Hello,

Everything working well in my YetiForce 5.0.0 complete on Ubuntu but i have problems with CRON. I read a instructions on: https://yetiforce.com/pl/baza-wiedzy/dokumentacja/dokumentacja-uzytkownika/item/enable-cron but did not help me. The Symptom is duplicate of Tickets and internall mails.

My error cron.log:
/var/www/html/my_path/cron/cron.sh: 22: /var/www/html/my_path/cron/cron.sh: */5: not found

My file cron.sh:
/5 * * * * sh /var/www/html/my_path/cron/cron.sh > /var/www/html/my_path/cache/logs/cron.log 2>&1 \n # */5 * * * * php /var/www/html/my_path/cron.php > /var/www/html/my_path/cache/logs/cron.log 2>&1 \n

โ” question

Most helpful comment

That is sad to hear @quasi754. I went on and tried to setup the ticket creation for myself to test it out. Kindly find below an overview of the steps.

I used a Gmail account for this. My procedure was as follows:

  1. Setup the RoundCube settings in Mail Tools (System Settings).
  2. Logged in one time through the My Mail (RoundCube) functionality.
  3. In the System Settings\Mail Tools\Mail Scanner, for the RoundCube email address I want to be scanned, I set the actions to Create email message, Create HelpDesk, Relate with Accounts, Relate with Contacts, Relate with Lead, Relate with HelpDesk.
  4. Set the User to the Admin. (All corporate emails/tickets created from this email assigned to Admin. If you want to use a group email, maybe better to link it to a User Group.)
  5. In the Folder, I selected INBOX under the Received section to monitor for incoming emails.
  6. In the tab General Configuration, I selected all the primary and secondary email fields for Leads, Accounts, and Contacts.
  7. Under Create/Open Ticket, I kept the selection on Relate to current ticket (if relating action is added).
  8. Created an Account with a Contact and gave it my personal email address.
  9. I sent an email from my personal email address to the email address linked with RoundCube.
  10. I didn't want to wait for CRON, so I went to Logs\Mail - Download History and pressed Start Manual Scanning.
  11. The log showed me that 3 emails were checked.
  12. I went to the Account I created previously and saw the corporate email was linked here.
  13. I went to the Tickets Tab and saw the ticket was created also.

As I mentioned previously, I didn't test the tickets at all prior to this point. I was only working with corporate emails till now. But the above was quite easy to configure (if I didn't forget to leave anything out in the documentation of course).

Maybe an idea to keep the current installation and remove all settings related to the email and creation of corporate emails, and then start configuring again from scratch. So that you know for sure that it's not the installation.

Furthermore, I noticed that you didn't include Relate with Accounts. Make sure you add that too. What I have seen, is that it is proper to have the ticket linked to an Account, but it is possible to have it linked to the Contact only, without the Account.

Note: The above assumes that CRON is configured and working well.

All 10 comments

That's the logs when Ticket is duplicated:
--------------- 2019-03-15 11:35:01 | Start CRON ---------- 2019-03-15 11:35:01 | LBL_WORKFLOW - Start task 2019-03-15 11:35:01 | LBL_WORKFLOW - End task (0.06 s) 2019-03-15 11:35:01 | LBL_SCHEDULED_IMPORT - Start task 2019-03-15 11:35:01 | LBL_SCHEDULED_IMPORT - End task (0.1 s) 2019-03-15 11:35:01 | LBL_MAIL_SCANNER_ACTION - Start task 2019-03-15 11:35:07 | LBL_MAIL_SCANNER_ACTION - End task (6.08 s) 2019-03-15 11:35:08 | LBL_MAIL_SCANNER_VERIFICATION - Start task 2019-03-15 11:35:08 | LBL_MAIL_SCANNER_VERIFICATION - End task (0.08 s) 2019-03-15 11:35:08 | LBL_MAIL_SCANNER_BIND - Start task 2019-03-15 11:35:08 | LBL_MAIL_SCANNER_BIND - End task (0.09 s) 2019-03-15 11:35:08 | LBL_MAILER - Start task 2019-03-15 11:35:08 | LBL_MAILER - End task (0.09 s) 2019-03-15 11:35:08 | LBL_CARD_DAV - Start task 2019-03-15 11:35:08 | LBL_CARD_DAV - End task (0.09 s) 2019-03-15 11:35:08 | LBL_CAL_DAV - Start task 2019-03-15 11:35:08 | LBL_CAL_DAV - End task (0.1 s) 2019-03-15 11:35:08 | LBL_ACTIVITY_STATE - Not ready to run as the time to run again is not completed 2019-03-15 11:35:08 | LBL_SEND_REMINDER - Start task 2019-03-15 11:35:09 | LBL_SEND_REMINDER - End task (0.1 s) 2019-03-15 11:35:09 | LBL_SEND_NOTIFICATIONS - Start task 2019-03-15 11:35:09 | LBL_SEND_NOTIFICATIONS - End task (0.65 s) 2019-03-15 11:35:09 | LBL_MULTI_REFERENCE_VALUE - Start task 2019-03-15 11:35:09 | LBL_MULTI_REFERENCE_VALUE - End task (0.09 s) 2019-03-15 11:35:09 | LBL_CRMACTIVITY_DAYS - Not ready to run as the time to run again is not completed 2019-03-15 11:35:09 | LBL_ASSETS_RENEWAL - Not ready to run as the time to run again is not completed 2019-03-15 11:35:09 | LBL_SOLD_SERVICES_RENEWAL - Not ready to run as the time to run again is not completed 2019-03-15 11:35:09 | LBL_RECORD_LABEL_UPDATER - Start task 2019-03-15 11:35:10 | LBL_RECORD_LABEL_UPDATER - End task (0.43 s) 2019-03-15 11:35:10 | LBL_PRIVILEGES_UPDATER - Start task 2019-03-15 11:40:44 | LBL_PRIVILEGES_UPDATER - End task (333.9 s) 2019-03-15 11:40:44 | LBL_UPDATER_RECORDS_COORDINATES - Start task 2019-03-15 11:40:44 | LBL_UPDATER_RECORDS_COORDINATES - End task (0.07 s) 2019-03-15 11:40:44 | LBL_ADDRESS_BOOK - Not ready to run as the time to run again is not completed 2019-03-15 11:40:44 | LBL_MARK_RECORDS_AS_REVIEWED - Start task 2019-03-15 11:40:44 | LBL_MARK_RECORDS_AS_REVIEWED - End task (0.07 s) 2019-03-15 11:40:44 | LBL_CACHE - Not ready to run as the time to run again is not completed 2019-03-15 11:40:44 | LBL_NEVER_ENDING_RECURRING_EVENTS - Not ready to run as the time to run again is not completed 2019-03-15 11:40:44 | LBL_CLEAR_FILE_UPLOAD_TEMP - Not ready to run as the time to run again is not completed 2019-03-15 11:40:44 | LBL_SMSNOTIFIER - Start task 2019-03-15 11:40:44 | LBL_SMSNOTIFIER - End task (0.08 s) 2019-03-15 11:40:44 | LBL_BROWSING_HISTORY - Not ready to run as the time to run again is not completed 2019-03-15 11:40:44 | LBK_SYSTEM_WARNINGS - Not ready to run as the time to run again is not completed 2019-03-15 11:40:44 | LBL_BATCH_PROCESSES - Start task 2019-03-15 11:40:44 | LBL_BATCH_PROCESSES - End task (0.17 s) 2019-03-15 11:40:45 | LBL_BATCH_METHODS - Start task 2019-03-15 11:40:45 | LBL_BATCH_METHODS - End task (0.09 s) 2019-03-15 11:40:45 | LBL_SESSION_CLEANER - Start task 2019-03-15 11:40:45 | LBL_SESSION_CLEANER - End task (0.1 s) 2019-03-15 11:40:45 | LBL_CURRENCY_UPDATE - Not ready to run as the time to run again is not completed =============== 2019-03-15 11:40:45 (343.87) | End CRON ==========

Also i got there error too:
PHP Warning: unlink(/var/www/html/my_path/storage/Products//tmpfile1552651501-670.tmp): No such file or directory in /var/www/html/my_path/app/Fields/File.php on line 942

Hi @quasi754 I experienced previously also duplicates of email, but this had to do with the folder settings of the email. I linked it to a GSuite email account and by linking the Inbox and the Sent Items in the Mail Scanner settings, the scanner was duplicating the incoming email twice. When I took the Inbox and only left the Sent Items as folder to check, it was solved. As well the Sent as the Received email was created once only. I think this has to do with tickets also if you set this up in the Mail Scanner.

It's worthwhile to play around with the Mail Scanner folder settings to see which folders cause duplicates. This might be the cause for it.

In regards to the CRON configuration, you only need one line. In my case I have this:
*/5 * * * * cd /path-to-crm; /usr/local/bin/php -f cron.php > /path-to-crm/cache/logs/cron.log 2>&1

@alagmouch Thank you, This one line above fixed the problem

Most welcome.

I don't know why but Ticets stop working again.. only when i click in Ticket it's creating. I did not touch cron.sh configuration.. I don't understand this.. He stoping and working when he want...

cron.logs:

--------------- 2019-03-19 14:25:03 | Start CRON ----------
2019-03-19 14:25:03 | LBL_WORKFLOW - Not ready to run as the time to run again is not completed
2019-03-19 14:25:03 | LBL_MAIL_SCANNER_VERIFICATION - Start task
2019-03-19 14:25:03 | LBL_MAIL_SCANNER_VERIFICATION - End task (0.08 s)
2019-03-19 14:25:03 | LBL_MAIL_SCANNER_ACTION - Not ready to run as the time to run again is not completed
2019-03-19 14:25:03 | LBL_MAIL_SCANNER_BIND - Not ready to run as the time to run again is not completed
2019-03-19 14:25:03 | LBL_SCHEDULED_IMPORT - Not ready to run as the time to run again is not completed
2019-03-19 14:25:03 | LBL_MAILER - Not ready to run as the time to run again is not completed
2019-03-19 14:25:03 | LBL_CARD_DAV - Not ready to run as the time to run again is not completed
2019-03-19 14:25:03 | LBL_CAL_DAV - Not ready to run as the time to run again is not completed
2019-03-19 14:25:03 | LBL_ACTIVITY_STATE - Not ready to run as the time to run again is not completed
2019-03-19 14:25:03 | LBL_SEND_REMINDER - Not ready to run as the time to run again is not completed
2019-03-19 14:25:03 | LBL_SEND_NOTIFICATIONS - Not ready to run as the time to run again is not completed
2019-03-19 14:25:03 | LBL_MULTI_REFERENCE_VALUE - Not ready to run as the time to run again is not completed
2019-03-19 14:25:03 | LBL_CRMACTIVITY_DAYS - Not ready to run as the time to run again is not completed
2019-03-19 14:25:03 | LBL_ASSETS_RENEWAL - Not ready to run as the time to run again is not completed
2019-03-19 14:25:03 | LBL_SOLD_SERVICES_RENEWAL - Not ready to run as the time to run again is not completed
2019-03-19 14:25:03 | LBL_RECORD_LABEL_UPDATER - Not ready to run as the time to run again is not completed
2019-03-19 14:25:03 | LBL_PRIVILEGES_UPDATER - Not ready to run as the time to run again is not completed
2019-03-19 14:25:03 | LBL_UPDATER_RECORDS_COORDINATES - Not ready to run as the time to run again is not completed
2019-03-19 14:25:03 | LBL_ADDRESS_BOOK - Not ready to run as the time to run again is not completed
2019-03-19 14:25:03 | LBL_MARK_RECORDS_AS_REVIEWED - Not ready to run as the time to run again is not completed
2019-03-19 14:25:03 | LBL_CACHE - Not ready to run as the time to run again is not completed
2019-03-19 14:25:03 | LBL_NEVER_ENDING_RECURRING_EVENTS - Not ready to run as the time to run again is not completed
2019-03-19 14:25:03 | LBL_CLEAR_FILE_UPLOAD_TEMP - Not ready to run as the time to run again is not completed
2019-03-19 14:25:03 | LBL_SMSNOTIFIER - Not ready to run as the time to run again is not completed
2019-03-19 14:25:03 | LBL_BROWSING_HISTORY - Not ready to run as the time to run again is not completed
2019-03-19 14:25:03 | LBK_SYSTEM_WARNINGS - Not ready to run as the time to run again is not completed
2019-03-19 14:25:03 | LBL_BATCH_PROCESSES - Not ready to run as the time to run again is not completed
2019-03-19 14:25:03 | LBL_BATCH_METHODS - Not ready to run as the time to run again is not completed
2019-03-19 14:25:03 | LBL_SESSION_CLEANER - Start task
2019-03-19 14:25:03 | LBL_SESSION_CLEANER - End task (0.06 s)
2019-03-19 14:25:03 | LBL_CURRENCY_UPDATE - Not ready to run as the time to run again is not completed
=============== 2019-03-19 14:25:03 (0.25) | End CRON ==========

It looks ok though. Time to run for the CRON jobs are managed in the System Settings Automation\CRON settings. But I don't think that is the issue.

Which Actions did you choose to perform in the Actions field in the tab Email Accounts in the Mail Scanner System settings?

Mostly it is Create email message, Relate with Accounts, Relate with Leads, Relate with Contacts, etc... (The corporate email is then created and then accordingly also a relation is created to whatever Module you wish.)

In regards to the Tickets, I do not have experience with it, but the action Create HelpDesk might be something to test with. See if it is already present in the Actions field in the Email Accounts tab. If not, then add it to see what happens. Other than that, you can also set the action required in the General configuration tab for closed tickets that receive an update.

While you test, you can also set the CRON job to start each 5 minutes or so in the Automation\CRON Settings. So that you don't have to wait long to see results of your configuration adjustments. (Make sure to put the time back as it was prior to the change.)

I hope this helps somehow. Otherwise let me know and I will do some testing with Tickets myself also.

I will try, but by the way i think i made a mistake installing something because that is impossibull the only one person have this issue. I must investigate it.

In Mail Scanner i Set: -Create email message -Create HelpDesk -Relate with Contacts -Relate with HelpDesk. Folders are configured to observ Sent as you advised. Today i came to work and creation ticket died completely, i tried fix it through few hours but without result.. Probably i will have to reinstall everything because i have no idea why tickets were duplicated and why stop working completely now..
I'm shocked because until tickets everything worked really well.

That is sad to hear @quasi754. I went on and tried to setup the ticket creation for myself to test it out. Kindly find below an overview of the steps.

I used a Gmail account for this. My procedure was as follows:

  1. Setup the RoundCube settings in Mail Tools (System Settings).
  2. Logged in one time through the My Mail (RoundCube) functionality.
  3. In the System Settings\Mail Tools\Mail Scanner, for the RoundCube email address I want to be scanned, I set the actions to Create email message, Create HelpDesk, Relate with Accounts, Relate with Contacts, Relate with Lead, Relate with HelpDesk.
  4. Set the User to the Admin. (All corporate emails/tickets created from this email assigned to Admin. If you want to use a group email, maybe better to link it to a User Group.)
  5. In the Folder, I selected INBOX under the Received section to monitor for incoming emails.
  6. In the tab General Configuration, I selected all the primary and secondary email fields for Leads, Accounts, and Contacts.
  7. Under Create/Open Ticket, I kept the selection on Relate to current ticket (if relating action is added).
  8. Created an Account with a Contact and gave it my personal email address.
  9. I sent an email from my personal email address to the email address linked with RoundCube.
  10. I didn't want to wait for CRON, so I went to Logs\Mail - Download History and pressed Start Manual Scanning.
  11. The log showed me that 3 emails were checked.
  12. I went to the Account I created previously and saw the corporate email was linked here.
  13. I went to the Tickets Tab and saw the ticket was created also.

As I mentioned previously, I didn't test the tickets at all prior to this point. I was only working with corporate emails till now. But the above was quite easy to configure (if I didn't forget to leave anything out in the documentation of course).

Maybe an idea to keep the current installation and remove all settings related to the email and creation of corporate emails, and then start configuring again from scratch. So that you know for sure that it's not the installation.

Furthermore, I noticed that you didn't include Relate with Accounts. Make sure you add that too. What I have seen, is that it is proper to have the ticket linked to an Account, but it is possible to have it linked to the Contact only, without the Account.

Note: The above assumes that CRON is configured and working well.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Raggazzoo picture Raggazzoo  ยท  3Comments

skramanzia picture skramanzia  ยท  3Comments

michelmarquesrj picture michelmarquesrj  ยท  3Comments

ldgbc picture ldgbc  ยท  3Comments

scsikid picture scsikid  ยท  3Comments