Kopia / Kopia Server / KopiaUI - OSx

Hi all:

Thanks a lot for your help in advanced.

I’m Trying to understand better the purpose of all 3 members of Kopia and its possible use cases. Please correct me if I’m wrong here:

  1. Kopia: Main program. Needs to be launched/executed by anyone external (command line invocation (crontab…etc), Kopia Server or KopiaUI). Responsible of all the task. It takes it’s info from the conf of each repository.

  2. Kopia Server: Small Exec that expose an API that allows configure and run scheduled snapshots and configure options. By itself, it’s just a small binary for the API and the communication to #1 Kopia. It does not have UI and must be open in order to receive and launch snapshots.

  3. KopiaUI: It’s Kopia Server, but with some basic functions and build in UI format. It can works in background memory and it’s on menu bar. Can be Started automatically. If you sleep the computer or reboot it, it assumes automatically the backup jobs.

Is that correct?

Thanks

You’re mostly correct, there are only 2 binaries:

  • kopia - which is the main binary, you can run it as a client or a server. The server exposes the HTML UI (exactly the same as what you can see in the UI), API to power the UI and another API to expose Kopia Repository Server (REST, but we’re rebuilding this as GRPC in the next version).

  • KopiaUI is an Electron shell that runs in system tray and starts kopia server --ui and launches browser to talk to it. Nothing more. In fact KopiaUI does not have any actual HTML UI - it relies 100% on UI served by kopia server.

2 Likes

How would I need to start kopia server to have it run exactly as in in Kopia UI?

Even when I create a TLS certificate (which I guess Kopia UI doesn’t) the connection doesn’t get established (TLS handshake error from 127.0.0.1:52190: remote error: tls: unknown certificate).

When I use kopia server start --insecure I get to a web interface but am asked for a username and password (which Kopia UI also doesn’t do).

In Kopia UI the server regularly crashes and when the UI is not open I don’t see this. So I’m thinking about adding the server to launchd.

According to the logs it seems to be:

kopia server start --ui --tls-print-server-cert --tls-generate-cert-name=127.0.0.1 --random-password --random-server-control-password --tls-generate-cert --async-repo-connect --shutdown-on-stdin --address=127.0.0.1:0 --config-file /Users/[USERNAME]/Library/Application Support/kopia/repository.config

Hi,

why does the server crash? Do you have any logs?

Cheers,

When I checked the logs I couldn’t even find entries prior to the crashes. I’ll check again next time.

The issue seems to be tracked here:

Not sure if this thread is the right place to post this but that’s the end of kopia-20230918-035744-2558-server-start.63.log after the latest crash:

[…]
2023-09-19T18:08:33.231938Z DEBUG kopia/repo [STORAGE] ListBlobs	{"prefix":"xw","resultCount":1,"error":null,"duration":"2.463883959s"}
2023-09-19T18:08:33.251861Z DEBUG kopia/repo [STORAGE] ListBlobs	{"prefix":"xe","resultCount":2,"error":null,"duration":"2.483849291s"}
2023-09-19T18:08:47.965668Z DEBUG kopia/repo [STORAGE] ListBlobs	{"prefix":"xr","resultCount":20,"error":null,"duration":"17.197253917s"}
2023-09-19T18:09:44.897061Z DEBUG kopia/repo [STORAGE] ListBlobs	{"prefix":"xs","resultCount":112,"error":null,"duration":"1m14.128376959s"}
2023-09-19T18:09:48.425394Z DEBUG kopia/repo [STORAGE] ListBlobs	{"prefix":"xn76_","resultCount":0,"error":null,"duration":"3.522311917s"}
2023-09-19T18:09:50.889369Z DEBUG kopia/repo [STORAGE] ListBlobs	{"prefix":"xn75_","resultCount":3,"error":null,"duration":"5.986289167s"}
2023-09-19T18:10:00.898700Z DEBUG kopia/repo [STORAGE] ListBlobs	{"prefix":"xn74_","resultCount":41,"error":null,"duration":"15.995621416s"}
2023-09-19T18:10:37.823679Z DEBUG kopia/repo [STORAGE] GetBlob	{"blobID":"q86bb515be070f9b808cf5617558f64b6-s4598106dd10e75f1120","offset":0,"length":-1,"outputLength":20384930,"error":null,"duration":"36.868021542s"}
2023-09-19T18:10:37.877284Z DEBUG kopia/manifest performing automatic compaction of 16 contents
2023-09-19T18:10:37.877333Z DEBUG kopia/manifest compactLocked: contentIDs=16
2023-09-19T18:10:39.121522Z DEBUG kopia/repo [STORAGE] PutBlob	{"blobID":"q92c50244653d59299a6174b2759c8a9b-s75624a09162681a6120","length":31190,"error":null,"duration":"1.23342475s"}

And that’s Kopia UI’s main.log:

[…]
goroutine 29242193 [chan receive, 14 minutes]:
runtime.gopark(0x36?, 0x1050cbc08?, 0x18?, 0x5e?, 0x1053c1274?)
	/Users/runner/hostedtoolcache/go/1.21.1/x64/src/runtime/proc.go:398 +0xc8 fp=0x14016039d70 sp=0x14016039d50 pc=0x104d588f8
runtime.chanrecv(0x14089e460c0, 0x14001225f28, 0x1)
	/Users/runner/hostedtoolcache/go/1.21.1/x64/src/runtime/chan.go:583 +0x414 fp=0x14016039df0 sp=0x14016039d70 pc=0x104d24544
runtime.chanrecv2(0x1400b2cd6d0?, 0x10650ed08?)
	/Users/runner/hostedtoolcache/go/1.21.1/x64/src/runtime/chan.go:447 +0x14 fp=0x14016039e20 sp=0x14016039df0 pc=0x104d24114
github.com/kopia/kopia/repo/maintenance.DeleteUnreferencedBlobs.func1()
	/Users/runner/work/kopia/kopia/repo/maintenance/blob_gc.go:45 +0x6c fp=0x14016039f60 sp=0x14016039e20 pc=0x1053c121c
golang.org/x/sync/errgroup.(*Group).Go.func1()
	/Users/runner/go/pkg/mod/golang.org/x/sync@v0.3.0/errgroup/errgroup.go:75 +0x58 fp=0x14016039fd0 sp=0x14016039f60 pc=0x1050efdd8
runtime.goexit()
	/Users/runner/hostedtoolcache/go/1.21.1/x64/src/runtime/asm_arm64.s:1197 +0x4 fp=0x14016039fd0 sp=0x14016039fd0 pc=0x104d8d1c4
created by golang.org/x/sync/errgroup.(*Group).Go in goroutine 91
	/Users/runner/go/pkg/mod/golang.org/x/sync@v0.3.0/errgroup/errgroup.go:72 +0x98

[2023-09-20 01:10:39.236] [info]  child process exited with code 2 and signal null
[2023-09-20 12:48:14.498] [error] failed to load content
[2023-09-20 12:48:14.514] [info]  Checking for update
[2023-09-20 12:48:15.009] [info]  reloading
[…]