Mautic: Unsubscribe 500 error

Created on 31 Oct 2019  路  3Comments  路  Source: mautic/mautic

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 )

Bug Description

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

mautic_500

| 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)

Steps to reproduce

  1. send email to the user (with unsubscribe link)
  2. delete user from mautic
  3. deleted user click unsubscribe link in email
  4. user get mautic's 500 internal server error

Log errors

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. )

bug

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" ?

All 3 comments

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.

Was this page helpful?
0 / 5 - 0 ratings