我已设置 ActivityPub 插件,但无法从任何其他联邦应用关注我在我的实例上设置的参与者。当我尝试关注:
news@forum.internet-czas-dzialac.pl
从 Mastodon 客户端,并刷新 Mastodon UI,关注请求卡住了:
它已经卡在“撤销关注请求”几个小时了。取消并重新发送关注请求没有帮助,它仍然卡住并且没有收到关于该类别新帖子的通知。
我已设置 ActivityPub 插件,但无法从任何其他联邦应用关注我在我的实例上设置的参与者。当我尝试关注:
news@forum.internet-czas-dzialac.pl
从 Mastodon 客户端,并刷新 Mastodon UI,关注请求卡住了:
它已经卡在“撤销关注请求”几个小时了。取消并重新发送关注请求没有帮助,它仍然卡住并且没有收到关于该类别新帖子的通知。
admin/site_settings/category/all_results?filter=plugin%3Adiscourse-activity-pub 中禁用“需要签名请求”并未解决问题[Discourse Activity Pub] Failed to process https://mastodon.social/users/Ifutig#delete: Object is not ready
[Discourse Activity Pub] DiscourseActivityPub::AP::Handlers::Warning
activesupport-7.2.2.1/lib/active_support/broadcast_logger.rb:130:in `block in warn'
activesupport-7.2.2.1/lib/active_support/broadcast_logger.rb:231:in `block in dispatch'
activesupport-7.2.2.1/lib/active_support/broadcast_logger.rb:231:in `each'
activesupport-7.2.2.1/lib/active_support/broadcast_logger.rb:231:in `dispatch'
activesupport-7.2.2.1/lib/active_support/broadcast_logger.rb:130:in `warn'
/var/www/discourse/plugins/discourse-activity-pub/lib/discourse_activity_pub/logger.rb:26:in `log'
/var/www/discourse/plugins/discourse-activity-pub/lib/discourse_activity_pub/logger.rb:63:in `warn'
/var/www/discourse/plugins/discourse-activity-pub/lib/discourse_activity_pub/ap/activity.rb:42:in `rescue in block in perform_transactions'
/var/www/discourse/plugins/discourse-activity-pub/lib/discourse_activity_pub/ap/activity.rb:35:in `block in perform_transactions'
activerecord-7.2.2.1/lib/active_record/connection_adapters/abstract/transaction.rb:616:in `block in within_new_transaction'
activesupport-7.2.2.1/lib/active_support/concurrency/null_lock.rb:9:in `synchronize'
activerecord-7.2.2.1/lib/active_record/connection_adapters/abstract/transaction.rb:613:in `within_new_transaction'
activerecord-7.2.2.1/lib/active_record/connection_adapters/abstract/database_statements.rb:361:in `transaction'
activerecord-7.2.2.1/lib/active_record/transactions.rb:234:in `block in transaction'
activerecord-7.2.2.1/lib/active_record/connection_adapters/abstract/connection_pool.rb:415:in `with_connection'
activerecord-7.2.2.1/lib/active_record/connection_handling.rb:296:in `with_connection'
activerecord-7.2.2.1/lib/active_record/transactions.rb:233:in `transaction'
/var/www/discourse/plugins/discourse-activity-pub/lib/discourse_activity_pub/ap/activity.rb:34:in `perform_transactions'
/var/www/discourse/plugins/discourse-activity-pub/lib/discourse_activity_pub/ap/activity.rb:26:in `process'
/var/www/discourse/plugins/discourse-activity-pub/app/jobs/discourse_activity_pub_process.rb:14:in `block in execute'
/var/www/discourse/lib/distributed_mutex.rb:53:in `block in synchronize'
/var/www/discourse/lib/distributed_mutex.rb:49:in `synchronize'
/var/www/discourse/lib/distributed_mutex.rb:49:in `synchronize'
/var/www/discourse/lib/distributed_mutex.rb:34:in `synchronize'
/var/www/discourse/plugins/discourse-activity-pub/app/jobs/discourse_activity_pub_process.rb:8:in `execute'
/var/www/discourse/app/jobs/base.rb:316:in `block (2 levels) in perform'
rails_multisite-6.1.0/lib/rails_multisite/connection_management/null_instance.rb:49:in `with_connection'
rails_multisite-6.1.0/lib/rails_multisite/connection_management.rb:21:in `with_connection'
/var/www/discourse/app/jobs/base.rb:303:in `block in perform'
/var/www/discourse/app/jobs/base.rb:299:in `each'
/var/www/discourse/app/jobs/base.rb:299:in `perform'
sidekiq-7.3.9/lib/sidekiq/processor.rb:220:in `execute_job'
sidekiq-7.3.9/lib/sidekiq/processor.rb:185:in `block (4 levels) in process'
sidekiq-7.3.9/lib/sidekiq/middleware/chain.rb:180:in `traverse'
sidekiq-7.3.9/lib/sidekiq/middleware/chain.rb:183:in `block in traverse'
/var/www/discourse/lib/sidekiq/pausable.rb:132:in `call'
sidekiq-7.3.9/lib/sidekiq/middleware/chain.rb:182:in `traverse'
sidekiq-7.3.9/lib/sidekiq/middleware/chain.rb:183:in `block in traverse'
sidekiq-7.3.9/lib/sidekiq/job/interrupt_handler.rb:9:in `call'
sidekiq-7.3.9/lib/sidekiq/middleware/chain.rb:182:in `traverse'
sidekiq-7.3.9/lib/sidekiq/middleware/chain.rb:183:in `block in traverse'
sidekiq-7.3.9/lib/sidekiq/metrics/tracking.rb:26:in `track'
sidekiq-7.3.9/lib/sidekiq/metrics/tracking.rb:134:in `call'
sidekiq-7.3.9/lib/sidekiq/middleware/chain.rb:182:in `traverse'
sidekiq-7.3.9/lib/sidekiq/middleware/chain.rb:173:in `invoke'
sidekiq-7.3.9/lib/sidekiq/processor.rb:184:in `block (3 levels) in process'
sidekiq-7.3.9/lib/sidekiq/processor.rb:145:in `block (6 levels) in dispatch'
sidekiq-7.3.9/lib/sidekiq/job_retry.rb:118:in `local'
sidekiq-7.3.9/lib/sidekiq/processor.rb:144:in `block (5 levels) in dispatch'
sidekiq-7.3.9/lib/sidekiq/config.rb:39:in `block in <class:Config>'
sidekiq-7.3.9/lib/sidekiq/processor.rb:139:in `block (4 levels) in dispatch'
sidekiq-7.3.9/lib/sidekiq/processor.rb:281:in `stats'
sidekiq-7.3.9/lib/sidekiq/processor.rb:134:in `block (3 levels) in dispatch'
sidekiq-7.3.9/lib/sidekiq/job_logger.rb:15:in `call'
sidekiq-7.3.9/lib/sidekiq/processor.rb:133:in `block (2 levels) in dispatch'
sidekiq-7.3.9/lib/sidekiq/job_retry.rb:85:in `global'
sidekiq-7.3.9/lib/sidekiq/processor.rb:132:in `block in dispatch'
sidekiq-7.3.9/lib/sidekiq/job_logger.rb:40:in `prepare'
sidekiq-7.3.9/lib/sidekiq/processor.rb:131:in `dispatch'
sidekiq-7.3.9/lib/sidekiq/processor.rb:183:in `block (2 levels) in process'
sidekiq-7.3.9/lib/sidekiq/processor.rb:182:in `handle_interrupt'
sidekiq-7.3.9/lib/sidekiq/processor.rb:182:in `block in process'
sidekiq-7.3.9/lib/sidekiq/processor.rb:181:in `handle_interrupt'
sidekiq-7.3.9/lib/sidekiq/processor.rb:181:in `process'
sidekiq-7.3.9/lib/sidekiq/processor.rb:86:in `process_one'
sidekiq-7.3.9/lib/sidekiq/processor.rb:76:in `run'
sidekiq-7.3.9/lib/sidekiq/component.rb:10:in `watchdog'
sidekiq-7.3.9/lib/sidekiq/component.rb:19:in `block in safe_thread'
activity pub allowed request origins 和 activity pub blocked request origins 设置为空Mastodon 的 sidekiq 报告了以下错误,用于 ActivityPub::DeliveryWorker 队列,参数如下:
"{\\\"@context\\\":\\\"https://www.w3.org/ns/activitystreams\\\",\\\"id\\\":\\\"https://toot.kuba-orlik.name/users/kuba#follows/2702/undo\\\",\\\"type\\\":\\\"Undo\\\",\\\"actor\\\":\\\"https://toot.kuba-orlik.name/users/kuba\\\",\\\"object\\\":{\\\"id\\\":\\\"https://toot.kuba-orlik.name/afe35800-107b-4843-baf6-763052aa8a79\\\",\\\"type\\\":\\\"Follow\\\",\\\"actor\\\":\\\"https://toot.kuba-orlik.name/users/kuba\\\",\\\"object\\\":\\\"https://forum.internet-czas-dzialac.pl/ap/actor/3120ea9df156a8556848a862fc980366\\\"}}\", 1, \"/inbox\"
HTTP::Request::UnsupportedSchemeError: unknown scheme: on /inbox
看起来 ap_id 在这个片段中是空的?
是的,我可以看到
curl -H "Accept: application/activity+json" https://forum.internet-czas-dzialac.pl/ap/actor/3120ea9df156a8556848a862fc980366 | jq
返回:
{
"id": "https://forum.internet-czas-dzialac.pl/ap/actor/3120ea9df156a8556848a862fc980366",
"type": "Group",
"updated": "2025-03-14T12:23:02Z",
"url": "https://forum.internet-czas-dzialac.pl/c/nowinki-od-icd/65",
"name": "Forum ICD - Newsy",
"inbox": "/inbox",
"outbox": "/outbox",
"followers": "https://forum.internet-czas-dzialac.pl/ap/actor/3120ea9df156a8556848a862fc980366/followers",
"preferredUsername": "news",
"publicKey": {
"id": "https://forum.internet-czas-dzialac.pl/ap/actor/3120ea9df156a8556848a862fc980366#main-key",
"owner": "https://forum.internet-czas-dzialac.pl/ap/actor/3120ea9df156a8556848a862fc980366",
"publicKeyPem": "-----BEGIN PUBLIC KEY-----\nMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA2JFbVH7kIfa/14CDnUww\n9x+XwOPsS0qyeec1jdasv8SqqCit22FwDsLhH6vWpSIDisEDOhTLZjFFtpwksA8d\nRZIdOFrFazPkUF69J5VDVGtLgjyRi/KkJewbVaUnxO8zNwnxyBYWe8QoMWbdFwto\nfNzvB/ht+9Pch8ksVzNPnrA3Z7egtWHWGNl5sQ+8eXOKzeMNOn73hCEKcOSPWulz\n1gbbdo0So5ThKpwXC0ViqcZy2yzyTFptdrvL7lphr0BywUsG6AruOuwmghw6eRNe\nFvzx0Pq01bUIyY+MXiYmN6sLMIDqi/kdoALzSE+tHcv7HzCLNuEJb1DCmZo56O2H\nSQIDAQAB\n-----END PUBLIC KEY-----\n"
},
"icon": {
"type": "Image",
"mediaType": "image/png",
"url": "https://forum.internet-czas-dzialac.pl/uploads/default/original/1X/adbc19ebc6466183dc0387c3f59d86bd2861b5c9.png"
},
"@context": "https://www.w3.org/ns/activitystreams"
}
你可以看到 inbox 和 outbox URL 没有协议和域名
我认为我已经找到了问题所在。我已发送一个 PR 来修复此问题:
更改的要点是添加这些 getter:
您的问题在于对象在初始阶段就被创建了 id。这与序列化器(或制造器)无关。您能否分享:
感谢 @angus 的关注!不幸的是,即使是最新版本,问题仍然存在。
我使用官方 Docker 设置进行自托管(./launcher rebuild app)。
我正在运行 Discourse 3.5.0.beta2-dev
discourse-chat-integration、discourse-whos-online、discourse-telegram-notifications、discourse-assign
我确实认为可能是这种情况,但我尝试安装此提交之前的版本,但遇到了同样的问题 ![]()
我已安装该插件的最新版本(来自提交 0083654),但问题仍未解决。快速检查:
> curl -H "Accept: application/activity+json" https://forum.internet-czas-dzialac.pl/ap/actor/3120ea9df156a8556848a862fc980366 | jq
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 1298 0 1298 0 0 9151 0 --:--:-- --:--:-- --:--:-- 9205
{
"id": "https://forum.internet-czas-dzialac.pl/ap/actor/3120ea9df156a8556848a862fc980366",
"type": "Group",
"updated": "2025-03-14T12:23:02Z",
"url": "https://forum.internet-czas-dzialac.pl/c/nowinki-od-icd/65",
"name": "Forum ICD - Newsy",
"inbox": "/inbox",
"outbox": "/outbox",
"followers": "https://forum.internet-czas-dzialac.pl/ap/actor/3120ea9df156a8556848a862fc980366/followers",
"preferredUsername": "news",
"publicKey": {
"id": "https://forum.internet-czas-dzialac.pl/ap/actor/3120ea9df156a8556848a862fc980366#main-key",
"owner": "https://forum.internet-czas-dzialac.pl/ap/actor/3120ea9df156a8556848a862fc980366",
"publicKeyPem": "-----BEGIN PUBLIC KEY-----\nMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA2JFbVH7kIfa/14CDnUww\n9x+XwOPsS0qyeec1jdasv8SqqCit22FwDsLhH6vWpSIDisEDOhTLZjFFtpwksA8d\nRZIdOFrFazPkUF69J5VDVGtLgjyRi/KkJewbVaUnxO8zNwnxyBYWe8QoMWbdFwto\nfNzvB/ht+9Pch8ksVzNPnrA3Z7egtWHWGNl5sQ+8eXOKzeMNOn73hCEKcOSPWulz\n1gbbdo0So5ThKpwXC0ViqcZy2yzyTFptdrvL7lphr0BywUsG6AruOuwmghw6eRNe\nFvzx0Pq01bUIyY+MXiYmN6sLMIDqi/kdoALzSE+tHcv7HzCLNuEJb1DCmZo56O2H\nSQIDAQAB\n-----END PUBLIC KEY-----\n"
},
"icon": {
"type": "Image",
"mediaType": "image/png",
"url": "https://forum.internet-czas-dzialac.pl/uploads/default/original/1X/adbc19ebc6466183dc0387c3f59d86bd2861b5c9.png"
},
"@context": "https://www.w3.org/ns/activitystreams"
}
您可以看到 inbox 和 outbox 键再次不是完整的 URL。
回到之前的提交将无助于解决问题。请尝试在 Admin > ActivityPub 中重新保存 actor,即点击 “Save Actor” 在 /admin/plugins/ap/actor。
啊!我重新保存了类别 actor,它现在可以正常工作了!
现在,我该如何修复单个用户 actor,例如 https://forum.internet-czas-dzialac.pl/ap/actor/0098dcca74e34cfd2115e9309a7d4531?
> curl -H "Accept: application/activity+json" https://forum.internet-czas-dzialac.pl/ap/actor/0098dcca74e34cfd2115e9309a7d4531 | jq
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 1332 0 1332 0 0 9273 0 --:--:-- --:--:-- --:--:-- 9314
{
"id": "https://forum.internet-czas-dzialac.pl/ap/actor/0098dcca74e34cfd2115e9309a7d4531",
"type": "Person",
"updated": "2025-03-14T12:34:26Z",
"url": "https://forum.internet-czas-dzialac.pl/u/kuba",
"name": "Kuba",
"inbox": "/inbox",
"outbox": "/outbox",
"sharedInbox": "https://forum.internet-czas-dzialac.pl/ap/users/inbox",
"followers": "https://forum.internet-czas-dzialac.pl/ap/actor/0098dcca74e34cfd2115e9309a7d4531/followers",
"preferredUsername": "kuba",
"publicKey": {
"id": "https://forum.internet-czas-dzialac.pl/ap/actor/0098dcca74e34cfd2115e9309a7d4531#main-key",
"owner": "https://forum.internet-czas-dzialac.pl/ap/actor/0098dcca74e34cfd2115e9309a7d4531",
"publicKeyPem": "-----BEGIN PUBLIC KEY-----\nMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA0wp46cDyUbUUTfvbWqy/\nRS3YXY2g69+a3R5n+f4EeCxcpNL1OGPyzgjszdoxAWLSXCHqZk91v2rvpfRZt8wi\nEQ8Sr5CVj1uKIny9bdxKtxVyiT7U1pIZGD1VhWXqY1tMRLxQWWhA2+UtD1pfFzk/\nyqcbqXUvlG6UsQBAlDnaPxKaq3CD1ui1ANVsVY+VEbJyROIVY3q86qw50KSDHu/y\n0TaD6UjZNtnGOVmjh11QZwn2j5A/GYj6gqFDdS58KMMoBuPAfRZ7uD3psJ5CqT6F\nKLwn5q3UvypEm89SmboRIEcq7Pcvv1Zts0QJRDaSA0M4VeW35iuAqnhQ7yHKthAF\nYwIDAQAB\n-----END PUBLIC KEY-----\n"
},
"icon": {
"type": "Image",
"mediaType": "image/png",
"url": "https://forum.internet-czas-dzialac.pl/user_avatar/forum.internet-czas-dzialac.pl/kuba/96/1866_2.png"
},
"@context": "https://www.w3.org/ns/activitystreams"
}
很高兴它奏效了!
当前的 数据验证 检查将在用户参与实际活动时应用(即,在需要时它将自我纠正),但扩展相同的验证检查到直接的个人 actor 访问(就像你在这里所做的那样)是一个好主意。这将做到这一点:
感谢你的坚持。拥有一个包含错误数据的真实实例对于确保验证检查按预期和按需工作非常有帮助。最初导致这些近期更改的数据损坏问题可能会以其他形式再次发生,因此这里的目标是确保在需要数据时(而不是通过迁移等方式处理)持续的数据一致性。如果你发现任何类似的问题,请告诉我!
现在可以用了!暂时切换到你的分支 ![]()
@angus 感谢您到目前为止的支持。尽管收件箱/发件箱 URL 现在看起来还可以,但关注功能仍然不起作用。我已尝试从两个不同的 Mastodon 实例关注 @kuba@forum.internet-czas-dzialac.pl,但在这两种情况下都失败了。
当我提交一个常规用户 actor 的关注请求时,我收到此错误:
[Discourse Activity Pub] Failed to process https://mastodon.internet-czas-dzialac.pl/6bef64d0-c8ad-473c-85f6-d3fd190b5ebd:
Activity is not supported for actor and object
activesupport-7.2.2.1/lib/active_support/broadcast_logger.rb:130:in `block in warn'
activesupport-7.2.2.1/lib/active_support/broadcast_logger.rb:231:in `block in dispatch'
activesupport-7.2.2.1/lib/active_support/broadcast_logger.rb:231:in `each'
activesupport-7.2.2.1/lib/active_support/broadcast_logger.rb:231:in `dispatch'
activesupport-7.2.2.1/lib/active_support/broadcast_logger.rb:130:in `warn'
/var/www/discourse/plugins/discourse-activity-pub/lib/discourse_activity_pub/logger.rb:26:in `log'
/var/www/discourse/plugins/discourse-activity-pub/lib/discourse_activity_pub/logger.rb:63:in `warn'
/var/www/discourse/plugins/discourse-activity-pub/lib/discourse_activity_pub/ap/object.rb:140:in `process_failed'
/var/www/discourse/plugins/discourse-activity-pub/lib/discourse_activity_pub/ap/activity.rb:139:in `process_actor_and_object'
/var/www/discourse/plugins/discourse-activity-pub/lib/discourse_activity_pub/ap/activity.rb:56:in `process_activity'
/var/www/discourse/plugins/discourse-activity-pub/lib/discourse_activity_pub/ap/activity.rb:36:in `block in perform_transactions'
activerecord-7.2.2.1/lib/active_record/connection_adapters/abstract/transaction.rb:616:in `block in within_new_transaction'
activesupport-7.2.2.1/lib/active_support/concurrency/null_lock.rb:9:in `synchronize'
activerecord-7.2.2.1/lib/active_record/connection_adapters/abstract/transaction.rb:613:in `within_new_transaction'
activerecord-7.2.2.1/lib/active_record/connection_adapters/abstract/database_statements.rb:361:in `transaction'
activerecord-7.2.2.1/lib/active_record/transactions.rb:234:in `block in transaction'
activerecord-7.2.2.1/lib/active_record/connection_adapters/abstract/connection_pool.rb:421:in `with_connection'
activerecord-7.2.2.1/lib/active_record/connection_handling.rb:296:in `with_connection'
activerecord-7.2.2.1/lib/active_record/transactions.rb:233:in `transaction'
/var/www/discourse/plugins/discourse-activity-pub/lib/discourse_activity_pub/ap/activity.rb:34:in `perform_transactions'
/var/www/discourse/plugins/discourse-activity-pub/lib/discourse_activity_pub/ap/activity.rb:26:in `process'
/var/www/discourse/plugins/discourse-activity-pub/app/jobs/discourse_activity_pub_process.rb:14:in `block in execute'
/var/www/discourse/lib/distributed_mutex.rb:53:in `block in synchronize'
(...)"
当我取消关注请求时,出现此错误:
[Discourse Activity Pub] Failed to process https://mastodon.internet-czas-dzialac.pl/users/icd#follows/5003/undo:
Object is not ready
activesupport-7.2.2.1/lib/active_support/broadcast_logger.rb:130:in `block in warn'
activesupport-7.2.2.1/lib/active_support/broadcast_logger.rb:231:in `block in dispatch'
activesupport-7.2.2.1/lib/active_support/broadcast_logger.rb:231:in `each'
activesupport-7.2.2.1/lib/active_support/broadcast_logger.rb:231:in `dispatch'
activesupport-7.2.2.1/lib/active_support/broadcast_logger.rb:130:in `warn'
/var/www/discourse/plugins/discourse-activity-pub/lib/discourse_activity_pub/logger.rb:26:in `log'
/var/www/discourse/plugins/discourse-activity-pub/lib/discourse_activity_pub/logger.rb:63:in `warn'
/var/www/discourse/plugins/discourse-activity-pub/lib/discourse_activity_pub/ap/object.rb:140:in `process_failed'
/var/www/discourse/plugins/discourse-activity-pub/lib/discourse_activity_pub/ap/activity.rb:137:in `process_actor_and_object'
/var/www/discourse/plugins/discourse-activity-pub/lib/discourse_activity_pub/ap/activity.rb:56:in `process_activity'
/var/www/discourse/plugins/discourse-activity-pub/lib/discourse_activity_pub/ap/activity.rb:36:in `block in perform_transactions'
activerecord-7.2.2.1/lib/active_record/connection_adapters/abstract/transaction.rb:616:in `block in within_new_transaction'
(...)"
第二个警告,即这个
是符合预期的,因为你不能撤销(Undo)尚未执行的操作。
至于为什么关注(follow)不起作用
无法处理 https://mastodon.internet-czas-dzialac.pl/6bef64d0-c8ad-473c-85f6-d3fd190b5ebd:活动不支持该参与者和对象
这表明你正在尝试关注一个非标准的参与者(actor)。当类型验证失败时,就会抛出该警告。你可以在这个文件夹中看到我们支持的各种参与者类型:
https://github.com/discourse/discourse-activity-pub/tree/main/lib/discourse_activity_pub/ap/actor
另外,那个 URL 似乎也无法解析到任何内容。
这很奇怪——我只是想关注一个普通用户。这里的日志是我尝试关注 @kuba@forum.internet-czas-dzialac.pl(认为它对应于 Profile - kuba - Forum Internet. Czas działać! - 除非我弄错了什么?)
从我从 https://github.com/discourse/discourse-activity-pub/blob/main/lib/discourse_activity_pub/ap/actor/person.rb 收集到的信息来看,通过 AP 关注 Discourse 用户是受支持的,对吗?
不可以。支持关注 Discourse 的分类或标签,但无法通过 ActivityPub 关注论坛用户。这些用户是“伪用户”,他们的帖子由分类/标签的 Actor 进行推广。
啊,明白了。是否有计划为以下特定用户提供支持?我很乐意提供帮助
啊,我明白了,是的,目前不支持。
短期到中期内没有。