Does disk image restore damage repo?

Yesterday I did a Macrium Reflect disk image restore which damaged a repo on Google Drive, at least that is what I think it did.
I can imagine that because kopiaUI is connected to the repo and has a cache directory in /AppData/Local/kopia/somenumber
After restoring a disk image this cache directory is not in sync with the repo and then kopiaUI starts doing snapshots or maintenance which really confuses things with this in the logs:

2022-06-01T22:46:32.349735Z DEBUG kopia/repo Creating cache directory 'C:\Users\xxxxxxxx\AppData\Local\kopia\62f44caa7eab8d89' with max size 5242880000
2022-06-01T22:46:32.362207Z DEBUG kopia/repo kopia.repository could not be fetched from cache: unable to open cache file: CreateFile C:\Users\xxxxxx\AppData\Local\kopia\62f44caa7eab8d89\kopia.repository: The system cannot find the file specified.
2022-06-01T22:46:32.504398Z DEBUG kopia/repo kopia.blobcfg could not be fetched from cache: unable to open cache file: CreateFile C:\Users\xxxxxx\AppData\Local\kopia\62f44caa7eab8d89\kopia.blobcfg: The system cannot find the file specified.
2022-06-01T22:46:32.517363Z DEBUG kopia/repo throttling limits from connection info {"limits": {}}
2022-06-01T22:46:32.674381Z ERROR cache unable to add xs9_b72739cb4c611270c95174c9896e41fc-sce6ee931e918f4bd-c1 to index blob cache: context canceled
2022-06-01T22:46:32.674895Z ERROR cache unable to add xn11_f0283bc0417be342a149e70711d70f5e-s0348f9ea45994f94110-c1 to index blob cache: context canceled
2022-06-01T22:46:32.676438Z ERROR cache unable to add xs8_6ad4ffbf10bbc9a376eae3a36485a5b4-s2bf6d47212b20970-c1 to index blob cache: context canceled
2022-06-01T22:46:32.686253Z ERROR cache unable to add xr0_7_da0a020f3b72dc23428f17a61ae5f1d1-s37c4e5c84d5127e4-c1 to index blob cache: context canceled
2022-06-01T22:46:32.814923Z ERROR cache unable to add xn11_f8c8691deb9d6b209559eae92e06e386-s666cbfc25b573ca9110-c1 to index blob cache: context canceled
2022-06-01T22:46:32.815438Z ERROR cache unable to add xn11_f3ab444dc414c1dde681ca96bafc4f82-sadb935f4031375ee110-c1 to index blob cache: context canceled
2022-06-01T22:46:32.815438Z ERROR cache unable to add xn11_f69cd51ea0eb1d21691c513b4effc26c-sf28ead5e71a6ffa5110-c1 to index blob cache: context canceled
2022-06-01T22:46:32.815438Z ERROR cache unable to add xn11_f41b15860bb2db9ec34c5050d1995737-s30444ce207f76f3d110-c1 to index blob cache: context canceled
2022-06-01T22:46:33.030959Z ERROR cache unable to add xn11_edfba6698af41c2461486f228df1f3a4-sc634e577a53a1474110-c1 to index blob cache: context canceled
2022-06-01T22:46:33.031478Z ERROR cache unable to add xn11_fd312fe5b375945f5308d5a28783308a-s4424872f3272921e110-c1 to index blob cache: context canceled
2022-06-01T22:46:33.031478Z ERROR cache unable to add xn11_fb1daf59591a4c203d2407ab7d9fd024-s274aa144087b2f60110-c1 to index blob cache: context canceled
2022-06-01T22:46:33.031478Z ERROR cache unable to add xn11_d0878f8cf22e10dc35a78d34ff97cbdc-s3f35b62d23c23a39110-c1 to index blob cache: context canceled
2022-06-01T22:46:33.465291Z ERROR cache unable to add xn11_da58b2ca92e2aaff919a19a6711d1507-s7cbfdef835ffbb9f110-c1 to index blob cache: context canceled
2022-06-01T22:46:33.465291Z ERROR cache unable to add xn11_d112ad5d6f7ce4d8493478d59c5384b2-s9fdfac40e12c2c67110-c1 to index blob cache: context canceled
2022-06-01T22:46:33.465291Z ERROR cache unable to add xn11_da6ebf665fbe3e18e33f2849793f53a2-scb81ca68865e54da110-c1 to index blob cache: context canceled
2022-06-01T22:46:33.465291Z ERROR cache unable to add xn11_d5d7e3ee06a635d23d2af07f52f0de25-se0e51cab089dc7f7110-c1 to index blob cache: context canceled
2022-06-01T22:46:34.289580Z ERROR cache unable to add xn11_cb6a3c983ed37f1b69f2f2eb0a33eab7-s512473a8a5b67cec110-c1 to index blob cache: context canceled
2022-06-01T22:46:34.289580Z ERROR cache unable to add xn11_c1629e048a6434fb1d519ee5e91a6799-s6fb323a8092388d1110-c1 to index blob cache: context canceled
2022-06-01T22:46:34.289580Z ERROR cache unable to add xn11_ca42d13a89ecc2936e754d41fd4fd203-sfce401e478e52fd2110-c1 to index blob cache: context canceled
2022-06-01T22:46:34.289580Z ERROR cache unable to add xn11_c76385a78fbc0a3a8e5849d32c97a32e-s1534b05e098adf47110-c1 to index blob cache: context canceled
2022-06-01T22:46:35.920196Z ERROR cache unable to add xn11_a6c92d77e18ef93e40125ec6b880893f-s017b9b3b73daeff2110-c1 to index blob cache: context canceled
2022-06-01T22:46:35.920196Z ERROR cache unable to add xn11_ccd9b5a82657aa60d0efdc45f7a2284a-sec34099165017461110-c1 to index blob cache: context canceled
2022-06-01T22:46:35.920196Z ERROR cache unable to add xn11_b78b30448ff5d80f5806dab207ab36ee-sc0e0d44ea6673376110-c1 to index blob cache: context canceled
2022-06-01T22:46:35.920196Z ERROR cache unable to add xn11_b8b82b4df9283e875f84b254a48fb44c-sc19b7cf077b93a93110-c1 to index blob cache: context canceled
2022-06-01T22:46:39.134553Z ERROR cache unable to add xn11_99713eff6e1586674fd6632db7c91151-s47d7f328479435c8110-c1 to index blob cache: context canceled
2022-06-01T22:46:39.134553Z ERROR cache unable to add xn11_a9a68d2ded063703ff6cc4b7a77602cd-se89f57fcec9dc4b5110-c1 to index blob cache: context canceled
2022-06-01T22:46:39.134553Z ERROR cache unable to add xn11_9131eee3a76ec8800d440aea71422bf1-sab1845b72f393438110-c1 to index blob cache: context canceled
2022-06-01T22:46:39.135550Z ERROR cache unable to add xn11_96730594615dfd474d66df320e504f45-s75fe15af2dca9bb6110-c1 to index blob cache: context canceled
2022-06-01T22:46:45.561273Z ERROR cache unable to add xn11_8780d5edcfc5934cdc1eb2597d3450e8-scca0381691e1c332110-c1 to index blob cache: context canceled
2022-06-01T22:46:45.561273Z ERROR cache unable to add xn11_9dc24215c450fb3b4549829ee27aa37f-sbc2c0a8a9cf4389c110-c1 to index blob cache: context canceled
2022-06-01T22:46:45.561273Z ERROR cache unable to add xn11_852aa5d796fa434839605fe37948ba67-s971e2b9aea601325110-c1 to index blob cache: context canceled
2022-06-01T22:46:45.561273Z ERROR cache unable to add xn11_8a968e547fe094abb5273bbf1b83003a-s96bd2d4b7848f9ed110-c1 to index blob cache: context canceled
2022-06-01T22:46:58.389780Z ERROR cache unable to add xn11_8c188bdee4561a54d57ce2c4190d773e-s38a154c881f72b8e110-c1 to index blob cache: context canceled
2022-06-01T22:46:58.389780Z ERROR cache unable to add xn11_6092e9c8572731ef9f122b42cb437954-s4a603e313599aa4d110-c1 to index blob cache: context canceled
2022-06-01T22:46:58.390777Z ERROR cache unable to add xn11_777948929bd850a5ad8130566ed70164-s08424019b78624d5110-c1 to index blob cache: context canceled
2022-06-01T22:46:58.390777Z ERROR cache unable to add xn11_7643e672ada417058704f208ddb1ef53-se3c381da08a61983110-c1 to index blob cache: context canceled
2022-06-01T22:47:24.014880Z ERROR cache unable to add xn11_649ef77c1d64f29e7cfb9d530f23ebea-sf9e335e7f8750680110-c1 to index blob cache: context canceled
2022-06-01T22:47:24.014880Z ERROR cache unable to add xn11_655600d7528c231f02192d2ab21222ce-sdad2e4202ff2cf28110-c1 to index blob cache: context canceled
2022-06-01T22:47:24.014880Z ERROR cache unable to add xn11_69a8c038d6f0fc1f0bda85f4885b067e-s532e348d4394504a110-c1 to index blob cache: context canceled
2022-06-01T22:47:24.014880Z ERROR cache unable to add xn11_6094770f37bce825d052d91a845b8648-sc9f2fe43088bb52f110-c1 to index blob cache: context canceled
2022-06-01T22:47:24.021861Z ERROR kopia/repo failed to open repository: unable to create shared content manager: error loading indexes: unable to load pack indexes despite 10 retries

Should I take a different approach like connect to repo>make snapshot>disconnect?

If you messed with the repo, make sure to clean your local kopia cache. Usually disconnecting kopia from its repo does this, so all it should take is a disconnect/reconnect.

Thank you, I was not sure I messed with the repo, I just put an image back with a cache from an earlier state of the windows system and a running kopiaUI with an old cache which connected to a later state of the repo.
What I did was a sync-to from another repo which was not connected to this repo, because I thought it was damaged, so yes, I disconnected from this “damaged” repo. After I connected again I still had the same error, so disconnecting/reconnecting was not a solution.
I am still getting used to how kopia is working and I wonder if this could be avoided in the future or how to handle.

Have you tried shutting down Kopia and removing all the contents from the cache folder, before starting up Kopia again?

That is the problem. When I restore a disk image and reboot Windows kopiaUI is already running and I am too late to stop it :frowning_face:

You may have tried it already but, if not, have you right-clicked the KopiaUI icon in system tray and disabled “Launch at Startup”?

Google drive is in continuous sync, that’s the problem I think. I wouldn’t backup such any drives like OneDrive, Google Drive, dropbox or any similar one. A sync daemon can lock files any time, change metadata that screw backup easily. If you still want to do that, at least stop syncing (unplug or disable network)

I was thinking of that but it is circumventing the problem I suppose. Don’t you think that putting back a disk image shouldn’t be a problem?
I am trying kopia for two weeks now and still testing different scenarios, so I am not really educated about the internal working of the software.
I am really interested what happens behind the scenes in such a scenario.

I am using Google Drive File Stream where all my files are stored in the cloud only. Kopia is writing to this directory and the files are only uploaded to Google drive, not mirrored! Google Drive is keeping track of those files and I never had a problem of a missed upload, not even in case of a computer crash while uploading. So I am not sure if there lies a problem with kopia.
I am still investigating what can go wrong. It looked like kopia was trying to synchronize an old cache to a newer repo and that should not have happened.

If the deleting all the cache files will gain you anything, it will also, if you just stop/disable Kopia and then make sure, that the cache folder get emptied.

Afterwards just start Kopia again and look where this will take you.