Monica: Avatar Pictures Return 404 Errors After Updating to 2.4.2

Created on 26 Jul 2018  路  6Comments  路  Source: monicahq/monica

Describe the bug
Avatar pictures return 404 errors after updating to 2.4.2. I use docker and I've already changed the way the storage directory is mounted. This is my current mount setup: /opt/monica/storage:/var/www/monica/storage. The folder /opt/monica/storage/app/public/avatars exists on the host system and has images in it. However, images don't load in Monica and 404 errors occur.

Screenshots
None

Which version are you using:

  • A server I maintain myself running version 2.4.2 in Docker

Additional context
I use HTTPS and the images load using HTTP. I've tested with HTTPS and nothing changed. The images referenced by the HTML are in fact the images stored on the server.

bug

Most helpful comment

Due to the failing migration(s) in 2.4.x, the artisan task which links the storage folder to /var/www/monica/public/storage is not executed.
I've created a PR which moves this task in front of the migrations.

@NQuackenboss For a quick fix, you can run php artisan storage:link inside your Docker container.

All 6 comments

Oops. Let's see why.

Alright I can't reproduce.
Is the link of the images valid when you take a look at the HTML code? Can you paste this link and see if it loads correctly?

The links to the images are valid in the fact that the images do exist on the filesystem. If I try to load the image I get the "Sorry, the page you are looking for could not be found." error from Monica. Here's an example of a profile picture URL that Monica tries to access: https://example.example.com/storage/avatars/vDTPT3IByTJS3zP6jNKLeSKc4kZSDoUSRiLVorTS_110.png. This file exists in /var/www/monica/storage/app/public/avatars in the container according to my docker volume mounted in /opt/monica/storage.

I have the same problem, both in production, as well as in a local development setup.

Directly accessing the avatar link in the dev setup (v2.4.2) returns a NotFoundHttpException in /var/www/monica/vendor/laravel/framework/src/Illuminate/Routing/RouteCollection.php#179.

I've tested different versions; the error first appears in v2.4.0.

Due to the failing migration(s) in 2.4.x, the artisan task which links the storage folder to /var/www/monica/public/storage is not executed.
I've created a PR which moves this task in front of the migrations.

@NQuackenboss For a quick fix, you can run php artisan storage:link inside your Docker container.

Another bug down - thanks!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

baisong picture baisong  路  3Comments

badry-abderrahmane picture badry-abderrahmane  路  3Comments

Svarto picture Svarto  路  3Comments

djaiss picture djaiss  路  4Comments

djaiss picture djaiss  路  3Comments