mastodon.zunda.ninja is one of the many independent Mastodon servers you can use to participate in the fediverse.
Zundon is a single user instance as home of @zundan as well as a test bed for changes of the code.

Administered by:

Server stats:

1
active users

酔った勢いでrubyを2.7.4から3.0.2に上げたらプロダクションだけ動きませんでした←

method=POST path=/inbox format=html controller=ActivityPub::InboxesController action=create status=500 error='ArgumentError: wrong number of arguments (given 3, expected 1..2)' duration=11.55 view=0.00 db=1.32 key=https://mstdn.jp/users/…#main-key

ArgumentError (wrong number of arguments (given 3, expected 1..2)):

app/lib/activitypub/tag_manager.rb:171:in `uri_to_resource'
app/controllers/concerns/signature_verification.rb:221:in `account_from_key_id'
app/controllers/concerns/signature_verification.rb:81:in `signed_request_account'
app/controllers/concerns/signature_verification.rb:49:in `require_signature!'

tootctl cache clearしたのになぐぬぬ(そのうちまた挑戦)

specで通ってないコードパスかもわね…

specで通ってるけど落ちないのわね…

別の場所でも出てる。バックトレースに出てない場所かな…

method=GET path=/@zundan/103116148519200756 format=html controller=StatusesController action=show status=500 error='ArgumentError: wrong number of arguments (given 3, expected 1..2)' duration=22.46 view=0.00 db=7.24

ArgumentError (wrong number of arguments (given 3, expected 1..2)):

app/models/account.rb:124:in `user_pending?'
app/controllers/concerns/account_owned_concern.rb:28:in `check_account_approval'
app/controllers/concerns/localized.rb:16:in `block in set_locale'
app/controllers/concerns/localized.rb:15:in `set_locale'

ActiveRecordのどこかっぽい感じかなあ… (だめエスパー)

さすがにActiveRecord側でruby-3に対応してないコードがないじゃろと思ったんだけどMastodon側でも定義はないみたい

$ git grep 'def find_by'
(なんもなし)

Railsのコアで定義されてるfind_byにどこからか余計な引数が割り込んでるように見える。サッパリワカラン。

klass: Account find_by: ["/app/vendor/bundle/ruby/3.0.0/gems/activerecord-6.1.4.1/lib/active_record/core.rb", 341]
method=POST path=/inbox format=html controller=ActivityPub::InboxesController action=create status=500 error='ArgumentError: wrong number of arguments (given 3, expected 1..2)' duration=76.63 view=0.00 db=19.94 key=https://best-friends.chat/users/…#main-key

ArgumentError (wrong number of arguments (given 3, expected 1..2)):

app/lib/activitypub/tag_manager.rb:172:in `uri_to_resource'
app/controllers/concerns/signature_verification.rb:221:in `account_from_key_id'
app/controllers/concerns/signature_verification.rb:81:in `signed_request_account'
app/controllers/concerns/signature_verification.rb:49:in `require_signature!'

これかしらね…

$ find vendor/bundle/ruby/3.0.0/gems/scout_apm-2.6.8 -type f -print0 | xargs -0 grep 'def find_by'
vendor/bundle/ruby/3.0.0/gems/scout_apm-2.6.8/lib/scout_apm/instruments/active_record.rb: def find_by_sql_with_scout_instruments(*args, &block)

うーっし。ステージングにScoutを入れて現象の再現に成功しました🎉 (ばんばんぞうさんかわいい)

zunda

Scout gemの更新は今のところ無いようだ。モンキーパッチ当ててみようかな。

$ bundle update --conservative scout_apm
:
Installing scout_apm 4.1.2 (was 2.6.8) with native extensions
Bundle updated!

でなおりました。