[bug] Built-in captcha throws error 500 #652

Closed
opened 2023-10-20 11:56:51 +00:00 by chayleaf · 8 comments

Your setup

From source

Extra details

NixOS @ 81e8f48ebdecf07aab321182011b067aafc78896

This is probably NixOS-specific, but I know too little of the codebase (and Erlang) to figure out the reason for this error, and it might have to be fixed on Akkoma side anyway.

Version

3.10.4

PostgreSQL version

13

What were you trying to do?

Register a user from the register page

What did you expect to happen?

I expected captcha to show up and work

What actually happened?

Captcha doesn't show up because of error 500, registering is impossible

Logs

request_id=F4_OqkCQ4z3xyH4AADyj [error] Internal server error: %ErlangError{original: :enoent, reason: ":\n\n  * 1st argument: invalid port name\n"}
[error] #PID<0.19956.0> running Pleroma.Web.Endpoint (connection #PID<0.19955.0>, stream id 1) terminated
Server: fedi.pavluk.org:80 (http)
Request: GET /api/v1/pleroma/captcha
** (exit) an exception was raised:
    ** (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, Atom, BitString, BitString, Date, Date, DateTime, DateTime, Decimal, Decimal, Float, Float, Integer, Integer, List, List, NaiveDateTime, NaiveDateTime, Phoenix.HTML.Form, Phoenix.HTML.Form, Phoenix.LiveComponent.CID, Phoenix.LiveComponent.CID, Phoenix.LiveView.Component, Phoenix.LiveView.Component, Phoenix.LiveView.Comprehension, Phoenix.LiveView.Comprehension, Phoenix.LiveView.JS, Phoenix.LiveView.JS, Phoenix.LiveView.Rendered, Phoenix.LiveView.Rendered, Time, Time, Tuple, Tuple, URI, URI
	(phoenix_html 3.3.1) lib/phoenix_html/safe.ex:1: Phoenix.HTML.Safe.impl_for!/1
	(phoenix_html 3.3.1) lib/phoenix_html/safe.ex:15: Phoenix.HTML.Safe.to_iodata/1
	(phoenix 1.6.16) lib/phoenix/controller.ex:772: Phoenix.Controller.render_and_send/4
	(phoenix 1.6.16) lib/phoenix/endpoint/render_errors.ex:78: Phoenix.Endpoint.RenderErrors.instrument_render_and_send/5
	(phoenix 1.6.16) lib/phoenix/endpoint/render_errors.ex:64: Phoenix.Endpoint.RenderErrors.__catch__/5
	(phoenix 1.6.16) lib/phoenix/endpoint/cowboy2_handler.ex:54: Phoenix.Endpoint.Cowboy2Handler.init/4
	(cowboy 2.10.0) src/cowboy_handler.erl:37: :cowboy_handler.execute/2

Severity

I can manage

Have you searched for this issue?

  • I have double-checked and have not found this issue mentioned anywhere.
### Your setup From source ### Extra details NixOS @ 81e8f48ebdecf07aab321182011b067aafc78896 This is probably NixOS-specific, but I know too little of the codebase (and Erlang) to figure out the reason for this error, and it might have to be fixed on Akkoma side anyway. ### Version 3.10.4 ### PostgreSQL version 13 ### What were you trying to do? Register a user from the register page ### What did you expect to happen? I expected captcha to show up and work ### What actually happened? Captcha doesn't show up because of error 500, registering is impossible ### Logs ````shell request_id=F4_OqkCQ4z3xyH4AADyj [error] Internal server error: %ErlangError{original: :enoent, reason: ":\n\n * 1st argument: invalid port name\n"} [error] #PID<0.19956.0> running Pleroma.Web.Endpoint (connection #PID<0.19955.0>, stream id 1) terminated Server: fedi.pavluk.org:80 (http) Request: GET /api/v1/pleroma/captcha ** (exit) an exception was raised: ** (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, Atom, BitString, BitString, Date, Date, DateTime, DateTime, Decimal, Decimal, Float, Float, Integer, Integer, List, List, NaiveDateTime, NaiveDateTime, Phoenix.HTML.Form, Phoenix.HTML.Form, Phoenix.LiveComponent.CID, Phoenix.LiveComponent.CID, Phoenix.LiveView.Component, Phoenix.LiveView.Component, Phoenix.LiveView.Comprehension, Phoenix.LiveView.Comprehension, Phoenix.LiveView.JS, Phoenix.LiveView.JS, Phoenix.LiveView.Rendered, Phoenix.LiveView.Rendered, Time, Time, Tuple, Tuple, URI, URI (phoenix_html 3.3.1) lib/phoenix_html/safe.ex:1: Phoenix.HTML.Safe.impl_for!/1 (phoenix_html 3.3.1) lib/phoenix_html/safe.ex:15: Phoenix.HTML.Safe.to_iodata/1 (phoenix 1.6.16) lib/phoenix/controller.ex:772: Phoenix.Controller.render_and_send/4 (phoenix 1.6.16) lib/phoenix/endpoint/render_errors.ex:78: Phoenix.Endpoint.RenderErrors.instrument_render_and_send/5 (phoenix 1.6.16) lib/phoenix/endpoint/render_errors.ex:64: Phoenix.Endpoint.RenderErrors.__catch__/5 (phoenix 1.6.16) lib/phoenix/endpoint/cowboy2_handler.ex:54: Phoenix.Endpoint.Cowboy2Handler.init/4 (cowboy 2.10.0) src/cowboy_handler.erl:37: :cowboy_handler.execute/2 ```` ### Severity I can manage ### Have you searched for this issue? - [x] I have double-checked and have not found this issue mentioned anywhere.
chayleaf added the
bug
label 2023-10-20 11:56:51 +00:00

enoent sounds like you are missing a dependency or bad compile

you haven't specified if you're from source or OTP, i'm assuming from source

there should be a binary at deps/captcha/priv/captcha if compilation has succeeded

enoent sounds like you are missing a dependency or bad compile you haven't specified if you're from source or OTP, i'm assuming from source there should be a binary at `deps/captcha/priv/captcha` if compilation has succeeded
Author
# find /nix/store/1w3nx329ixq6a3lz1h8isph64fxlwxm0-pleroma-3.10.4/lib/captcha-0.1.0/
/nix/store/1w3nx329ixq6a3lz1h8isph64fxlwxm0-pleroma-3.10.4/lib/captcha-0.1.0/
/nix/store/1w3nx329ixq6a3lz1h8isph64fxlwxm0-pleroma-3.10.4/lib/captcha-0.1.0/ebin
/nix/store/1w3nx329ixq6a3lz1h8isph64fxlwxm0-pleroma-3.10.4/lib/captcha-0.1.0/ebin/Elixir.Captcha.beam
/nix/store/1w3nx329ixq6a3lz1h8isph64fxlwxm0-pleroma-3.10.4/lib/captcha-0.1.0/ebin/captcha.app
/nix/store/1w3nx329ixq6a3lz1h8isph64fxlwxm0-pleroma-3.10.4/lib/captcha-0.1.0/priv
/nix/store/1w3nx329ixq6a3lz1h8isph64fxlwxm0-pleroma-3.10.4/lib/captcha-0.1.0/priv/.gitkeep

I guess the Nix package needs to be updated then

```shell # find /nix/store/1w3nx329ixq6a3lz1h8isph64fxlwxm0-pleroma-3.10.4/lib/captcha-0.1.0/ /nix/store/1w3nx329ixq6a3lz1h8isph64fxlwxm0-pleroma-3.10.4/lib/captcha-0.1.0/ /nix/store/1w3nx329ixq6a3lz1h8isph64fxlwxm0-pleroma-3.10.4/lib/captcha-0.1.0/ebin /nix/store/1w3nx329ixq6a3lz1h8isph64fxlwxm0-pleroma-3.10.4/lib/captcha-0.1.0/ebin/Elixir.Captcha.beam /nix/store/1w3nx329ixq6a3lz1h8isph64fxlwxm0-pleroma-3.10.4/lib/captcha-0.1.0/ebin/captcha.app /nix/store/1w3nx329ixq6a3lz1h8isph64fxlwxm0-pleroma-3.10.4/lib/captcha-0.1.0/priv /nix/store/1w3nx329ixq6a3lz1h8isph64fxlwxm0-pleroma-3.10.4/lib/captcha-0.1.0/priv/.gitkeep ``` I guess the Nix package needs to be updated then

yeah sounds like whoever compiled it for nix ignored an error, no idea whomst they are though

yeah sounds like whoever compiled it for nix ignored an error, no idea whomst they are though
Author

No, there's no error at all, it just silently doesn't compile the captcha module. I don't think its compile task even runs.

No, there's no error at all, it just silently doesn't compile the captcha module. I don't think its compile task even runs.
14 KiB
Author

either way, this is a nixpkgs issue so I'll close this, thanks for the pointers

either way, this is a nixpkgs issue so I'll close this, thanks for the pointers

for assistance, i have bumped captcha's version in 033b7b04e0 which should help if nix passes weird cflags or anything like that

for assistance, i have bumped captcha's version in 033b7b04e081d4db5ff150a6b5fef03ead205e19 which should help if nix passes weird cflags or anything like that
Author

I've opened a PR that fixes it in nixpkgs https://github.com/NixOS/nixpkgs/pull/262291

I've opened a PR that fixes it in nixpkgs https://github.com/NixOS/nixpkgs/pull/262291

ah wonderful, thanks a lot~

ah wonderful, thanks a lot~
Sign in to join this conversation.
No Milestone
No project
No Assignees
2 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: AkkomaGang/akkoma#652
No description provided.