[bug] Unable to get / post media at 3.12.1 #728

Closed
opened 2024-03-31 15:34:28 +00:00 by harukamy · 2 comments

Your setup

From source

Extra details

Archlinux

Version

v3.12.1 and devel:2d439034

PostgreSQL version

16.2

What were you trying to do?

Media uploaded or attempted to retrieve media (images, icons, emoji).

What did you expect to happen?

Media is uploaded, media is retrieved.

What actually happened?

500 error returned.

This problem occurs in both v3.12.1 and the develop branch, two different instances.

Logs

Uploading

```
Mar 31 22:11:47 stellanaut mix[424]: 22:11:47.831 request_id=F8Hbh1NcgWfRgw4AANHR [error] Internal server error: %FunctionClauseError{module: IO, function: :chardata_to_string, arity: 1, kind: nil, args: nil, clauses: nil}
Mar 31 22:11:47 stellanaut mix[424]: 22:11:47.832 [error] #PID<0.20865.0> running Pleroma.Web.Endpoint (connection #PID<0.20864.0>, stream id 1) terminated
Mar 31 22:11:47 stellanaut mix[424]: Server: uchu-teien.com:80 (http)
Mar 31 22:11:47 stellanaut mix[424]: Request: POST /api/v1/media
Mar 31 22:11:47 stellanaut mix[424]: ** (exit) an exception was raised:
Mar 31 22:11:47 stellanaut mix[424]:     ** (FunctionClauseError) no function clause matching in IO.chardata_to_string/1
Mar 31 22:11:47 stellanaut mix[424]:         (elixir 1.16.2) lib/io.ex:687: IO.chardata_to_string(nil)
Mar 31 22:11:47 stellanaut mix[424]:         (elixir 1.16.2) lib/path.ex:662: Path.join/2
Mar 31 22:11:47 stellanaut mix[424]:         (elixir 1.16.2) lib/path.ex:632: Path.join/1
Mar 31 22:11:47 stellanaut mix[424]:         (pleroma 3.12.0) lib/pleroma/upload.ex:95: Pleroma.Upload.store/2
Mar 31 22:11:47 stellanaut mix[424]:         (pleroma 3.12.0) lib/pleroma/web/activity_pub/activity_pub.ex:1506: Pleroma.Web.ActivityPub.ActivityPub.upload/2
Mar 31 22:11:47 stellanaut mix[424]:         (pleroma 3.12.0) lib/pleroma/web/mastodon_api/controllers/media_controller.ex:25: Pleroma.Web.MastodonAPI.MediaController.create/2
Mar 31 22:11:47 stellanaut mix[424]:         (pleroma 3.12.0) lib/pleroma/web/mastodon_api/controllers/media_controller.ex:5: Pleroma.Web.MastodonAPI.MediaController.action/2
Mar 31 22:11:47 stellanaut mix[424]:         (pleroma 3.12.0) lib/pleroma/web/mastodon_api/controllers/media_controller.ex:5: Pleroma.Web.MastodonAPI.MediaController.phoenix_controller_pipeline/2
```

Get media

```
Mar 31 22:12:06 stellanaut mix[424]: 22:12:06.825 [error] Internal server error: %ArgumentError{message: "construction of binary failed: segment 1 of type 'binary': expected a binary but got: nil"}
Mar 31 22:12:06 stellanaut mix[424]: 22:12:06.825 [error] #PID<0.21092.0> running Pleroma.Web.Endpoint (connection #PID<0.21091.0>, stream id 1) terminated
Mar 31 22:12:06 stellanaut mix[424]: Server: phoenixcg:80 (http)
Mar 31 22:12:06 stellanaut mix[424]: Request: GET /media/4ddc842171ae1053c4660c6c031e68804632628b218ca11a2aa1f6e03402f6ba.png?imageView2/1/w/80/h/80
Mar 31 22:12:06 stellanaut mix[424]: ** (exit) an exception was raised:
Mar 31 22:12:06 stellanaut mix[424]:     ** (ArgumentError) construction of binary failed: segment 1 of type 'binary': expected a binary but got: nil
Mar 31 22:12:06 stellanaut mix[424]:         (pleroma 3.12.0) lib/pleroma/web/plugs/uploaded_media.ex:73: Pleroma.Web.Plugs.UploadedMedia.media_is_banned/2
Mar 31 22:12:06 stellanaut mix[424]:         (pleroma 3.12.0) lib/pleroma/web/plugs/uploaded_media.ex:60: Pleroma.Web.Plugs.UploadedMedia.call/2
Mar 31 22:12:06 stellanaut mix[424]:         (pleroma 3.12.0) lib/pleroma/web/endpoint.ex:5: Pleroma.Web.Endpoint.plug_builder_call/2
Mar 31 22:12:06 stellanaut mix[424]:         (pleroma 3.12.0) lib/pleroma/web/endpoint.ex:5: Pleroma.Web.Endpoint.call/2
Mar 31 22:12:06 stellanaut mix[424]:         (plug_cowboy 2.6.1) lib/plug/cowboy/handler.ex:11: Plug.Cowboy.Handler.init/2
Mar 31 22:12:06 stellanaut mix[424]:         (cowboy 2.10.0) /opt/garden/deps/cowboy/src/cowboy_handler.erl:37: :cowboy_handler.execute/2
Mar 31 22:12:06 stellanaut mix[424]:         (cowboy 2.10.0) /opt/garden/deps/cowboy/src/cowboy_stream_h.erl:306: :cowboy_stream_h.execute/3
Mar 31 22:12:06 stellanaut mix[424]:         (cowboy 2.10.0) /opt/garden/deps/cowboy/src/cowboy_stream_h.erl:295: :cowboy_stream_h.request_process/3
```

Get media (2)

```
Mar 31 22:27:03 stellanaut mix[6557]: Request: GET /media/5c49094f1153a67723dae10c74145385bf67a1818ed3d7cc51dbc913d607517a.png
Mar 31 22:27:03 stellanaut mix[6557]: ** (exit) an exception was raised:
Mar 31 22:27:03 stellanaut mix[6557]:     ** (ArgumentError) construction of binary failed: segment 1 of type 'binary': expected a binary but got: nil
Mar 31 22:27:03 stellanaut mix[6557]:         (pleroma 3.12.0-339-g2d439034-develop) lib/pleroma/web/plugs/uploaded_media.ex:73: Pleroma.Web.Plugs.UploadedMedia.media_is_banned/2
Mar 31 22:27:03 stellanaut mix[6557]:         (pleroma 3.12.0-339-g2d439034-develop) lib/pleroma/web/plugs/uploaded_media.ex:60: Pleroma.Web.Plugs.UploadedMedia.call/2
Mar 31 22:27:03 stellanaut mix[6557]:         (pleroma 3.12.0-339-g2d439034-develop) lib/pleroma/web/endpoint.ex:5: Pleroma.Web.Endpoint.plug_builder_call/2
Mar 31 22:27:03 stellanaut mix[6557]:         (pleroma 3.12.0-339-g2d439034-develop) lib/pleroma/web/endpoint.ex:5: Pleroma.Web.Endpoint.call/2
Mar 31 22:27:03 stellanaut mix[6557]:         (plug_cowboy 2.6.1) lib/plug/cowboy/handler.ex:11: Plug.Cowboy.Handler.init/2
Mar 31 22:27:03 stellanaut mix[6557]:         (cowboy 2.10.0) /opt/garden/deps/cowboy/src/cowboy_handler.erl:37: :cowboy_handler.execute/2
Mar 31 22:27:03 stellanaut mix[6557]:         (cowboy 2.10.0) /opt/garden/deps/cowboy/src/cowboy_stream_h.erl:306: :cowboy_stream_h.execute/3
Mar 31 22:27:03 stellanaut mix[6557]:         (cowboy 2.10.0) /opt/garden/deps/cowboy/src/cowboy_stream_h.erl:295: :cowboy_stream_h.request_process/3
```

Severity

I cannot use the software

Have you searched for this issue?

  • I have double-checked and have not found this issue mentioned anywhere.
### Your setup From source ### Extra details Archlinux ### Version v3.12.1 and devel:2d439034 ### PostgreSQL version 16.2 ### What were you trying to do? Media uploaded or attempted to retrieve media (images, icons, emoji). ### What did you expect to happen? Media is uploaded, media is retrieved. ### What actually happened? 500 error returned. This problem occurs in both v3.12.1 and the develop branch, two different instances. ### Logs ````shell Uploading ``` Mar 31 22:11:47 stellanaut mix[424]: 22:11:47.831 request_id=F8Hbh1NcgWfRgw4AANHR [error] Internal server error: %FunctionClauseError{module: IO, function: :chardata_to_string, arity: 1, kind: nil, args: nil, clauses: nil} Mar 31 22:11:47 stellanaut mix[424]: 22:11:47.832 [error] #PID<0.20865.0> running Pleroma.Web.Endpoint (connection #PID<0.20864.0>, stream id 1) terminated Mar 31 22:11:47 stellanaut mix[424]: Server: uchu-teien.com:80 (http) Mar 31 22:11:47 stellanaut mix[424]: Request: POST /api/v1/media Mar 31 22:11:47 stellanaut mix[424]: ** (exit) an exception was raised: Mar 31 22:11:47 stellanaut mix[424]: ** (FunctionClauseError) no function clause matching in IO.chardata_to_string/1 Mar 31 22:11:47 stellanaut mix[424]: (elixir 1.16.2) lib/io.ex:687: IO.chardata_to_string(nil) Mar 31 22:11:47 stellanaut mix[424]: (elixir 1.16.2) lib/path.ex:662: Path.join/2 Mar 31 22:11:47 stellanaut mix[424]: (elixir 1.16.2) lib/path.ex:632: Path.join/1 Mar 31 22:11:47 stellanaut mix[424]: (pleroma 3.12.0) lib/pleroma/upload.ex:95: Pleroma.Upload.store/2 Mar 31 22:11:47 stellanaut mix[424]: (pleroma 3.12.0) lib/pleroma/web/activity_pub/activity_pub.ex:1506: Pleroma.Web.ActivityPub.ActivityPub.upload/2 Mar 31 22:11:47 stellanaut mix[424]: (pleroma 3.12.0) lib/pleroma/web/mastodon_api/controllers/media_controller.ex:25: Pleroma.Web.MastodonAPI.MediaController.create/2 Mar 31 22:11:47 stellanaut mix[424]: (pleroma 3.12.0) lib/pleroma/web/mastodon_api/controllers/media_controller.ex:5: Pleroma.Web.MastodonAPI.MediaController.action/2 Mar 31 22:11:47 stellanaut mix[424]: (pleroma 3.12.0) lib/pleroma/web/mastodon_api/controllers/media_controller.ex:5: Pleroma.Web.MastodonAPI.MediaController.phoenix_controller_pipeline/2 ``` Get media ``` Mar 31 22:12:06 stellanaut mix[424]: 22:12:06.825 [error] Internal server error: %ArgumentError{message: "construction of binary failed: segment 1 of type 'binary': expected a binary but got: nil"} Mar 31 22:12:06 stellanaut mix[424]: 22:12:06.825 [error] #PID<0.21092.0> running Pleroma.Web.Endpoint (connection #PID<0.21091.0>, stream id 1) terminated Mar 31 22:12:06 stellanaut mix[424]: Server: phoenixcg:80 (http) Mar 31 22:12:06 stellanaut mix[424]: Request: GET /media/4ddc842171ae1053c4660c6c031e68804632628b218ca11a2aa1f6e03402f6ba.png?imageView2/1/w/80/h/80 Mar 31 22:12:06 stellanaut mix[424]: ** (exit) an exception was raised: Mar 31 22:12:06 stellanaut mix[424]: ** (ArgumentError) construction of binary failed: segment 1 of type 'binary': expected a binary but got: nil Mar 31 22:12:06 stellanaut mix[424]: (pleroma 3.12.0) lib/pleroma/web/plugs/uploaded_media.ex:73: Pleroma.Web.Plugs.UploadedMedia.media_is_banned/2 Mar 31 22:12:06 stellanaut mix[424]: (pleroma 3.12.0) lib/pleroma/web/plugs/uploaded_media.ex:60: Pleroma.Web.Plugs.UploadedMedia.call/2 Mar 31 22:12:06 stellanaut mix[424]: (pleroma 3.12.0) lib/pleroma/web/endpoint.ex:5: Pleroma.Web.Endpoint.plug_builder_call/2 Mar 31 22:12:06 stellanaut mix[424]: (pleroma 3.12.0) lib/pleroma/web/endpoint.ex:5: Pleroma.Web.Endpoint.call/2 Mar 31 22:12:06 stellanaut mix[424]: (plug_cowboy 2.6.1) lib/plug/cowboy/handler.ex:11: Plug.Cowboy.Handler.init/2 Mar 31 22:12:06 stellanaut mix[424]: (cowboy 2.10.0) /opt/garden/deps/cowboy/src/cowboy_handler.erl:37: :cowboy_handler.execute/2 Mar 31 22:12:06 stellanaut mix[424]: (cowboy 2.10.0) /opt/garden/deps/cowboy/src/cowboy_stream_h.erl:306: :cowboy_stream_h.execute/3 Mar 31 22:12:06 stellanaut mix[424]: (cowboy 2.10.0) /opt/garden/deps/cowboy/src/cowboy_stream_h.erl:295: :cowboy_stream_h.request_process/3 ``` Get media (2) ``` Mar 31 22:27:03 stellanaut mix[6557]: Request: GET /media/5c49094f1153a67723dae10c74145385bf67a1818ed3d7cc51dbc913d607517a.png Mar 31 22:27:03 stellanaut mix[6557]: ** (exit) an exception was raised: Mar 31 22:27:03 stellanaut mix[6557]: ** (ArgumentError) construction of binary failed: segment 1 of type 'binary': expected a binary but got: nil Mar 31 22:27:03 stellanaut mix[6557]: (pleroma 3.12.0-339-g2d439034-develop) lib/pleroma/web/plugs/uploaded_media.ex:73: Pleroma.Web.Plugs.UploadedMedia.media_is_banned/2 Mar 31 22:27:03 stellanaut mix[6557]: (pleroma 3.12.0-339-g2d439034-develop) lib/pleroma/web/plugs/uploaded_media.ex:60: Pleroma.Web.Plugs.UploadedMedia.call/2 Mar 31 22:27:03 stellanaut mix[6557]: (pleroma 3.12.0-339-g2d439034-develop) lib/pleroma/web/endpoint.ex:5: Pleroma.Web.Endpoint.plug_builder_call/2 Mar 31 22:27:03 stellanaut mix[6557]: (pleroma 3.12.0-339-g2d439034-develop) lib/pleroma/web/endpoint.ex:5: Pleroma.Web.Endpoint.call/2 Mar 31 22:27:03 stellanaut mix[6557]: (plug_cowboy 2.6.1) lib/plug/cowboy/handler.ex:11: Plug.Cowboy.Handler.init/2 Mar 31 22:27:03 stellanaut mix[6557]: (cowboy 2.10.0) /opt/garden/deps/cowboy/src/cowboy_handler.erl:37: :cowboy_handler.execute/2 Mar 31 22:27:03 stellanaut mix[6557]: (cowboy 2.10.0) /opt/garden/deps/cowboy/src/cowboy_stream_h.erl:306: :cowboy_stream_h.execute/3 Mar 31 22:27:03 stellanaut mix[6557]: (cowboy 2.10.0) /opt/garden/deps/cowboy/src/cowboy_stream_h.erl:295: :cowboy_stream_h.request_process/3 ``` ```` ### Severity I cannot use the software ### Have you searched for this issue? - [x] I have double-checked and have not found this issue mentioned anywhere.
harukamy added the
bug
label 2024-03-31 15:34:28 +00:00
harukamy changed title from [bug] to [bug] Unable to get / post media at 3.12.1 2024-03-31 15:37:41 +00:00

not a bug, you did not set your media base URL

please ensure you follow the upgrade steps as outlined in the release post https://meta.akkoma.dev/t/akkoma-stable-2024-03-securer-i-barely-know-her/681

not a bug, you did not set your media base URL please ensure you follow the upgrade steps as outlined in the release post https://meta.akkoma.dev/t/akkoma-stable-2024-03-securer-i-barely-know-her/681
Author

I was not aware of its existence on that forum. Thanks.

I was not aware of its existence on that forum. Thanks.
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#728
No description provided.