500 internal server error email link when tracking link clicks or page visits in a campaign

Your software
My Mautic version is: 3.3.2
My PHP version is: 7.4.16
My Database type and version is: Mysql 5.6.43

Your problem
My problem is:

I have been unable to solve this issue for over four days now. I am getting 500 internal server error on my email links whenever I try to track page visits or link clicks on a double opt-in on boarding campaign. It’s good to note the error is only occurring when I am trying to track page visits or link clicks. Without tracking the error is not occurring.

What is confusing is that the error clears after refreshing the page or clicking the link again. A normal opt-in lead is unlikely to click the same link twice or refresh the page after receiving the 500 internal server error.

I have hosted mautic on shared hosting with a litespeed server. I replicated the campaign in namecheap shared hosting with a none litespeed server and the error still occurred. Upon looking at error logs I am not seeing anything.

These errors are showing in the log:

none

Steps I have tried to fix the problem:

  1. Clearing cache.
  2. Eliminating foreign characters and emoji’s on my url, page title and the landing page
  3. Deactivating and uninstalling the WP Mautic wordpress plugin and activating it again.
  4. Using Mautic internal landing pages
  5. Masking my link with bitly
  6. Increasing my PHP memory limit
  7. Increasing my php post max limit
  • Tracking of users with no cookie present setting is set to yes

I have tried literally everything I could think of. Kindly assist.

set permissions for your var/log folder. I have this same error periodically.

Any further directions on how to do this? On my Mautic installation the folder and file permissions section shows the var/log folder is writable. Any custom permission combination you can recommend?

Current permission is set as 7 5 5

Can’t the issue be solved once and for all.

Hey,
Are you using special characters in your UTM tags for that email which you are tracking?

I am actually not using any UTM tags. The goal is to track a link click or page visit for a double opt-in campaign.

I have found a solution to fix the problem once and for all

  1. Enable pdo_mysql on cpanel or server

  2. In app/config/local.php, at ‘db_driver’ => ‘mysqli’ change it to ‘db_driver’ => ‘pdo_mysql’

  3. Clear Cache by deleting the cache folder via the file manager

Did the above and links tracking visits and url clicks are opening fine without the 500 internal server error.

The error code below guided me. I had ignored it since it wasn’t triggered by my own activities. It would autogenerate itself and fill the entire error log as one error.

mautic.ERROR: CAMPAIGN: An exception occurred while executing ‘REPLACE INTO maunfbd_campaign_lead_event_failed_log( log_id, date_added, reason) SELECT id, :dateAdded as date_added, :message as reason from maunfbd_campaign_lead_event_log WHERE is_scheduled = 1 AND lead_id = :contactId AND campaign_id = :campaignId AND rotation = :rotation’: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near ‘:dateAdded as date_added, :message as reason from maunfbd_campaign_lead_event…’ at line 2

More resources on the same.

1 Like

I am having same issue tried the above method changing db_drive to pdo_mysql but nothing happened any other solution please