Mastodon: Can't enable "federation relay"

Created on 27 Aug 2018  ·  20Comments  ·  Source: tootsuite/mastodon

I'm the admin of raki.social. I upgraded to 2.5.0rc1 from the release tag.

The upgrade went fine, but I haven't been able to get the new "federation relay" feature working. After adding the suggested relay (https://relay.joinmastodon.org/inbox) it shows up "Disabled":

screen shot 2018-08-27 at 11 12 04 am

If I click "Enable", it seems like it's trying to do something, but nothing really happens -- there's no error and it remains "Disabled".

I don't know how to troubleshoot this further. I'm not sure where to look for relevant logs. I tried grepping through syslog but didn't see anything related.


  • [x] I searched or browsed the repo’s other issues to ensure this is not a duplicate.
  • [x] This bug happens on a tagged release and not on master (If you're a user, don't worry about this).

Most helpful comment

That was a fantastic pointer actually. I started suspecting it's something about my deployment of the code, and lo and behold, a high -c setting has led to a lot of delivery jobs in the worker failing because of too many open files.

This is still something to be solved because there are a lot of jobs and the relay must keep up with them, but at least the mystery is solved, I lowered the setting and was able to enable a relay on mastodon.social.

All 20 comments

I ran into the same issue

It shows as disabled if the relay hasn't replied back to your follow request. Which it probably didn't do yet because it's lagging behind.
The UI should probably show that it's pending, rather than disabled!

Ah... okay @ThibG. I will wait for a while and see if it gets the reply. Thanks.

I agree the UI should be improved. Displaying "Pending" would be a great start.

I think it's a mistake on my part... As @ThibG mentions I forgot to change the UI from enabled/disabled to disabled/pending/enabled, and there might be a bug with actually recording the "accept" event because the relay seems to be sending them (and is not lagging behind significantly) and yet this issue exists.

Got the same problem. Should we wait for the next release?

Problems may occur when upper case is included in inbox_url.

It may be fixed by adding the following modification to pub-relay.
https://source.joinmastodon.org/mastodon/pub-relay/merge_requests/2

@noellabo have you tried this change? I've just recompiled my binary on relay.mastodon.nl to test but I can't see any change. I'm seeing these responses after trying to enable a relay (no change in the admin UI)

Aug 29 21:14:24 woolly server[30285]: FOLLOW:
Aug 29 21:14:24 woolly server[30285]: #<InboxHandler::Actor:0x20beec0
Aug 29 21:14:24 woolly server[30285]:  @endpoints=InboxHandler::Endpoints(@shared_inbox="https://mastodon.nl/inbox"),
Aug 29 21:14:24 woolly server[30285]:  @id="https://mastodon.nl/users/DimitryJacobs",
Aug 29 21:14:24 woolly server[30285]:  @inbox="https://mastodon.nl/users/DimitryJacobs/inbox",
Aug 29 21:14:24 woolly server[30285]:  @public_key=
Aug 29 21:14:24 woolly server[30285]:   InboxHandler::Key(
Aug 29 21:14:24 woolly server[30285]:    @owner="https://mastodon.nl/users/DimitryJacobs",
Aug 29 21:14:24 woolly server[30285]:    @public_key_pem=
Aug 29 21:14:24 woolly server[30285]:     "-----BEGIN PUBLIC KEY-----\n" +
Aug 29 21:14:24 woolly server[30285]:     "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA73DycWpRb2WR91JSEbh8\n" +
Aug 29 21:14:24 woolly server[30285]:     "FGFbLSGD4miPkEuyCl9ArBwiMAt2WFinTEYG0uIt9YCLRVTF1tvWpDKL7Kvg+fYd\n" +
Aug 29 21:14:24 woolly server[30285]:     "paLwxkZf4fvIsi2HqKXc2Sd0ZCAK8VxPWo0DTdLatIl6opnBPH2DfwrJLH1XbQZL\n" +
Aug 29 21:14:24 woolly server[30285]:     "X59PSG6o9dYjlk/riMnZ1YXwMt2t38EUErMpyFOKFLed8bPTopWYkzyUcPktnCt6\n" +
Aug 29 21:14:24 woolly server[30285]:     "W6s1NhUH+7HQ7ifb2mk9tGJl7+mJ2FVY1xwzMwiBz/UueTLQfUyziXyrfC1gXXbd\n" +
Aug 29 21:14:24 woolly server[30285]:     "Uzka6kSG/oRQ0LTUrB3Es5P2F6aqxID6LP61Rs5aDJNptyW5a7919YzP2XDxstJB\n" +
Aug 29 21:14:24 woolly server[30285]:     "SQIDAQAB\n" +
Aug 29 21:14:24 woolly server[30285]:     "-----END PUBLIC KEY-----\n")>
Aug 29 21:14:24 woolly server[30285]: #<Activity:0x20bee00
Aug 29 21:14:24 woolly server[30285]:  @cc=[],
Aug 29 21:14:24 woolly server[30285]:  @id="https://mastodon.nl/941eaced-e395-4d2b-ac15-5671bad9b799",
Aug 29 21:14:24 woolly server[30285]:  @object="https://www.w3.org/ns/activitystreams#Public",
Aug 29 21:14:24 woolly server[30285]:  @signature_present=false,
Aug 29 21:14:24 woolly server[30285]:  @to=[],
Aug 29 21:14:24 woolly server[30285]:  @types=["Follow"]>

@mdbraber I wouldn't expect that PR to fix the underlying issue for most cases. It only solves issues where the relay URL has upper case characters. The example URL (https://relay.joinmastodon.org/inbox), and probably most relay URLs, does not have any upper case characters.

Indeed, it seems that it hasn't fixed this problem.

There are test specs for handling the Accept activities in Mastodon, and the tests pass. And the relay code looks like it's sending them. So it's very mysterious. The payloads don't look very different between test spec and relay either.

@mdbraber What is the error recorded in the worker's log?

Aug 30 07:38:52 hrt worker[22827]: POST https://dtp-mstdn.jp/inbox 401

I've been messing around with this and found a solution (I'm using relay.mastodon.nl as my test server). The only visible change I could see in the payloads for the pub-relay server was that it's using multiple contexts:

"@context": {"https://www.w3.org/ns/activitystreams", "https://w3id.org/security/v1"},

when changing this to:

"@context": {"https://www.w3.org/ns/activitystreams"},

in inbox_handler.cr and pub_relay.cr (in the pub-relay source) my relay is shown as enabled.

I'm not sure though if changing the pub-relay code should be the proposed solution or that something should be fixed on the side of Mastodon. @Gargron can probably best judge that.

@noellabo well no errors (now) - it's showing the right response code (202).

Honestly - it took me a moment to figure out that worker had to be running too ;-) I've done zero to none Ruby (Sidekiq / Rails), Crystal before so it took me a moment to figure out how it was supposed to work :-)

I was able to add https://relay.mastodon.nl/inbox as a relay. 👍

I also got the same problem and I can say https://relay.mastodon.nl/inbox is working well.

FYI for all those using relay.mastodon.nl I've now created a whitelist with only selected instances to not have non-Dutch related content pushed to it. My idea is to have it act as a "booster" for Dutch related content, not a a general relay. As soon as I get round to it I'd be happy to set up another test instance. But I think @Gargron (or someone who controls relay.joinmastodon.org) might be able to fix that too.

https://relay.mastodon.host/inbox works too if needed.

Are you telling me that all other installations of the relay work and only mine doesn't? You're also using the Crystal code, right?

Seems to be the case :)On Aug 30, 2018 5:28 PM, Eugen Rochko notifications@github.com wrote:Are you telling me that all other installations of the relay work and only mine doesn't? You're also using the Crystal code, right?

—You are receiving this because you commented.Reply to this email directly, view it on GitHub, or mute the thread.

That was a fantastic pointer actually. I started suspecting it's something about my deployment of the code, and lo and behold, a high -c setting has led to a lot of delivery jobs in the worker failing because of too many open files.

This is still something to be solved because there are a lot of jobs and the relay must keep up with them, but at least the mystery is solved, I lowered the setting and was able to enable a relay on mastodon.social.

So to reiterate: It's not a bug in Mastodon code, and not really a bug in the Relay, but the relay needs to be improved in many ways yet.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

cphuntington97 picture cphuntington97  ·  63Comments

BrianPansky picture BrianPansky  ·  69Comments

Thann picture Thann  ·  63Comments

valentin2105 picture valentin2105  ·  67Comments

nclm picture nclm  ·  187Comments