IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIII
Before you create the issue:
IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIII
Search for similar report among other reported issues.
Learn how to troubleshoot at https://www.mautic.org/docs/en/tips/troubleshooting.html
Use drag&drop to attach images or other files )
Getting mautic's 500 internal server error when deleted user try to unsubscribe through link in the email.
In mautic logs getting Uncaught PHP Exception. Nginx logs are clear.
When sending Example email and click unsubscribe, getting (as expected) Record not found, no errors.
Tested on Ubuntu 18.04 and CentOS 7

| Q | A
| --- | ---
| Mautic version | v2.15.1 v2.15.2
| PHP version | 7.2.24 7.2.17
| Browser | Chrome(78.0.3904.70) Firefox(70.0)
unsubscribe link in email500 internal server error mautic.CRITICAL: Uncaught PHP Exception Symfony\Component\Debug\Exception\FatalThrowableError: "Call to a member function getId() on null" at /home/xxxxx/mautic/app/bundles/EmailBundle/Controller/PublicController.php line 182 {"exception":"[object] (Symfony\Component\Debug\Exception\FatalThrowableError(code: 0): Call to a member function getId() on null at /home/xxxxx/mautic/app/bundles/EmailBundle/Controller/PublicController.php:182)"} []
Please check for related errors in the latest log file in [mautic root]/app/log/ and/or the web server's logs and post them here. Be sure to remove sensitive information if applicable. )
Yes the page cannot be found because the contact is not existing anymore. What do you think we should have as page ? 404 ? Or a message like "your profile has been deleted before your request" ?
Hi!
Thank you for the quick answer.
Maybe something like Record not found will be much better than internal server error
Mautic already has this message, why not to use that?
But if this is the expected situation I will try to find my own workaround.
Closing due to a lack of recent activity. Please create a new issue and link to this one if necessary.
Most helpful comment
Yes the page cannot be found because the contact is not existing anymore. What do you think we should have as page ? 404 ? Or a message like "your profile has been deleted before your request" ?