glitch-soc / mastodon

A glitchy but lovable microblogging server
https://glitch-soc.github.io/docs/
GNU Affero General Public License v3.0
690 stars 184 forks source link

Attempting to save new favicon errors out #2755

Open th0mcat opened 2 months ago

th0mcat commented 2 months ago

Steps to reproduce the problem

  1. Open Preferences -> Administration -> Server settings
  2. Under Favicon, select a file on local device and hit "Save changes"
  3. The job errors out

Expected behaviour

New favicon will be uploaded and applied to site

Actual behaviour

The " We're sorry, but something went wrong on our end." screen displays

Detailed description

Debug log:

D, [2024-06-24T18:17:07.056828 #30] DEBUG -- : [e2822c7d-cde2-4118-bf4d-ef1734e0c8c9] Cache read: cache:7.1:blocked_ips ({:expires_in=>10 minutes, :namespace=>"cache:7.1", :compress=>true, :compress_threshold=>1024})
D, [2024-06-24T18:17:07.057338 #30] DEBUG -- : [e2822c7d-cde2-4118-bf4d-ef1734e0c8c9] Cache fetch_hit: cache:7.1:blocked_ips ({:expires_in=>10 minutes, :namespace=>"cache:7.1", :compress=>true, :compress_threshold=>1024})
D, [2024-06-24T18:17:07.062805 #30] DEBUG -- : [e2822c7d-cde2-4118-bf4d-ef1734e0c8c9]   User Load (0.6ms)  SELECT "users"."id", "users"."email", "users"."created_at", "users"."updated_at", "users"."encrypted_password", "users"."reset_password_token", "users"."reset_password_sent_at", "users"."sign_in_count", "users"."current_sign_in_at", "users"."last_sign_in_at", "users"."confirmation_token", "users"."confirmed_at", "users"."confirmation_sent_at", "users"."unconfirmed_email", "users"."locale", "users"."encrypted_otp_secret", "users"."encrypted_otp_secret_iv", "users"."encrypted_otp_secret_salt", "users"."consumed_timestep", "users"."otp_required_for_login", "users"."last_emailed_at", "users"."otp_backup_codes", "users"."account_id", "users"."disabled", "users"."invite_id", "users"."chosen_languages", "users"."created_by_application_id", "users"."approved", "users"."sign_in_token", "users"."sign_in_token_sent_at", "users"."webauthn_id", "users"."sign_up_ip", "users"."role_id", "users"."settings", "users"."time_zone", "users"."otp_secret" FROM "users" WHERE "users"."id" = $1 ORDER BY "users"."id" ASC LIMIT $2  [["id", 1], ["LIMIT", 1]]
D, [2024-06-24T18:17:07.070808 #30] DEBUG -- : [e2822c7d-cde2-4118-bf4d-ef1734e0c8c9]   Account Load (0.6ms)  SELECT "accounts"."id", "accounts"."username", "accounts"."domain", "accounts"."private_key", "accounts"."public_key", "accounts"."created_at", "accounts"."updated_at", "accounts"."note", "accounts"."display_name", "accounts"."uri", "accounts"."url", "accounts"."avatar_file_name", "accounts"."avatar_content_type", "accounts"."avatar_file_size", "accounts"."avatar_updated_at", "accounts"."header_file_name", "accounts"."header_content_type", "accounts"."header_file_size", "accounts"."header_updated_at", "accounts"."avatar_remote_url", "accounts"."locked", "accounts"."header_remote_url", "accounts"."last_webfingered_at", "accounts"."inbox_url", "accounts"."outbox_url", "accounts"."shared_inbox_url", "accounts"."followers_url", "accounts"."protocol", "accounts"."memorial", "accounts"."moved_to_account_id", "accounts"."featured_collection_url", "accounts"."fields", "accounts"."actor_type", "accounts"."discoverable", "accounts"."also_known_as", "accounts"."silenced_at", "accounts"."suspended_at", "accounts"."hide_collections", "accounts"."avatar_storage_schema_version", "accounts"."header_storage_schema_version", "accounts"."devices_url", "accounts"."suspension_origin", "accounts"."sensitized_at", "accounts"."trendable", "accounts"."reviewed_at", "accounts"."requested_review_at", "accounts"."indexable" FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2  [["id", 111924747209748643], ["LIMIT", 1]]
D, [2024-06-24T18:17:07.074977 #30] DEBUG -- : [e2822c7d-cde2-4118-bf4d-ef1734e0c8c9]   SessionActivation Load (0.3ms)  SELECT "session_activations".* FROM "session_activations" WHERE "session_activations"."user_id" = $1 AND "session_activations"."session_id" = $2 LIMIT $3  [["user_id", 1], ["session_id", "344577c57ee1f3ab2775dc49ef200006"], ["LIMIT", 1]]
D, [2024-06-24T18:17:07.077305 #30] DEBUG -- : [e2822c7d-cde2-4118-bf4d-ef1734e0c8c9]   SessionActivation Load (0.3ms)  SELECT "session_activations".* FROM "session_activations" WHERE "session_activations"."session_id" = $1 LIMIT $2  [["session_id", "344577c57ee1f3ab2775dc49ef200006"], ["LIMIT", 1]]
D, [2024-06-24T18:17:07.078361 #30] DEBUG -- : [e2822c7d-cde2-4118-bf4d-ef1734e0c8c9]   UserRole Load (0.2ms)  SELECT "user_roles".* FROM "user_roles" WHERE "user_roles"."id" = $1 LIMIT $2  [["id", 3], ["LIMIT", 1]]
D, [2024-06-24T18:17:07.079312 #30] DEBUG -- : [e2822c7d-cde2-4118-bf4d-ef1734e0c8c9]   UserRole Load (0.4ms)  SELECT "user_roles".* FROM "user_roles" WHERE "user_roles"."id" = $1 LIMIT $2  [["id", -99], ["LIMIT", 1]]
D, [2024-06-24T18:17:07.081691 #30] DEBUG -- : [e2822c7d-cde2-4118-bf4d-ef1734e0c8c9]   SiteUpload Load (0.3ms)  SELECT "site_uploads".* FROM "site_uploads" WHERE "site_uploads"."var" = $1 ORDER BY "site_uploads"."id" ASC LIMIT $2  [["var", "favicon"], ["LIMIT", 1]]
I, [2024-06-24T18:17:07.083609 #30]  INFO -- : [e2822c7d-cde2-4118-bf4d-ef1734e0c8c9] [paperclip] Trying to link /tmp/RackMultipart20240624-30-l2btlc.png to /tmp/44f9d5d53081e3229f0a0d43f328dd1620240624-30-394jed.png
I, [2024-06-24T18:17:07.088493 #30]  INFO -- : [e2822c7d-cde2-4118-bf4d-ef1734e0c8c9] [paperclip] Trying to link /tmp/44f9d5d53081e3229f0a0d43f328dd1620240624-30-394jed.png to /tmp/63f552e93db363e9c6f5ebb6dfac958e20240624-30-6lodrj.png
I, [2024-06-24T18:17:07.089431 #30]  INFO -- : [e2822c7d-cde2-4118-bf4d-ef1734e0c8c9] Command :: file -b --mime '/tmp/63f552e93db363e9c6f5ebb6dfac958e20240624-30-6lodrj.png'
I, [2024-06-24T18:17:07.150352 #30]  INFO -- : [e2822c7d-cde2-4118-bf4d-ef1734e0c8c9] method=PATCH path=/admin/settings/branding format=html controller=Admin::Settings::BrandingController action=update status=500 allocations=5765 duration=90.15 view=0.00 db=2.41
E, [2024-06-24T18:17:07.152966 #30] ERROR -- : [e2822c7d-cde2-4118-bf4d-ef1734e0c8c9]   
[e2822c7d-cde2-4118-bf4d-ef1734e0c8c9] Paperclip::Error (Error while optimizing 44f9d5d53081e3229f0a0d43f328dd1620240624-30-394jed: VipsForeignSave: "/tmp/16a902410395d94fee4a9e17f4b7279420240624-30-ekqmso.ico" is not a known file format
):
[e2822c7d-cde2-4118-bf4d-ef1734e0c8c9]   
[e2822c7d-cde2-4118-bf4d-ef1734e0c8c9] lib/paperclip/vips_lazy_thumbnail.rb:72:in `rescue in make'
[e2822c7d-cde2-4118-bf4d-ef1734e0c8c9] lib/paperclip/vips_lazy_thumbnail.rb:35:in `make'
[e2822c7d-cde2-4118-bf4d-ef1734e0c8c9] lib/paperclip/attachment_extensions.rb:21:in `block in post_process_style'
[e2822c7d-cde2-4118-bf4d-ef1734e0c8c9] lib/paperclip/attachment_extensions.rb:20:in `each'
[e2822c7d-cde2-4118-bf4d-ef1734e0c8c9] lib/paperclip/attachment_extensions.rb:20:in `inject'
[e2822c7d-cde2-4118-bf4d-ef1734e0c8c9] lib/paperclip/attachment_extensions.rb:20:in `post_process_style'
[e2822c7d-cde2-4118-bf4d-ef1734e0c8c9] app/models/form/admin_settings.rb:123:in `block (2 levels) in <class:AdminSettings>'
[e2822c7d-cde2-4118-bf4d-ef1734e0c8c9] app/controllers/admin/settings_controller.rb:14:in `new'
[e2822c7d-cde2-4118-bf4d-ef1734e0c8c9] app/controllers/admin/settings_controller.rb:14:in `update'
[e2822c7d-cde2-4118-bf4d-ef1734e0c8c9] app/controllers/concerns/localized.rb:11:in `set_locale'
[e2822c7d-cde2-4118-bf4d-ef1734e0c8c9] lib/mastodon/rack_middleware.rb:9:in `call'
[e2822c7d-cde2-4118-bf4d-ef1734e0c8c9] lib/public_file_server_middleware.rb:18:in `call'

Mastodon instance

powerg.love

Mastodon version

v4.3.0-nightly.2024-06-24+glitch

Browser name and version

Firefox 127.0, Safari iOS, Orion iOS

Operating system

Windows 11, iOS 17.5.1

Technical details

No response

ClearlyClaire commented 2 months ago

This is an upstream issue. Can you report it there? As a workaround, you can set MASTODON_USE_LIBVIPS=false in your environment to use ImageMagick instead of libvips (but I don't remember if ImageMagick is still installed in the default docker image)