Skip to content

Field Occurrence.breadcrumbs is broken for MariaDB #150

@phihos

Description

@phihos
Contributor

Describe the bug

Hey folks, I recently upgraded from v0.3.0 to v0.6.0 and the detail page of any error crashed with

** (ArgumentError) cannot load `"[]"` as type {:array, :string} for field :breadcrumbs in %ErrorTracker.Occurrence{__meta__: #Ecto.Schema.Metadata<:loaded, "error_tracker_occurrences">, id: nil, reason: nil, context: nil, breadcrumbs: nil, stacktrace: nil, error_id: nil, error: #Ecto.Association.NotLoaded<association :error is not loaded>, inserted_at: nil}

I already debugged this and it seems that the Ecto adapter Ecto.Adapters.MyXQL correctly stores arrays (like "[]" for an empty array), but crashes on retrieval.
I think there are two hints that we can not make this work just by configuration:

  1. I was not able to find documentation on how to make type :array work with MyXQL. The closest thing I found was this entry in the docs that describes how to store type :map in a JSON column. But no word about :array.
  2. When looking at the MyXQL source we see no implementation for def loaders(:array, type)....

In order to fix this I propose implementing a custom type. I already implemented a proposal that I will show in a PR soon.

To Reproduce

Steps to reproduce the behavior:

  1. Configure a MariaDB db as storage backend.
  2. Generate some error.
  3. Try to navigate to the error detail page (like /errors/1).
  4. Internal server error.

Expected behavior

Detail page should not crash.

Activity

added a commit that references this issue on May 4, 2025
c7ef12e
added 10 commits that reference this issue on May 4, 2025
1f9dc59
90c3cea
8f541c5
ab78bec
5877a6e
0f7348b
be7b2b3
bc070c2
b6b143c
f2d45e4
self-assigned this
on May 11, 2025
added theissue type on May 11, 2025

17 remaining items

Loading
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

    Participants

    @odarriba@phihos

    Issue actions

      Field Occurrence.breadcrumbs is broken for MariaDB · Issue #150 · elixir-error-tracker/error-tracker