superseriousbusiness / gotosocial

Fast, fun, small ActivityPub server.
https://docs.gotosocial.org
GNU Affero General Public License v3.0
3.66k stars 310 forks source link

[bug] Can't search for user on Akkoma instance via profile URL #1882

Closed Sentynel closed 1 year ago

Sentynel commented 1 year ago

Describe the bug with a clear and concise description of what the bug is.

tl;dr: Searching for @torvalds@social.kernel.org behaves fine. Searching for https://social.kernel.org/torvalds returns an error, but URL lookups work fine for other servers.

Here's the error:

timestamp="10/06/2023 20:57:50.235" func=middleware.Logger.func1.1 level=ERROR latency=183.788057ms userAgent="Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:109.0) Gecko/20100101 Firefox/114.0" method=GET statusCode=500 path=/api/v2/search clientIP=xx.xx.xx.xx error="Error #01: error looking up status: enrichStatus: error resolving statusable from data for account https://social.kernel.org/torvalds: ResolveStatusable: error unmarshalling bytes into json: invalid character '<' looking for beginning of value\n" requestID=wfe1k9w8040005newq6g msg="Internal Server Error: wrote 54B"

To me, this looks like it's returned an HTML response to something we expected to return JSON. This happens on other Akkoma servers as well. @mal0ki reports that this happens when you query from Mastodon as well, so this seems likely to be an issue with Akkoma doing something non-compliantly, but we might be able to handle it better. If we can work out what specific request flow triggers this and what should have happened, I'll report to them as well.

What's your GoToSocial Version?

v0.9.0

GoToSocial Arch

No response

What happened?

No response

What you expected to happen?

No response

How to reproduce it?

No response

Anything else we need to know?

No response

tsmethurst commented 1 year ago

Some context on this:

If you do curl -H 'accept: application/activity+json' https://social.kernel.org/torvalds it ignores the Accept header and just returns text/html.

Same deal for application/ld+json; profile="https://www.w3.org/ns/activitystreams". So it looks to me like they just don't support also using the URL of the Actor to dereference

tsmethurst commented 1 year ago

@Sentynel is it OK with you if I close this, since this seems to be a bug on their side and not ours?

Sentynel commented 1 year ago

Yes, of course.