# Cannot use Console operations for cronjobs

**URL:** <https://forum.mautic.org/t/cannot-use-console-operations-for-cronjobs/20443>\
**Category:** Product Support\
**Tags:** mautic-3\
**Created:** [August 11, 2021, 2:33pm UTC](https://forum.mautic.org/t/cannot-use-console-operations-for-cronjobs/20443 "2021-08-11T14:33:58Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![alex123](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/alex123/32/637_2.png) [@alex123](https://forum.mautic.org/u/alex123)\
**Post date:** [August 11, 2021, 2:33pm UTC](https://forum.mautic.org/t/cannot-use-console-operations-for-cronjobs/20443/1 "2021-08-11T14:33:58Z")

</div>

**Your software**  
My Mautic version is: Cannot find anywhere (update to 3.3.3 is suggested in Dashboard)  
My PHP version is: 7.4  
My Database type and version is: MySql 8.0.25-0ubuntu0.20.04.1  
**Your problem**  
My problem is:

I have a running Mautic installation ( self hosted Ubuntu 20.04, NGINX) connected to Amazon SES. I just can send segment email. I wanted to set up cronjobs as described in the manual but I discover that Console command is refusing to work. When I go to Bin directory where Console is residing and type any of the console commands like:

```
console mautic:campaigns:update 

```

or

```
 console cache:clear

```

I get following error:

```
console: Unable to connect to 127.0.0.1:3109

```

These errors are showing in the log:

[2021-08-11 13:09:46] mautic.DEBUG: CONTACT: Tracking session for contact ID# 26969 through GET /email/6101723e245ef250694932.gif  
[2021-08-11 13:09:49] mautic.DEBUG: CONTACT: 26969 set as current lead.  
[2021-08-11 13:09:49] mautic.DEBUG: CONTACT: Tracking session for contact ID# 26969 through GET /email/6101723e245ef250694932.gif  
[2021-08-11 14:12:01] mautic.DEBUG: CONTACT: New lead created with ID# 72601.  
[2021-08-11 14:12:01] mautic.DEBUG: CONTACT: Tracking session for contact ID# 72601 through GET /index.php/media/images/avatar.png  
[2021-08-11 14:12:01] mautic.DEBUG: CONTACT: Tracking session for contact ID# 72601 through GET /index.php/media/images/avatar.png  
[2021-08-11 14:12:01] mautic.DEBUG: CAMPAIGN: Campaign triggered for event type page.pagehit(page / )  
[2021-08-11 14:12:01] mautic.DEBUG: CONTACT: Tracking session for contact ID# 72601 through GET /index.php/media/images/avatar.png  
[2021-08-11 14:12:01] mautic.DEBUG: CAMPAIGN: Current contact ID# 72601  
[2021-08-11 14:12:01] mautic.DEBUG: CAMPAIGN: Contact does not have any applicable page.pagehit associations.  
[2021-08-11 14:12:01] mautic.DEBUG: CAMPAIGN: Campaign triggered for event type page.devicehit(page / )  
[2021-08-11 14:12:01] mautic.DEBUG: CONTACT: Tracking session for contact ID# 72601 through GET /index.php/media/images/avatar.png  
[2021-08-11 14:12:01] mautic.DEBUG: CAMPAIGN: Current contact ID# 72601  
[2021-08-11 14:12:01] mautic.DEBUG: CAMPAIGN: Contact does not have any applicable page.devicehit associations.  
[2021-08-11 14:24:56] mautic.DEBUG: CONTACT: 2883 set as current lead.  
[2021-08-11 14:24:56] mautic.DEBUG: CONTACT: Tracking session for contact ID# 2883 through GET /emai

Steps I have tried to fix the problem: No idea

Please advise on solution.

---

<div class="post-metadata">

**Author:** ![joeyk](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/joeyk/32/11164_2.png) [@joeyk](https://forum.mautic.org/u/joeyk)\
**Post date:** [August 11, 2021, 5:57pm UTC](https://forum.mautic.org/t/cannot-use-console-operations-for-cronjobs/20443/2 "2021-08-11T17:57:02Z")

</div>

The exact command started with php, right?

---

<div class="post-metadata">

**Author:** ![alex123](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/alex123/32/637_2.png) [@alex123](https://forum.mautic.org/u/alex123)\
**Post date:** [August 11, 2021, 7:15pm UTC](https://forum.mautic.org/t/cannot-use-console-operations-for-cronjobs/20443/3 "2021-08-11T19:15:37Z")

</div>

No, if I put php in front of this like

```
php console mautic:segments:update

```

I get following error:

PHP Fatal error: Declaration of Doctrine\DBAL\Driver\PDOConnection::query() must be compatible with PDO::query(string $query, ?int $fetchMode = null, mixed …$fetchModeArgs) in /var/www/html/mautic/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOConnection.php on line 70

In PDOConnection.php line 70:

Compile Error: Declaration of Doctrine\DBAL\Driver\PDOConnection::query() must be compatible with PDO::query(string $query, ?int $fetch  
Mode = null, mixed …$fetchModeArgs)

Some more stuff from the log:

[2021-08-11 15:21:37] mautic.DEBUG: CONTACT: 39066 set as current lead.  
[2021-08-11 18:41:23] mautic.DEBUG: CONTACT: 3096 set as current lead.  
[2021-08-11 18:41:23] mautic.DEBUG: CONTACT: Tracking session for contact ID# 3096 through GET /email/610d118550827357225497.gif  
[2021-08-11 19:17:20] mautic.WARNING: PHP Warning - file\_put\_contents(/var/www/html/mautic/var/cache/prod/lastUpdateCheck.txt): failed to open stream: Permission denied - in file /var/www/html/mautic/app/bundles/CoreBundle/Helper/UpdateHelper.php - at line 197 {“overrideCache”:false,“cacheFile”:"/var/www/html/mautic/var/cache/prod/lastUpdateCheck.txt",“updateStability”:“stable”,“release”:"[object] (Mautic\CoreBundle\Helper\Update\Github\Release: {})",“data”:{“error”:false,“message”:“mautic.core.updater.update.available”,“version”:“3.3.3”,“announcement”:“[https://github.com/mautic/mautic/releases/tag/3.3.3",“package”:“https://github.com/mautic/mautic/releases/download/3.3.3/3.3.3-update.zip”,“stability”:“stable”,"checkedTime](https://github.com/mautic/mautic/releases/tag/3.3.3%22,%22package%22:%22https://github.com/mautic/mautic/releases/download/3.3.3/3.3.3-update.zip%22,%22stability%22:%22stable%22,%22checkedTime)”:1628709440}}  
[2021-08-11 19:17:21] mautic.DEBUG: CONTACT: New lead created with ID# 72602.  
[2021-08-11 19:17:22] mautic.DEBUG: CONTACT: Tracking session for contact ID# 72602 through GET /index.php/media/images/avatar.png  
[2021-08-11 19:17:22] mautic.DEBUG: CONTACT: Tracking session for contact ID# 72602 through GET /index.php/media/images/avatar.png  
[2021-08-11 19:17:22] mautic.DEBUG: CAMPAIGN: Campaign triggered for event type page.pagehit(page / )  
[2021-08-11 19:17:22] mautic.DEBUG: CONTACT: Tracking session for contact ID# 72602 through GET /index.php/media/images/avatar.png  
[2021-08-11 19:17:22] mautic.DEBUG: CAMPAIGN: Current contact ID# 72602  
[2021-08-11 19:17:22] mautic.DEBUG: CAMPAIGN: Contact does not have any applicable page.pagehit associations.  
[2021-08-11 19:17:22] mautic.DEBUG: CAMPAIGN: Campaign triggered for event type page.devicehit(page / )  
[2021-08-11 19:17:22] mautic.DEBUG: CONTACT: Tracking session for contact ID# 72602 through GET /index.php/media/images/avatar.png  
[2021-08-11 19:17:22] mautic.DEBUG: CAMPAIGN: Current contact ID# 72602  
[2021-08-11 19:17:22] mautic.DEBUG: CAMPAIGN: Contact does not have any applicable page.devicehit associations.

---

<div class="post-metadata">

**Author:** ![alex123](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/alex123/32/637_2.png) [@alex123](https://forum.mautic.org/u/alex123)\
**Post date:** [August 13, 2021, 11:14am UTC](https://forum.mautic.org/t/cannot-use-console-operations-for-cronjobs/20443/4 "2021-08-13T11:14:21Z")

</div>

Anyone? Any help?

---

<div class="post-metadata">

**Author:** ![joeyk](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/joeyk/32/11164_2.png) [@joeyk](https://forum.mautic.org/u/joeyk)\
**Post date:** [August 14, 2021, 5:36am UTC](https://forum.mautic.org/t/cannot-use-console-operations-for-cronjobs/20443/5 "2021-08-14T05:36:58Z")

</div>

Im not answering, because I can’t say anything smart. It seems to be, that you have a php issue here, but I might be wrong. The fact that you cant issue a basic php command questions the integrity of the whole install.  
But again: I might be wrong

---

<div class="post-metadata">

**Author:** ![alex123](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/alex123/32/637_2.png) [@alex123](https://forum.mautic.org/u/alex123)\
**Post date:** [August 14, 2021, 9:03am UTC](https://forum.mautic.org/t/cannot-use-console-operations-for-cronjobs/20443/6 "2021-08-14T09:03:09Z")

</div>

I think I found what was the problem. At least for now.  
Although in Mautic php version was 7.4, in CLI of Ubuntu there was php 8. Strange that Mautic does not see which version of php is on the host.

I downloaded 7.4 and downgraded to this version. Now the error seems to be gone.
