garethgeorge/backrest

ARM32 builds

Closed this issue · 9 comments

Is your feature request related to a problem? Please describe.
I'm using restic-server running on a Raspberry Pi 2 and would like to manage the repository with backrest.

Describe the solution you'd like
Would it be possible to include ARM32 builds?

Additional context
Is it safe to use restic-server and backrest together? Anything I should look out for?

Hey, I can definitely add arm32 builds.

Re: restic-server with backrest is a totally fine configuration. Just be aware that backrest schedules snapshot indexing after it does a backup, so if you’re not using it to make backups you’ll have to click the “index snapshots” button on the repo overview page when you want to browse your latest data.

Ok, cool!

Thanks for the advice!

I'd like that, too. Many (most?) NAS use 32-bit ARM devices and their own flavor of Linux. Would like to try running this on mine.

Went ahead and added arm32 builds in the latest release but I don't have a device to test on, PTAL and let me know if those work for you.

The program runs fine on my NAS, the web interface comes up and I can add a user and repo (using local/direct path). The repo access starts ok and I can list snapshots but when I try to browse a snapshot, after a while I get the following error in the web interface:

Failed to list snapshot files: [unknown] failed to list snapshot files: failed to list snapshot files: command "/opt/bin/restic ls --json a9b1d86c813eae8c8e4909e335812d5ea2dbdc9b580bcc978ce8ce789a31d9ab / -o sftp.args=-oBatchMode=yes" failed: failed to parse JSON: json: cannot unmarshal number 2147484159 into Go struct field LsEntry.mode of type int Process STDOUT: {"time":"2024-02-29T12:05:18.764821+01:00","parent":"01f3eae9b26c8dfbaa8075d17078596f3bb39a889166c455cfc9bd58733e2f51","tree":"dc9c0faffc98711cb86e83acc5e2c3ba3d5009bd88fe934b4ec48be601a5ec07","paths":["C:\\"],"hostname":"MYHOST","username":"MYHOST\\User","tags":["C:\\"],"program_version":"restic 0.16.4","id":"a9b1d86c813eae8c8e4909e335812d5ea2dbdc9b580bcc978ce8ce789a31d9ab","short_id":"a9b1d86c","struct_type":"snapshot"} {"name":"C","type":"dir","path":"/C","uid":0,"gid":0,"mode":2147484159,"permissions":"drwxrwxrwx","mtime":"2024-02-29T11:54:37.8576422+01:00","atime":"2024-02-29T11:54:37.8576422+01:00","ctime":"2024-02-29T11:54:37.8576422+01:00","struct_type":"node"}

MYHOST resp. MYHOST\User come from the Windows computer I made the backup of "C:\" from.

Really interesting -- this is probably happening because int's are actually 32 bit on arm32 (which makes sense :) ) so the mode value is too big for the struct I defined:

type LsEntry struct {
        Name  string `json:"name"`
        Type  string `json:"type"`
        Path  string `json:"path"`
        Uid   int    `json:"uid"`
        Gid   int    `json:"gid"`
        Size  int    `json:"size"`
        Mode  int    `json:"mode"`
        Mtime string `json:"mtime"`
        Atime string `json:"atime"`
        Ctime string `json:"ctime"`
}

The fix is probably to make all of those fields int64 (and thankfully it's already transmitted as 64bit on the wire https://github.com/garethgeorge/backrest/blob/main/proto/v1/service.proto#L112-L123).

Thanks, Gareth. Is this still on the radar? Sounds like this would be easy to fix.

Hi, this is actually fixed for some time now :) arm32 builds should be working now. I'll go ahead and mark this as closed -- the fixes should be bundled up in the latest release. Please re-open if you're still seeing problems w/arm32.

Thanks, I have updated the file but I am getting this error which looks pretty much the same as last time:

Failed to list snapshot files: [unknown] failed to list snapshot files: failed to list snapshot files: command "/opt/bin/restic ls --json de50667cb65fe72fa254cf6ce783be126eacf5f99c225491cf58f43c39d0e5d8 / -o sftp.args=-oBatchMode=yes" failed: failed to parse JSON: json: cannot unmarshal number 2147484159 into Go struct field LsEntry.mode of type int Process STDOUT: {"time":"2024-03-19T12:05:11.1679065+01:00","parent":"87a9240f7a451977fb62a513af5f49da3607a629b68f90d4df40a2a05f866d8a","tree":"a8bb80d76833a6d9cd0a53d9e9ffe8eac52c8b594759c5a28f282e1940bc70c3","paths":["C:\\"],"hostname":"MYHOST","username":"MYHOST\\User","tags":["C:\\"],"program_version":"restic 0.16.4","id":"de50667cb65fe72fa254cf6ce783be126eacf5f99c225491cf58f43c39d0e5d8","short_id":"de50667c","struct_type":"snapshot"} {"name":"C","type":"dir","path":"/C","uid":0,"gid":0,"mode":2147484159,"permissions":"drwxrwxrwx","mtime":"2024-03-15T09:15:02.4446803+01:00","atime":"2024-03-15T09:15:02.4446803+01:00","ctime":"2024-03-15T09:15:02.4446803+01:00","struct_type":"node"}

I don't have the right to re-open the issue, though.