The avatar remains broken in Mautic v5.1

The avatar is broken in my freshly installed v5.1, which I installed using Composer. It happened last time, and I fixed it by changing the “site_url”. However, this time it’s not working.

Here are the steps I tried:

  • Removed the index.php from the site_url (local.php file).
  • Added the avatar.png file in the media/images folder, and the permissions are fine.
  • The site URL in the system settings in the Mautic dashboard is the same as the site_url in local.php.

448180902_8066281183493187_4868678846229295798_n

I do have SSL installed properly, and I’m using nginx with proper configs. I’ve double-checked everything. Now the question is, what else should I try to fix it?

Same problem here. Installed with docker + caddy handling the SSL through reverse proxy. All working OK except the avatar.
Image correctly exists and shows in https://my.new.site/app/assets/images/avatar.svg but the app tries to show https://www.gravatar.com/avatar/39953076e7a1a7fdb6a877f6888213cb?s=250&d=http%3A%2F%2Fmy.new.site%2Fs%2F"https%3A%2Fmy.new.site"%2Fapp%2Fassets%2Fimages%2Favatar.svg%3Fve1459721
and I don’t know why / where can change to fix the http… then if open image in new tab it goes to:
https://i0.wp.com/my.new.site/s/https:/my.new.site/app/assets/images/avatar.svg
I notice the error “https:/”, maybe this is the cause?

According to the implementation of the responsible GravatarHelper.php Mautic requires the icon from Gravatar in the following order:

  1. If your webserver environment is qualified as local development environment, Mautic sends the email address of the user to Gravatar with falling back to Gravatar’s mystery person icon if no Gravatar account is assigned to the email address.

  2. If your webserver environment is qualified as staging or production, Mautic sends the email address of the user to Gravatar with falling back to the local default avatar icon at /app/assets/images/avatar.svg if no Gravatar account is assigned to the email address.

So, if the user’s email address is assigned to a Gravatar account, there should no problem in any environment.

But if Gravatar has to fall back to the passed default icon, it can run into problems, if the default icon is not accessible by Gravatar. To handle this issue, make sure that

a) your local environment is qualified as local environment by (a) adding your local IP address to the “dev_hosts” list in /config/local.php, or by (b) setting the APP_ENV environment variable to “dev” in the .env files or the webserver configuration.

b) your staging and production environment has not restricted the access to the /app/assets/images/avatar.svg default icon, e.g. by http password protection or any other web server configuration. Make sure you can access this icon by accessing it directly in your browser.