[solved] Mastodon frontends do not seem to work after migrating my instance

Hello,

First of all, thank you very much for your Akkoma fork, it’s fantastic!

After migrating my Pleroma instance, my newly installed Mastodon frontends do not seem to work.

I’m running Akkoma stable from source on a Raspberry Pi 4, Arch Linux, Elixir 1.14.0 (compiled with Erlang/OTP 25).

Installing either Mastodon-fe, or Fedibird-fe via the admin CLI task, I do not see HTML files (particularly an index.html) in the appropriate directories, is this normal?

After setting the Mastodon config in the database via /pleroma/admin, I try opening /web, and the following gets logged:

Jan 01 16:24:57 ashildr mix[723795]: Request: GET /web/
Jan 01 16:24:57 ashildr mix[723795]: ** (exit) an exception was raised:
Jan 01 16:24:57 ashildr mix[723795]:     ** (Protocol.UndefinedError) protocol Phoenix.HTML.Safe not implemented for %{errors: %{detail: "Internal server error"}} of type Map. This protocol is implemented for the following type(s): Atom, BitString, Date, DateTime, Decimal, Float, Integer, List, NaiveDateTime, Phoenix.HTML.Form, Phoenix.LiveComponent.CID, Phoenix.LiveView.Component, Phoenix.LiveView.Comprehension, Phoenix.LiveView.JS, Phoenix.LiveView.Rendered, Time, Tuple
Jan 01 16:24:57 ashildr mix[723795]:         (phoenix_html 3.2.0) lib/phoenix_html/safe.ex:1: Phoenix.HTML.Safe.impl_for!/1
Jan 01 16:24:57 ashildr mix[723795]:         (phoenix_html 3.2.0) lib/phoenix_html/safe.ex:15: Phoenix.HTML.Safe.to_iodata/1
Jan 01 16:24:57 ashildr mix[723795]:         (phoenix 1.6.15) lib/phoenix/controller.ex:772: Phoenix.Controller.render_and_send/4
Jan 01 16:24:57 ashildr mix[723795]:         (phoenix 1.6.15) lib/phoenix/endpoint/render_errors.ex:78: Phoenix.Endpoint.RenderErrors.instrument_render_and_send/5
Jan 01 16:24:57 ashildr mix[723795]:         (phoenix 1.6.15) lib/phoenix/endpoint/render_errors.ex:64: Phoenix.Endpoint.RenderErrors.__catch__/5
Jan 01 16:24:57 ashildr mix[723795]:         (phoenix 1.6.15) lib/phoenix/endpoint/cowboy2_handler.ex:54: Phoenix.Endpoint.Cowboy2Handler.init/4
Jan 01 16:24:57 ashildr mix[723795]:         (cowboy 2.9.0) /mnt/hd/pleroma/deps/cowboy/src/cowboy_handler.erl:37: :cowboy_handler.execute/2
Jan 01 16:24:57 ashildr mix[723795]:         (cowboy 2.9.0) /mnt/hd/pleroma/deps/cowboy/src/cowboy_handler.erl:37: :cowboy_handler.execute/2
Jan 01 16:24:57 ashildr mix[723795]:         (cowboy 2.9.0) /mnt/hd/pleroma/deps/cowboy/src/cowboy_stream_h.erl:306: :cowboy_stream_h.execute/3
Jan 01 16:24:57 ashildr mix[723795]: 16:24:57.835 request_id=FzY4vV3RitfIHb4AAAnE [error] Internal server error: %Ecto.MultipleResultsError{message: "expected at most one result but got 2 in query:\n\nfrom a0 in Pleroma.Web.OAuth.App,\n  where: a0.client_name == ^\"Mastodon-Local\" and a0.redirect_uris == ^\".\"\n"}
Jan 01 16:24:57 ashildr mix[723795]: 16:24:57.838 [error] #PID<0.2508.0> running
 Pleroma.Web.Endpoint (connection #PID<0.2484.0>, stream id 6) terminated

The browser returns an internal server error, after redirecting from /web to /web/login.

Any help is greatly appreciated, and of course please let me know if there’s anything else I could provide.

Erion

you’ve somehow managed to get 2 mastodon api oauth apps in your DB, that should… not happen

might be a relic of pleroma

gonna need some manual intervention

run this SQL:

SELECT id FROM apps WHERE client_name = 'Mastodon-Local'
ORDER BY inserted_at ASC
LIMIT 1;

note down the ID

then run

DELETE FROM oauth_authorizations WHERE app_id = <the ID you just got>;
DELETE FROM oauth_tokens WHERE app_id  = <the ID you just got>;
DELETE FROM apps CASCADE WHERE id = <the ID you just got>;

then try again

Huge thanks for the quick reply and your instructions, this appears to have fixed things. There was one row in the ‘apps’ table with ID 1, no authorizations or tokens.

I’d love to know how it got created, but I guess this is something I may never know :relaxed:

Thanks again.