bookwyrm-social / bookwyrm

Social reading and reviewing, decentralized with ActivityPub
http://joinbookwyrm.com/
Other
2.17k stars 255 forks source link

Moving account between instances #3354

Closed pi3r8 closed 2 months ago

pi3r8 commented 2 months ago

Describe the bug When trying to move an account from one instance to another, getting the error Set this user as an alias on the user you are moving to first This happens even when the alias has been set. To Reproduce Steps to reproduce the behavior: on 'new' account instance

  1. Go to Account > Settings
  2. Click on Aliases
  3. enter a username in user@instance.com format
  4. create alias on 'old' account instance
  5. Go to Account > Settings
  6. click move account
  7. enter new username in user@instance.com format and password
  8. click move account

Expected behavior Old account to be migrated to the new instance with followers directed to new account.

Screenshots If applicable, add screenshots to help explain your problem.

Instance the.me.uk, linux.me.uk

Additional context This was discussed on the bookwyrm Element chat and the issue seems to relate to if the new account is known to the old server: So we’re picking up the local version of the user instead of always fetching their info from the remote So we maybe want a flag like refetch or something to force it to check the remote. (In handle_remote_webfinger)

hughrun commented 2 months ago

I've had another look at the code for this and I'm not convinced our theory on Matrix is sound. There shouldn't normally be any reason that the new server hasn't picked up the change to the old account assuming activitypub broadcast tasks are running properly and there's not a big backlog - when users are saved, the change is broadcast to known servers by default.

linux.me.uk is timing out for me - i.e. it's not reachable. This seems more likely the problem.

pi3r8 commented 2 months ago

I've had another look at the code for this and I'm not convinced our theory on Matrix is sound. There shouldn't normally be any reason that the new server hasn't picked up the change to the old account assuming activitypub broadcast tasks are running properly and there's not a big backlog - when users are saved, the change is broadcast to known servers by default.

linux.me.uk is timing out for me - i.e. it's not reachable. This seems more likely the problem.

Hi, thanks for looking at this. Linux.me.uk is down right now for cost reasons as its on a payg Azure instance. The instance was up and reachable for 4-5 days while this issue was ongoing. Other events were replicated between the instances. E.G if I rated a book on linux.me.uk I could see this on the.me.uk and vice versa. I have brought linux.me.uk back up, but the same error continues.

hughrun commented 2 months ago

@pi3r8 ok there's no need to keep linux.me.uk running now - I can see you have both users pointing at each other.

Because I can't log in to your server, I can't search for users but if you are logged in and go to https://the.me.uk/user/pi3r8@linux.me.uk.json can you tell me whether it shows your the.me.uk user as a value in alsoKnownAs?

Basically, every server will have a locally stored user for every external user it knows about. We need to see whether the local version has been updated to match the values on the external server. If not there's either a problem with queues on the remote server (i.e. it's not sending) or some problem receiving and/or processing those messages. If the value has been updated ...there's something else strange going on.

pi3r8 commented 2 months ago

@pi3r8 ok there's no need to keep linux.me.uk running now - I can see you have both users pointing at each other.

Because I can't log in to your server, I can't search for users but if you are logged in and go to https://the.me.uk/user/pi3r8@linux.me.uk.json can you tell me whether it shows your the.me.uk user as a value in alsoKnownAs?

Basically, every server will have a locally stored user for every external user it knows about. We need to see whether the local version has been updated to match the values on the external server. If not there's either a problem with queues on the remote server (i.e. it's not sending) or some problem receiving and/or processing those messages. If the value has been updated ...there's something else strange going on.

  |   -- | -- id | "https://linux.me.uk/user/pi3r8" type | "Person" preferredUsername | "pi3r8" inbox | "https://linux.me.uk/user/pi3r8/inbox" publicKey |   id | "https://linux.me.uk/user/pi3r8/#main-key" owner | "https://linux.me.uk/user/pi3r8" publicKeyPem | "-----BEGIN PUBLIC KEY-----\nMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAjvYxM303mmbE7INdQVSz\nuk419xj0OZBCTG2Hcd2Od57mmuMTRewPw1FzfmfKYt/GmDKKTojmQoLIf5988XL8\nVd2hlxv4uZ1cAS8FLY6OlnMisQtNPMUOPXQAwbqg2S5SVv3WXXJ40iv0GxPZieu4\n8UjY8WKmNDjb3PCSpEODf/omysNO8T6biGKlm0ESD/9wVzZm084dlx/JRXdB1IOu\no7jhAc3vO/TPy1CnAIwuVZcJONg6k7e8/mlVzNUPo0CeyJUkwG2ux91C8bCiU3bT\nWARbWV2u54yPILN+M4E+DG8fSkSFHfXGzHfUN2o/waYXzdHuoPbhbUvkh0tQ/fvW\nUQIDAQAB\n-----END PUBLIC KEY-----" followers | "https://linux.me.uk/user/pi3r8/followers" following | "https://linux.me.uk/user/pi3r8/following" outbox | "https://linux.me.uk/user/pi3r8/outbox" endpoints |   sharedInbox | "https://linux.me.uk/inbox" icon |   type | "Image" url | "https://the.me.uk/images/avatars/9c9664d7-c8e6-4498-96c0-fb145c407967.png" name | "avatar for pi3r8@linux.me.uk" @context | "https://www.w3.org/ns/activitystreams" bookwyrmUser | true manuallyApprovesFollowers | false discoverable | true hideFollows | false alsoKnownAs | [] @context |   0 | "https://www.w3.org/ns/activitystreams" 1 | "https://w3id.org/security/v1" 2 |   manuallyApprovesFollowers | "as:manuallyApprovesFollowers" schema | "http://schema.org#" PropertyValue | "schema:PropertyValue" value | "schema:value" alsoKnownAs |   @id | "as:alsoKnownAs" @type | "@id" movedTo |   @id | "as:movedTo" @type | "@id"
id "https://linux.me.uk/user/pi3r8" type "Person" preferredUsername "pi3r8" inbox "https://linux.me.uk/user/pi3r8/inbox" publicKey id "https://linux.me.uk/user/pi3r8/#main-key" owner "https://linux.me.uk/user/pi3r8" publicKeyPem "Removed" followers "https://linux.me.uk/user/pi3r8/followers" following "https://linux.me.uk/user/pi3r8/following" outbox "https://linux.me.uk/user/pi3r8/outbox" endpoints sharedInbox "https://linux.me.uk/inbox" icon type "Image" url "https://the.me.uk/images/avatars/9c9664d7-c8e6-4498-96c0-fb145c407967.png" name "avatar for pi3r8@linux.me.uk" @context "https://www.w3.org/ns/activitystreams" bookwyrmUser true manuallyApprovesFollowers false discoverable true hideFollows false alsoKnownAs [] @context 0 "https://www.w3.org/ns/activitystreams" 1 "https://w3id.org/security/v1" 2 manuallyApprovesFollowers "as:manuallyApprovesFollowers" schema "[http://schema.org#](http://schema.org/#)" PropertyValue "schema:PropertyValue" value "schema:value" alsoKnownAs @id "as:alsoKnownAs" @type "@id" movedTo @id "as:movedTo" @type "@id"