debugging journal
READING ORDER: top down!!!
current issue, relay errors on new post
though the posts do appear on frontend after a reload, but it seems it's shelling out to pds on getProfileFeed?
relay:
2024-11-14T22:40:58.161-0300 DEBUG bgs bgs/fedmgr.go:539 got remote repo event {"pdsHost": "pds.gsky.ln4.net", "repo": "did:plc:dovi3rnfyclbl4qlma4s4nnb", "seq": 21}
2024-11-14T22:40:58.161-0300 DEBUG bgs bgs/bgs.go:821 bgs got repo append event {"seq": 21, "pdsHost": "pds.gsky.ln4.net", "repo": "did:plc:dovi3rnfyclbl4qlma4s4nnb"}
2024-11-14T22:40:58.162-0300 DEBUG repomgr repomgr/repomgr.go:536 HandleExternalUserEvent {"pds": 1, "uid": 3, "since": "3laxafaphds2n", "nrev": "3laxaocq2tk2n"}
2024-11-14T22:40:58.182-0300 DEBUG indexer indexer/indexer.go:87 Handling Repo Event! {"uid": 3}
2024-11-14T22:40:58.182-0300 DEBUG indexer indexer/indexer.go:482 record create event {"collection": "app.bsky.feed.post"}
2024-11-14T22:40:58.182-0300 ERROR indexer indexer/indexer.go:99 failed to handle repo op {"err": "handle recordCreate: unrecognized record type (creation): app.bsky.feed.post"}
2024-11-14T22:40:58.183-0300 DEBUG indexer indexer/indexer.go:116 Sending event {"did": "did:plc:dovi3rnfyclbl4qlma4s4nnb"}
its so weird that it'd fail on something that it knows in the switch case..
switch rec := op.Record.(type) { case *bsky.FeedPost: if err := ix.handleRecordCreateFeedPost(ctx, evt.User, op.Rkey, *op.RecCid, rec); err != nil { return nil, err }
added some more debugging and it's nil wtf
2024-11-14T22:46:37.647-0300 ERROR indexer indexer/indexer.go:100 failed to handle repo op {"err": "handle recordCreate: unrecognized record type (creation): app.bsky.feed.post (actually of type %!s(<nil>), record=<nil>)"}
weird weird weird!!!
feedgen shenanigans part 0 #
the Following feed has my own test user's post, but errors out because of the unable to find feed
error since i don't have a feedgen, i think that's going to be my focus next
feedgen shenanigans part 1 #
using jaz's golang feedgen https://github.com/ericvolp12/go-bsky-feed-generator
i was able to spin something up that could sorta reproduce the followers feed here https://github.com/lun-4/atproto/tree/luna.gluesky/luna/feedgen2
still wip, currently learning how to link it all together in the appview
feedgen shenanigans part 2 #
configured a feedgen. took a bit of a woozy because there's url validation on the responses given by appview, and since i didn't configure CDN url it generated an invalid feedgen url (undefined/img/avatar/did:plc..../
). i had to create a small shim that extracts ImageProcessingServer into its own configurable process because it seems that the appview default logic (which is to spin its own image processing server) is just broken. maybe. idk. got something that works and looks more and more like real production bsky. i shouldn't have tested the feedgen with an avatar lmao
feedgen soruce code for Followers feed
- https://github.com/lun-4/atproto/tree/luna.gluesky/luna/feedgen2
- main code for followers logic in https://github.com/lun-4/atproto/blob/luna.gluesky/luna/feedgen2/pkg/feeds/luna/firehose.go
- syncs from firehose at cursor=0 and stores all follow relationships and post at-urls in sqlite
- this is done so that i don't need to create a dependency on the dataplane
notes for upstreaming:
- the cdn shim requires changes to which types are exported out of the bsky package
goat
was modified so that its Default vars can be overriden by env var.- so that i can override to my did:plc server without having to patch source code
- would be welcome to PR that to indigo very soon. sounds very useful esp. in a future beyond plc.directory
haven't setup jetstream or ozone over the weekend, but i want to. after that is burning this all down and redoing everything with proper public documented steps
started upstreaming at least One(tm) patch: let ATP_PLC_HOST override default plc host <a href="/wiki/_/tags/823.html">#823</a>
https://github.com/bluesky-social/indigo/pull/823
ozone yipee #
got ozone running, no patches needed. tough luck if you typo the OZONE_PUBLIC_URL
var tho. account seems to remain broken, might fix itself if i edit the plc record manually, but i cba'd to do it, spun up second account instead
also got pdsls running with minimal patches needed so i can also debug records easily (thx @futanari.tentacle.expert)
- not in gluesky repo since it's not really env vars that i set but patches to frontend source code, but search for
plc.directory
andbsky
and you'll get the places to patch
soon: jetstream! then burning all of this down and spinning it back up with step-by-step documents.
jet streams #
easy at first
$ ws 'ws://localhost:6008/subscribe'
< {"did":"did:plc:dovi3rnfyclbl4qlma4s4nnb","time_us":1732230103181678,"kind":"commit","commit":{"rev":"3lbikzync2c2l","operation":"create","collection":"app.bsky.feed.post","rkey":"3lbikzyl4pk2k","record":{"$type":"app.bsky.feed.post","createdAt":"2024-11-21T23:01:42.158Z","langs":["en"],"text":"test123"},"cid":"bafyreibed4cfra5a66xbc24af44xqpv6vwyb4bgeijsagfpjfsvxaywjlm"}}
...well, save for this:
{"time":"2024-11-21T20:10:54.194324843-03:00","level":"ERROR","msg":"no new events in last 15s, shutting down for docker to restart me","source":"liveness_checker","seq":46}
so, uh
export JETSTREAM_LIVENESS_TTL=9000000000s
lol, lmao, etc
soon: spin everything again while writing step-by-step docs so that i know what to upstream later