Sync v2: error decoding response body

tl;dr: sync v2 is throwing an unexpected error.

I am running atuin, with a self-hosted sync server.

I have upgraded both client and server to v18.0.1 using bash <(curl --proto '=https' --tlsv1.2 -sSf https://setup.atuin.sh).

I have followed these instructions to set up sync v2 on the client. I have not adjusted the server config - perhaps I should?

When I ran atuin sync, I got:

History DB is longer than history record store
This happens when you used Atuin pre-record-store
Run atuin history init-store to correct this


Error: a request to the sync server failed: "error decoding response body: expected value at line 1 column 1"

Location:
    atuin/src/command/client/sync.rs:102:38

So I did atuin history init-store.

When I re-ran atuin sync, I get:

Error: a request to the sync server failed: "error decoding response body: expected value at line 1 column 1"

Location:
    atuin/src/command/client/sync.rs:102:38

Welcome to the forum!

There’s nothing needed to change on the server. v18 added a new database table and some new routes, but not much else. Have you got some sort of reverse proxy setup?

Does sync v1 work with a v18 client and a v18 server?

Otherwise, pulling some logs will hopefully answer what’s going on here.

Server logs

You can get these by running your server with

RUST_LOG=info,atuin_server=debug

Client logs

Try running

ATUIN_LOG=debug atuin sync

Both will be pretty chatty, but :crossed_fingers: there’s a useful error in there

1 Like

Fixed, and the issue was me, not atuin.

The problem was on the server side.

I had run bash <(curl --proto '=https' --tlsv1.2 -sSf https://setup.atuin.sh), on the server and atuin help showed atuin 18.0.1.

However, when I ran atuin sync, with v1 sync, on the client, it showed:

Atuin version mismatch! In order to successfully sync, the server needs to run a newer version of Atuin
Client: 18.0.1
Server: 17.2.1
Error: could not sync due to version mismatch

Odd, as I had just upgraded it, and running atuin help showed the right version.

What I had failed to take into account is that, on the server, I init atuin using systemd. So I needed to restart the systemd server, for it to run with the updated version of atuin.

Now, v2 (and v1) sync is working correctly.

Sorry for the noise :frowning:

Ah I see! No worries, glad you got it sorted.

I’ll make sure that error shows up properly with v2 sync also :pray: