Hi! Seattle.Pink, a Chuckya (second-derivative of Mastodon, through glitch-soc) ...
Kasanwa-Solane are existing in cyberpunk, lol @ka_so@cyberpunk.lol
Hi! Seattle.Pink, a Chuckya (second-derivative of Mastodon, through glitch-soc) instance I help adminsiter, is having federation issues, and we need help in figuring out how to fix it.
In Sidekiq, we've been getting a lot of errors of OpenSSL::PKey::PKeyError: Neither PUB key nor PRIV key.
I don't know if there's an underlying issue that's causing that that needs be addressed.
We found an issue on upstream Mastodon's GitHub repository about the Sidekiq errors we've been seeing, and a comment in a reply included a script to run in the Rails console to help fix the stated issue.
We modified the script from that issue to survive more types of errors, and to also log its progress as it goes, so that it's resumable without having to retry ones that previously failed.
File.open('script_output.txt', 'w') do |f|
Account.remote.where(public_key: '').find_each(start: # id goes here
) do |acct|
f.puts "#{acct.id}"
f.flush
begin
if acct.uri.blank?
ResolveAccountService.new.call("@#{acct.username}@#{acct.domain}")
else
ActivityPub::FetchRemoteActorService.new.call(acct.uri)
end
rescue HTTP::TimeoutError, HTTP::ConnectionError, Seahorse::Client::NetworkingError, OpenSSL::SSL::SSLError, HTTP::Redirector::EndlessRedirectError => e
f.puts "Error fetching account #{acct.id}: #{e.message}"
f.flush
end
end
f.puts "finished"
f.flush
end
Unfortunately, that doesn't appear to be fixing the issue for Seattle.Pink.
Here's some database queries that illustrate.
September 3rd, 7:32 PM Pacific:
mastodon_production=# SELECT count(*) FROM accounts WHERE public_key = '' AND private_key IS NULL;
count
-------
79193
(1 row)
mastodon_production=# SELECT count(*) FROM accounts WHERE public_key != '' OR private_key IS NOT NULL;
count
-------
38521
(1 row)
Septempber 11th, 12:07 PM Pacific:
mastodon_production=# SELECT count(*) FROM accounts WHERE public_key = '' AND private_key IS NULL;
count
-------
80204
(1 row)
mastodon_production=# SELECT count(*) FROM accounts WHERE public_key != '' OR private_key IS NOT NULL;
count
-------
38341
(1 row)
Notice that the number in the first query, number of accounts missing keys, has gone up, and number of accounts with known public or private keys has gone down, despite us having the script running nearly that whole time.
We're unsure what to do next to try resolving our federation issues.