# Errors with Cron jobs after updating to Mautic 3

**URL:** <https://forum.mautic.org/t/errors-with-cron-jobs-after-updating-to-mautic-3/15016>\
**Category:** Mautic 3 - Install/Upgrade Support\
**Created:** [June 30, 2020, 9:59am UTC](https://forum.mautic.org/t/errors-with-cron-jobs-after-updating-to-mautic-3/15016 "2020-06-30T09:59:29Z")\
**Posts on this page:** 14\
**Page:** 1

<div class="post-metadata">

**Author:** ![coffeeandspice](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/coffeeandspice/32/692_2.png) [@coffeeandspice](https://forum.mautic.org/u/coffeeandspice)\
**Post date:** [June 30, 2020, 9:59am UTC](https://forum.mautic.org/t/errors-with-cron-jobs-after-updating-to-mautic-3/15016/1 "2020-06-30T09:59:29Z")

</div>

Hi,

I’ve just updated my installation to M3, and updated my cron jobs, but I’m getting the following error on all 3 jobs:

**/var/www/vhosts/[redacted]/bin/console mautic:campaigns:trigger" completed with error in 0 seconds, output:**

PHP Warning: Class ‘Tightenco\Collect\Support\LazyCollection’ not found in /var/www/vhosts/[redacted]/vendor/tightenco/collect/src/Collect/Support/alias.php on line 19  
PHP Parse error: syntax error, unexpected ‘=’ in /var/www/vhosts/[redacted]/vendor/tightenco/collect/src/Collect/Support/LazyCollection.php on line 611

---

<div class="post-metadata">

**Author:** ![silavapi](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/silavapi/32/7424_2.png) [@silavapi](https://forum.mautic.org/u/silavapi)\
**Post date:** [June 30, 2020, 10:11am UTC](https://forum.mautic.org/t/errors-with-cron-jobs-after-updating-to-mautic-3/15016/2 "2020-06-30T10:11:40Z")

</div>

Hi there, and welcome to the Mautic Community Forums!

Were there any errors when you performed the migration?

---

<div class="post-metadata">

**Author:** ![coffeeandspice](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/coffeeandspice/32/692_2.png) [@coffeeandspice](https://forum.mautic.org/u/coffeeandspice)\
**Post date:** [June 30, 2020, 10:18am UTC](https://forum.mautic.org/t/errors-with-cron-jobs-after-updating-to-mautic-3/15016/3 "2020-06-30T10:18:00Z")

</div>

I did have this:

ERR\_MAUTIC\_3\_MIGRATIONS\_IDENTIFICATION\_FAILED: We couldn’t reliably detect the amount of available database migrations. Please try again by refreshing this page.

However, I think that was more to do with a PHP timeout, as it all went through fine after I refreshed. I’ve also updated the timeout settings in php so scripts can run for 240 seconds just in case it causes issues in the future

---

<div class="post-metadata">

**Author:** ![coffeeandspice](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/coffeeandspice/32/692_2.png) [@coffeeandspice](https://forum.mautic.org/u/coffeeandspice)\
**Post date:** [June 30, 2020, 10:26am UTC](https://forum.mautic.org/t/errors-with-cron-jobs-after-updating-to-mautic-3/15016/4 "2020-06-30T10:26:58Z")

</div>

I’ve also just tried to clear the cache from the command line and I get the same error

---

<div class="post-metadata">

**Author:** ![silavapi](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/silavapi/32/7424_2.png) [@silavapi](https://forum.mautic.org/u/silavapi)\
**Post date:** [June 30, 2020, 10:33am UTC](https://forum.mautic.org/t/errors-with-cron-jobs-after-updating-to-mautic-3/15016/5 "2020-06-30T10:33:16Z")

</div>

OK, can you please share your PHP version also?

How did you install the original 2.x Mautic instance, with a download from [https://www.mautic.org](https://www.mautic.org) or some other way?

---

<div class="post-metadata">

**Author:** ![coffeeandspice](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/coffeeandspice/32/692_2.png) [@coffeeandspice](https://forum.mautic.org/u/coffeeandspice)\
**Post date:** [June 30, 2020, 10:35am UTC](https://forum.mautic.org/t/errors-with-cron-jobs-after-updating-to-mautic-3/15016/6 "2020-06-30T10:35:46Z")

</div>

Mautic 2 was originally installed with a download from [mautic.org](http://mautic.org), then upgraded through the dashboard.

I’m running PHP v7.3.19, and MySQL v5.7.30.

Everything is running on a Plesk Obsidian server on Ubuntu 18

Thanks

---

<div class="post-metadata">

**Author:** ![dennisameling](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/dennisameling/32/958_2.png) [@dennisameling](https://forum.mautic.org/u/dennisameling)\
**Post date:** [June 30, 2020, 12:22pm UTC](https://forum.mautic.org/t/errors-with-cron-jobs-after-updating-to-mautic-3/15016/7 "2020-06-30T12:22:44Z")

</div>

@coffeeandspice  
I was also seeing some slowness on Plesk Obsidian, increasing the timeout helped there. It’s indeed possible to refresh the page when you’re doing the UI upgrade to continue the process where it stalled, so I think your database should be OK.

We did see a similar warning about LazyCollection in this topic: [Mautic 3.0 Installation Error - Row size too large](https://forum.mautic.org/t/mautic-3-0-installation-error-row-size-too-large/14801)

You seem to be using the correct PHP and MySQL versions, so that looks good to me. Saw a similar error in [https://github.com/tightenco/collect/issues/181](https://github.com/tightenco/collect/issues/181) but there the user was running the wrong PHP version.

At this point I’m not sure what is causing this warning to show up for you. Could you maybe, just to be sure, remove your cache folder and try again? Does that make any difference?

---

<div class="post-metadata">

**Author:** ![coffeeandspice](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/coffeeandspice/32/692_2.png) [@coffeeandspice](https://forum.mautic.org/u/coffeeandspice)\
**Post date:** [June 30, 2020, 1:06pm UTC](https://forum.mautic.org/t/errors-with-cron-jobs-after-updating-to-mautic-3/15016/8 "2020-06-30T13:06:38Z")

</div>

@dennisameling

I’ve come across those threads as well. The tighten/collect seems to be causing issues for multiple people, so maybe it needs to be looked into?

I had already tried deleting the cache. For some reason on plesk, I always have to go to the CLI and change the ownership of the cache files for things to work normally again. This started happening after having to revert to a backup in the past.

As this is a live version of mautic that I actually need running, I’ve reverted back to 2.16.3. Would there be a way to create a fresh install of V3 and link it to the existing database? When I create fresh installs things seem to work so much better.

---

<div class="post-metadata">

**Author:** ![dennisameling](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/dennisameling/32/958_2.png) [@dennisameling](https://forum.mautic.org/u/dennisameling)\
**Post date:** [June 30, 2020, 1:58pm UTC](https://forum.mautic.org/t/errors-with-cron-jobs-after-updating-to-mautic-3/15016/9 "2020-06-30T13:58:51Z")

</div>

@coffeeandspice you can theoretically set up a fresh installation of V3, then restore your M2 database to it and run `bin/console doctrine:migrations:migrate --no-interaction` for the M3 database migrations to run. If you had any custom settings/plugins/themes you’ll need to restore those from the M2 installation. For an overview of the configuration parameters that have changed in M3, see [https://github.com/mautic/mautic/blob/d28710f8d6ccde404fbedb2b556c6e64f44342f9/UPGRADE-3.0.md#configuration](https://github.com/mautic/mautic/blob/d28710f8d6ccde404fbedb2b556c6e64f44342f9/UPGRADE-3.0.md#configuration). **We haven’t tested this so not sure it will work as expected**.

The Mautic 3 upgrade script does actually remove the old M2 installation completely (then restores settings/plugins/themes/media from M2) and creates fresh cache, so there shouldn’t be any reason for it not to work.

Would you mind trying the following:

- Copy the M2 instance in Plesk using the “Copy website” feature, to e.g. a subdomain `mysubdomain.mydomain.com`
- Set the PHP timeout to 480 on the site in Plesk
- Run the upgrade script again on your cloned version

Curious to hear if that will work; I’m just trying to understand whether this is a local (server-related) issue or whether we need to make some changes to the upgrade script. Thanks in advance! 🙂

---

<div class="post-metadata">

**Author:** ![coffeeandspice](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/coffeeandspice/32/692_2.png) [@coffeeandspice](https://forum.mautic.org/u/coffeeandspice)\
**Post date:** [June 30, 2020, 4:05pm UTC](https://forum.mautic.org/t/errors-with-cron-jobs-after-updating-to-mautic-3/15016/10 "2020-06-30T16:05:06Z")

</div>

I’ll try that later and keep you posted.

I’ll also try the fresh install and database migration and let you know how that goes too.

---

<div class="post-metadata">

**Author:** ![coffeeandspice](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/coffeeandspice/32/692_2.png) [@coffeeandspice](https://forum.mautic.org/u/coffeeandspice)\
**Post date:** [July 6, 2020, 8:59pm UTC](https://forum.mautic.org/t/errors-with-cron-jobs-after-updating-to-mautic-3/15016/11 "2020-07-06T20:59:41Z")

</div>

Hi @dennisameling,

I finally got round to testing the upgrade. I increased the PHP timeout to 480 and it made no difference.

---

<div class="post-metadata">

**Author:** ![henryweismann](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/henryweismann/32/3125_2.png) [@henryweismann](https://forum.mautic.org/u/henryweismann)\
**Post date:** [August 16, 2020, 11:06am UTC](https://forum.mautic.org/t/errors-with-cron-jobs-after-updating-to-mautic-3/15016/12 "2020-08-16T11:06:24Z")

</div>

I had this too:

> [16-Aug-2020 10:08:00 UTC] PHP Warning: Class ‘Tightenco\Collect\Support\LazyCollection’ not found in …/vendor/tightenco/collect/src/Collect/Support/alias.php on line 19  
> [16-Aug-2020 10:08:00 UTC] PHP Parse error: syntax error, unexpected ‘=’ in …/vendor/tightenco/collect/src/Collect/Support/LazyCollection.php on line 611

It was because MAUTIC requires PHP 7.2 and even though I had upgraded an htaccess setting had it at 7.0 still.

I also got a memory error after that was fixed:

[16-Aug-2020 10:53:07 UTC] PHP Fatal error: Allowed memory size of 33554432 bytes exhausted (tried to allocate 32768 bytes) in /home/jewishdata/public\_html/newsletter/app/bundles/LeadBundle/Model/CompanyModel.php on line 367  
[16-Aug-2020 10:53:07 UTC] PHP Fatal error: Allowed memory size of 33554432 bytes exhausted (tried to allocate 32768 bytes) in /home/jewishdata/public\_html/newsletter/vendor/psr/log/Psr/Log/LogLevel.php on line 1

Which we fixed by increasing the allotted memory via an ini file.

---

<div class="post-metadata">

**Author:** ![rauljauregi](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/rauljauregi/32/4119_2.png) [@rauljauregi](https://forum.mautic.org/u/rauljauregi)\
**Post date:** [December 30, 2020, 8:27am UTC](https://forum.mautic.org/t/errors-with-cron-jobs-after-updating-to-mautic-3/15016/13 "2020-12-30T08:27:58Z")

</div>

I also have this error, but my PHP is 7.3 . Mautic version 3.2.1. MySQL

Mautic was working correctly, but when I tried to whitelist the IP address of CloudFlare and the A2hosting host, I changed the configuration settings on Mautic dashboard.

 ![changed](https://us1.discourse-cdn.com/flex020/uploads/mautic/original/2X/e/e71bd4ee09f579d60864cab41efe70f4cd128a85.jpeg)

But I did it wrong and turned on a 404 throughout Mautic.

So I changed in …/app/config/local.php deleting the host and the IP I entered in the lines:

```
trusted_hosts' => array(

),
trusted_proxies' => array(

),

```

Now I cannot access Mautic and instead have these messages:

**Warning** : Class ‘Tightenco\Collect\Support\LazyCollection’ not found in **/home/mautic.mysite.com/vendor/tightenco/collect/src/Collect/Support/alias.php** on line **19**

**Parse error** : syntax error, unexpected ‘=’ in **/home/mautic.mysite.com/vendor/tightenco/collect/src/Collect/Support/LazyCollection.php** on line **611**

Now even if I turn back the previous local.php file which I made a copy I have not even the previous 404. I have removed the content of the cache folder also.

I would appreciate so much any kind of help or suggestions.  
Thank you in advance

---

<div class="post-metadata">

**Author:** ![EJL](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/ejl/32/12155_2.png) [@EJL](https://forum.mautic.org/u/EJL)\
**Post date:** [March 26, 2021, 2:36pm UTC](https://forum.mautic.org/t/errors-with-cron-jobs-after-updating-to-mautic-3/15016/14 "2021-03-26T14:36:40Z")

</div>

In SSH run php -v to ensure CLI PHP version is correct
