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

[Bug]: Lemmy instances sending every activity twice #4609

Open
5 tasks done
freamon opened this issue Apr 8, 2024 · 19 comments
Open
5 tasks done

[Bug]: Lemmy instances sending every activity twice #4609

freamon opened this issue Apr 8, 2024 · 19 comments
Labels
area: federation support federation via activitypub bug Something isn't working

Comments

@freamon
Copy link

freamon commented Apr 8, 2024

Requirements

  • Is this a bug report? For questions or discussions use https://lemmy.ml/c/lemmy_support
  • Did you check to see if this issue already exists?
  • Is this only a single bug? Do not put multiple bugs in one issue.
  • Do you agree to follow the rules in our Code of Conduct?
  • Is this a backend issue? Use the lemmy-ui repo for UI / frontend issues.

Summary

This is discussed this post on on Lemmy - you can see me protesting that it should be me filing the report, but I've slept since then, and Nutomic said please (?!). There's a question of whether it's due to instance configuration, Lemmy itself, or some combination of the two (it only stated with 0.19.x, but not all instances do it, and there isn't always a correlation between it happening and the amount of containers an instance is using). I was reluctant to make this Issue because there's information you'll need about instance config that I'm not going to be able to give to you, because I'm not running Lemmy, so this is all second-hand info and observation.

The post on Lemmy has a video. The background to it is that I wanted to use ActivityPub for an Automod on lemmy.world/c/starwarsmemes, so I sent a Follow request to that community (using a Ruby script). When anything happens lemmy.world sends an Announce activity to my server, and the Automod can, amongst other things, send a notification to my phone when a new post is made. In the video, the red terminal is showing a tail -f on the nginx log; the green terminal is showing the .object.id, .object.type, and .object.actor from the JSON contained inside each request. starwarsmemes is pretty quiet at the minute, so I was able to monitor the results of activity that I myself was generating as a user on lemmy.world. Hopefully, the video makes it clear that duplicate activity is being sent every time.

I've seen similar behaviour before: post on lemmy.ca and post on endlesstalk.org. The background to those posts is that I was running a fake lemmy community (best viewed from here), that was using a basic ActivityPub server to federate comments and votes, and I could tell from that that those instances (among others) were duplicating everything.

I saw it first with lemmy.world when they upgraded to 0.19.3, and my dumb AutoMod pinged my phone 4 times to tell me about the same new post (I mentioned it to the admins in this comment).

Outside of my server, you can also see duplicate activity trip other recipients up. One place is Lemmy modlogs. For example, this modlog shows me manually restoring a comment that the AutoMod removed. I did this with my own fair hand, using the lemmy-ui, so I know that whilst I didn't do the same thing twice, activity was sent twice to endlesstalk.org about it. Another is PieFed. They've tightened up their ability to filter out duplicates now, but - if they've not been deleted since - you can still see what happened here and here, as well as here and here (the originals weren't updated, btw). In both circumstances (modlogs and piefed), I'm guessing it's hit-and-miss because it depends on how much time there was between the original activity and its duplicate.

It's entirely possible that is down to instance mis-configuration (in which, quite a few instances are making the same mistake, which is a problem in itself). It's only slightly vague suggestions from admins that the software itself is at fault. That's why I'd prefer it was them making this Issue instead of me, but I've been requested to do it, so here it is.

Steps to Reproduce

  1. Be a server admin, using software that lets you monitor incoming activity
  2. Subscribe to a community on an affected instance like lemmy.world
  3. Generate some activity using an actor unrelated to your own server, and see how many times the instance Announces it

Technical Details

(I can't you much here, for the aforementioned I'm-not-running-Lemmy reasons)

Version

0.19.3

Lemmy Instance URL

lemmy.world

@freamon freamon added the bug Something isn't working label Apr 8, 2024
@Nutomic Nutomic added the area: federation support federation via activitypub label Apr 8, 2024
@Nutomic
Copy link
Member

Nutomic commented Apr 9, 2024

This seems like a bug in Lemmy so youre definitely right to report it here. Doesnt matter if you observe it from another platform. It looks like all requests go to /inbox and you respond with status 200 without producing error codes or timeouts, so it doesnt look like a problem on your side.

@phiresky Do you have any idea about this? All I can think of is that theres more than one federation worker active for a single target instance, but the code looks correct.

Edit: It could help to write unit tests for the outgoing federation queue, to ensure that it starts and stops workers as expected, and sends activities correctly.

@phiresky
Copy link
Collaborator

phiresky commented Apr 9, 2024

I know that lemmy.world definitely had a misconfiguration for a bit where they had multiple instances of Lemmy running without the appropriate -federation-worker flags set (since those where not required before 0.19).

If this issue doesn't happen always and for every instance then it's likely a misconfiguration in those instances.

That doesn't mean we shouldn't do something to improve the situation. For example we could add a heuristic to the federation workers that detects and logs an error when the federation_queue_state table has been updated by someone else which would mean overlapping federation workers running.

The best solution would be a horizontal scaling method that does not require manual configuration of federation instance ranges but I can't think of a way to do that without huge complexity.

@Nutomic
Copy link
Member

Nutomic commented Apr 9, 2024

The bug also seems to happen for instances that are running only a single Lemmy backend, eg mander.xyz.

@freamon
Copy link
Author

freamon commented Apr 10, 2024

Have done some more testing.

Test 1

Sent a Follow from my server to a community on mander.xyz using a Ruby script.

Script in here
 #!/usr/bin/env ruby

require 'securerandom'
require 'openssl'
require 'http'          # needs 'gem install http'

# change these
my_site                 = "lemmon.website"
my_dir                  = "u"
my_actor                = "freamon"
my_private_key_location = "/home/andrew/keys/#{my_actor}/private.pem"
my_public_key_location  = "https://#{my_site}/#{my_dir}/#{my_actor}"

target_site             = "mander.xyz"
target_dir              = "c"
target_actor            = "printforgood"

uuid = SecureRandom.uuid

json = <<~EOT
{
  "@context": [
    "https://w3id.org/security/v1",
    "https://www.w3.org/ns/activitystreams"
  ],
  "id":"https://#{my_site}/follows/#{uuid}",
  "type":"Follow",
  "actor":"https://#{my_site}/#{my_dir}/#{my_actor}",
  "object":"https://#{target_site}/#{target_dir}/#{target_actor}"
}
EOT

date          = Time.now.utc.httpdate
digest        = Base64.strict_encode64(OpenSSL::Digest.digest('SHA256', json))
digest.prepend("SHA-256=")
keypair       = OpenSSL::PKey::RSA.new(File.read("#{my_private_key_location}"))
signed_string = "(request-target): post /#{target_dir}/#{target_actor}/inbox\ncontent-type: application/activity+json\ndate: #{date}\ndigest: #{digest}\nhost: #{target_site}"
signature     = Base64.strict_encode64(keypair.sign(OpenSSL::Digest::SHA256.new, signed_string))
header        = 'keyId="' + my_public_key_location + '#main-key",algorithm="rsa-sha256",headers="(request-target) content-type date digest host",signature="' + signature + '"'

response = HTTP.headers({ 'Host': target_site, 'User-Agent': 'ActivityPub +https://' + my_site, 'Content-Type': 'application/activity+json', 'Digest': digest, 'Date': date, 'Signature': header })
               .post("https://#{target_site}/#{target_dir}/#{target_actor}/inbox", body: json)

p response        # header
p response.to_s   # body (if any)

Received 3 duplicate Accepts in response.
Nginx log:

ip.address - - [09/Apr/2024:18:30:27 +0000] "POST /inbox HTTP/1.1" 200 0 "-" "Lemmy/0.19.3; +https://mander.xyz"
ip.address - - [09/Apr/2024:18:30:27 +0000] "POST /inbox HTTP/1.1" 200 0 "-" "Lemmy/0.19.3; +https://mander.xyz"
ip.address - - [09/Apr/2024:18:30:27 +0000] "POST /inbox HTTP/1.1" 200 0 "-" "Lemmy/0.19.3; +https://mander.xyz"

My backend server just gives each request a UUID and dumps the bodies into a file:

-rw-r--r-- 1 andrew andrew    475 Apr  9 18:30 activity_from_printforgood_737b341e-54f4-42fe-9bdb-ae89c7f89222.json
-rw-r--r-- 1 andrew andrew    475 Apr  9 18:30 activity_from_printforgood_38b15127-ba42-4b4a-b552-946a6707d2e9.json
-rw-r--r-- 1 andrew andrew    475 Apr  9 18:30 activity_from_printforgood_f8a6f4ed-376c-4ade-9abe-87d9035435fc.json

Each file contains the same Accept JSON.

JSON in here
{
  "@context": [
    "https://join-lemmy.org/context.json",
    "https://www.w3.org/ns/activitystreams"
  ],
  "actor": "https://mander.xyz/c/printforgood",
  "to": [
    "https://lemmon.website/u/freamon"
  ],
  "object": {
    "actor": "https://lemmon.website/u/freamon",
    "to": null,
    "object": "https://mander.xyz/c/printforgood",
    "type": "Follow",
    "id": "https://lemmon.website/follows/194d816b-1599-4587-95ae-d274c1d4209c"
  },
  "type": "Accept",
  "id": "https://mander.xyz/activities/accept/b0f94ef2-f411-4b09-8548-9d81b98b01c7"
}

Test 2

Sent a Follow from a Lemmy instance running inside a VM and tunnelled through to via ngrok.com, to a community on mander.xyz, using the lemmy-ui

Received only 1 Accept in response:

screenshot in here

Lemmy0 19 3 on DESKTOP-2B5PCTI - Virtual Machine Connection 09_04_2024 22_30_39

Test 3

Still on the VM. Extracted the private key for my lemmy user, and sent a Follow to a different community on mander.xyz (that was conveniently stuck at 'Pending'), using the Ruby script from Test 1.

Received 2 Accepts in response, one of which lemmy dutifully rejected

screenshot in here

Lemmy0 19 3 on DESKTOP-2B5PCTI - Virtual Machine Connection 09_04_2024 23_38_03

Test 4

Used the lemmy-ui again to subscribe to a different community on mander.xyz. Also received 2 Accepts in response, one of which lemmy rejected

Test 5

Same as test 2-5, but for communities on lemmy.ml instead. Follows were sent using the lemmy-ui, and the Ruby script, but only 1 Accept was ever sent back

Test 6

Sent a Follow from my server to a community on lemmy.ml using the Ruby script. Received only 1 Accept back in response

Thoughts

I've considered the possibility that me using lemmon.website to experiment with ActivityPub is a factor, and Lemmy instances have more than 1 idea of what the site is, and are sending activity for each version. The argument against this, is that I've interacted way more with lemmy.ml than mander.xyz, and there's no duplications coming from lemmy.ml. Also, when lemmy.world was on 0.18.5, it likewise never sent me dupes. I even tried to insert another record for 'lemmon.website' into the lemmy DB on the VM I was using, and - unsurprisingly - it rejected it for not being unique.

Likewise, the Ruby script I've used - it works without issue for lemmy.ml (and Mastodon instances, and Pixelfed instances, etc), but me using it in Test 3 seemed to be the trigger that tripped mander.xyz up into starting sending me activity twice.

I haven't been able to form anything conclusive from this, but maybe something will stand out to people more familiar with Lemmy's code.

@Nothing4You
Copy link
Contributor

I've seen duplicate activities on Lemmy <-> Lemmy before, it seems unlikely to be related to the software on the receiving side.

@phiresky
Copy link
Collaborator

It would be good to get a reproduction with an instance that someone actually controls because otherwise it's hard to say whether there is a misconfiguration or not and to get the relevant logs / db entries (which are on the sending side)

@phiresky
Copy link
Collaborator

phiresky commented Apr 10, 2024

it seems unlikely to be related to the software on the receiving side.

It might be relevant since in general every actor has their own inbox, and the merging of these inboxes into a single site-wide inbox might not work correctly depending on how other end presents their inboxes. If lemmy sees inboxes as separate then it may send events to multiple inboxes

@Nutomic
Copy link
Member

Nutomic commented Apr 11, 2024

It might be relevant since in general every actor has their own inbox, and the merging of these inboxes into a single site-wide inbox might not work correctly depending on how other end presents their inboxes. If lemmy sees inboxes as separate then it may send events to multiple inboxes

I also thought about that, but based on the logs posted by @freamon, all activities were sent to /inbox. So I dont see any way for deduplication to fail. Also all inbox requests receive response status 200, so it cant be retries due to errors.

I messaged the admin of mander.xyz to help investigate, but havent received a response so far.

@freamon
Copy link
Author

freamon commented Apr 26, 2024

Some good news / bad news for you - lemmy.ml is duplicating activities. I subscribed to asklemmy@lemmy.ml from a test Lemmy instance tunnelled through via ngrok, so I could screenshot the 'inspect' window - you can see a pattern of 200 OK, 400 Bad Request for every activity. I've included two images to demonstrate that they are the same activity.

Lemmy0 19 3 on DESKTOP-2B5PCTI - Virtual Machine Connection 26_04_2024 15_15_59

Lemmy0 19 3 on DESKTOP-2B5PCTI - Virtual Machine Connection 26_04_2024 15_16_24

(I don't imagine it's a config issue for you guys, but LW changed their config to fix the problem when they were doing it)

@jlandahl
Copy link

Note that the duplication has returned: https://lemmy.ml/comment/11010288

Anyone know if lemmy.world is testing that config change again or something?

@Nothing4You
Copy link
Contributor

@freamon brought this up in their matrix chat the other day and the answer was nothing changed on lemmy.world's end

@freamon
Copy link
Author

freamon commented May 14, 2024

@jlandahl - LW had to reset a container, so you shouldn't be getting any more duplicate activity from them. It was the same with lemmy.ml incidentally - a few comments up I was saying that they were duplicating too, but then they reset as part of testing an upgrade to 0.19.4, and that stopped it.


As a Issue that seems to start randomly, and is stopped by 'turning it off and on again', I suspect this will be a hard problem to solve.

I noticed when I was recording the video the other day (of which this is an excerpt), that there was a recurring pattern: 30 seconds of nothing, then a flood of activity, then back to 30 seconds of nothing, etc. I imagine this is by design, and my instance has to wait its turn to get a bunch in one, rather than get activities as they are created. It made me wonder whether 'version 1' of an activity was being generated but not actually sent, just queued up and stuck somewhere. Then Lemmy was generating 'version 2' because it thought the first version wasn't delivered successfully, and then both versions were being sent at the same time.

@MrKaplan-lw
Copy link

Hello,

I'm part of the Lemmy.World infra team.

I'd be happy to help finding the root cause of this issue, but it's currently not clear what information we should be looking for?

We're currently running with the default log level for our federation container and there are no logs even mentioning lemmon.website, except for some unrelated html error pages from a kbin instance.

@Nutomic
Copy link
Member

Nutomic commented May 15, 2024

To fix this we have to narrow down what exactly is causing the duplicate activities. My understanding is that the bug doesnt happen with the default ansible configuration, and affected instances have some different config. Some things worth trying on a test instance:

  • Does the bug get triggered by running multiple Lemmy processes with --disable-activity-sending, --disable-http-server etc?
  • Is the bug random and goes away after restarting Lemmy?
  • Are all activities sent out multiple times, or only specific activity types?

@MrKaplan-lw
Copy link

Does the bug get triggered by running multiple Lemmy processes with --disable-activity-sending, --disable-http-server etc?

We've previously been using multiple federation containers and now we are using a single federation container.
As far as we know this issue has been there both with multiple federation containers and a single federation container.
We're using --disable-http-server --disable-scheduled-tasks for the single container.

Is the bug random and goes away after restarting Lemmy?

It seems to be random. Restarting fixes it according to @freamon's feedback after we restart the container.

Are all activities sent out multiple times, or only specific activity types?

This is probably something @freamon can answer.
As I understand from our matrix chat this affects at least posts, comments, and dislikes, probably votes in general.

@freamon
Copy link
Author

freamon commented May 15, 2024

Yeah - restarting seems to fix it (at least from my perspective).

It's for all activities - anything a remote community might Announce, and - for my one local community - anything a user might send.

(I just verified that last part by upvoting a random post on endlesstalk.org. You can tell how broke that instance is anyway by how out-of-sync it is with votes generally (e.g. compare https://endlesstalk.org/post/34649989 with the fedi-link), but the upvote I gave for a post on !tails@lemmon.website was sent to me a sweet 7 times. There's some info here about his container setup, with a comment that also suggests that a restart fixes it.)

@Nutomic
Copy link
Member

Nutomic commented May 20, 2024

I added some extra logging in #4726 to figure out where the problem is coming from. Once that is merged and released, run Lemmy with RUST_LOG="warn,lemmy_server=debug or RUST_LOG="warn,lemmy_server=trace (preferably with a separate process only for federation). Then see if any of these log lines are printed more than once, and report them here.

dessalines pushed a commit that referenced this issue May 21, 2024
* Extra logging to debug duplicate activities (ref #4609)

* Fix logging for api tests

* fmt
@MrKaplan-lw
Copy link

We also noticed some very strange behavior where it seems that our outbound federation progress for some instances seems to be jumping between two very different states:

federation log
2024-05-25T15:31:52.882129Z INFO lemmy_federate: lemmy.nz: Warning. 156026 behind, 4 consecutive fails, current retry delay 16.00s
2024-05-25T15:31:56.780994Z INFO lemmy_federate: lemmy.nz: Warning. 564823 behind, 1 consecutive fails, current retry delay 2.00s
2024-05-25T15:32:00.335359Z INFO lemmy_federate: lemmy.nz: Warning. 149781 behind, 2 consecutive fails, current retry delay 4.00s
2024-05-25T15:32:52.881611Z INFO lemmy_federate: lemmy.nz: Warning. 155871 behind, 2 consecutive fails, current retry delay 4.00s
2024-05-25T15:32:56.780767Z INFO lemmy_federate: lemmy.nz: Warning. 564804 behind, 2 consecutive fails, current retry delay 4.00s
2024-05-25T15:33:00.335156Z INFO lemmy_federate: lemmy.nz: Warning. 149716 behind, 1 consecutive fails, current retry delay 2.00s
2024-05-25T15:33:52.883808Z INFO lemmy_federate: lemmy.nz: Warning. 155939 behind, 2 consecutive fails, current retry delay 4.00s
2024-05-25T15:33:56.780301Z INFO lemmy_federate: lemmy.nz: Warning. 564828 behind, 2 consecutive fails, current retry delay 4.00s
2024-05-25T15:34:00.335028Z INFO lemmy_federate: lemmy.nz: Warning. 149798 behind, 2 consecutive fails, current retry delay 4.00s
2024-05-25T15:34:52.882518Z INFO lemmy_federate: lemmy.nz: Warning. 155945 behind, 2 consecutive fails, current retry delay 4.00s
2024-05-25T15:34:56.780648Z INFO lemmy_federate: lemmy.nz: Warning. 564812 behind, 2 consecutive fails, current retry delay 4.00s
2024-05-25T15:35:00.335200Z INFO lemmy_federate: lemmy.nz: Warning. 149750 behind, 2 consecutive fails, current retry delay 4.00s
2024-05-25T15:35:52.881500Z INFO lemmy_federate: lemmy.nz: Warning. 156004 behind, 1 consecutive fails, current retry delay 2.00s
2024-05-25T15:35:56.781378Z INFO lemmy_federate: lemmy.nz: Warning. 564856 behind, 2 consecutive fails, current retry delay 4.00s
2024-05-25T15:36:00.334935Z INFO lemmy_federate: lemmy.nz: Warning. 149852 behind, 3 consecutive fails, current retry delay 8.00s
2024-05-25T15:36:52.881748Z INFO lemmy_federate: lemmy.nz: Warning. 156025 behind, 2 consecutive fails, current retry delay 4.00s
2024-05-25T15:36:56.780399Z INFO lemmy_federate: lemmy.nz: Warning. 564890 behind, 2 consecutive fails, current retry delay 4.00s
2024-05-25T15:37:00.335461Z INFO lemmy_federate: lemmy.nz: Warning. 149791 behind, 2 consecutive fails, current retry delay 4.00s
2024-05-25T15:37:52.881624Z INFO lemmy_federate: lemmy.nz: Warning. 156111 behind, 2 consecutive fails, current retry delay 4.00s
2024-05-25T15:37:56.780952Z INFO lemmy_federate: lemmy.nz: Warning. 564939 behind, 1 consecutive fails, current retry delay 2.00s
2024-05-25T15:38:00.335711Z INFO lemmy_federate: lemmy.nz: Warning. 149867 behind, 2 consecutive fails, current retry delay 4.00s
2024-05-25T15:38:52.881694Z INFO lemmy_federate: lemmy.nz: Warning. 156129 behind, 2 consecutive fails, current retry delay 4.00s
2024-05-25T15:38:56.781616Z INFO lemmy_federate: lemmy.nz: Warning. 564892 behind, 2 consecutive fails, current retry delay 4.00s
2024-05-25T15:39:00.334975Z INFO lemmy_federate: lemmy.nz: Warning. 149827 behind, 2 consecutive fails, current retry delay 4.00s
2024-05-25T15:39:52.881675Z INFO lemmy_federate: lemmy.nz: Warning. 155952 behind, 1 consecutive fails, current retry delay 2.00s
2024-05-25T15:39:56.780145Z INFO lemmy_federate: lemmy.nz: Warning. 564766 behind, 2 consecutive fails, current retry delay 4.00s
2024-05-25T15:40:00.335165Z INFO lemmy_federate: lemmy.nz: Warning. 149625 behind, 2 consecutive fails, current retry delay 4.00s
2024-05-25T15:40:52.882508Z INFO lemmy_federate: lemmy.nz: Warning. 155967 behind, 2 consecutive fails, current retry delay 4.00s
2024-05-25T15:40:56.780187Z INFO lemmy_federate: lemmy.nz: Warning. 564716 behind, 1 consecutive fails, current retry delay 2.00s
2024-05-25T15:41:00.335531Z INFO lemmy_federate: lemmy.nz: Warning. 149620 behind, 2 consecutive fails, current retry delay 4.00s
2024-05-25T15:41:52.883130Z INFO lemmy_federate: lemmy.nz: Warning. 155955 behind, 2 consecutive fails, current retry delay 4.00s
2024-05-25T15:41:56.780292Z INFO lemmy_federate: lemmy.nz: Warning. 564653 behind, 1 consecutive fails, current retry delay 2.00s
2024-05-25T15:42:00.335289Z INFO lemmy_federate: lemmy.nz: Warning. 149542 behind, 2 consecutive fails, current retry delay 4.00s
2024-05-25T15:42:52.881806Z INFO lemmy_federate: lemmy.nz: Warning. 155895 behind, 2 consecutive fails, current retry delay 4.00s
2024-05-25T15:42:56.781834Z INFO lemmy_federate: lemmy.nz: Warning. 564604 behind, 2 consecutive fails, current retry delay 4.00s
2024-05-25T15:43:00.334984Z INFO lemmy_federate: lemmy.nz: Warning. 149410 behind, 1 consecutive fails, current retry delay 2.00s
2024-05-25T15:43:52.882361Z INFO lemmy_federate: lemmy.nz: Warning. 155894 behind, 3 consecutive fails, current retry delay 8.00s
2024-05-25T15:43:56.780914Z INFO lemmy_federate: lemmy.nz: Warning. 564573 behind, 2 consecutive fails, current retry delay 4.00s
2024-05-25T15:44:00.335214Z INFO lemmy_federate: lemmy.nz: Warning. 149412 behind, 2 consecutive fails, current retry delay 4.00s
2024-05-25T15:44:52.882009Z INFO lemmy_federate: lemmy.nz: Warning. 155767 behind, 1 consecutive fails, current retry delay 2.00s
2024-05-25T15:44:56.781584Z INFO lemmy_federate: lemmy.nz: Warning. 564504 behind, 2 consecutive fails, current retry delay 4.00s
2024-05-25T15:45:00.335169Z INFO lemmy_federate: lemmy.nz: Warning. 149339 behind, 2 consecutive fails, current retry delay 4.00s
2024-05-25T15:45:52.881760Z INFO lemmy_federate: lemmy.nz: Warning. 155728 behind, 2 consecutive fails, current retry delay 4.00s
2024-05-25T15:45:56.781597Z INFO lemmy_federate: lemmy.nz: Warning. 564471 behind, 2 consecutive fails, current retry delay 4.00s
2024-05-25T15:46:00.335559Z INFO lemmy_federate: lemmy.nz: Warning. 149311 behind, 2 consecutive fails, current retry delay 4.00s
2024-05-25T15:46:52.881645Z INFO lemmy_federate: lemmy.nz: Warning. 155852 behind, 3 consecutive fails, current retry delay 8.00s
2024-05-25T15:46:56.780087Z INFO lemmy_federate: lemmy.nz: Warning. 564589 behind, 3 consecutive fails, current retry delay 8.00s
2024-05-25T15:47:00.335297Z INFO lemmy_federate: lemmy.nz: Warning. 149374 behind, 2 consecutive fails, current retry delay 4.00s
2024-05-25T15:47:52.883753Z INFO lemmy_federate: lemmy.nz: Warning. 155865 behind, 2 consecutive fails, current retry delay 4.00s
2024-05-25T15:47:56.780058Z INFO lemmy_federate: lemmy.nz: Warning. 564560 behind, 2 consecutive fails, current retry delay 4.00s
2024-05-25T15:48:00.334942Z INFO lemmy_federate: lemmy.nz: Warning. 149431 behind, 3 consecutive fails, current retry delay 8.00s
2024-05-25T15:48:52.881672Z INFO lemmy_federate: lemmy.nz: Warning. 155879 behind, 2 consecutive fails, current retry delay 4.00s
2024-05-25T15:48:56.780275Z INFO lemmy_federate: lemmy.nz: Warning. 564533 behind, 1 consecutive fails, current retry delay 2.00s
2024-05-25T15:49:00.335882Z INFO lemmy_federate: lemmy.nz: Warning. 149430 behind, 2 consecutive fails, current retry delay 4.00s
2024-05-25T15:49:52.882028Z INFO lemmy_federate: lemmy.nz: Warning. 155808 behind, 2 consecutive fails, current retry delay 4.00s
2024-05-25T15:49:56.780165Z INFO lemmy_federate: lemmy.nz: Warning. 564538 behind, 2 consecutive fails, current retry delay 4.00s
2024-05-25T15:50:00.335082Z INFO lemmy_federate: lemmy.nz: Warning. 149400 behind, 2 consecutive fails, current retry delay 4.00s
2024-05-25T15:50:52.882606Z INFO lemmy_federate: lemmy.nz: Warning. 155703 behind, 1 consecutive fails, current retry delay 2.00s
2024-05-25T15:50:56.781114Z INFO lemmy_federate: lemmy.nz: Warning. 564408 behind, 2 consecutive fails, current retry delay 4.00s
2024-05-25T15:51:00.335224Z INFO lemmy_federate: lemmy.nz: Warning. 149327 behind, 1 consecutive fails, current retry delay 2.00s
2024-05-25T15:51:52.882065Z INFO lemmy_federate: lemmy.nz: Warning. 155719 behind, 2 consecutive fails, current retry delay 4.00s
2024-05-25T15:51:56.780093Z INFO lemmy_federate: lemmy.nz: Warning. 564418 behind, 2 consecutive fails, current retry delay 4.00s
2024-05-25T15:52:00.335032Z INFO lemmy_federate: lemmy.nz: Warning. 149350 behind, 2 consecutive fails, current retry delay 4.00s
2024-05-25T15:52:52.881588Z INFO lemmy_federate: lemmy.nz: Warning. 155673 behind, 2 consecutive fails, current retry delay 4.00s
2024-05-25T15:52:56.780547Z INFO lemmy_federate: lemmy.nz: Warning. 564313 behind, 1 consecutive fails, current retry delay 2.00s
2024-05-25T15:53:00.334959Z INFO lemmy_federate: lemmy.nz: Warning. 149330 behind, 2 consecutive fails, current retry delay 4.00s
2024-05-25T15:53:52.882071Z INFO lemmy_federate: lemmy.nz: Warning. 155679 behind, 1 consecutive fails, current retry delay 2.00s
2024-05-25T15:53:56.781345Z INFO lemmy_federate: lemmy.nz: Warning. 564351 behind, 2 consecutive fails, current retry delay 4.00s
2024-05-25T15:54:00.335194Z INFO lemmy_federate: lemmy.nz: Warning. 149335 behind, 1 consecutive fails, current retry delay 2.00s
2024-05-25T15:54:52.882001Z INFO lemmy_federate: lemmy.nz: Warning. 155641 behind, 2 consecutive fails, current retry delay 4.00s
2024-05-25T15:54:56.781260Z INFO lemmy_federate: lemmy.nz: Warning. 564330 behind, 2 consecutive fails, current retry delay 4.00s
2024-05-25T15:55:00.335239Z INFO lemmy_federate: lemmy.nz: Warning. 149371 behind, 2 consecutive fails, current retry delay 4.00s
2024-05-25T15:55:52.882236Z INFO lemmy_federate: lemmy.nz: Warning. 155769 behind, 3 consecutive fails, current retry delay 8.00s
2024-05-25T15:55:56.780505Z INFO lemmy_federate: lemmy.nz: Warning. 564346 behind, 2 consecutive fails, current retry delay 4.00s
2024-05-25T15:56:00.335258Z INFO lemmy_federate: lemmy.nz: Warning. 149468 behind, 2 consecutive fails, current retry delay 4.00s
2024-05-25T15:56:52.882039Z INFO lemmy_federate: lemmy.nz: Warning. 155710 behind, 2 consecutive fails, current retry delay 4.00s
2024-05-25T15:56:56.780091Z INFO lemmy_federate: lemmy.nz: Warning. 564359 behind, 2 consecutive fails, current retry delay 4.00s
2024-05-25T15:57:00.335538Z INFO lemmy_federate: lemmy.nz: Warning. 149504 behind, 2 consecutive fails, current retry delay 4.00s
2024-05-25T15:57:52.881600Z INFO lemmy_federate: lemmy.nz: Warning. 155666 behind, 2 consecutive fails, current retry delay 4.00s
2024-05-25T15:57:56.780240Z INFO lemmy_federate: lemmy.nz: Warning. 564309 behind, 1 consecutive fails, current retry delay 2.00s
2024-05-25T15:58:00.335040Z INFO lemmy_federate: lemmy.nz: Warning. 149524 behind, 2 consecutive fails, current retry delay 4.00s
2024-05-25T15:58:52.885354Z INFO lemmy_federate: lemmy.nz: Warning. 155746 behind, 2 consecutive fails, current retry delay 4.00s
2024-05-25T15:58:56.781194Z INFO lemmy_federate: lemmy.nz: Warning. 564404 behind, 2 consecutive fails, current retry delay 4.00s
2024-05-25T15:59:00.334807Z INFO lemmy_federate: lemmy.nz: Warning. 149561 behind, 1 consecutive fails, current retry delay 2.00s
2024-05-25T15:59:52.881718Z INFO lemmy_federate: lemmy.nz: Warning. 155729 behind, 2 consecutive fails, current retry delay 4.00s
2024-05-25T15:59:56.781862Z INFO lemmy_federate: lemmy.nz: Warning. 564304 behind, 2 consecutive fails, current retry delay 4.00s
2024-05-25T16:00:00.334953Z INFO lemmy_federate: lemmy.nz: Warning. 149601 behind, 2 consecutive fails, current retry delay 4.00s
2024-05-25T16:00:52.882702Z INFO lemmy_federate: lemmy.nz: Warning. 155812 behind, 1 consecutive fails, current retry delay 2.00s
2024-05-25T16:00:56.780182Z INFO lemmy_federate: lemmy.nz: Warning. 564395 behind, 2 consecutive fails, current retry delay 4.00s
2024-05-25T16:01:00.335445Z INFO lemmy_federate: lemmy.nz: Warning. 149689 behind, 1 consecutive fails, current retry delay 2.00s
2024-05-25T16:01:52.882490Z INFO lemmy_federate: lemmy.nz: Warning. 155965 behind, 4 consecutive fails, current retry delay 16.00s
2024-05-25T16:01:56.780590Z INFO lemmy_federate: lemmy.nz: Warning. 564496 behind, 4 consecutive fails, current retry delay 16.00s
2024-05-25T16:02:00.335083Z INFO lemmy_federate: lemmy.nz: Warning. 149887 behind, 4 consecutive fails, current retry delay 16.00s
2024-05-25T16:02:52.881696Z INFO lemmy_federate: lemmy.nz: Warning. 155999 behind, 2 consecutive fails, current retry delay 4.00s
2024-05-25T16:02:56.780658Z INFO lemmy_federate: lemmy.nz: Warning. 564526 behind, 2 consecutive fails, current retry delay 4.00s
2024-05-25T16:03:00.335131Z INFO lemmy_federate: lemmy.nz: Warning. 149913 behind, 2 consecutive fails, current retry delay 4.00s
2024-05-25T16:03:52.883922Z INFO lemmy_federate: lemmy.nz: Warning. 156010 behind, 2 consecutive fails, current retry delay 4.00s
2024-05-25T16:03:56.780501Z INFO lemmy_federate: lemmy.nz: Warning. 564435 behind, 2 consecutive fails, current retry delay 4.00s
2024-05-25T16:04:00.335047Z INFO lemmy_federate: lemmy.nz: Warning. 149915 behind, 2 consecutive fails, current retry delay 4.00s
2024-05-25T16:04:52.881784Z INFO lemmy_federate: lemmy.nz: Warning. 156011 behind, 2 consecutive fails, current retry delay 4.00s
2024-05-25T16:04:56.781995Z INFO lemmy_federate: lemmy.nz: Warning. 564417 behind, 1 consecutive fails, current retry delay 2.00s
2024-05-25T16:05:00.335115Z INFO lemmy_federate: lemmy.nz: Warning. 149911 behind, 2 consecutive fails, current retry delay 4.00s
2024-05-25T16:05:52.883636Z INFO lemmy_federate: lemmy.nz: Warning. 155943 behind, 2 consecutive fails, current retry delay 4.00s
2024-05-25T16:05:56.780858Z INFO lemmy_federate: lemmy.nz: Warning. 564338 behind, 1 consecutive fails, current retry delay 2.00s
2024-05-25T16:06:00.335005Z INFO lemmy_federate: lemmy.nz: Warning. 149891 behind, 2 consecutive fails, current retry delay 4.00s
2024-05-25T16:06:52.881973Z INFO lemmy_federate: lemmy.nz: Warning. 155941 behind, 2 consecutive fails, current retry delay 4.00s
2024-05-25T16:06:56.780269Z INFO lemmy_federate: lemmy.nz: Warning. 564247 behind, 1 consecutive fails, current retry delay 2.00s
2024-05-25T16:07:00.335326Z INFO lemmy_federate: lemmy.nz: Warning. 149898 behind, 2 consecutive fails, current retry delay 4.00s
2024-05-25T16:07:52.882361Z INFO lemmy_federate: lemmy.nz: Warning. 155863 behind, 2 consecutive fails, current retry delay 4.00s
2024-05-25T16:07:56.780432Z INFO lemmy_federate: lemmy.nz: Warning. 564138 behind, 1 consecutive fails, current retry delay 2.00s
2024-05-25T16:08:00.335105Z INFO lemmy_federate: lemmy.nz: Warning. 149847 behind, 2 consecutive fails, current retry delay 4.00s
2024-05-25T16:08:52.881978Z INFO lemmy_federate: lemmy.nz: Warning. 155772 behind, 1 consecutive fails, current retry delay 2.00s
2024-05-25T16:08:56.781183Z INFO lemmy_federate: lemmy.nz: Warning. 564063 behind, 2 consecutive fails, current retry delay 4.00s
2024-05-25T16:09:00.334927Z INFO lemmy_federate: lemmy.nz: Warning. 149813 behind, 1 consecutive fails, current retry delay 2.00s
2024-05-25T16:09:52.881944Z INFO lemmy_federate: lemmy.nz: Warning. 155863 behind, 3 consecutive fails, current retry delay 8.00s
2024-05-25T16:09:56.780603Z INFO lemmy_federate: lemmy.nz: Warning. 564140 behind, 3 consecutive fails, current retry delay 8.00s
2024-05-25T16:10:00.335016Z INFO lemmy_federate: lemmy.nz: Warning. 149867 behind, 1 consecutive fails, current retry delay 2.00s
2024-05-25T16:10:52.882023Z INFO lemmy_federate: lemmy.nz: Warning. 155800 behind, 1 consecutive fails, current retry delay 2.00s
2024-05-25T16:10:56.780240Z INFO lemmy_federate: lemmy.nz: Warning. 564027 behind, 2 consecutive fails, current retry delay 4.00s
2024-05-25T16:11:00.335042Z INFO lemmy_federate: lemmy.nz: Warning. 149834 behind, 1 consecutive fails, current retry delay 2.00s
2024-05-25T16:11:52.881899Z INFO lemmy_federate: lemmy.nz: Warning. 155847 behind, 1 consecutive fails, current retry delay 2.00s
2024-05-25T16:11:56.780159Z INFO lemmy_federate: lemmy.nz: Warning. 563969 behind, 2 consecutive fails, current retry delay 4.00s
2024-05-25T16:12:00.335978Z INFO lemmy_federate: lemmy.nz: Warning. 149864 behind, 3 consecutive fails, current retry delay 8.00s
2024-05-25T16:12:52.884165Z INFO lemmy_federate: lemmy.nz: Warning. 155825 behind, 3 consecutive fails, current retry delay 8.00s
2024-05-25T16:12:56.780382Z INFO lemmy_federate: lemmy.nz: Warning. 563987 behind, 3 consecutive fails, current retry delay 8.00s
2024-05-25T16:13:00.335219Z INFO lemmy_federate: lemmy.nz: Warning. 149723 behind, 1 consecutive fails, current retry delay 2.00s
2024-05-25T16:13:52.883741Z INFO lemmy_federate: lemmy.nz: Warning. 155788 behind, 3 consecutive fails, current retry delay 8.00s
2024-05-25T16:13:56.780351Z INFO lemmy_federate: lemmy.nz: Warning. 563928 behind, 3 consecutive fails, current retry delay 8.00s
2024-05-25T16:14:00.335126Z INFO lemmy_federate: lemmy.nz: Warning. 149562 behind, 1 consecutive fails, current retry delay 2.00s
2024-05-25T16:14:52.881963Z INFO lemmy_federate: lemmy.nz: Warning. 155814 behind, 3 consecutive fails, current retry delay 8.00s
2024-05-25T16:14:56.780643Z INFO lemmy_federate: lemmy.nz: Warning. 563932 behind, 3 consecutive fails, current retry delay 8.00s
2024-05-25T16:15:00.335169Z INFO lemmy_federate: lemmy.nz: Warning. 149579 behind, 3 consecutive fails, current retry delay 8.00s
2024-05-25T16:15:52.882822Z INFO lemmy_federate: lemmy.nz: Warning. 155768 behind, 2 consecutive fails, current retry delay 4.00s
2024-05-25T16:15:56.780748Z INFO lemmy_federate: lemmy.nz: Warning. 563828 behind, 1 consecutive fails, current retry delay 2.00s
2024-05-25T16:16:00.335500Z INFO lemmy_federate: lemmy.nz: Warning. 149248 behind, 2 consecutive fails, current retry delay 4.00s
2024-05-25T16:16:52.883395Z INFO lemmy_federate: lemmy.nz: Warning. 155733 behind, 1 consecutive fails, current retry delay 2.00s
2024-05-25T16:16:56.780155Z INFO lemmy_federate: lemmy.nz: Warning. 563810 behind, 2 consecutive fails, current retry delay 4.00s
2024-05-25T16:17:00.335150Z INFO lemmy_federate: lemmy.nz: Warning. 149014 behind, 1 consecutive fails, current retry delay 2.00s
2024-05-25T16:17:52.883271Z INFO lemmy_federate: lemmy.nz: Warning. 155766 behind, 2 consecutive fails, current retry delay 4.00s
2024-05-25T16:17:56.780207Z INFO lemmy_federate: lemmy.nz: Warning. 563781 behind, 1 consecutive fails, current retry delay 2.00s
2024-05-25T16:18:00.334957Z INFO lemmy_federate: lemmy.nz: Warning. 148902 behind, 2 consecutive fails, current retry delay 4.00s
2024-05-25T16:18:52.881679Z INFO lemmy_federate: lemmy.nz: Warning. 155772 behind, 2 consecutive fails, current retry delay 4.00s
2024-05-25T16:18:56.780282Z INFO lemmy_federate: lemmy.nz: Warning. 563714 behind, 2 consecutive fails, current retry delay 4.00s
2024-05-25T16:19:00.335354Z INFO lemmy_federate: lemmy.nz: Warning. 148870 behind, 2 consecutive fails, current retry delay 4.00s
2024-05-25T16:19:52.881869Z INFO lemmy_federate: lemmy.nz: Warning. 155716 behind, 2 consecutive fails, current retry delay 4.00s
2024-05-25T16:19:56.780783Z INFO lemmy_federate: lemmy.nz: Warning. 563650 behind, 1 consecutive fails, current retry delay 2.00s
2024-05-25T16:20:00.335180Z INFO lemmy_federate: lemmy.nz: Warning. 148929 behind, 2 consecutive fails, current retry delay 4.00s
2024-05-25T16:20:52.883264Z INFO lemmy_federate: lemmy.nz: Warning. 155697 behind, 1 consecutive fails, current retry delay 2.00s
2024-05-25T16:20:56.780797Z INFO lemmy_federate: lemmy.nz: Warning. 563601 behind, 2 consecutive fails, current retry delay 4.00s
2024-05-25T16:21:00.335320Z INFO lemmy_federate: lemmy.nz: Warning. 148887 behind, 1 consecutive fails, current retry delay 2.00s
2024-05-25T16:21:52.881857Z INFO lemmy_federate: lemmy.nz: Warning. 155707 behind, 1 consecutive fails, current retry delay 2.00s
2024-05-25T16:21:56.780233Z INFO lemmy_federate: lemmy.nz: Warning. 563549 behind, 2 consecutive fails, current retry delay 4.00s
2024-05-25T16:22:00.335090Z INFO lemmy_federate: lemmy.nz: Warning. 148902 behind, 1 consecutive fails, current retry delay 2.00s
2024-05-25T16:22:52.881898Z INFO lemmy_federate: lemmy.nz: Warning. 155706 behind, 2 consecutive fails, current retry delay 4.00s
2024-05-25T16:22:56.781176Z INFO lemmy_federate: lemmy.nz: Warning. 563420 behind, 1 consecutive fails, current retry delay 2.00s
2024-05-25T16:23:00.335423Z INFO lemmy_federate: lemmy.nz: Warning. 148870 behind, 2 consecutive fails, current retry delay 4.00s
2024-05-25T16:23:52.882278Z INFO lemmy_federate: lemmy.nz: Warning. 155670 behind, 2 consecutive fails, current retry delay 4.00s
2024-05-25T16:23:56.780164Z INFO lemmy_federate: lemmy.nz: Warning. 563392 behind, 1 consecutive fails, current retry delay 2.00s
2024-05-25T16:24:00.335070Z INFO lemmy_federate: lemmy.nz: Warning. 148847 behind, 2 consecutive fails, current retry delay 4.00s
2024-05-25T16:24:52.881769Z INFO lemmy_federate: lemmy.nz: Warning. 155735 behind, 2 consecutive fails, current retry delay 4.00s
2024-05-25T16:24:56.781300Z INFO lemmy_federate: lemmy.nz: Warning. 563362 behind, 1 consecutive fails, current retry delay 2.00s
2024-05-25T16:25:00.335496Z INFO lemmy_federate: lemmy.nz: Warning. 148834 behind, 2 consecutive fails, current retry delay 4.00s
2024-05-25T16:25:52.882037Z INFO lemmy_federate: lemmy.nz: Warning. 155687 behind, 2 consecutive fails, current retry delay 4.00s
2024-05-25T16:25:56.780068Z INFO lemmy_federate: lemmy.nz: Warning. 563321 behind, 1 consecutive fails, current retry delay 2.00s
2024-05-25T16:26:00.335124Z INFO lemmy_federate: lemmy.nz: Warning. 148788 behind, 2 consecutive fails, current retry delay 4.00s
2024-05-25T16:26:52.883473Z INFO lemmy_federate: lemmy.nz: Warning. 155626 behind, 2 consecutive fails, current retry delay 4.00s
2024-05-25T16:26:56.781585Z INFO lemmy_federate: lemmy.nz: Warning. 563268 behind, 2 consecutive fails, current retry delay 4.00s
2024-05-25T16:27:00.335090Z INFO lemmy_federate: lemmy.nz: Warning. 148723 behind, 2 consecutive fails, current retry delay 4.00s
2024-05-25T16:27:52.881616Z INFO lemmy_federate: lemmy.nz: Warning. 155513 behind, 2 consecutive fails, current retry delay 4.00s
2024-05-25T16:27:56.780796Z INFO lemmy_federate: lemmy.nz: Warning. 563209 behind, 2 consecutive fails, current retry delay 4.00s
2024-05-25T16:28:00.334881Z INFO lemmy_federate: lemmy.nz: Warning. 148780 behind, 2 consecutive fails, current retry delay 4.00s
2024-05-25T16:28:52.884088Z INFO lemmy_federate: lemmy.nz: Warning. 155451 behind, 3 consecutive fails, current retry delay 8.00s
2024-05-25T16:28:56.780349Z INFO lemmy_federate: lemmy.nz: Warning. 563240 behind, 3 consecutive fails, current retry delay 8.00s
2024-05-25T16:29:00.335100Z INFO lemmy_federate: lemmy.nz: Warning. 148780 behind, 2 consecutive fails, current retry delay 4.00s
2024-05-25T16:29:52.882238Z INFO lemmy_federate: lemmy.nz: Warning. 155206 behind, 2 consecutive fails, current retry delay 4.00s
2024-05-25T16:29:56.780417Z INFO lemmy_federate: lemmy.nz: Warning. 563131 behind, 2 consecutive fails, current retry delay 4.00s
2024-05-25T16:30:00.335219Z INFO lemmy_federate: lemmy.nz: Warning. 148810 behind, 2 consecutive fails, current retry delay 4.00s

This can also be observed when watching https://phiresky.github.io/lemmy-federation-state/site?domain=lemmy.world or dashboards from grafana.lem.rocks.
As our highest activity ids are increasing in a stable manner and not jumping around, this seems like something is messing up the federation_queue_state table, which could be an additional worker thread with invalid state?

MrKaplan-lw pushed a commit to Fedihosting-Foundation-Forks/lemmy that referenced this issue May 26, 2024
…myNet#4726)

* Extra logging to debug duplicate activities (ref LemmyNet#4609)

* Fix logging for api tests

* fmt

This is cherry-picked from 6b46a70
LemmyNet@6b46a70
LemmyNet#4726
MrKaplan-lw pushed a commit to Fedihosting-Foundation-Forks/lemmy that referenced this issue May 26, 2024
…myNet#4726)

* Extra logging to debug duplicate activities (ref LemmyNet#4609)

* Fix logging for api tests

* fmt

This is cherry-picked from 6b46a70
LemmyNet@6b46a70
LemmyNet#4726
@Nutomic
Copy link
Member

Nutomic commented May 27, 2024

@MrKaplan-lw Yes that definitely looks like there is more than one worker active. So far its not clear where exactly in the code this is caused, but maybe my changes in #4733 and further testing/refactoring will help.

Does this jumping between different states happen only for a single remote instance at a time, or are multiple/all of them affected at once?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: federation support federation via activitypub bug Something isn't working
Projects
None yet
Development

No branches or pull requests

6 participants