d devhelper

← All errors

Data problem

ActiveRecord::RecordInvalid

Validation failed: Mime type is not a valid reference data value of type mime_type, value provided:image/svg+xml

ChatMessageCreateJob@sendbird_create_messages2 events · 0 users first seen 218 d agolast seen 12 h ago

In one line

A user sent an SVG file in chat, and the app only accepts the mime types it has seeded, so ChatMessage creation was rejected.

Checked against the code

What happened

  • For FILE messages, the job takes the mime type straight from Sendbird (`message[:file][:type]`).
  • `image/svg+xml` is not one of the seeded `mime_type` reference data values (png, jpeg, gif, heic, pdf, doc, xls, and similar).
  • `ChatMessage.create!` fails validation and the job raises.
  • There have been only 16 events in 218 days, so this is occasional user uploads of SVG files and not a regression or deploy problem.

What to do next

  1. Query Confirms image/svg+xml is absent in production reference data; expect only png, jpeg, gif and heic.
    SELECT key, value FROM reference_data WHERE key LIKE 'image/%';
  2. Check Ask product whether SVG chat attachments should be supported. If yes, add an `image/svg+xml` reference datum. If no, block SVG uploads in the client or Sendbird upload settings.

Queries are shown, never run. Check them before using them on production.

Ask a follow-up

Continues the same session, so it still remembers the error and the code it read.

Enter to send · Shift+Enter for a new line
Analysed 1 h ago · claude-sonnet-5-5 · $0.04