loftwah / linkarooie

Simplify your online presence with a single link.
https://linkarooie.com
MIT License
26 stars 6 forks source link

500 Internal Server Error During User Registration Due to Missing Font in MiniMagick #189

Closed loftwah closed 2 months ago

loftwah commented 2 months ago

The user registration process fails with a 500 Internal Server Error when generating Open Graph images. The issue is caused by MiniMagick failing to find the Courier font, resulting in an exception. This prevents the image generation and breaks the registration flow.

Steps to Reproduce:

  1. Attempt to register a new user with the following details:

    • Email: dean+tempy@deanlofts.xyz
    • Password: [FILTERED]
    • Username: tempytemp
  2. Observe the 500 error in the logs:

    MiniMagick::Error (`mogrify -gravity North -font Courier -fill #BEF264 -pointsize 40 -draw text 0,479 'Tempy McTempface' -pointsize 28 -draw text 0,537.0 '@tempytemp' /tmp/mini_magick20240920-1-3rc0f9.png` failed with status: 1 and error:
    mogrify-im6.q16: unable to read font `Courier'...

Expected Behavior: The registration should complete successfully, and the Open Graph image should be generated without errors.

Proposed Solution:

  1. Install the Courier font on the server.
  2. Update open_graph_image_generator.rb to use an available font or provide a fallback.
  3. Handle MiniMagick exceptions gracefully to avoid breaking the registration flow.

Additional Context: Logs indicate multiple failures related to the missing Courier font during the mogrify command execution.

loftwah commented 2 months ago

https://github.com/loftwah/linkarooie/pull/191