BeaconCMS / BeaconCMS/beacon_live_admin

version 0.4.3 attempts to sort components by a non-existent path column

Open
#386 1 comment 0 reactions 0 assignees View on GitHub
bug
Dominant language
JavaScript
Stars
73
Forks
35
PR merge metrics
No merged PRs in 30d

Description

### Environment

* Elixir version (Elixir 1.17.2 (compiled with Erlang/OTP 27)):
* Phoenix version (1.7.21):
* Phoenix LiveView version (phoenix_live_view 1.0.9):
* Beacon version (beacon 0.5.1):
* Operating system macos
* Browsers on which you attempted to reproduce this bug (the more the merrier):

### Actual behavior

What you did (tried to access /admin//components).
What you expected (to see a list of components).
What actually happened (showed an error - at end).
The exact error message and stack trace (which you already have!).
Mentioning that your beacon_components table doesn't have a path column (as confirmed by pgAdmin).

mix phx.server output:
##################

↳ :erpc.execute_call/3, at: erpc.erl:1269

[debug] QUERY ERROR source="beacon_components" db=0.0ms queue=8.5ms idle=1171.3ms

SELECT b0."id", b0."site", b0."name", b0."description", b0."body", b0."template", b0."example", b0."category", b0."thumbnail", b0."inserted_at", b0."updated_at" FROM "beacon_components" AS b0 WHERE (b0."site" = $1) ORDER BY b0."path" LIMIT $2 OFFSET $3 [:drpbanerji_brochure, 15, 0]

↳ :erpc.execute_call/3, at: erpc.erl:1269

[debug] failed to call Beacon.Content.list_components(:drpbanerji_brochure, [per_page: 15, page: 1, query: nil, sort: :path]) for site :drpbanerji_brochure on node :nonode@nohost

[error] GenServer #PID<0.1443.0> terminating

** (Beacon.LiveAdmin.ClusterError) failed to call Beacon.Content.list_components(:drpbanerji_brochure, [per_page: 15, page: 1, query: nil, sort: :path]) for site :drpbanerji_brochure on node :nonode@nohost

Got:

Erlang error: {:exception, %Postgrex.Error{message: nil, postgres: %{code: :undefined_column, line: "3718", message: "column b0.path does not exist", position: "225", file: "parse_relation.c", unknown: "ERROR", severity: "ERROR", pg_code: "42703", routine: "errorMissingColumn"}, connection_id: 53052, query: "SELECT b0.\"id\", b0.\"site\", b0.\"name\", b0.\"description\", b0.\"body\", b0.\"template\", b0.\"example\", b0.\"category\", b0.\"thumbnail\", b0.\"inserted_at\", b0.\"updated_at\" FROM \"beacon_components\" AS b0 WHERE (b0.\"site\" = $1) ORDER BY b0.\"path\" LIMIT $2 OFFSET $3"}, [{Ecto.Adapters.SQL, :raise_sql_call_error, 1, [file: ~c"lib/ecto/adapters/sql.ex", line: 1096, error_info: %{module: Exception}]}, {Ecto.Adapters.SQL, :execute, 6, [file: ~c"lib/ecto/adapters/sql.ex", line: 994]}, {Ecto.Repo.Queryable, :execute, 4, [file: ~c"lib/ecto/repo/queryable.ex", line: 232]}, {Ecto.Repo.Queryable, :all, 3, [file: ~c"lib/ecto/repo/queryable.ex", line: 19]}, {Beacon.Content, :list_components, 2, []}]}

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by reproducing /admin//components and tracing the Beacon.Content.list_components call with sort: :path. Inspect the component-listing query against the beacon_components schema; done means the page lists components without the undefined-column error.

Written by the indexing model from the issue text.

Assessment

Tech stack
elixir, postgresql
Domain
backend, databases
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.