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

Misskey v13 failed to communicate with some of the mastodon sites and old misskey sites via relay #9752

Closed
CHN-beta opened this issue Jan 30, 2023 · 9 comments · Fixed by #9758
Labels
⚠️bug? This might be a bug

Comments

@CHN-beta
Copy link

💡 Summary

After upgrade to v13, my Misskey instance failed to communicate with some of the other instances via relay. That is, for example, with misskey v13, most of the notes from o3o.ca no longer be shown in the global timeline, and the requests to o3o.ca showed a significant drop (red box in the picture).
图片

Meanwhile, old misskey instances (v12) could not communicate to v13 in a similar manner.

This behavior could be reproduced in a newly set instance.

🥰 Expected Behavior

All notes from mastodon and misskey v12 instances connected to the same relay should be shown in global timeline.

🤬 Actual Behavior

On a new set misskey v13 instances, a lot of notes from misskey v13 instances were shown in global timeline. No note from mastodon was shown.

On a new set misskey v12 instances, only notes from mastodon were shown in global timeline. Notes from misskey v12 instances might could also be shown in global timeline, but today active v12 instances are not common.

📝 Steps to Reproduce

  1. Setup two new instance, use v12.119.2 and v13.2.5 respectively. The two instances use similar configs:
url: https://misskeytestv12.chn.moe/
port: 3004
db:
  host: 127.0.0.1
  port: 5432
  db: misskeytestv12
  user: xxx
  pass: xxxxxxxxxxxxxxx
  disableCache: true
  extra:
    statement_timeout: 600000
redis:
  host: localhost
  port: 6379
id: 'aid'
proxyRemoteFiles: true
signToActivityPubGet: true
  1. Do not follow or search any one, Just add a relay: https://relay.nya.one/inbox
  2. Wait for several minutes. In the global timeline of misskey v12 instance, only a lot of notes from mastodon was shown. In the global timeline of misskey v13 instance, only a lot of notes from misskey v13 was shown.

A screenshot from v12 instance:

图片

A screenshot from v13 instance:

图片

📌 Environment

Misskey version: 13.2.5, running with docker
Your OS: Gentoo
Your browser: firefox

@CHN-beta CHN-beta added the ⚠️bug? This might be a bug label Jan 30, 2023
@CHN-beta
Copy link
Author

The log files.

log.tar.gz

@rakino
Copy link

rakino commented Jan 30, 2023

image

Chart for Misskey.cf notes
image

@Candinya
Copy link
Contributor

Candinya commented Jan 30, 2023

Same question, still trying to figure out differences between:

  1. directly delivered non-misskey notes
  2. relay delivered non-misskey notes
  3. relay delivered misskey notes

Currently only 2. relay delivered non-misskey notes has this weird issue (the others can show up in global timeline site (global timeline and user's page) normally)

They all have been observed from inbox queue, so it might be a queue processor issue (I guess).

Only for reference, not 100% sure.

@CHN-beta
Copy link
Author

Same question, still trying to figure out differences between:

1. directly delivered non-misskey notes

2. relay delivered non-misskey notes

3. relay delivered misskey notes

Currently only 2. relay delivered non-misskey notes has this weird issue (the others can show up in global timeline site (global timeline and user's page) normally)

They all have been observed from inbox queue, so it might be a queue processor issue (I guess).

Only for reference, not 100% sure.

According to my test, relay delivered notes from misskey v13 also have some issue: They did now show up in global timeline in misskey v12.

@CHN-beta
Copy link
Author

I have confirmed that the problem behavior could be reproduced at v12.120.0-alpha7 (commit b19ef59). That is, v12.120.0-alpha7 behaves like v13.2.5, it could only receive notes by relay from misskey v13 but not from mastodon.
I have also tried two version before v12.120.0-alpha7 (v12.120.0-alpha4 and v12.120.0-alpha1), sadly both of them failed to start.

@HolgerHuo
Copy link

FYI, notes from BirdSiteLive are not delivered as well.

Those ActivityPub create activities were delivered successfully, from both BirdSiteLive's and Activity-Relay's perspectives (no error logs), and also Misskey's perspective (as it responed with status code 202):

Nginx log for BirdSiteLive activity: "POST /inbox HTTP/2.0" 202 0 "-" "-"
Nginx log for Activity-Relay activity: "POST /inbox HTTP/2.0" 202 0 "-" "Relay Service (golang net/http; Activity-Relay ; relay.example.com)"

@AyumuNekozuki
Copy link

AyumuNekozuki commented Jan 31, 2023

自身の環境でも同様の現象が発生し、色々調べたところ、以下のログが発生していることを確認しました。
NODE_ENV=production を付与せずにサーバーを起動すると以下のログが確認できます。

completed(skip: LD-Signatureの検証に失敗しました) id=23811 attempts=1/8 age=563ms

暫定的な対処として、以下のコードをコメントアウトし、再ビルド・起動すると問題なく、リレーからの投稿が流れるようになります。ただ、これは "正しい" 対処法ではない気がします。

// LD-Signature検証
const ldSignature = this.ldSignatureService.use();
const verified = await ldSignature.verifyRsaSignature2017(activity, authUser.key.keyPem).catch(() => false);
if (!verified) {
return 'skip: LD-Signatureの検証に失敗しました';
}

@Candinya
Copy link
Contributor

Candinya commented Jan 31, 2023

Seems like the normalize function has changed

Before:

public async normalize(data: any) {
const customLoader = this.getLoader();
return await jsonld.normalize(data, {
documentLoader: customLoader,
});
}

After:

public async normalize(data: any) {
const customLoader = this.getLoader();
return 42;
}

@Candinya
Copy link
Contributor

Fix confirmed, will open a PR for this.
Note: this will be a breaking change, any instance running v13 should update immediately to ensure the correct signature

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
⚠️bug? This might be a bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants