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.
- CreatorTopic
- April 13, 2017 at 4:40 pm #27645
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.comRan: php app/console oro:cron –env=prod
Nothing happens.Ran: php app/console oro:cron:imap-sync –env=prod
PHP1234567891011Resetting hanged email origins ...Updated 0 row(s).Finding an email origin ...Found "email1@hunterstone.com.au (imap.gmail.com)" email origin. Id: 1.Get folders enabled for sync...Got 1 folder(s).The folder "INBOX" is selected.Previous max email UID "38298"Found 1 email(s).Finding an email origin ...Exit because all origins have been synchronised.No case created.
Ran again: php app/console oro:cron:imap-sync –env=prod
PHP12345678910111213Resetting hanged email origins ...Updated 0 row(s).Finding an email origin ...Found "info@hunterstone.com.au (imap.gmail.com)" email origin. Id: 1.Get folders enabled for sync...Got 1 folder(s).The folder "INBOX" is selected.Previous max email UID "38299"Found 1 email(s).Skip "test5" (UID: 38299) email, because it is already synchronised.Finding an email origin ...Found "info@hunterstone.com.au (imap.gmail.com)" email origin. Id: 1.Exit because all origins have been synchronised.No case created. Any idea? Thanks in advance.
- CreatorTopic
- AuthorReplies
- April 14, 2017 at 7:21 am #27646
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:April 18, 2017 at 7:32 am #27647Hi,
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.April 18, 2017 at 7:46 am #27648Also running:
app/console oro:cron:email-body-sync
Returns:12345[ReflectionException]Property Oro\Bundle\EmailBundle\Entity\Email::$user_d41b1c4b does not existoro:cron:email-body-sync [--max-exec-time [MAX-EXEC-TIME]] [--batch-size [BATCH-SIZE]] [-h|--help] [-q|--quiet] [-v|vv|vvv|--verbose] [-V|--version] [--ansi] [--no-ansi] [-n|--no-interaction] [-s|--shell] [--process-isolation] [-e|--env ENV] [--no-debug] [--current-user CURRENT-USER] [--current-organization CURRENT-ORGANIZATION] [--disabled-listeners DISABLED-LISTENERS] [--] <command>Same as described here:
https://github.com/orocrm/platform/issues/287#issuecomment-204487389My platform version is:
PHP12oro/platform 2.1.0 Business Application Platform (BAP)oro/platform-serialised-fields 2.1.0 Oro Platform Serialized FieldsApril 18, 2017 at 8:43 am #27649More tries this time with –evn=prod:
12345678910php app/console oro:cron:email-body-sync --env=prodWarning: Error while sending QUERY packet. PID=122 in /var/www/html/vendor/doctrine/dbal/lib/Doctrine/DBAL/Connection.php on line 1278[Doctrine\ORM\ORMException]The EntityManager is closed.oro:cron:email-body-sync [--max-exec-time [MAX-EXEC-TIME]] [--batch-size [BATCH-SIZE]] [-h|--help] [-q|--quiet] [-v|vv|vvv|--verbose] [-V|--version] [--ansi] [--no-ansi] [-n|--no-interaction] [-s|--shell] [--process-isolation] [-e|--env ENV] [--no-debug] [--current-user CURRENT-USER] [--current-organization CURRENT-ORGANIZATION] [--disabled-listeners DISABLED-LISTENERS] [--] <command>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.
April 18, 2017 at 2:46 pm #27650Hello @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.
Shell12345678910111213141516171819202122232425php app/console --env=prod oro:cron:imap-syncResetting hanged email origins ...Updated 0 row(s).Finding an email origin ...Found "dnahrebecki@oroinc.com (imap.gmail.com)" email origin. Id: 37.Get folders enabled for sync...Got 2 folder(s).The folder "[Gmail]/Test" is selected.Loading emails from "[Gmail]/Test" folder ...Query: ""after:2017/04/18"".Found 1 email(s).Skip "test" (UID: 1) email, because it was sent earlier than the start synchronization is setThe folder "INBOX" is selected.Previous max email UID "5050"Found 1 email(s).Batch save time: "2" seconds.Finding an email origin ...Found "dnahrebecki@oroinc.com (imap.gmail.com)" email origin. Id: 37.Exit because all origins have been synchronised.php app/console oro:cron:email-body-sync --env=prodBatch save time: 0 minutes 3 seconds.All emails was processedApril 19, 2017 at 2:16 am #27651Also, 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
April 19, 2017 at 3:16 am #27652Hi,
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.April 19, 2017 at 6:46 am #27653As 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?April 19, 2017 at 9:32 am #27654Hi
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:
Shell1app/console oro:process:configuration:loadThe output of this command should contain this line:
Shell1[info] > process definition: "convert_mailbox_email_to_case"..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:
Shell1[2017-04-19 15:18:27] oro_workflow.DEBUG: Process executed {"definition":"convert_mailbox_email_to_case","event":"create","entityId":166} []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.
April 24, 2017 at 12:20 am #27655While 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.
April 24, 2017 at 1:15 am #27656So 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:PHP12345678# php app/console oro:cron:email-body-sync[Doctrine\ORM\ORMException]The EntityManager is closed.oro:cron:email-body-sync [--max-exec-time [MAX-EXEC-TIME]] [--batch-size [BATCH-SIZE]] [-h|--help] [-q|--quiet] [-v|vv|vvv|--verbose] [-V|--version] [--ansi] [--no-ansi] [-n|--no-interaction] [-s|--shell] [--process-isolation] [-e|--env ENV] [--no-debug] [--current-user CURRENT-USER] [--current-organization CURRENT-ORGANIZATION] [--disabled-listeners DISABLED-LISTENERS] [--] <command>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?
April 24, 2017 at 2:32 am #27657So 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:Shell123456#!/bin/bashwhile [ 1 ]; do/bin/date >> /var/www/html/app/logs/cron-prod.log/usr/local/bin/php /var/www/html/app/console oro:cron --env prod >> /var/www/html/app/logs/cron-prod.logsleep 60done
- 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:Shell12345#!/bin/bashwhile [ 1 ]; do/bin/date >> /var/www/html/app/logs/message-queue.log/usr/local/bin/php /var/www/html/app/console oro:message-queue:consume --env prod >> /var/www/html/app/logs/message-queue.logdone
- The count of remaining queue messages can be seen by:MySQL1select count(1) from oro_message_queue limit 1;
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.
April 24, 2017 at 4:21 am #27658These are the logs when a crash on message queue due to excessive memory usage happens:
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172Mon Apr 24 08:24:19 UTC 2017Fatal error: Allowed memory size of 1073741824 bytes exhausted (tried to allocate 16384 bytes) in /var/www/html/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOStatement.php on line 91Fatal error: Allowed memory size of 1073741824 bytes exhausted (tried to allocate 73728 bytes) in /var/www/html/vendor/composer/ClassLoader.php on line 444Mon Apr 24 08:32:16 UTC 2017Fatal error: Allowed memory size of 1073741824 bytes exhausted (tried to allocate 16384 bytes) in /var/www/html/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOStatement.php on line 91Fatal error: Allowed memory size of 1073741824 bytes exhausted (tried to allocate 73728 bytes) in /var/www/html/vendor/composer/ClassLoader.php on line 444Mon Apr 24 08:40:07 UTC 2017Fatal error: Allowed memory size of 1073741824 bytes exhausted (tried to allocate 32768 bytes) in /var/www/html/vendor/doctrine/cache/lib/Doctrine/Common/Cache/FilesystemCache.php on line 65Fatal error: Allowed memory size of 1073741824 bytes exhausted (tried to allocate 73728 bytes) in /var/www/html/vendor/composer/ClassLoader.php on line 444Mon Apr 24 08:48:02 UTC 2017Fatal error: Allowed memory size of 1073741824 bytes exhausted (tried to allocate 32768 bytes) in /var/www/html/vendor/doctrine/cache/lib/Doctrine/Common/Cache/FilesystemCache.php on line 65Fatal error: Allowed memory size of 1073741824 bytes exhausted (tried to allocate 73728 bytes) in /var/www/html/vendor/composer/ClassLoader.php on line 444Mon Apr 24 08:57:28 UTC 2017Warning: PDO::rollBack(): MySQL server has gone away in /var/www/html/vendor/doctrine/dbal/lib/Doctrine/DBAL/Connection.php on line 1278Warning: PDO::rollBack(): Error reading result set's header in /var/www/html/vendor/doctrine/dbal/lib/Doctrine/DBAL/Connection.php on line 1278Fatal error: Allowed memory size of 1073741824 bytes exhausted (tried to allocate 367003024 bytes) in /var/www/html/vendor/monolog/monolog/src/Monolog/Formatter/HtmlFormatter.php on line 122Mon Apr 24 09:01:55 UTC 2017Mon Apr 24 09:02:11 UTC 2017Fatal error: Allowed memory size of 1073741824 bytes exhausted (tried to allocate 16384 bytes) in /var/www/html/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOStatement.php on line 91Fatal error: Allowed memory size of 1073741824 bytes exhausted (tried to allocate 73728 bytes) in /var/www/html/vendor/composer/ClassLoader.php on line 444Mon Apr 24 09:10:01 UTC 2017Fatal error: Allowed memory size of 1073741824 bytes exhausted (tried to allocate 16384 bytes) in /var/www/html/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOStatement.php on line 91Fatal error: Allowed memory size of 1073741824 bytes exhausted (tried to allocate 73728 bytes) in /var/www/html/vendor/composer/ClassLoader.php on line 444Mon Apr 24 09:17:51 UTC 2017Fatal error: Allowed memory size of 1073741824 bytes exhausted (tried to allocate 20480 bytes) in /var/www/html/vendor/doctrine/cache/lib/Doctrine/Common/Cache/FilesystemCache.php on line 71Fatal error: Allowed memory size of 1073741824 bytes exhausted (tried to allocate 73728 bytes) in /var/www/html/vendor/composer/ClassLoader.php on line 444Mon Apr 24 09:25:37 UTC 2017Fatal error: Allowed memory size of 1073741824 bytes exhausted (tried to allocate 16384 bytes) in /var/www/html/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOStatement.php on line 91Fatal error: Allowed memory size of 1073741824 bytes exhausted (tried to allocate 73728 bytes) in /var/www/html/vendor/composer/ClassLoader.php on line 444Mon Apr 24 09:33:18 UTC 2017Fatal error: Allowed memory size of 1073741824 bytes exhausted (tried to allocate 16384 bytes) in /var/www/html/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOStatement.php on line 91Fatal error: Allowed memory size of 1073741824 bytes exhausted (tried to allocate 73728 bytes) in /var/www/html/vendor/composer/ClassLoader.php on line 444Mon Apr 24 09:40:57 UTC 2017Fatal error: Allowed memory size of 1073741824 bytes exhausted (tried to allocate 32768 bytes) in /var/www/html/vendor/doctrine/cache/lib/Doctrine/Common/Cache/FilesystemCache.php on line 65Fatal error: Allowed memory size of 1073741824 bytes exhausted (tried to allocate 73728 bytes) in /var/www/html/vendor/composer/ClassLoader.php on line 444Mon Apr 24 09:48:33 UTC 2017Fatal error: Allowed memory size of 1073741824 bytes exhausted (tried to allocate 16384 bytes) in /var/www/html/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOStatement.php on line 91Fatal error: Allowed memory size of 1073741824 bytes exhausted (tried to allocate 73728 bytes) in /var/www/html/vendor/composer/ClassLoader.php on line 444Mon Apr 24 09:56:10 UTC 2017Fatal error: Allowed memory size of 1073741824 bytes exhausted (tried to allocate 16384 bytes) in /var/www/html/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOStatement.php on line 91Fatal error: Allowed memory size of 1073741824 bytes exhausted (tried to allocate 73728 bytes) in /var/www/html/vendor/composer/ClassLoader.php on line 444Mon Apr 24 10:03:46 UTC 2017Mon Apr 24 10:05:04 UTC 2017April 25, 2017 at 3:18 am #27659Try 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:
INI123[mysqld]max_allowed_packet=104857600 - AuthorReplies
The forum ‘OroCRM – Installation/Technical Issues or Problems’ is closed to new topics and replies.