# Mautic API Authentication problem

**URL:** https://forum.mautic.org/t/mautic-api-authentication-problem/31926
**Category:** Product Support
**Created:** [May 1, 2024, 2:42pm UTC](https://forum.mautic.org/t/mautic-api-authentication-problem/31926 "2024-05-01T14:42:03Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![mneumann](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/mneumann/32/2512_2.png) [@mneumann](https://forum.mautic.org/u/mneumann)
#### Post date: [May 1, 2024, 2:42pm UTC](https://forum.mautic.org/t/mautic-api-authentication-problem/31926/1 "2024-05-01T14:42:03Z")

</div>

**Your software**  
My Mautic version is: v4.4.11  
My PHP version is: 7.4.33  
My Database type and version is: Percona Ver 8.0.33-25

**Your problem**  
My problem is:  
I have a strange problem. I am trying to connect to the API, and connecting with an n8n on the same server works perfectly fine. I try to connect from an n8n at another location and I cannot connect. Trying with OAuth 2, after logging on and confirming that I want to connect I get an Error: connect ETIMEDOUT, with the IP of the Mautic server. Trying to connect with credentials just times out. I tried to connect with a WordPress plugin and the same problem. No way to connect.

These errors are showing in the log:  
I believe they are unrelated, because it happened all before my attempts:  
[2024-05-01 09:00:48] mautic.WARNING: PHP Warning - require(/var/www/html/var/cache/prod/Container5IRGbkK/getMautic\_Form\_Type\_FormconfigService.php): failed to open stream: No such file or directory - in file /var/www/html/var/cache/prod/Container5IRGbkK/appAppKernelProdContainer.php - at line 2338 {“file”:“getMautic\_Form\_Type\_FormconfigService.php”,“lazyLoad”:true} {“hostname”:“603ae2c7cf02”,“pid”:3925531}  
[2024-05-01 09:00:48] mautic.ERROR: PHP Notice: require(): Failed opening required ‘/var/www/html/var/cache/prod/Container5IRGbkK/getMautic\_Form\_Type\_FormconfigService.php’ (include\_path=‘.:/usr/local/lib/php’) - in file /var/www/html/var/cache/prod/Container5IRGbkK/appAppKernelProdContainer.php - at line 2338 {“hostname”:“603ae2c7cf02”,“pid”:3925531}  
[2024-05-01 09:00:48] mautic.ERROR: Symfony\Component\Debug\Exception\FatalErrorException: Notice: require(): Failed opening required ‘/var/www/html/var/cache/prod/Container5IRGbkK/getMautic\_Form\_Type\_FormconfigService.php’ (include\_path=‘.:/usr/local/lib/php’) - in file /var/www/html/var/cache/prod/Container5IRGbkK/appAppKernelProdContainer.php - at line 2338 {“hostname”:“603ae2c7cf02”,“pid”:3925531}  
[2024-05-01 09:00:48] mautic.WARNING: PHP Warning - require(/var/www/html/var/cache/prod/Container5IRGbkK/getSecurity\_Firewall\_Map\_Context\_MainService.php): failed to open stream: No such file or directory - in file /var/www/html/var/cache/prod/Container5IRGbkK/appAppKernelProdContainer.php - at line 2338 {“file”:“getSecurity\_Firewall\_Map\_Context\_MainService.php”,“lazyLoad”:true} {“hostname”:“603ae2c7cf02”,“pid”:3937634}  
[2024-05-01 09:00:48] mautic.ERROR: PHP Notice: require(): Failed opening required ‘/var/www/html/var/cache/prod/Container5IRGbkK/getSecurity\_Firewall\_Map\_Context\_MainService.php’ (include\_path=‘.:/usr/local/lib/php’) - in file /var/www/html/var/cache/prod/Container5IRGbkK/appAppKernelProdContainer.php - at line 2338 {“hostname”:“603ae2c7cf02”,“pid”:3937634}  
[2024-05-01 09:00:48] mautic.ERROR: Symfony\Component\Debug\Exception\FatalErrorException: Notice: require(): Failed opening required ‘/var/www/html/var/cache/prod/Container5IRGbkK/getSecurity\_Firewall\_Map\_Context\_MainService.php’ (include\_path=‘.:/usr/local/lib/php’) - in file /var/www/html/var/cache/prod/Container5IRGbkK/appAppKernelProdContainer.php - at line 2338 {“hostname”:“603ae2c7cf02”,“pid”:3937634}  
[2024-05-01 09:00:48] mautic.WARNING: PHP Warning - require(/var/www/html/var/cache/prod/Container5IRGbkK/getSecurity\_Firewall\_Map\_Context\_MainService.php): failed to open stream: No such file or directory - in file /var/www/html/var/cache/prod/Container5IRGbkK/appAppKernelProdContainer.php - at line 2338 {“file”:“getSecurity\_Firewall\_Map\_Context\_MainService.php”,“lazyLoad”:true} {“hostname”:“603ae2c7cf02”,“pid”:3945474}  
[2024-05-01 09:00:48] mautic.ERROR: PHP Notice: require(): Failed opening required ‘/var/www/html/var/cache/prod/Container5IRGbkK/getSecurity\_Firewall\_Map\_Context\_MainService.php’ (include\_path=‘.:/usr/local/lib/php’) - in file /var/www/html/var/cache/prod/Container5IRGbkK/appAppKernelProdContainer.php - at line 2338 {“hostname”:“603ae2c7cf02”,“pid”:3945474}  
[2024-05-01 09:00:48] mautic.NOTICE: PHP Notice - Undefined variable: inline - in file /var/www/html/offline.php - at line 77 {“inTemplate”:false,“isAjax”:false,“message”:“The site is currently offline due to encountering an error. If the problem persists, please contact the system administrator.”,“submessage”:“System administrators, check server logs for errors.”,“inDev”:false,“base”:“/”,“root”:“/var/www/html”,“assetPrefix”:“”,“paths”:{“themes”:“themes”,“assets”:“media”,“asset\_prefix”:“”,“plugins”:“plugins”,“translations”:“translations”,“local\_config”:“%kernel.root\_dir%/config/local.php”,“root”:“/var/www/”,“app”:“app”,“bundles”:“app/bundles”,“vendor”:“vendor”},“assetBase”:“/media”} {“hostname”:“603ae2c7cf02”,“pid”:3945474}  
[2024-05-01 09:00:48] mautic.ERROR: Symfony\Component\Debug\Exception\FatalErrorException: Notice: require(): Failed opening required ‘/var/www/html/var/cache/prod/Container5IRGbkK/getSecurity\_Firewall\_Map\_Context\_MainService.php’ (include\_path=‘.:/usr/local/lib/php’) - in file /var/www/html/var/cache/prod/Container5IRGbkK/appAppKernelProdContainer.php - at line 2338 {“hostname”:“603ae2c7cf02”,“pid”:3945474}

Steps I have tried to fix the problem:  
clearing the cache

---

<div class="post-metadata">

### Author: ![roblefko](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/roblefko/32/4958_2.png) [@roblefko](https://forum.mautic.org/u/roblefko)
#### Post date: [December 30, 2024, 3:20am UTC](https://forum.mautic.org/t/mautic-api-authentication-problem/31926/2 "2024-12-30T03:20:14Z")

</div>

Did you ever resolve this issue? I’m able to connect to my Mautic 4 instance from n8n, but when I try to connect to a new instance using Mautic 5, I’m unable to connect via the API or Oauth2.

---

<div class="post-metadata">

### Author: ![mneumann](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/mneumann/32/2512_2.png) [@mneumann](https://forum.mautic.org/u/mneumann)
#### Post date: [January 1, 2025, 11:34am UTC](https://forum.mautic.org/t/mautic-api-authentication-problem/31926/3 "2025-01-01T11:34:22Z")

</div>

In my case I think it was an issue of VPS location. As far as I remember I ended up moving the mautic instance closer to the API endpoints that were trying to connect.
