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

Mastodon doesn't accept replies, wants a "public key" #77

Closed
nekr0z opened this issue May 14, 2021 · 15 comments
Closed

Mastodon doesn't accept replies, wants a "public key" #77

nekr0z opened this issue May 14, 2021 · 15 comments

Comments

@nekr0z
Copy link

nekr0z commented May 14, 2021

This log

Particularly

I 2021-05-14 07:26:26.271407+00:00 Received 401: Public key not found for key acct:evgenykuznetsov.org@evgenykuznetsov.org
W 2021-05-14 07:26:26.278356+00:00 401 Client Error: Unauthorized for url: https://fed.fab.industries/users/fabsh/inbox ; Public key not found for key acct:evgenykuznetsov.org@evgenykuznetsov.org
W 2021-05-14 07:26:26.281131+00:00   File "/workspace/oauth_dropins/webutil/util.py", line 1507, in call
    resp.raise_for_status()

  File "/layers/google.python.pip/pip/lib/python3.9/site-packages/requests/models.py", line 943, in raise_for_status
    raise HTTPError(http_error_msg, response=self)
@snarfed
Copy link
Owner

snarfed commented May 14, 2021

Ugh, thanks for filing. Mastodon probably changed their requirements again, as in #73 and #29 and other times. We may need to ping them again and ask.

@snarfed
Copy link
Owner

snarfed commented Oct 20, 2021

Looked at this again just now, and compared against the Mastodon req'ts in #73 (comment) . Both of these URLs are redirecting to Bridgy Fed ok and serving a valid Webfinger response with public key:

@ClearlyClaire thanks for your help in #73 (comment) a while back! Has Mastodon changed its Webfinger logic again since then? Any idea what could be triggering the 401 here?

@ClearlyClaire
Copy link

Hi! I don't think we have changed anything since that time.
https://evgenykuznetsov.org/.well-known/webfinger?resource=acct:evgenykuznetsov.org@evgenykuznetsov.org points to https://fed.brid.gy/evgenykuznetsov.org which has preferredName “nekr0z”, but querying acct:nekr0z@fed.brid.gy fails with a 502.

@snarfed
Copy link
Owner

snarfed commented Oct 22, 2021

Ah, preferredName! There's the rub. Not sure how recently Mastodon started querying preferredName@server-host, but it's news to me. Guess we'll need to start handling that, probably by using domain instead of the user's own desired nickname. Ah well.

@snarfed
Copy link
Owner

snarfed commented Oct 22, 2021

@ClearlyClaire as a minor feature request, if you could expand the Mastodon error response to include the final Webfinger request that failed, eg acct:nekr0z@fed.brid.gy here, that would definitely help!

@snarfed
Copy link
Owner

snarfed commented Oct 22, 2021

Oh, preferredUsername! Got it, yes, we have looked at that before, just evidently hadn't hit anyone who explicitly set it until now.

@ClearlyClaire
Copy link

ClearlyClaire commented Oct 22, 2021

Mastodon has checked preferredName for as long as it supported ActivityPub!

As for your feature request, well, there's the following PR waiting: mastodon/mastodon#15605
This PR would have displayed “Request for acct:nekr0z@fed.brid.gy returned HTTP 502”

@nekr0z
Copy link
Author

nekr0z commented Oct 22, 2021

Oh, preferredUsername! Got it, yes, we have looked at that before, just evidently hadn't hit anyone who explicitly set it until now.

Wow! I wonder how I managed to set it, there doesn't seem to be anything regarding this in the docs, and I don't remember setting it explicitly.

@snarfed
Copy link
Owner

snarfed commented Oct 23, 2021

Oh sorry, only half explicit, it's from the h-card p-nickname on your homepage.

snarfed added a commit that referenced this issue Oct 23, 2021
...since Mastodon looks up [preferredUsername]@fed.brid.gy. see #77
@snarfed
Copy link
Owner

snarfed commented Oct 23, 2021

Thanks again for the debugging help @ClearlyClaire! @nekr0z I think this is fixed; https://fed.brid.gy/evgenykuznetsov.org now overrides preferredUsername to be evgenykuznetsov.org. Feel free to retry!

@nekr0z
Copy link
Author

nekr0z commented Oct 23, 2021

Hmmmm... https://fed.brid.gy/log?key=https%3A%2F%2Fevgenykuznetsov.org%2Fen%2Fposts%2F2021%2Fcovid%2F+https%3A%2F%2Ffed.fab.industries%2Finbox&start_time=1634897313

preferredUsername is now evgenykuznetsov.org, but there's still a "Public key not found"

@ClearlyClaire
Copy link

This is curious, as I have no issue resolving acct:evgenykuznetsov.org@evgenykuznetsov.org anymore. Maybe you could try sending to https://social.sitedethib.com/inbox, it should return a more detailed error message.

@nekr0z
Copy link
Author

nekr0z commented Oct 23, 2021

This is curious, as I have no issue resolving acct:evgenykuznetsov.org@evgenykuznetsov.org anymore. Maybe you could try sending to https://social.sitedethib.com/inbox, it should return a more detailed error message.

I can't trigger that as a user. @snarfed, can you?

@snarfed
Copy link
Owner

snarfed commented Oct 23, 2021

Hmm! I retried sending to fed.fab.industries/inbox just now and it succeeded and returned a 202. Not sure why it failed the first time. https://fed.brid.gy/log?key=https%3A%2F%2Fevgenykuznetsov.org%2Fen%2Fposts%2F2021%2Fcovid%2F+https%3A%2F%2Ffed.fab.industries%2Finbox&start_time=1635026237

(I also tried sending to social.sitedethib.com/inbox, but from a local dev instance, and got a 401 since I probably didn't adjust all the HTTP headers and signature. No matter though if the real instance is working!)

@nekr0z
Copy link
Author

nekr0z commented Oct 28, 2021

I can confirm everything seems to be working now. Let's close this. Thank you for all the debugging and fixing!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants