Skip to content

Inspect.Algebra.concat error when inspecting a vector #14586

@jamilabreu

Description

@jamilabreu

Elixir and Erlang/OTP versions

Elixir Version: 1.19.0-rc.0
OTP: 28.0

Operating system

OSX 15.5

Current behavior

I was directed here from Elixir Forum 💜

When inserting an embedding with a vector (pgvector) column, the job completes but I’m seeing this in the logs:

INSERT INTO "embeddings" ("type","text","node_id","vector","id","inserted_at","updated_at") VALUES ($1,$2,$3,$4,$5,$6,$7) [:identity, "[vector text here]", "01977d67-1d42-7673-b4f2-ef5037c61148", #Inspect.Error<
  got FunctionClauseError with message:

      """
      no function clause matching in Inspect.Algebra.concat/2
      """

  while inspecting:

      %{
        data: <<6, 0, 0, 0, 61, 10, 101, 30, 61, 171, 249, 31, 185, 223, 79, 87, 61,
          71, 135, 151, 188, 157, 18, 123, 188, 149, 159, 41, 188, 249, 7, 131, 59,
          247, 101, 120, 60, 194, 83, 21, 189, 3, 220, 243, 60, 122, 221, 207, 60,
          107, 90, 103, 188, 189, 239, 151, 188, 166, 39, 216, 61, 7, 33, 8, 60, 148,
          49, 96, 188, 102, 220, 201, 189, 58, 119, 64, 60, 23, 143, 150, 188, 51,
          239, 20, 61, 4, 200, 25, 59, 80, 26, 81, 188, 180, 192, ...>>,
        ...
      }

  Stacktrace:

    (elixir 1.19.0-rc.0) lib/inspect/algebra.ex:697: Inspect.Algebra.concat({{:doc_group, [["[" | {:doc_nest, [["0.033787839114665985" | ","], {:doc_break, " ", :flex}, ["0.08397125452756882" | ","], {:doc_break, " ", :flex}, ["-4.259298730175942e-4" | ","], {:doc_break, " ", :flex}, ["0.04871329292654991" | ","], {:doc_break, " ", :flex}, ["-0.01917385123670101" | ","], {:doc_break, " ", :flex}, ["-0.018264370039105415" | ","], {:doc_break, " ", :flex}, ["-0.03039908967912197" | ","], {:doc_break, " ", :flex}, ["0.007549937814474106" | ","], {:doc_break, " ", :flex}, ["0.023721257224678993" | ","], {:doc_break, " ", :flex}, ["-0.0321931354701519" | ","], {:doc_break, " ", :flex}, ["0.01531167235225439" | ","], {:doc_break, " ", :flex}, ["0.014364815317094326" | ","], {:doc_break, " ", :flex}, ["-0.02318553440272808" | ","], {:doc_break, " ", :flex}, ["-0.020282670855522156" | ","], {:doc_break, " ", :flex}, ["0.032990485429763794" | ","], {:doc_break, " ", :flex}, ["0.01808995008468628" | ","], ...], ...}] | "]"], :normal}, %Inspect.Opts{base: :decimal, binaries: :infer, char_lists: :infer, charlists: false, custom_options: [], inspect_fun: &Inspect.inspect/2, limit: 0, pretty: false, printable_limit: 4096, safe: true, structs: true, syntax_colors: [], width: 80}}, ")")
    (elixir 1.19.0-rc.0) lib/inspect/algebra.ex:1095: Inspect.Algebra.fold/2
    (elixir 1.19.0-rc.0) lib/inspect/algebra.ex:376: Inspect.Algebra.to_doc_with_opts/2
    (elixir 1.19.0-rc.0) lib/inspect/algebra.ex:561: Inspect.Algebra.call_container_fun/3
    (elixir 1.19.0-rc.0) lib/inspect/algebra.ex:538: Inspect.Algebra.container_each/5
    (elixir 1.19.0-rc.0) lib/inspect/algebra.ex:514: Inspect.Algebra.container_doc_with_opts/6
    (elixir 1.19.0-rc.0) lib/inspect/algebra.ex:428: Inspect.Algebra.to_doc_with_opts/2
    (elixir 1.19.0-rc.0) lib/inspect/algebra.ex:359: Inspect.Algebra.to_doc/2
    (elixir 1.19.0-rc.0) lib/kernel.ex:2469: Kernel.inspect/2
    (ecto_sql 3.12.1) lib/ecto/adapters/sql.ex:1326: Ecto.Adapters.SQL.log_iodata/7
    (logger 1.19.0-rc.0) lib/logger.ex:1008: Logger.__do_log__/4
    (ecto_sql 3.12.1) lib/ecto/adapters/sql.ex:1294: Ecto.Adapters.SQL.log/4
    (db_connection 2.7.0) lib/db_connection.ex:1704: DBConnection.log/5
    (postgrex 0.20.0) lib/postgrex.ex:296: Postgrex.query/4
    (ecto_sql 3.12.1) lib/ecto/adapters/sql.ex:1150: Ecto.Adapters.SQL.struct/10
    (ecto 3.12.6) lib/ecto/repo/schema.ex:837: Ecto.Repo.Schema.apply/4
    (ecto 3.12.6) lib/ecto/repo/schema.ex:416: anonymous fn/15 in Ecto.Repo.Schema.do_insert/4
    (oban_pro 1.6.0-rc.5) lib/oban/pro/worker.ex:1136: Oban.Pro.Worker.process/3
    (oban 2.19.4) lib/oban/queue/executor.ex:145: Oban.Queue.Executor.perform/1
    (oban 2.19.4) lib/oban/queue/executor.ex:77: Oban.Queue.Executor.call/1

Expected behavior

Show results without error

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions