Deleting wrongly encrypted history entries on server

I was setting up atuin on a second host and what to share history between them and before I understood how keys worked, I just created a new key (the option is called “leave blank to use an existing one”, but since there is no existing one it just creates a new one I assumed).

I realized this and installed again with the key file from the other host. However, I now have a 1 entry history record in the server which is encrypted with the wrong key (the newly generated key for the second host).

How can I delete it?

Here’s the output now when I do antuin sync:

$ atuin sync
Uploading 1 records to <big id A>/history
  [00:00:00] [#########################################################################################################################################################################################################################################################] 1/1 (0.0s)Downloading 6489 records from <big ID B>/history
  [00:00:23] [#################################################################################################################################################################################################################################################] 6,489/6,489 (0.0s)Downloading 1 records from <big ID C>/history
  [00:00:00] [#########################################################################################################################################################################################################################################################] 1/1 (0.0s)Error: attempting to decrypt with incorrect key. currently using k4.lid.<big id g> expecting k4.lid.<big id h>

I assume the error appears after the upload is associated with, my I’m not sure.

Hey!

That’s right!

Ah I see - you can resolve this with the following, though note that data encrypted with the wrong key is unrecoverable

In future, and to anyone reading this from search engines; Please do not manually copy around key files. atuin login has a process to automatically migrate keys if you try to login with a different one

Thanks for the reply, I’ll try the process outlined here.

though note that data encrypted with the wrong key is unrecoverable

That’s fine, there’s only 1 command there as I realized right away.

Hmm, I did atuin login but I wasn’t prompted by anything like that. How should it have worked?

1 Like

Ah, I might have understood this part

I read that as you having copied the file rather than used login, sorry!

It will have migrated the key locally but if you’ve already synced then it won’t have helped

Actually I misrepresented what I did :).

I did copy the key from the other host as I thought login would ask me for the key file, but of course login actually asks you for the key contents so I just copy and pasted the key contents into the login prompt :).

Sorry for the confusion.