500 Error on API calls

Your software
My Mautic version is: 4.1.1
My PHP version is: 7.4

Your problem
My problem is:

9/14/2022 19:34.58.192: GET REQUEST: https://wwww.imacs.org/api/segments
9/14/2022 19:34.58.272: 500: HttpResponseProxy{HTTP/1.1 500 Internal Server Error [Content-Type: application/json, Transfer-Encoding: chunked, Connection: keep-alive, Cache-Control: max-age=0, must-revalidate, private, Date: Wed, 14 Sep 2022 19:34:58 GMT, Expires: Wed, 14 Sep 2022 19:34:58 GMT, Server: nginx, X-Robots-Tag: noindex, nofollow, nosnippet, noimageindex, X-Xss-Protection: 1; mode=block, X-Content-Type-Options: nosniff] ResponseEntityProxy{[Content-Type: application/json,Chunked: true]}} 20220914IF unexpected server condition error (https://wwww.imacs.org/api/segments)

These errors are showing in the log:

[2022-09-14 15:55:19] mautic.ERROR: PHP Notice: require(): Failed opening required ‘/home/nginx/domains/wwww.imacs.org/public/var/cache/prod/ContainerELZRZee/getMautic_Email_Subscriber_ContactTrackerService.php’ (include_path=‘.:/usr/local/lib/php’) - in file /home/nginx/domains/wwww.imacs.org/public/var/cache/prod/ContainerELZRZee/appAppKernelProdContainer.php - at line 2270

[2022-09-14 15:55:19] mautic.ERROR: Symfony\Component\Debug\Exception\FatalErrorException: Notice: require(): Failed opening required ‘/home/nginx/domains/wwww.imacs.org/public/var/cache/prod/ContainerELZRZee/getMautic_Email_Subscriber_ContactTrackerService.php’ (include_path=‘.:/usr/local/lib/php’) - in file /home/nginx/domains/wwww.imacs.org/public/var/cache/prod/ContainerELZRZee/appAppKernelProdContainer.php - at line 2270

[2022-09-14 19:57:19] mautic.CRITICAL: Uncaught PHP Exception InvalidArgumentException: “The directory “/home/nginx/domains/wwww.imacs.org/public/var/cache/prod/jms_serializer” is not writable.” at /home/nginx/domains/wwww.imacs.org/public/vendor/jms/metadata/src/Cache/FileCache.php line 48 {“exception”:“[object] (InvalidArgumentException(code: 0): The directory "/home/nginx/domains/wwww.imacs.org/public/var/cache/prod/jms_serializer" is not writable. at /home/nginx/domains/wwww.imacs.org/public/vendor/jms/metadata/src/Cache/FileCache.php:48)”}

Steps I have tried to fix the problem:

  • Resetting permissions
  • Clearing the cache
  • Restarting the server

The strange thing is that API calls that return a small result set work fine. Calls that return larger sets come back with a 500 exception. Hmmmm…

1 Like

I’m experiencing a similar issue on my end. Following…

Could you share the call you are making?

Hey Joey,

I’m guessing you are responding to @DavidSchargel above. And I don’t want to hijack this thread, so I created my own topic. I would love any input you have. I believe it is a high level problem, perhaps “operator error”…


This makes me believe that permissions on var/cache/ folder are not correct. Server must be able to write inside var/cache folder @DavidSchargel