Running kopia repo connect from-config throws invalid memory address or nil pointer dereference

I am trying to run Kopia on the CLI using an existing repository.config file, which I copied from the running Kopia config. Soo… basically, I ran

kopia repository connect  server --url https://my.server:5151 --server-cert-fingerprint <fingerprint> --override-hostname=stephan --override-username=stephan.budach

Then I copied the resulting config file to ST7A.config and disconnected from the repo The resulting config looks good to me:

bash-3.2$ cat ST7A.config
  "apiServer": {
    "url": "https://my.server:5151",
    "serverCertFingerprint": "obfuscated"
  "hostname": "stephan",
  "username": "stephan.budach",
  "description": "API Server: https://my.server:5151",
  "enableActions": false

However, when I am trying to start kopia using the copied config file, I am getting this:

bash-3.2$ kopia repo connect from-config --file=/Users/stephan.budach/Library/Application\ Support/kopia/ST7A.config
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0x1aef210]

goroutine 1 [running]:, 0xc0005041b0, 0x0, 0x0, 0x0, 0x0)
	/home/runner/work/kopia/kopia/cli/command_repository_connect_from_config.go:48 +0x1d0, 0xc0005041b0, 0x0, 0x1009ebf, 0xc00030c000, 0x1c590c0, 0x1d90ae0)
	/home/runner/work/kopia/kopia/cli/command_repository_connect_from_config.go:25 +0x125, 0x100b445, 0x1c590c0)
	/home/runner/work/kopia/kopia/cli/storage_providers.go:40 +0x51*actionMixin).applyActions(0xc0004cc428, 0xc000098d80, 0x0, 0x0)
	/home/runner/go/pkg/mod/ +0x6d*Application).applyActions(0xc0004a6000, 0xc000098d80, 0x0, 0x0)
	/home/runner/go/pkg/mod/ +0xdc*Application).execute(0xc0004a6000, 0xc000098d80, 0xc0004b0e40, 0x3, 0x4, 0x0, 0x0, 0x0, 0xc0000abdd0)
	/home/runner/go/pkg/mod/ +0x90*Application).Parse(0xc0004a6000, 0xc0000300b0, 0x4, 0x4, 0x1, 0xc0000abdd8, 0x0, 0x1)
	/home/runner/go/pkg/mod/ +0x213
	/home/runner/work/kopia/kopia/main.go:81 +0x188

Actually, I am trying to use Kopia CLI with different repos and since KopiaUI does that as well, I am wondering, what went wrong here - or rather, we I did.

1 Like