Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: Lemmy is asking for a application/ld+json webfinger where it should be jrd+json or xrd+xml #3222

Closed
3 of 4 tasks
Cl0v1s opened this issue Jun 20, 2023 · 6 comments
Closed
3 of 4 tasks
Labels
bug Something isn't working

Comments

@Cl0v1s
Copy link

Cl0v1s commented Jun 20, 2023

Requirements

  • Is this a bug report? For questions or discussions use https://lemmy.ml/c/lemmy_support
  • Did you check to see if this issue already exists?
  • Is this only a single bug? Do not put multiple bugs in one issue.
  • Is this a UI / front end issue? Use the lemmy-ui repo.

Summary

When trying to follow a Lemmy instance from external softwares (such as Akkoma), Lemmy starts webfinger queries accepting only a application/ld+json MIME type where it should be jrd+json or xrd+xml
https://datatracker.ietf.org/doc/html/rfc7033#page-11

This leads to fails on the foreign server.

Steps to Reproduce

  1. From a foreign instance follow a lemmy account or community
  2. Wait for the Lemmy server to ask for webfinger
  3. Foreign instance fails to answer because of the wrong MIME type

(With foreign instance being pleroma / akkoma)

Technical Details

Crash on Akkoma side, after the Lemmy request:

[error] Internal server error: %Phoenix.NotAcceptableError{message: "no supported media type in accept header.\n\nExpected one of [\"json\", \"jrd+json\", \"xml\", \"xrd+xml\"] but got the following formats:\n\n  * \" application/ld+json\" with extensions: [\"activity+json\", \"application/ld+json\"]\n  \"application/activity+json\" with extensions: [\"activity+json\", \"\"]\n\nTo accept custom formats, register them under the :mime library\nin your config/config.exs file:\n\n    config :mime, :types, %{\n      \"application/xml\" => [\"xml\"]\n    }\n\nAnd then run `mix deps.clean --build mim 
` to force it to be recompiled.\n", accepts: ["json", "jrd+json", "xml", "xrd+xml"], plug_status: 406}

Version

BE: 0.17.4

Lemmy Instance URL

lemmy.world

@Cl0v1s Cl0v1s added the bug Something isn't working label Jun 20, 2023
@wakest
Copy link

wakest commented Jun 23, 2023

I posted about an issue about webfinger searching of lemmy posts in mastodon now not working here and someone mentioned I should mention it in this issue as well in case its related

@Cl0v1s Cl0v1s changed the title [Bug]: Lemmy is aking for a application/ld+json webfinger where it should be jrd+json or xrd+xml [Bug]: Lemmy is asking for a application/ld+json webfinger where it should be jrd+json or xrd+xml Jun 23, 2023
@pimeys
Copy link

pimeys commented Jun 23, 2023

Haven't been able to follow almost any Lemmy groups from Akkoma due to this error, except one for some reason: !196@lemmy.blahaj.zone, which works just fine.

Maybe they answer differently to the webfinger request?

And maybe that community is all I need... rule

@Houkime
Copy link

Houkime commented Jul 12, 2023

The root of this issue is in activitypub_federation crate.
Webfinger is resolved using generic object fetching here:
https://github.com/LemmyNet/activitypub-federation-rust/blob/af92e0d53204a2ccd13bc0db3c58de24bff646bf/src/fetch/webfinger.rs#L39C26-L39C43

And the function for fetching, which due to it being generic has nothing to do with webfinger, accepts only one MIME type and it is activity+json
https://github.com/LemmyNet/activitypub-federation-rust/blob/af92e0d53204a2ccd13bc0db3c58de24bff646bf/src/fetch/mod.rs#L54

@lionirdeadman
Copy link

Does this need work for the other way around? I notice we don't have handling of this mimetype in our default nginx config

@Nutomic
Copy link
Member

Nutomic commented Jul 21, 2023

We route all requests to .well-known path to backend:

https://github.com/LemmyNet/lemmy-ansible/blob/main/templates/nginx_internal.conf#L86

@Cl0v1s
Copy link
Author

Cl0v1s commented Jul 26, 2023

Thanks for your work !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

6 participants