# Repo disconnect throws panic error

**URL:** <https://kopia.discourse.group/t/repo-disconnect-throws-panic-error/1868>\
**Category:** General Topics\
**Created:** [March 10, 2023, 1:51pm UTC](https://kopia.discourse.group/t/repo-disconnect-throws-panic-error/1868 "2023-03-10T13:51:47Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![kopanla](https://yyz2.discourse-cdn.com/free1/user_avatar/kopia.discourse.group/kopanla/32/243_2.png) [@kopanla](https://kopia.discourse.group/u/kopanla)\
**Post date:** [March 10, 2023, 1:51pm UTC](https://kopia.discourse.group/t/repo-disconnect-throws-panic-error/1868/1 "2023-03-10T13:51:47Z")

</div>

After verifying a and disconnecting from a repo the following happened. Anybody has an idea why?

Kopia 12.1

```auto
Finished verifying 310222 contents, found 0 errors.

kopia repository disconnect

panic: runtime error: invalid memory address or nil pointer dereference
[signal 0xc0000005 code=0x0 addr=0x0 pc=0x8bf1cf]

goroutine 1 [running]:
github.com/danieljoos/wincred.(*GenericCredential).Delete(...)
        C:/Users/runneradmin/go/pkg/mod/github.com/danieljoos/wincred@v1.1.2/wincred.go:49
github.com/zalando/go-keyring.windowsKeychain.Delete({}, {0xc0000aa060?, 0xc00057e170?}, {0xc00003b794?, 0xc0000a4630?})
        C:/Users/runneradmin/go/pkg/mod/github.com/zalando/go-keyring@v0.2.1/keyring_windows.go:42 +0x8f
github.com/zalando/go-keyring.Delete(...)
        C:/Users/runneradmin/go/pkg/mod/github.com/zalando/go-keyring@v0.2.1/keyring.go:37
github.com/kopia/kopia/internal/passwordpersist.keyringStrategy.DeletePassword({}, {0x1bfc238, 0xc0002e3170}, {0xc0000be060, 0x2c})
        D:/a/kopia/kopia/internal/passwordpersist/passwordpersist_keyring.go:59 +0x9a
github.com/kopia/kopia/internal/passwordpersist.Multiple.DeletePassword({0xc00008e5e0?, 0x2, 0xc00050f958?}, {0x1bfc238, 0xc0002e3170}, {0xc0000ae060, 0x2c})
        D:/a/kopia/kopia/internal/passwordpersist/passwordpersist_multiple.go:55 +0xb1
github.com/kopia/kopia/cli.(*commandRepositoryDisconnect).run(0xc0001bc290, {0x1afc238, 0xc0002d3170})
        D:/a/kopia/kopia/cli/command_repository_disconnect.go:29 +0xc8
github.com/kopia/kopia/cli.(*App).noRepositoryAction.func1.1.1()
        D:/a/kopia/kopia/cli/app.go:389 +0x89
github.com/kopia/kopia/cli.(*profileFlags).withProfiling(0x0?, 0x0?)
        D:/a/kopia/kopia/cli/profile.go:45 +0x32d
github.com/kopia/kopia/cli.(*App).noRepositoryAction.func1.1({0x1bfc238?, 0xc0002e3170?})
        D:/a/kopia/kopia/cli/app.go:384 +0x68
github.com/kopia/kopia/cli.(*App).runAppWithContext.func1({0x1bfc238, 0xc0002e3140}, 0xc0002e3140?, 0xc0002ba500, 0xc00025fd40)
        D:/a/kopia/kopia/cli/app.go:495 +0x191
github.com/kopia/kopia/cli.(*App).runAppWithContext(0xc0002ba500, 0x0?, 0x0?)
        D:/a/kopia/kopia/cli/app.go:496 +0x178
github.com/kopia/kopia/cli.(*App).noRepositoryAction.func1(0x4bbd54?)
        D:/a/kopia/kopia/cli/app.go:383 +0x51
github.com/alecthomas/kingpin.(*actionMixin).applyActions(0xc00027eac8?, 0x1522920?)
        C:/Users/runneradmin/go/pkg/mod/github.com/alecthomas/kingpin@v1.3.8-0.20220615105907-eae6867f4166/actions.go:28 +0x5c
github.com/alecthomas/kingpin.(*Application).applyActions(0xc000510200?, 0xc0001963f0)
        C:/Users/runneradmin/go/pkg/mod/github.com/alecthomas/kingpin@v1.3.8-0.20220615105907-eae6867f4166/app.go:560 +0xed
github.com/alecthomas/kingpin.(*Application).execute(0xc000510200, 0xc0001963f0?, {0xc000308600, 0x2, 0x2})
        C:/Users/runneradmin/go/pkg/mod/github.com/alecthomas/kingpin@v1.3.8-0.20220615105907-eae6867f4166/app.go:398 +0x66
github.com/alecthomas/kingpin.(*Application).Parse(0xc000510200, {0xc0000d4010?, 0xc000510200?, 0x1beb3ec?})
        C:/Users/runneradmin/go/pkg/mod/github.com/alecthomas/kingpin@v1.3.8-0.20220615105907-eae6867f4166/app.go:230 +0x14f
main.main()
        D:/a/kopia/kopia/main.go:77 +0x1dd

```

---

<div class="post-metadata">

**Author:** ![ChrisA](https://avatars.discourse-cdn.com/v4/letter/c/b77776/32.png) [@ChrisA](https://kopia.discourse.group/u/ChrisA)\
**Post date:** [March 12, 2023, 8:56am UTC](https://kopia.discourse.group/t/repo-disconnect-throws-panic-error/1868/2 "2023-03-12T08:56:56Z")

</div>

Hi,

it is hard to tell what actually went wrong. I am not a contributor but tried to track down the exception. Kopia incorporates the zalando-keyring lib which itself is based on a library for managing windows credentials ( [danieljoos/wincred: Go wrapper around the Windows Credential Manager API functions (github.com)](https://github.com/danieljoos/wincred)).

So the exception is basically thrown there. I am assuming your running kopia with the cli on windows right? What did you do exactly? Are you using the cli only? Have you tried to reconnect to the repository and disconnect afterwards?

Cheers,

---

<div class="post-metadata">

**Author:** ![kopanla](https://yyz2.discourse-cdn.com/free1/user_avatar/kopia.discourse.group/kopanla/32/243_2.png) [@kopanla](https://kopia.discourse.group/u/kopanla)\
**Post date:** [March 13, 2023, 8:28am UTC](https://kopia.discourse.group/t/repo-disconnect-throws-panic-error/1868/3 "2023-03-13T08:28:34Z")

</div>

I just did a full content verify and disconnected (as shown in my previous) post. There are no follow-up issues. Connecting and disconnecting works fine (and snapshots too …). It seems like Kopia used a lot of memory during the disconnect (which took a while) and crashed?

---

<div class="post-metadata">

**Author:** ![ChrisA](https://avatars.discourse-cdn.com/v4/letter/c/b77776/32.png) [@ChrisA](https://kopia.discourse.group/u/ChrisA)\
**Post date:** [March 13, 2023, 6:38pm UTC](https://kopia.discourse.group/t/repo-disconnect-throws-panic-error/1868/4 "2023-03-13T18:38:00Z")

</div>

It is hard to identify the cause of the exception - especially if it is working right now 🙂

Can you post some details about your repository? What is the size or the general setup? Are you running a repository server etc.?

Cheers,

---

<div class="post-metadata">

**Author:** ![kopanla](https://yyz2.discourse-cdn.com/free1/user_avatar/kopia.discourse.group/kopanla/32/243_2.png) [@kopanla](https://kopia.discourse.group/u/kopanla)\
**Post date:** [March 14, 2023, 6:18am UTC](https://kopia.discourse.group/t/repo-disconnect-throws-panic-error/1868/5 "2023-03-14T06:18:25Z")

</div>

It is a small repo (filesystem, 130gb, compressed). It is just a test repo. I only use Kopia for testing. I believe Kopia has still “reliability issues” especially with compression enabled, so I do a content verify --full after every snapshot (for testing). That is probably what the “cloud backup folks” here don’t do that often 😉 My main backup tool is restic (and finally restic supports compression too …).

---

<div class="post-metadata">

**Author:** ![budy](https://yyz2.discourse-cdn.com/free1/user_avatar/kopia.discourse.group/budy/32/38_2.png) [@budy](https://kopia.discourse.group/u/budy)\
**Post date:** [March 17, 2023, 5:36pm UTC](https://kopia.discourse.group/t/repo-disconnect-throws-panic-error/1868/6 "2023-03-17T17:36:20Z")

</div>

What makes you think, that Kopia has issues with compression? All my repos have compression enabled and none has any issues with it.

---

<div class="post-metadata">

**Author:** ![kopanla](https://yyz2.discourse-cdn.com/free1/user_avatar/kopia.discourse.group/kopanla/32/243_2.png) [@kopanla](https://kopia.discourse.group/u/kopanla)\
**Post date:** [March 20, 2023, 3:58am UTC](https://kopia.discourse.group/t/repo-disconnect-throws-panic-error/1868/7 "2023-03-20T03:58:04Z")

</div>

Just based on my experience.

Example (of a well understood compression issue).

> [@Apparent compression header error on 0.9.7](https://kopia.discourse.group/t/apparent-compression-header-error-on-0-9-7/822):
>
> When running full maintenance, I receive the following error: Rewriting contents from short packs... unable to rewrite content "17d8ad0f1a5e691e1b0d0fc3d4760070": unable to get content data and info: error decompressing: invalid compression header, expected 00001102 but got 00001103 Followed by 20 others with different content hashes. 
> 
> > **'kopia repository status' returns:**
> >
> > Config file: C:\Users\Michael Nickerson\AppData\Roaming\kopia\repository.config Description: Reposito…
