From 57dfd3d33dc32dc681c71eb8dd3a0bce87de3125 Mon Sep 17 00:00:00 2001 From: Claudio Ortolina Date: Fri, 3 Oct 2025 10:11:56 +0300 Subject: [PATCH] Remove ErrorTracker Doesn't work with recent LiveView releases, and seems to be maintained very slowly despite incoming PRs to fix the issues. --- compose.yaml | 1 - config/config.exs | 9 +-------- config/dev.exs | 6 ------ config/runtime.exs | 14 -------------- config/test.exs | 5 ----- lib/music_library/application.ex | 1 - lib/music_library/error_repo.ex | 5 ----- .../components/layouts/app.html.heex | 9 --------- lib/music_library_web/router.ex | 6 +----- mix.exs | 1 - mix.lock | 1 - .../20250101170610_add_error_tracker.exs | 6 ------ .../20250328084536_upgrade_error_tracker_v5.exs | 7 ------- priv/gettext/default.pot | 5 ----- priv/gettext/en/LC_MESSAGES/default.po | 5 ----- .../20250101170610_add_error_tracker.exs | 11 ----------- .../20250123104921_remove_error_tracker.exs | 9 --------- test/prod.hurl | 4 ++-- 18 files changed, 4 insertions(+), 101 deletions(-) delete mode 100644 lib/music_library/error_repo.ex delete mode 100644 priv/error_repo/migrations/20250101170610_add_error_tracker.exs delete mode 100644 priv/error_repo/migrations/20250328084536_upgrade_error_tracker_v5.exs delete mode 100644 priv/repo/migrations/20250101170610_add_error_tracker.exs delete mode 100644 priv/repo/migrations/20250123104921_remove_error_tracker.exs diff --git a/compose.yaml b/compose.yaml index c92182d2..813beb66 100644 --- a/compose.yaml +++ b/compose.yaml @@ -14,7 +14,6 @@ services: - CLOAK_ENCRIPTION_KEY - DATABASE_PATH - DISCOGS_PERSONAL_ACCESS_TOKEN - - ERROR_DATABASE_PATH - LAST_FM_API_KEY - LAST_FM_SHARED_SECRET - LAST_FM_USER diff --git a/config/config.exs b/config/config.exs index bf3fc738..03e5a13c 100644 --- a/config/config.exs +++ b/config/config.exs @@ -12,7 +12,7 @@ config :elixir, :time_zone_database, TimeZoneInfo.TimeZoneDatabase config :time_zone_info, update: :daily config :music_library, - ecto_repos: [MusicLibrary.BackgroundRepo, MusicLibrary.Repo, MusicLibrary.ErrorRepo], + ecto_repos: [MusicLibrary.BackgroundRepo, MusicLibrary.Repo], generators: [timestamp_type: :utc_datetime, binary_id: true] config :music_library, default_timezone: "Europe/London" @@ -76,11 +76,6 @@ config :logger, :default_formatter, # Use JSON for JSON parsing in Phoenix config :phoenix, :json_library, JSON -config :error_tracker, - repo: MusicLibrary.ErrorRepo, - otp_app: :music_library, - enabled: true - config :music_library, Oban, engine: Oban.Engines.Lite, queues: [default: 10, heavy_writes: 1, music_brainz: 1], @@ -94,8 +89,6 @@ config :music_library, Oban, ]} ] -config :music_library, MusicLibrary.ErrorRepo, priv: "priv/error_repo" - config :music_library, MusicLibrary.BackgroundRepo, priv: "priv/background_repo" config :fluxon, :translate_function, &MusicLibraryWeb.CoreComponents.translate_error/1 diff --git a/config/dev.exs b/config/dev.exs index 017ba61a..f9a4984d 100644 --- a/config/dev.exs +++ b/config/dev.exs @@ -8,12 +8,6 @@ config :music_library, MusicLibrary.Repo, stacktrace: true, show_sensitive_data_on_connection_error: true -config :music_library, MusicLibrary.ErrorRepo, - database: Path.expand("../data/music_library_errors_dev.db", __DIR__), - pool_size: 5, - stacktrace: true, - show_sensitive_data_on_connection_error: true - config :music_library, MusicLibrary.BackgroundRepo, database: Path.expand("../data/music_library_background_dev.db", __DIR__), pool_size: 5, diff --git a/config/runtime.exs b/config/runtime.exs index a5e3cf1a..f28a1f2d 100644 --- a/config/runtime.exs +++ b/config/runtime.exs @@ -84,20 +84,6 @@ if config_env() == :prod do temp_store: :memory, show_sensitive_data_on_connection_error: true - error_database_path = - System.get_env("ERROR_DATABASE_PATH") || - raise """ - environment variable ERROR_DATABASE_PATH is missing. - For example: /etc/music_library/music_library_errors.db - """ - - config :music_library, MusicLibrary.ErrorRepo, - database: error_database_path, - # 16MB * pool_size = base memory usage - cache_size: -8000, - pool_size: String.to_integer(System.get_env("POOL_SIZE") || "5"), - show_sensitive_data_on_connection_error: true - background_database_path = System.get_env("BACKGROUND_DATABASE_PATH") || raise """ diff --git a/config/test.exs b/config/test.exs index b210a2a7..f377cf53 100644 --- a/config/test.exs +++ b/config/test.exs @@ -11,11 +11,6 @@ config :music_library, MusicLibrary.Repo, pool_size: 32, pool: Ecto.Adapters.SQL.Sandbox -config :music_library, MusicLibrary.ErrorRepo, - database: Path.expand("../data/music_library_errors_test.db", __DIR__), - pool_size: 32, - pool: Ecto.Adapters.SQL.Sandbox - config :music_library, MusicLibrary.BackgroundRepo, database: Path.expand("../data/music_library_background_test.db", __DIR__), pool_size: 32, diff --git a/lib/music_library/application.ex b/lib/music_library/application.ex index eff5ca89..dabb4c8c 100644 --- a/lib/music_library/application.ex +++ b/lib/music_library/application.ex @@ -18,7 +18,6 @@ defmodule MusicLibrary.Application do children = [ MusicLibrary.Vault, MusicLibrary.Repo, - MusicLibrary.ErrorRepo, MusicLibrary.BackgroundRepo, MusicLibraryWeb.Telemetry, {Oban, Application.fetch_env!(:music_library, Oban)}, diff --git a/lib/music_library/error_repo.ex b/lib/music_library/error_repo.ex deleted file mode 100644 index a950af95..00000000 --- a/lib/music_library/error_repo.ex +++ /dev/null @@ -1,5 +0,0 @@ -defmodule MusicLibrary.ErrorRepo do - use Ecto.Repo, - otp_app: :music_library, - adapter: Ecto.Adapters.SQLite3 -end diff --git a/lib/music_library_web/components/layouts/app.html.heex b/lib/music_library_web/components/layouts/app.html.heex index 03ccab66..22307a78 100644 --- a/lib/music_library_web/components/layouts/app.html.heex +++ b/lib/music_library_web/components/layouts/app.html.heex @@ -98,15 +98,6 @@ <.icon name="hero-chart-bar" class="h-4 w-4 mr-2" aria-hidden="true" data-slot="icon" /> {gettext("Live Dashboard")} - <.dropdown_link href={~p"/dev/errors"}> - <.icon - name="hero-exclamation-circle" - class="h-4 w-4 mr-2" - aria-hidden="true" - data-slot="icon" - /> - {gettext("Errors")} - <.dropdown_link href={~p"/dev/oban"}> <.icon name="hero-cog" class="h-4 w-4 mr-2" aria-hidden="true" data-slot="icon" /> {gettext("Oban")} diff --git a/lib/music_library_web/router.ex b/lib/music_library_web/router.ex index 3e341743..6d7d86d3 100644 --- a/lib/music_library_web/router.ex +++ b/lib/music_library_web/router.ex @@ -89,19 +89,15 @@ defmodule MusicLibraryWeb.Router do end if Application.compile_env(:music_library, :monitoring_routes) do - use ErrorTracker.Web, :router - import Phoenix.LiveDashboard.Router scope "/dev" do pipe_through [:browser, :logged_in] - error_tracker_dashboard("/errors") - live_dashboard "/dashboard", metrics: MusicLibraryWeb.Telemetry, metrics_history: {MusicLibraryWeb.Telemetry.Storage, :metrics_history, []}, - ecto_repos: [MusicLibrary.Repo, MusicLibrary.BackgroundRepo, MusicLibrary.ErrorRepo] + ecto_repos: [MusicLibrary.Repo, MusicLibrary.BackgroundRepo] oban_dashboard "/oban" end diff --git a/mix.exs b/mix.exs index 57f3bf66..4f9ecf27 100644 --- a/mix.exs +++ b/mix.exs @@ -111,7 +111,6 @@ defmodule MusicLibrary.MixProject do # Prod error/perf tooling {:sentry, "~> 11.0"}, {:phoenix_live_dashboard, "~> 0.8.3"}, - {:error_tracker, "~> 0.6.0"}, {:recon, "~> 2.5"}, {:telemetry_metrics, "~> 1.0"}, {:telemetry_poller, "~> 1.0"} diff --git a/mix.lock b/mix.lock index 175dccba..6967378b 100644 --- a/mix.lock +++ b/mix.lock @@ -14,7 +14,6 @@ "ecto_sqlite3": {:hex, :ecto_sqlite3, "0.22.0", "edab2d0f701b7dd05dcf7e2d97769c106aff62b5cfddc000d1dd6f46b9cbd8c3", [:mix], [{:decimal, "~> 1.6 or ~> 2.0", [hex: :decimal, repo: "hexpm", optional: false]}, {:ecto, "~> 3.13.0", [hex: :ecto, repo: "hexpm", optional: false]}, {:ecto_sql, "~> 3.13.0", [hex: :ecto_sql, repo: "hexpm", optional: false]}, {:exqlite, "~> 0.22", [hex: :exqlite, repo: "hexpm", optional: false]}], "hexpm", "5af9e031bffcc5da0b7bca90c271a7b1e7c04a93fecf7f6cd35bc1b1921a64bd"}, "ecto_sqlite3_extras": {:hex, :ecto_sqlite3_extras, "1.2.2", "36e60b561a11441d15f26c791817999269fb578b985162207ebb08b04ca71e40", [:mix], [{:exqlite, ">= 0.13.2", [hex: :exqlite, repo: "hexpm", optional: false]}, {:table_rex, "~> 4.0", [hex: :table_rex, repo: "hexpm", optional: false]}], "hexpm", "2b66ba7246bb4f7e39e2578acd4a0e4e4be54f60ff52d450a01be95eeb78ff1e"}, "elixir_make": {:hex, :elixir_make, "0.9.0", "6484b3cd8c0cee58f09f05ecaf1a140a8c97670671a6a0e7ab4dc326c3109726", [:mix], [], "hexpm", "db23d4fd8b757462ad02f8aa73431a426fe6671c80b200d9710caf3d1dd0ffdb"}, - "error_tracker": {:hex, :error_tracker, "0.6.0", "ac37d943b0720faccc26bc3adf39b2b74968b1ee0ae681c2fb57c98c5a10178d", [:mix], [{:ecto, "~> 3.11", [hex: :ecto, repo: "hexpm", optional: false]}, {:ecto_sql, "~> 3.0", [hex: :ecto_sql, repo: "hexpm", optional: false]}, {:ecto_sqlite3, ">= 0.0.0", [hex: :ecto_sqlite3, repo: "hexpm", optional: true]}, {:jason, "~> 1.1", [hex: :jason, repo: "hexpm", optional: false]}, {:myxql, ">= 0.0.0", [hex: :myxql, repo: "hexpm", optional: true]}, {:phoenix_ecto, "~> 4.6", [hex: :phoenix_ecto, repo: "hexpm", optional: false]}, {:phoenix_live_view, "~> 0.19 or ~> 1.0", [hex: :phoenix_live_view, repo: "hexpm", optional: false]}, {:plug, "~> 1.10", [hex: :plug, repo: "hexpm", optional: false]}, {:postgrex, ">= 0.0.0", [hex: :postgrex, repo: "hexpm", optional: true]}], "hexpm", "8b99db5abeb883e7d622daf850c4dda38ce3bfabc4455431212d698df3156c63"}, "esbuild": {:hex, :esbuild, "0.10.0", "b0aa3388a1c23e727c5a3e7427c932d89ee791746b0081bbe56103e9ef3d291f", [:mix], [{:jason, "~> 1.4", [hex: :jason, repo: "hexpm", optional: false]}], "hexpm", "468489cda427b974a7cc9f03ace55368a83e1a7be12fba7e30969af78e5f8c70"}, "expo": {:hex, :expo, "1.1.0", "f7b9ed7fb5745ebe1eeedf3d6f29226c5dd52897ac67c0f8af62a07e661e5c75", [:mix], [], "hexpm", "fbadf93f4700fb44c331362177bdca9eeb8097e8b0ef525c9cc501cb9917c960"}, "exqlite": {:hex, :exqlite, "0.33.1", "0465fdb997be174edeba6a27496fa27dfe8bc79ef1324a723daa8f0e8579da24", [:make, :mix], [{:cc_precompiler, "~> 0.1", [hex: :cc_precompiler, repo: "hexpm", optional: false]}, {:db_connection, "~> 2.1", [hex: :db_connection, repo: "hexpm", optional: false]}, {:elixir_make, "~> 0.8", [hex: :elixir_make, repo: "hexpm", optional: false]}, {:table, "~> 0.1.0", [hex: :table, repo: "hexpm", optional: true]}], "hexpm", "b3db0c9ae6e5ee7cf84dd0a1b6dc7566b80912eb7746d45370f5666ed66700f9"}, diff --git a/priv/error_repo/migrations/20250101170610_add_error_tracker.exs b/priv/error_repo/migrations/20250101170610_add_error_tracker.exs deleted file mode 100644 index fae8d2ed..00000000 --- a/priv/error_repo/migrations/20250101170610_add_error_tracker.exs +++ /dev/null @@ -1,6 +0,0 @@ -defmodule MusicLibrary.ErrorRepo.Migrations.AddErrorTracker do - use Ecto.Migration - def up, do: ErrorTracker.Migration.up(version: 4) - - def down, do: ErrorTracker.Migration.down(version: 2) -end diff --git a/priv/error_repo/migrations/20250328084536_upgrade_error_tracker_v5.exs b/priv/error_repo/migrations/20250328084536_upgrade_error_tracker_v5.exs deleted file mode 100644 index 60d06596..00000000 --- a/priv/error_repo/migrations/20250328084536_upgrade_error_tracker_v5.exs +++ /dev/null @@ -1,7 +0,0 @@ -defmodule MusicLibrary.ErrorRepo.Migrations.UpgradeErrorTrackerV5 do - use Ecto.Migration - - def up, do: ErrorTracker.Migration.up(version: 5) - - def down, do: ErrorTracker.Migration.down(version: 4) -end diff --git a/priv/gettext/default.pot b/priv/gettext/default.pot index 897373eb..8a8b45a3 100644 --- a/priv/gettext/default.pot +++ b/priv/gettext/default.pot @@ -389,11 +389,6 @@ msgstr "" msgid "A->Z" msgstr "" -#: lib/music_library_web/components/layouts/app.html.heex -#, elixir-autogen, elixir-format -msgid "Errors" -msgstr "" - #: lib/music_library_web/live/artist_live/show.ex #, elixir-autogen, elixir-format msgid "On Tour" diff --git a/priv/gettext/en/LC_MESSAGES/default.po b/priv/gettext/en/LC_MESSAGES/default.po index 03abcecb..d44a60a4 100644 --- a/priv/gettext/en/LC_MESSAGES/default.po +++ b/priv/gettext/en/LC_MESSAGES/default.po @@ -389,11 +389,6 @@ msgstr "" msgid "A->Z" msgstr "" -#: lib/music_library_web/components/layouts/app.html.heex -#, elixir-autogen, elixir-format -msgid "Errors" -msgstr "" - #: lib/music_library_web/live/artist_live/show.ex #, elixir-autogen, elixir-format msgid "On Tour" diff --git a/priv/repo/migrations/20250101170610_add_error_tracker.exs b/priv/repo/migrations/20250101170610_add_error_tracker.exs deleted file mode 100644 index 24500701..00000000 --- a/priv/repo/migrations/20250101170610_add_error_tracker.exs +++ /dev/null @@ -1,11 +0,0 @@ -defmodule MusicLibrary.Repo.Migrations.AddErrorTracker do - use Ecto.Migration - def up, do: ErrorTracker.Migration.up(version: 4) - - def down do - # Not sure why, but the built-in migration fails, so we're removing things manually - drop table(:error_tracker_meta) - drop table(:error_tracker_errors) - drop table(:error_tracker_occurrences) - end -end diff --git a/priv/repo/migrations/20250123104921_remove_error_tracker.exs b/priv/repo/migrations/20250123104921_remove_error_tracker.exs deleted file mode 100644 index aa3f5fe6..00000000 --- a/priv/repo/migrations/20250123104921_remove_error_tracker.exs +++ /dev/null @@ -1,9 +0,0 @@ -defmodule MusicLibrary.Repo.Migrations.RemoveErrorTracker do - use Ecto.Migration - - def change do - drop table(:error_tracker_meta) - drop table(:error_tracker_errors) - drop table(:error_tracker_occurrences) - end -end diff --git a/test/prod.hurl b/test/prod.hurl index 4f920aea..c11be3f6 100644 --- a/test/prod.hurl +++ b/test/prod.hurl @@ -38,7 +38,7 @@ GET https://music-library.claudio-ortolina.org/dev/dashboard HTTP 302 Location: /login -# Error Tracker -GET https://music-library.claudio-ortolina.org/dev/errors +# Oban +GET https://music-library.claudio-ortolina.org/dev/oban HTTP 302 Location: /login