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]:
github.com/kopia/kopia/cli.connectToStorageFromConfigFile(0x1f3e7a0, 0xc0005041b0, 0x0, 0x0, 0x0, 0x0)
	/home/runner/work/kopia/kopia/cli/command_repository_connect_from_config.go:48 +0x1d0
github.com/kopia/kopia/cli.connectToStorageFromConfig(0x1f3e7a0, 0xc0005041b0, 0x0, 0x1009ebf, 0xc00030c000, 0x1c590c0, 0x1d90ae0)
	/home/runner/work/kopia/kopia/cli/command_repository_connect_from_config.go:25 +0x125
github.com/kopia/kopia/cli.RegisterStorageConnectFlags.func2(0xc000098d80, 0x100b445, 0x1c590c0)
	/home/runner/work/kopia/kopia/cli/storage_providers.go:40 +0x51
github.com/alecthomas/kingpin.(*actionMixin).applyActions(0xc0004cc428, 0xc000098d80, 0x0, 0x0)
	/home/runner/go/pkg/mod/github.com/alecthomas/kingpin@v0.0.0-20200323085623-b6657d9477a6/actions.go:28 +0x6d
github.com/alecthomas/kingpin.(*Application).applyActions(0xc0004a6000, 0xc000098d80, 0x0, 0x0)
	/home/runner/go/pkg/mod/github.com/alecthomas/kingpin@v0.0.0-20200323085623-b6657d9477a6/app.go:560 +0xdc
github.com/alecthomas/kingpin.(*Application).execute(0xc0004a6000, 0xc000098d80, 0xc0004b0e40, 0x3, 0x4, 0x0, 0x0, 0x0, 0xc0000abdd0)
	/home/runner/go/pkg/mod/github.com/alecthomas/kingpin@v0.0.0-20200323085623-b6657d9477a6/app.go:398 +0x90
github.com/alecthomas/kingpin.(*Application).Parse(0xc0004a6000, 0xc0000300b0, 0x4, 0x4, 0x1, 0xc0000abdd8, 0x0, 0x1)
	/home/runner/go/pkg/mod/github.com/alecthomas/kingpin@v0.0.0-20200323085623-b6657d9477a6/app.go:230 +0x213
main.main()
	/home/runner/work/kopia/kopia/main.go:81 +0x188
bash-3.2$

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