bluesky-social / indigo

Go source code for Bluesky's atproto services.
https://atproto.com
Apache License 2.0
913 stars 119 forks source link

Can't migrate via goat, possibly because I'm an idiot #787

Open waferbaby opened 3 weeks ago

waferbaby commented 3 weeks ago

Hi friends! I'm trying to migrate to my own hosted PDS, which is up and running nicely (yay!). I'm trying to follow Bryan's guide to migrate via goat, but I'm running into an issue where:

I scrubbed through existing/closed issues and the guide, and I cannot for the life of me work out what I'm missing. Help? 😅

haileyok commented 3 weeks ago

@bnewbold

bnewbold commented 3 weeks ago

hrm, the basic account login should not usually require an email token. do you have "email 2FA" enabled for your account? is your account email verified?

I may not have tested this flow when the "email 2FA" flag is set. You might be able to disable that and try again? If that is what the issue is, let me know and i'll at least open a ticket to track the issue.

waferbaby commented 3 weeks ago

@bnewbold You are a scholar and a gentleman. Will give that a shot.

waferbaby commented 3 weeks ago

@bnewbold Progress! That worked, could get the correct code via email* - however, It's now telling me the API is sending me invalid data (wrong content type, maybe? assuming HTML instead of whatever it's expecting?).

error: failed connecting to new host: XRPC ERROR 404: failed to decode xrpc error message: invalid character '<' looking for beginning of value

* Also just FYI, when it sends you that email, the message actually says:

To update the email for your account, enter the code below in the app along with your new email.
waferbaby commented 3 weeks ago

@bnewbold Running through the manual migration steps via goat, it looks like that error is coming from my self-hosted server - logging in after account creation shows the same thing - here's the output in my local logs:

{
    "level": 30,
    "time": 1730764573244,
    "pid": 7,
    "hostname": "homebase",
    "name": "pds",
    "req": {
        "id": 9140,
        "method": "POST",
        "url": "//xrpc/com.atproto.server.createSession",
        "query": {},
        "params": {},
        "headers": {
            "host": "wafer.baby",
            "user-agent": "indigo/v0.0.0-20241031232035-1a73c3fb6841",
            "content-length": "87",
            "accept-encoding": "gzip",
            "content-type": "application/json",
            "x-forwarded-for": "(ip address)",
            "x-forwarded-host": "wafer.baby",
            "x-forwarded-proto": "https"
        }
    },
    "res": {
        "statusCode": 404,
        "headers": {
            "x-powered-by": "Express",
            "access-control-allow-origin": "*",
            "content-security-policy": "default-src 'none'",
            "x-content-type-options": "nosniff",
            "content-type": "text/html; charset=utf-8",
            "content-length": 178,
            "vary": "Accept-Encoding"
        }
    },
    "responseTime": 3,
    "msg": "request completed"
}
waferbaby commented 3 weeks ago

Oh ha, it's because I left a trailing slash on my server name - removing that lets it work! FYI.

moll-dev commented 1 day ago

+1 I ended up patching goat to take a hardcoded 2FA