Phoenix.ActionClauseError at PUT /api/v1/akkoma/preferred_frontend
no function clause matching in Pleroma.Web.AkkomaAPI.FrontendSettingsController.update_preferred_frontend/2

The following arguments were given to Pleroma.Web.AkkomaAPI.FrontendSettingsController.update_preferred_frontend/2:

    # 1
    %Plug.Conn{adapter: {Plug.Cowboy.Conn, :...}, assigns: %{user: nil, token: nil, digest: "SHA-256=aNPM7+NUOq+z1kQ9UB5yJn8Dt4NLk/RCh2VCqaOCbIU=", locale: "en", locales: [], csp_nonce: "O-v1Xs_caEzgICh"}, body_params: %{}, cookies: %{}, halted: false, host: "localhost", method: "PUT", owner: #PID<0.3757.0>, params: %{}, path_info: ["api", "v1", "akkoma", "preferred_frontend"], path_params: %{}, port: 4000, private: %{:phoenix_view => %{_: Pleroma.Web.AkkomaAPI.FrontendSettingsView}, :open_api_spex => %{params: %{}, body_params: %{}, spec_module: Pleroma.Web.ApiSpec, operation_id: "AkkomaAPI.FrontendSettingsController.available_frontends"}, Pleroma.Web.Router => [], :phoenix_action => :update_preferred_frontend, :phoenix_layout => %{_: {Pleroma.Web.LayoutView, "app.html"}}, :phoenix_controller => Pleroma.Web.AkkomaAPI.FrontendSettingsController, :phoenix_endpoint => Pleroma.Web.Endpoint, :phoenix_format => "json", :phoenix_router => Pleroma.Web.Router, :plug_session_fetch => :done, :plug_session => %{}, :before_send => [#Function<0.76384852/1 in Plug.Session.before_send/2>, #Function<1.119864668/1 in Plug.Logger.call/2>], :authentication_ignored => true, :operation_id => "AkkomaAPI.FrontendSettingsController.available_frontends", :called_plugs => [Pleroma.Web.Plugs.ExpectPublicOrAuthenticatedCheckPlug, Pleroma.Web.Plugs.OAuthScopesPlug, Pleroma.Web.Plugs.EnsurePublicOrAuthenticatedPlug]}, query_params: %{}, query_string: "", remote_ip: nil, req_cookies: %{}, req_headers: [{"accept", "*/*"}, {"content-length", "38"}, {"content-type", "application/json"}, {"host", "localhost:4000"}, {"user-agent", "curl/7.88.1"}], request_path: "/api/v1/akkoma/preferred_frontend", resp_body: nil, resp_cookies: %{}, resp_headers: [{"cache-control", "max-age=0, private, must-revalidate"}, {"access-control-allow-credentials", "true"}, {"access-control-allow-origin", "*"}, {"access-control-expose-headers", "Link,X-RateLimit-Reset,X-RateLimit-Limit,X-RateLimit-Remaining,X-Request-Id,Idempotency-Key"}, {"x-xss-protection", "0"}, {"x-permitted-cross-domain-policies", "none"}, {"x-frame-options", "DENY"}, {"x-content-type-options", "nosniff"}, {"referrer-policy", "same-origin"}, {"content-security-policy", "style-src 'self' 'nonce-O-v1Xs_caEzgICh';font-src 'self';script-src 'self' 'unsafe-eval' 'unsafe-inline';connect-src 'self' http://localhost:4000 ws://localhost:4000;media-src 'self' https:;img-src 'self' data: blob: https:;default-src 'none';base-uri 'none';frame-ancestors 'none';manifest-src 'self';"}, {"permissions-policy", "interest-cohort=()"}, {"x-request-id", "F6-OeBC4DtmsYkAAABPC"}], scheme: :http, script_name: [], secret_key_base: :..., state: :unset, status: nil}

    # 2
    %{}
113    conn
114    |> json(available)
115  end
116
117  @doc "PUT /api/v1/akkoma/preferred_frontend"
118  def update_preferred_frontend(
119        %{body_params: %{frontend_name: preferred_frontend}} = conn,
120        _params
121#        conn,
122#        %{frontend_name: preferred_frontend}
123#        conn, params
Pleroma.Web.AkkomaAPI.FrontendSettingsController.update_preferred_frontend/2 Docs pleroma
Called with 2 arguments
  1. %Plug.Conn{adapter: {Plug.Cowboy.Conn, :...}, assigns: %{user: nil, token: nil, digest: "SHA-256=aNPM7+NUOq+z1kQ9UB5yJn8Dt4NLk/RCh2VCqaOCbIU=", locale: "en", locales: [], csp_nonce: "O-v1Xs_caEzgICh"}, body_params: %{}, cookies: %{}, halted: false, host: "localhost", method: "PUT", owner: #PID<0.3757.0>, params: %{}, path_info: ["api", "v1", "akkoma", "preferred_frontend"], path_params: %{}, port: 4000, private: %{:phoenix_view => %{_: Pleroma.Web.AkkomaAPI.FrontendSettingsView}, :open_api_spex => %{params: %{}, body_params: %{}, spec_module: Pleroma.Web.ApiSpec, operation_id: "AkkomaAPI.FrontendSettingsController.available_frontends"}, Pleroma.Web.Router => [], :phoenix_action => :update_preferred_frontend, :phoenix_layout => %{_: {Pleroma.Web.LayoutView, "app.html"}}, :phoenix_controller => Pleroma.Web.AkkomaAPI.FrontendSettingsController, :phoenix_endpoint => Pleroma.Web.Endpoint, :phoenix_format => "json", :phoenix_router => Pleroma.Web.Router, :plug_session_fetch => :done, :plug_session => %{}, :before_send => [#Function<0.76384852/1 in Plug.Session.before_send/2>, #Function<1.119864668/1 in Plug.Logger.call/2>], :authentication_ignored => true, :operation_id => "AkkomaAPI.FrontendSettingsController.available_frontends", :called_plugs => [Pleroma.Web.Plugs.ExpectPublicOrAuthenticatedCheckPlug, Pleroma.Web.Plugs.OAuthScopesPlug, Pleroma.Web.Plugs.EnsurePublicOrAuthenticatedPlug]}, query_params: %{}, query_string: "", remote_ip: nil, req_cookies: %{}, req_headers: [{"accept", "*/*"}, {"content-length", "38"}, {"content-type", "application/json"}, {"host", "localhost:4000"}, {"user-agent", "curl/7.88.1"}], request_path: "/api/v1/akkoma/preferred_frontend", resp_body: nil, resp_cookies: %{}, resp_headers: [{"cache-control", "max-age=0, private, must-revalidate"}, {"access-control-allow-credentials", "true"}, {"access-control-allow-origin", "*"}, {"access-control-expose-headers", "Link,X-RateLimit-Reset,X-RateLimit-Limit,X-RateLimit-Remaining,X-Request-Id,Idempotency-Key"}, {"x-xss-protection", "0"}, {"x-permitted-cross-domain-policies", "none"}, {"x-frame-options", "DENY"}, {"x-content-type-options", "nosniff"}, {"referrer-policy", "same-origin"}, {"content-security-policy", "style-src 'self' 'nonce-O-v1Xs_caEzgICh';font-src 'self';script-src 'self' 'unsafe-eval' 'unsafe-inline';connect-src 'self' http://localhost:4000 ws://localhost:4000;media-src 'self' https:;img-src 'self' data: blob: https:;default-src 'none';base-uri 'none';frame-ancestors 'none';manifest-src 'self';"}, {"permissions-policy", "interest-cohort=()"}, {"x-request-id", "F6-OeBC4DtmsYkAAABPC"}], scheme: :http, script_name: [], secret_key_base: :..., state: :unset, status: nil}
  2. %{}
Attempted function clauses (showing 1 out of 1)
                                
                                    def update_preferred_frontend(%{body_params: %{frontend_name: preferred_frontend}} = conn, _params)
                                
                            
1defmodule Pleroma.Web.AkkomaAPI.FrontendSettingsController do
2  use Pleroma.Web, :controller
3
4  alias Pleroma.Web.Plugs.OAuthScopesPlug
5  alias Pleroma.Akkoma.FrontendSettingsProfile
6
Pleroma.Web.AkkomaAPI.FrontendSettingsController.action/2 pleroma
1defmodule Pleroma.Web.AkkomaAPI.FrontendSettingsController do
2  use Pleroma.Web, :controller
3
4  alias Pleroma.Web.Plugs.OAuthScopesPlug
5  alias Pleroma.Akkoma.FrontendSettingsProfile
6
Pleroma.Web.AkkomaAPI.FrontendSettingsController.phoenix_controller_pipeline/2 pleroma
427        :telemetry.execute([:phoenix, :router_dispatch, :stop], measurements, metadata)
428        halted_conn
429
430      %Plug.Conn{} = piped_conn ->
431        try do
432          plug.call(piped_conn, plug.init(opts))
433        else
434          conn ->
435            measurements = %{duration: System.monotonic_time() - start}
436            metadata = %{metadata | conn: conn}
437            :telemetry.execute([:phoenix, :router_dispatch, :stop], measurements, metadata)
Phoenix.Router.__call__/5 phoenix
1# Pleroma: A lightweight social networking server
2# Copyright © 2017-2021 Pleroma Authors <https://pleroma.social/>
3# SPDX-License-Identifier: AGPL-3.0-only
4
5defmodule Pleroma.Web.Endpoint do
6  use Phoenix.Endpoint, otp_app: :pleroma
7
8  require Pleroma.Constants
9
10  alias Pleroma.Config
Pleroma.Web.Endpoint.plug_builder_call/2 pleroma
131          case conn do
132            %Plug.Conn{path_info: ["__plug__", "debugger", "action"], method: "POST"} ->
133              Plug.Debugger.run_action(conn)
134
135            %Plug.Conn{} ->
136              super(conn, opts)
137          end
138        rescue
139          e in Plug.Conn.WrapperError ->
140            %{conn: conn, kind: kind, reason: reason, stack: stack} = e
141            Plug.Debugger.__catch__(conn, kind, reason, stack, @plug_debugger)
Pleroma.Web.Endpoint."call (overridable 3)"/2 pleroma
1# Pleroma: A lightweight social networking server
2# Copyright © 2017-2021 Pleroma Authors <https://pleroma.social/>
3# SPDX-License-Identifier: AGPL-3.0-only
4
5defmodule Pleroma.Web.Endpoint do
6  use Phoenix.Endpoint, otp_app: :pleroma
7
8  require Pleroma.Constants
9
10  alias Pleroma.Config
Pleroma.Web.Endpoint.call/2 pleroma
6  def init(req, {plug, opts}) do
7    conn = @connection.conn(req)
8
9    try do
10      conn
11      |> plug.call(opts)
12      |> maybe_send(plug)
13      |> case do
14        %Plug.Conn{adapter: {@connection, %{upgrade: {:websocket, websocket_args}} = req}} = conn ->
15          {handler, state, cowboy_opts} = websocket_args
16          {__MODULE__, copy_resp_headers(conn, req), {handler, state}, cowboy_opts}
Plug.Cowboy.Handler.init/2 plug_cowboy
32-optional_callbacks([terminate/3]).
33
34-spec execute(Req, Env) -> {ok, Req, Env}
35	when Req::cowboy_req:req(), Env::cowboy_middleware:env().
36execute(Req, Env=#{handler := Handler, handler_opts := HandlerOpts}) ->
37	try Handler:init(Req, HandlerOpts) of
38		{ok, Req2, State} ->
39			Result = terminate(normal, Req2, State, Handler),
40			{ok, Req2, Env#{result => Result}};
41		{Mod, Req2, State} ->
42			Mod:upgrade(Req2, Env, Handler, State);
:cowboy_handler.execute/2 cowboy
301	end.
302
303execute(_, _, []) ->
304	ok;
305execute(Req, Env, [Middleware|Tail]) ->
306	case Middleware:execute(Req, Env) of
307		{ok, Req2, Env2} ->
308			execute(Req2, Env2, Tail);
309		{suspend, Module, Function, Args} ->
310			proc_lib:hibernate(?MODULE, resume, [Env, Tail, Module, Function, Args]);
311		{stop, _Req2} ->
:cowboy_stream_h.execute/3 cowboy
290%% to simplify the debugging of errors. The proc_lib library
291%% already adds the stacktrace to other types of exceptions.
292-spec request_process(cowboy_req:req(), cowboy_middleware:env(), [module()]) -> ok.
293request_process(Req, Env, Middlewares) ->
294	try
295		execute(Req, Env, Middlewares)
296	catch
297		exit:Reason={shutdown, _}:Stacktrace ->
298			erlang:raise(exit, Reason, Stacktrace);
299		exit:Reason:Stacktrace when Reason =/= normal, Reason =/= shutdown ->
300			erlang:raise(exit, {Reason, Stacktrace}, Stacktrace)
:cowboy_stream_h.request_process/3 cowboy
No code available.
:proc_lib.init_p_do_apply/3 stdlib
Params
frontend_name
"pleroma-fe/stable"
Request info
URI:
http://localhost:4000/api/v1/akkoma/preferred_frontend
Query string:
Headers
accept
*/*
content-length
38
content-type
application/json
host
localhost:4000
user-agent
curl/7.88.1