[bug] media proxy does not work with incorrect config #441

Closed
opened 2023-01-22 01:32:37 +00:00 by catgirlinspace · 5 comments

Your setup

Docker

Extra details

Using the docker setup included in repo with Traefik on Unraid

Version

3.5.0-14-gd9508474

PostgreSQL version

14

What were you trying to do?

I wanted to use media proxy.

What did you expect to happen?

I expected media proxy to just work without any issues.

What actually happened?

Attempting to use any client-to-server APIs with the media proxy on causes this. Server-to-server interactions seemingly continue to work fine.
image

When this happened initally I had spent over a day debugging the issue and did a full reinstall. I had to connect to the postgres db myself and remove the media proxy settings.

Logs

Server: fediverse.catgirlin.space:80 (http)
Request: GET /api/v1/accounts/catgirl?with_relationships=true
** (exit) an exception was raised: ** (FunctionClauseError) no function clause matching in I0.chardata_to_string/1
(elixir 1.13.4) lib/io.ex:627: I0.chardata_to_string (nil)
(elixir 1.13.4) lib/path.ex:548: Path.do_join/3
(elixir 1.13.4) lib/path.ex:540: Path.join/2
(elixir 1.13.4) lib/path.ex: 509: Path.join/1
(pleroma 3.5.0-14-gd9508474) lib/pleroma/web/media_proxy.ex:80: Pleroma.Web.MediaProxy.whitelisted?/1
(pleroma 3.5.0-14-gd9508474) lib/pleroma/web/media_proxy.ex:55: Pleroma.Web.MediaProxy.url_proxiablе?/1
(pleroma 3.5.0-14-gd9508474) lib/pleroma/web/media_proxy.ex:46: Pleroma.Web.MediaProxy.url/1
(pleroma 3.5.0-14-gd9508474) lib/pleroma/web/mastodon_api/views/account_view.ex:204: Pleroma.Web.MastodonAPI.AccountView.do_render/2

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 Docker ### Extra details Using the docker setup included in repo with Traefik on Unraid ### Version 3.5.0-14-gd9508474 ### PostgreSQL version 14 ### What were you trying to do? I wanted to use media proxy. ### What did you expect to happen? I expected media proxy to just work without any issues. ### What actually happened? Attempting to use any client-to-server APIs with the media proxy on causes this. Server-to-server interactions seemingly continue to work fine. ![image](/attachments/5361b2fd-32e0-4fa6-a5ca-56190e9b8b43) When this happened initally I had spent over a day debugging the issue and did a full reinstall. I had to connect to the postgres db myself and remove the media proxy settings. ### Logs ```shell Server: fediverse.catgirlin.space:80 (http) Request: GET /api/v1/accounts/catgirl?with_relationships=true ** (exit) an exception was raised: ** (FunctionClauseError) no function clause matching in I0.chardata_to_string/1 (elixir 1.13.4) lib/io.ex:627: I0.chardata_to_string (nil) (elixir 1.13.4) lib/path.ex:548: Path.do_join/3 (elixir 1.13.4) lib/path.ex:540: Path.join/2 (elixir 1.13.4) lib/path.ex: 509: Path.join/1 (pleroma 3.5.0-14-gd9508474) lib/pleroma/web/media_proxy.ex:80: Pleroma.Web.MediaProxy.whitelisted?/1 (pleroma 3.5.0-14-gd9508474) lib/pleroma/web/media_proxy.ex:55: Pleroma.Web.MediaProxy.url_proxiablе?/1 (pleroma 3.5.0-14-gd9508474) lib/pleroma/web/media_proxy.ex:46: Pleroma.Web.MediaProxy.url/1 (pleroma 3.5.0-14-gd9508474) lib/pleroma/web/mastodon_api/views/account_view.ex:204: Pleroma.Web.MastodonAPI.AccountView.do_render/2 ``` ### 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.
184 KiB
catgirlinspace added the
bug
label 2023-01-22 01:32:37 +00:00
catgirlinspace changed title from [bug] to [bug] media proxy breaks api 2023-01-22 01:32:49 +00:00
floatingghost added
not a bug
and removed
bug
labels 2023-01-22 01:51:08 +00:00

bad config

check your URLs, this appears to be caused by an incorrectly set upload base URL

bad config check your URLs, this appears to be caused by an incorrectly set upload base URL
floatingghost changed title from [bug] media proxy breaks api to [bug] media proxy does not work with incorrect config 2023-01-22 01:52:51 +00:00
Author

im assuming you're referring to this setting? image
i thought i should leave it blank if i'm not using a cdn.

im assuming you're referring to this setting? ![image](/attachments/4120f909-62a0-470d-aff5-722b5b173563) i thought i should leave it blank if i'm not using a cdn.

Base URL is optional unless you're using a CDN. It doesn't need to be set to enable media proxy.

Base URL is optional unless you're using a CDN. It doesn't need to be set to enable media proxy.

see https://akkoma.dev/AkkomaGang/akkoma/src/branch/develop/lib/pleroma/upload.ex#L233

this function is returning nil

check your uploader config

see https://akkoma.dev/AkkomaGang/akkoma/src/branch/develop/lib/pleroma/upload.ex#L233 this function is returning nil check your uploader config
Author

ah, setting my truncated namespace to be nothing fixed it. i didn't realize that not being saved wasn't the same as empty and i had to first change it to " ", save, change it back to "", and then save again for the db to save it as "". it seems like the issue is fixed now!! thanks!!!!

ah, setting my truncated namespace to be nothing fixed it. i didn't realize that not being saved wasn't the same as empty and i had to first change it to " ", save, change it back to "", and then save again for the db to save it as "". it seems like the issue is fixed now!! thanks!!!!
Sign in to join this conversation.
No Milestone
No project
No Assignees
3 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#441
No description provided.