Api returns 500 error after cleaning the cache

Your software
My Mautic version is: 4.0.1
My PHP version is: 7.4
My Database type and version is: mariadb

Your problem
My problem is: trying to make a call -
http://send.pinkcreators.com/api/contacts/new?firstname=tester&lastname=testt&email=testinggg@gmail.com

api is returning the 500 error.

HTTP/1.1 500 Internal Server Error
Date: Fri, 22 Oct 2021 20:14:56 GMT
Server: Apache/2.4.41 (Ubuntu)
Vary: Authorization
Set-Cookie: a86c511dba8f33b15af45aa3ffe=dcgc8vv7lgmdlpt887h578; path=/; HttpOnly
Content-Length: 831
Connection: close
Content-Type: text/html; charset=UTF-8


<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8" />
    <meta name="robots" content="noindex,nofollow,noarchive" />
    <title>An Error Occurred: Internal Server Error</title>
    <style>body { background-color: #fff; color: #222; font: 16px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; margin: 0; }
.container { margin: 30px; max-width: 600px; }
h1 { color: #dc3545; font-size: 24px; }
h2 { font-size: 18px; }</style>
</head>
<body>
<div class="container">
    <h1>Oops! An Error Occurred</h1>
    <h2>The server returned a "500 Internal Server Error".</h2>

    <p>
        Something is broken. Please let us know what you were doing when this error occurred.
        We will fix it as soon as possible. Sorry for any inconvenience caused.
    </p>
</div>
</body>
</html>

These errors are showing in the log:

Steps I have tried to fix the problem:
at first I was getting the 404 error, and API was actually WORKING, but then I followed the suggested troubleshooting steps -

rm -rf /var/www/html/app/cache/*
php7.4 /var/www/html/bin/console cache:clear
restarted the server, and now it’s the 500 error.

apache logs -
POST /api/contacts/new?firstname=tester&lastname=testsss&email=tester@gmail.com HTTP/1.1" 500 1130 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/94.0.4606.81 Safari/537.36"

on the dashboard the error log is empty. Please help, thank you!!

1 Like

It’s same for me on Mautic v3.3.2 …

I’m looking in my logs to see if I can figure out where this is coming from… when it was working fine until now.

Pierre

Can you check your file permissions?

sudo chown -R www-data:www-data /yourmauticfolder/
sudo chmod -R 755 /yourmauticfolder/

if needed

Também estou com o mesmo problema…

Toda vez que eu tento salvar um e-mail, ou aplicar as alterações de um e-mail, o sistema gera esse erro.

Qual modelo de email você está usando?

Olá amigo, é o formato de texto simples mesmo… mas eu já descobri o que era o erro…

Eu estava inserindo Ícones do facebook no texto… e toda vez que eu colocava alguns icone, ele gerava esse erro e não salvava o e-mail… Foi só tirar os Ícones que tudo funcionou…

Mas, vou te falar uma coisa… esse editor tem hora que passa raiva… ele muda os objetos, não permite alterar texto… uma blz…

Mas tudo certo… Obrigado pelo retorno e a intenção em ajudar.