OroCRM Forums

Covering OroCRM topics, including community updates and company announcements.

Forums Forums OroCRM OroCRM – Installation/Technical Issues or Problems Convert to case doesn't work.

This topic contains 14 replies, has 3 voices, and was last updated by  Mike Kudelya 6 years, 11 months ago.

Starting from March 1, 2020 the forum has been switched to the read-only mode. Please head to StackOverflow for support.

  • Creator
    Topic
  • #27645

    pm
    Participant

    Hi,
    I added a system email successfully (suppose email1@address.com).
    Enabled convert to case and set up owner and assignee.
    Created a new contact with 1 email address which is different than the system email address (suppose email2@address.com).
    Sent an email with subject test5 from email2@address.com to email1@address.com

    Ran: php app/console oro:cron –env=prod
    Nothing happens.

    Ran: php app/console oro:cron:imap-sync –env=prod

    No case created.

    Ran again: php app/console oro:cron:imap-sync –env=prod

    No case created. Any idea? Thanks in advance.

Viewing 14 replies - 1 through 14 (of 14 total)
  • Author
    Replies
  • #27646

    Mike Kudelya
    Participant

    Hi

    Cases and Lead are created after you run “app/console oro:cron:email-body-sync” or click on the email (i.e. you should open an email for viewing). If you can’t see the list of mailbox emails, you should do the following:

    – Set a user who can see these emails in Access Management section when you are creating a Mailbox.
    – Go to My Emails (email/user-emails)
    – Optionally, mailboxes can be filtered here:

    #27647

    pm
    Participant

    Hi,
    Thanks for the reply. Following steps you wrote now I can access system emails’ inbox and click on emails and see their body. Viewing an email still doesn’t create a case. The case owner and email access username are the same as the one I’m using to test it. Any more steps? Thanks in advance.

    #27648

    pm
    Participant

    Also running:
    app/console oro:cron:email-body-sync
    Returns:

    Same as described here:
    https://github.com/orocrm/platform/issues/287#issuecomment-204487389

    My platform version is:

    #27649

    pm
    Participant

    More tries this time with –evn=prod:

    It just created one case which is good to see that this part of the software works for the first time but then above error appeared. I investigated and everywhere people mention a code snipped which should be added to the Symphony based software to prevent this by resetting the entity manager. I have no idea where to add it to Oro or whether it is needed or already have been added. Please help. Thanks in advance.

    #27650

    dnahrebecki
    Moderator

    Hello @pm,

    could you please provide detailed steps to reproduce this issue? Which database do you use, MySQL? Do you use standard application or some customization? I’ve just checked on a fresh install and after synchronization cases have been successfully created.

    #27651

    Mike Kudelya
    Participant

    Also, please clear our cache directories (/app/cache/dev&prod) and try syncing again, your Email entity t(app/cache/dev/oro_entities/Extend/Entity/EX_OroEmailBundle_Email.php) might not contain the $user_d41b1c4b property. Is this a fresh install, or have you upgraded the system? Thanks

    #27652

    pm
    Participant

    Hi,
    Thanks for the reply. I have just the standard application. I run on a docker container. The database is mysql. I can see emails come now. But I cannot see cases getting created.

    #27653

    pm
    Participant

    As I’m constantly working on this system to find issues, I wonder where to look for errors?
    It just silently dies and there is no error message neither on website nor on app/logs/prod.log.
    These are the problems:
    magento customers/orders/shopping carts only synchronized once and never synchronized again.
    Cron job runs and comes back immediately with no output at all and of course it doesn’t do anything.
    Email syncronization is within scheduled tasks but running the cron doesn’t run it. Running it manually does the job. That means, cron doesn’t work. I have netbeans and xdebug and a working dev environment. Which PHP file should I put a debug pointer to find out why cron doesn’t run any job?

    #27654

    Mike Kudelya
    Participant

    Hi

    Before you click on the email body put a debug pointer to this line, the ProcessDefinition entity should be the following. In any case if the $definitions array is empty you have to run:

    The output of this command should contain this line:

    Also, please check that the code doesn’t throw an exception.

    When a case entity is created, my /app/logs/dev.log contains this line:

    These are the problems:
    magento customers/orders/shopping carts only synchronized once and never synchronized again.
    Cron job runs and comes back immediately with no output at all and of course it doesn’t do anything.

    The main goal of the oro:cron command is to create a message for the “message queue consumer”, which executes jobs.
    You should do two things:

    – Run this command every minute “app/console oro:cron –env=prod > /dev/null”
    – “app/console oro:message-queue:consume” must be running in background.

    Can you also please have a look at this documentation.

    #27655

    pm
    Participant

    While I’m working through the code to figure out why cron doesn’t do anything, this question pupped up:

    • Why I cannot see app/console oro:cron:email-body-sync in System> Scheduled Tasks page?
    • How to add app/console oro:cron:email-body-sync to System> Scheduled Tasks?

    Thanks in advance.

    #27656

    pm
    Participant

    So I think email-body-sync was not added to the cron due to message queue was not running.
    Finally I made sure that both the cron job and message queue job are running and I saw that the email-body-sync appeared on the cron list and the cron script is running it on time. But no email synchronization. I ran email-body-sync manually and faced the famous symfony error:

    This one makes me angry. It is like crash error messages of Windows. It just an error with no clue what is wrong. Any ideas?

    #27657

    pm
    Participant

    So these are the lessons I got in my investigations:

    • cron job should be running every one minute. If in case one cannot set the crontab it can be done by writing a shell script that runs the cron every one minute:
    • Message queue should be running in the background (nohup <message queue command> &). The message queue is needed to run steps queued for cron jobs.
    • The message queue has some sort of memory leak. No matter how much max_memory_size I give to php, it runs out of memory every 5 to 7 minute. Good news is that restart it resumes the queue. So one can write a shell script like this:
    • The count of remaining queue messages can be seen by:

      The cron command adds some more to the queue and the queue command consumes then.

    • Until the queue is not finished, you can’t find out why your jobs are not getting done and what is the problem. So first steps to troubleshoot is to make sure cron and message queue are running.
    #27658

    pm
    Participant

    These are the logs when a crash on message queue due to excessive memory usage happens:

    #27659

    Mike Kudelya
    Participant

    Try running your ‘oro:message-queue:consume’ with -vvv option. Could you please show me the last messages that this command prompted before the memory limit crashed?

    MySQL server has gone away

    It is popular error on MySQL 5.7. I removed it with this option:

Viewing 14 replies - 1 through 14 (of 14 total)

The forum ‘OroCRM – Installation/Technical Issues or Problems’ is closed to new topics and replies.

Back to top