misskey-dev / misskey

🌎 A completely free and open interplanetary microblogging platform 🚀
https://misskey-hub.net/
GNU Affero General Public License v3.0
10.06k stars 1.37k forks source link

Error 401 when following users from other instance #14593

Closed oluceps closed 1 month ago

oluceps commented 1 month ago

💡 Summary

When trying to follow users from other instances, the follow button keeps spinning and logging:

Sep 21 03:13:11 hastur misskey[1833222]: {
Sep 21 03:13:11 hastur misskey[1833222]:   code: 'BRIEF_REQUEST_INTERVAL',
Sep 21 03:13:11 hastur misskey[1833222]:   info: { remaining: 0, reset: 1726863191, resetMs: 1726863191611, total: 1 }
Sep 21 03:13:11 hastur misskey[1833222]: }
Sep 21 03:13:11 hastur misskey[1833309]: WARN 1        [queue inbox]        inbox activity ignored (maybe): id=https://wxw.moe/users/tiefraum/statuses/113171468138905601#updates/1726859590 reason=skip: Unknown type: Note
Sep 21 03:13:13 hastur misskey[1833309]: ERR  1        [queue deliver]        failed(UnrecoverableError: 401 Unauthorized
Sep 21 03:13:13 hastur misskey[1833309]:     at DeliverProcessorService.process (file:///nix/store/ws9y7xdkxfzv5xgf15i58c7jkfk5aacz-misskey-2024.8.0/data/packages/backend/built/queue/processors/DeliverProcessorService.js:140:27)
Sep 21 03:13:13 hastur misskey[1833309]:     at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
Sep 21 03:13:13 hastur misskey[1833309]:     at async Worker.processJob (/nix/store/ws9y7xdkxfzv5xgf15i58c7jkfk5aacz-misskey-2024.8.0/data/node_modules/.pnpm/bullmq@5.10.4/node_modules/bullmq/dist/cjs/classes/worker.js:445:28)
Sep 21 03:13:13 hastur misskey[1833309]:     at async Worker.retryIfFailed (/nix/store/ws9y7xdkxfzv5xgf15i58c7jkfk5aacz-misskey-2024.8.0/data/node_modules/.pnpm/bullmq@5.10.4/node_modules/bullmq/dist/cjs/classes/worker.js:634:24)) id=432 attempts=1/12 age=4442ms to=https://wayland.social/users/compositor/inbox
Sep 21 03:13:15 hastur misskey[1833309]: ERR  1        [queue deliver]        failed(UnrecoverableError: 401 Unauthorized
Sep 21 03:13:15 hastur misskey[1833309]:     at DeliverProcessorService.process (file:///nix/store/ws9y7xdkxfzv5xgf15i58c7jkfk5aacz-misskey-2024.8.0/data/packages/backend/built/queue/processors/DeliverProcessorService.js:140:27)
Sep 21 03:13:15 hastur misskey[1833309]:     at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
Sep 21 03:13:15 hastur misskey[1833309]:     at async Worker.processJob (/nix/store/ws9y7xdkxfzv5xgf15i58c7jkfk5aacz-misskey-2024.8.0/data/node_modules/.pnpm/bullmq@5.10.4/node_modules/bullmq/dist/cjs/classes/worker.js:445:28)
Sep 21 03:13:15 hastur misskey[1833309]:     at async Worker.retryIfFailed (/nix/store/ws9y7xdkxfzv5xgf15i58c7jkfk5aacz-misskey-2024.8.0/data/node_modules/.pnpm/bullmq@5.10.4/node_modules/bullmq/dist/cjs/classes/worker.js:634:24)) id=433 attempts=1/12 age=4265ms to=https://wayland.social/users/compositor/inbox
Sep 21 03:35:21 hastur misskey[1833222]: {
Sep 21 03:35:21 hastur misskey[1833222]:   code: 'BRIEF_REQUEST_INTERVAL',
Sep 21 03:35:21 hastur misskey[1833222]:   info: { remaining: 0, reset: 1726864521, resetMs: 1726864521364, total: 1 }
Sep 21 03:35:21 hastur misskey[1833222]: }
Sep 21 03:35:21 hastur misskey[1833309]: ERR  1        [queue deliver]        failed(UnrecoverableError: 401 Unauthorized
Sep 21 03:35:21 hastur misskey[1833309]:     at DeliverProcessorService.process (file:///nix/store/ws9y7xdkxfzv5xgf15i58c7jkfk5aacz-misskey-2024.8.0/data/packages/backend/built/queue/processors/DeliverProcessorService.js:140:27)
Sep 21 03:35:21 hastur misskey[1833309]:     at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
Sep 21 03:35:21 hastur misskey[1833309]:     at async Worker.processJob (/nix/store/ws9y7xdkxfzv5xgf15i58c7jkfk5aacz-misskey-2024.8.0/data/node_modules/.pnpm/bullmq@5.10.4/node_modules/bullmq/dist/cjs/classes/worker.js:445:28)
Sep 21 03:35:21 hastur misskey[1833309]:     at async Worker.retryIfFailed (/nix/store/ws9y7xdkxfzv5xgf15i58c7jkfk5aacz-misskey-2024.8.0/data/node_modules/.pnpm/bullmq@5.10.4/node_modules/bullmq/dist/cjs/classes/worker.js:634:24)) id=437 attempts=1/12 age=341ms to=https://wayland.social/users/compositor/inbox

🥰 Expected Behavior

Successful follow a user from other instances.

🤬 Actual Behavior

Error reported as above described.

📝 Steps to Reproduce

  1. try following a user.
  2. reproduced.

Some similar issue I've found: https://github.com/misskey-dev/misskey/issues/8723 https://github.com/misskey-dev/misskey/issues/8093

This issue always happens whether I enable or comment the signToActivityPubGet option. And I noticed that this is default true at present.

my misskey yaml cfg:

allowedPrivateNetworks:
  - 127.0.0.1/32
  - 10.0.0.1/16
db:
  db: misskey
  host: localhost
  pass: misskey
  port: 5432
  user: misskey
dbReplications: false
id: aidx
maxFileSize: 262144000
meilisearch:
  apiKey: some
  host: localhost
  port: 7700
  scope: local
  ssl: false
outgoingAddressFamily: dual
port: 3000
proxyBypassHosts:
  - api.deepl.com
  - api-free.deepl.com
  - www.recaptcha.net
  - hcaptcha.com
  - challenges.cloudflare.com
proxyRemoteFiles: true
redis:
  host: localhost
  port: 6379
# signToActivityPubGet: true
url: https://nyaw.xyz/

my reverse proxy config: https://github.com/oluceps/nixos-config/blob/109ae10e9a1c57ea03d8cb43ccb2d449c1468b39/hosts/nodens/caddy.nix#L199

my current misskey service config: https://github.com/oluceps/nixos-config/blob/trival/hosts/hastur/misskey.nix

This also appears when I running misskey instance in container: https://github.com/oluceps/nixos-config/blob/dbc68903aee8ffef7abaf7147040ed90d5c9be45/hosts/hastur/misskey.nix#L26.

💻 Frontend Environment

* Model and OS of the device(s): NixOS x86_64 
* Browser: Chrome Version 129.0.6668.22 (Official Build) beta (64-bit)
* Server URL: https://nyaw.xyz
* Misskey: 2024.8.0

🛰 Backend Environment (for server admin)

* Installation Method or Hosting Service: manual install
* Misskey: 2024.8.0
* Node: v20.17.0
* PostgreSQL: 16.4
* Redis: redis-7.2.5
* OS and Architecture:

 - system: `"x86_64-linux"`
 - host os: `Linux 6.11.0-cachyos, NixOS, 24.11 (Vicuna), 24.11.20240917.46dc692`
 - multi-user?: `yes`
 - sandbox: `yes`
 - version: `nix-env (Lix, like Nix) 2.92.0-dev-pre20240909-c14486a

Do you want to address this bug yourself?

oluceps commented 1 month ago

And still exist on develop branch HEAD: d3f1b0f0909483f724c6a72ac33c2febaa330e7c

kakkokari-gtyih commented 1 month ago

Doesn't 401 error mean that the destination server is refusing to follow?

It may not a bug, but simply the server is rejecting you.

oluceps commented 1 month ago

Doesn't 401 error mean that the destination server is refusing to follow?

It may not be a bug, but simply the server is rejecting you.

I think that may not the origin problem, bcz not all user of my instance encountered this issue, others could follow users normally. There doesn't make sense if rejected only part of users of the instance.

oluceps commented 1 month ago

To be mentioned that in these which users could not be followed instances, their federation status isError at /admin/federation dashboard, but clicking in and accessing it seems to work well. I wonder what caused this and how we can resolve it.

oluceps commented 1 month ago

To be mentioned that in these which users could not be followed instances, their federation status isError at /admin/federation dashboard, but clicking in and accessing it seems to work well. I wonder what caused this and how we can resolve it.

Additional info: image And the issue not only happened with these instances.

oluceps commented 1 month ago

Solved. it's not server rejection, but the webfinger.

https://github.com/mastodon/mastodon/discussions/20983#discussioncomment-5275601

https://github.com/oluceps/nixos-config/commit/9c0f361520dcc6aa51c0ada763bae89e9bb10fac