atuinsh/atuin

[Bug]: "Status 413" when running `atuin sync`

ajhall opened this issue · 1 comments

What did you expect to happen?

I'm using Atuin with mostly default settings (just style, show_preview, and smart_sort changed) and the default sync server. I'm logged in and I expected auto-sync to do its thing in the background.

I was setting up a new system and installed Atuin on it, but I wasn't seeing my recent history. I ran atuin sync on my main computer and expected to see it sync a few records.

What happened?

atuin sync ran for almost 2 minutes, then errored out:

Error: There was an error with the atuin sync service: Status 413.
If the problem persists, contact the host

Location:
    /tmp/atuin-20240415-7811-bnpvtn/atuin-18.2.0/atuin-client/src/api_client.rs:171:9

Here are the logs with ATUIN_LOG=debug: atuin.log

What's the best way to get the sync working again without losing any history?

Atuin doctor output

atuin:
  version: 18.2.0
  sync:
    cloud: true
    records: false
    auto_sync: true
    last_sync: 2024-04-19 13:29:54.682366488 +00:00:00
shell:
  name: fish
  default: unknown
  plugins:
  - atuin
system:
  os: Ubuntu
  arch: x86_64
  version: '23.10'
  disks:
  - name: /dev/mapper/ubuntu
    filesystem: ext4
  - name: /dev/nvme0n1p4
    filesystem: ext4
  - name: /dev/nvme0n1p1
    filesystem: vfat

Code of Conduct

  • I agree to follow this project's Code of Conduct

Haha, I think I figured out my problem. There were a lot of absurdly long entries in my history, mostly either accidental pastes or SAML strings.

This helped me find them:

atuin history list | awk '{ print length, $0 }' | sort -n -s -r | cut -d" " -f2- | less -S

Then I updated my history_filter, ran atuin history prune, and did a few manual calls to atuin search --delete to clean things up.

A few things I think might have helped me out:

  • Some feedback during atuin sync without turning on verbose logging - by default it just looks like it's hanging
  • Some indication that the background sync wasn't working
  • Maybe a maximum-length option on history entries would be useful. I would never want to pull a huge item like that out of my history, and plus I feel like I'm abusing your sync server by pushing junk data up to it 😅 Never mind, I see that this exists already