500 errors with Sparkpost webhook

Mautic version 2.16
PHP version 7.1

Hi there,

/var/www/html/app/logs/mautic_prod-2020-03-09.php" could not be opened: failed to open stream: Permission denied

This might seem to indicate that there are some file/folder ownership/permissions problems with your Mautic instance.

Do you see any warnings under Settings Cog > System Info > Folder & File permissions?

Yes, i noticed that too, it seems to be a permission problem, all files and folders are owned by apache user on my instance and i don’t see any file permission error in backed.

Settings Cog > System Info > Folder & File permissions?

Sorry here’s what I meant in a quick screen capture in case that didn’t make sense:

Sometimes you can get issues with ownership/permissions and the folder/file permissions view may well flag those up for you.

Thanks for screen capture, here is the screenshot of the backend configuration.

Do you have command-line access? If so, can you provide a screenshot of your file/folders by executing the following command within your /var/www/html directory?

ls -l

It might not be permissions/ownership related but worth checking before going down any tangents :slight_smile:

Also did you experience these (or any other) errors at any point before you set up your Sparkpost integration at all?

Here is the screenshot of above command.


Do you only get the 500 error when you try accessing the SparkPost callback URL directly?
Or, is it when you are setting up the bounce notification in the SparkPost dashboard?

The callback URL is not really designed to be accessed directly in a browser. Its only intended to receive POST requests from the email service itself with a JSON payload - indicating bounce (hard bounce, soft bounce) or complaint.

The way the bounce notification for each transport is implemented in Mautic is slightly different. For example, the Amazon SES callback URL triggers a 500 error if its accessed through the browser. Whereas the Sendgrid callback URL displays a page showing “success” if accessed through the browser. In both cases however, the bounce notification does work.

The 500 error can be a bit of a false alarm. OP, can you try sending a message to a non-existent email address and see if it is marked as Email Bounced inside the contact record within Mautic? That is the definitive way to see if bounce tracking for your selected transport is working.

1 Like

Yes, I’m not accessing callback url in browser, trying to create webhook inside Sparkpost as described in the following url.


I have installed Mautic 2.15.2 with same environment and configuration steps, everything working perfectly fine.

For any future readers:

I ran into this problem after I modified a few files in Mautic - nothing big, just some css and a few lines of html, cleared the cache and BOOM. site down.

After reading @rcheesley’s post above, I just reran the permissions for the hell of it:

Chown -R www-data:www-data /var/www/html
Chmod -R 775 /var/www/html

Restarted apache (service apaches2 restart) and then magically everything worked again.

1 Like