pcal43 / fastback

Fast, incremental Minecraft world backups. Powered by Git.
https://pcal43.github.io/fastback/
GNU General Public License v2.0
127 stars 19 forks source link

Restore fails due to "Error downloading object: DIM-1/data/raids.dat" #282

Closed Kataiser closed 12 months ago

Kataiser commented 12 months ago

Seems to happen every time, on any world, and even with only bare minimum of mods (for an iris install anyway). Using native git (git version 2.42.0.windows.1), local repo, and didn't test on a dedicated server. I've also included the zipped raids file if that matters, idk why it would though. latest.log raids.dat.zip

Kataiser commented 12 months ago

Oh it works with native-git-enabled false. Interesting

pcal43 commented 12 months ago

Oh it works with native-git-enabled false. Interesting

How were you able to do that? The CLI tries to stop you from switching between native and non-native mode on the same backup, because they are not compatible. I suspect that's what you're seeing here.

I pretty strongly suspect that you started this backup as non-native and manually set native-git-enabled true at some point later. Is that the case?

pcal43 commented 12 months ago

Try this in native mode and let me know if it helps. It basically tries to correct the lfs misconfiguration that your repo has:

fastback-0.15.6+1.20.1-prerelease-fabric.jar.zip

Kataiser commented 12 months ago

I didn't swap between the two, I fully nuked the .git and .fastback each test. (And restarted the game most times, and the first run was native)

Kataiser commented 12 months ago

This patch doesn't fix it, exact same error

pcal43 commented 12 months ago

Hmm, ok, thanks for clarifying. That's pretty weird.

So, I'm not 100% certain what is going on there but it does still feel to me

The trick is that for native to work, .git/config needs to have a bit that looks like this:

[filter "lfs"]
    clean = git-lfs clean -- %f
    smudge = git-lfs smudge -- %f
    process = git-lfs filter-process
    required = true

Based on the log you provided, it sort of looks to me like you somehow have a bit that tries to use the jgit smudge filter.

Kataiser commented 12 months ago

Yeah my config has that


[core]
    symlinks = false
    repositoryformatversion = 0
    filemode = false
    logallrefupdates = true
[commit]
    gpgsign = false
[fastback]
    native-git-enabled = true
[lfs]
    repositoryformatversion = 0
[filter "lfs"]
    clean = git-lfs clean -- %f
    smudge = git-lfs smudge -- %f
    process = git-lfs filter-process
    required = true
pcal43 commented 12 months ago

This patch doesn't fix it, exact same error

Hmm. My theory probably is not right, then. Are you able to try running the checkout (restore) command directly?

 git -C G:\Misc games\Minecraft\saves\lighthouseredstone-2023-09-17_12-33-14 checkout qBQ4/2023-09-17_12-33-14
pcal43 commented 12 months ago

..also, running

git lfs logs last

like it says might provide clues.

Kataiser commented 12 months ago

Fails, but at least from the command line we can see the error unlike in the MC log: fatal: not a git repository (or any of the parent directories): .git (which is weird cause git diff and such work). Also I had to add quotes to the path which suggest to me it may be a space in path issue in your mod

Kataiser commented 12 months ago

G:\Misc games\Minecraft\saves\New World>git lfs logs last
No logs to show
pcal43 commented 12 months ago

Also I had to add quotes to the path which suggest to me it may be a space in path issue in your mod

I don't think that's it. The code passes the command as an array of arguments - there is no string processing, no quoting required.

It just doesn't bother adding quotes when it reads it back in the logs.

Kataiser commented 12 months ago

Also maybe worth noting that the restore creates 10 files (as well as the full world structure) before failing on raids.dat

Kataiser commented 12 months ago

I can send the entire world and repo if you want, it's tiny

pcal43 commented 12 months ago

Fails, but at least from the command line we can see the error unlike in the MC log: fatal: not a git repository (or any of the parent directories): .git

Well, I think the trick would be to try to get it to work from the command line. One guess - lfs may not like the -C for some reason. This works fine for me but there may be something on Windows that is different.

Try ditching the -C and just making sure that pwd is the world directory when you run the command (if it wasn't).

Kataiser commented 12 months ago

Yeah I had the dir right

G:\Misc games\Minecraft\saves\New World>git checkout qBQ4/2023-09-17_23-10-13
error: pathspec 'qBQ4/2023-09-17_23-10-13' did not match any file(s) known to git

And yes the timestamp is different, I created a new repo/backup for the prerelease version

pcal43 commented 12 months ago

Ok. Well, I think you're in a good spot to isolate what's going on, then. e.g., what does git branch -a say?

Kataiser commented 12 months ago

* zBGj/2023-09-17_23-10-13

...oh right oops.


G:\Misc games\Minecraft\saves\New World>git checkout zBGj/2023-09-17_23-10-13
Already on 'zBGj/2023-09-17_23-10-13'
M       DIM-1/data/raids.dat
M       DIM1/data/raids_end.dat
M       data/raids.dat
M       level.dat
M       level.dat_old
M       playerdata/480c3e62-8f82-44f3-99c7-dee16591314b.dat
M       playerdata/480c3e62-8f82-44f3-99c7-dee16591314b.dat_old
M       stats/480c3e62-8f82-44f3-99c7-dee16591314b.json

G:\Misc games\Minecraft\saves\New World>git -C "G:\Misc games\Minecraft\saves\lighthouseredstone-2023-09-17_23-10-13" checkout zBGj/2023-09-17_23-10-13
fatal: not a git repository (or any of the parent directories): .git
pcal43 commented 12 months ago

Can you try it with -C on the same world directory?

I need to sign off. It looks like you have the problem pretty well isolated. I'm guessing it's some windows thing, maybe with spaces in the path, maybe with the -C. Not sure.

If you're able to identify something the mod can be doing differently that would help I'll be happy to change it.

Kataiser commented 12 months ago

Checkout works in that case, yeah idk how to help since I'm not very good at git

pcal43 commented 12 months ago

You can also try setting GIT_TRACE=1 and GIT_CURL_VERBOSE=1 in the environment. That will spit out a whole bunch of debugging info that might have more clues.

pcal43 commented 12 months ago

Checkout works in that case, yeah idk how to help since I'm not very good at git

Yeah so then it seems like something specific to the lighthouseredstone world. Would be helpful to try to isolate in just one test case.

Kataiser commented 12 months ago

Well like I said in the first message here, it happens in every world I try

pcal43 commented 12 months ago

But it's not happening on New World. ?

Kataiser commented 12 months ago

Ah sorry for the confusion, they're the same world. idk why it's like that, it's just some random old superflat I found cause it was small

pcal43 commented 12 months ago

Mmmm. But they're different git trees? So, something is different. Looking at what's different between the two would probably be a good place to start.

Another thing to try would be to set things up so there are no space in any of the directories (including misc games). I know Windows has all kinds of bugs with spaces in path names, would be good to at least rule out that out as a possible explanation.

Kataiser commented 12 months ago

Still happens even with a new world and no spaces in path. 20230918T001635.3619083.log

G:\Minecraft\saves\backuptest>git branch -a
  Tdes/2023-09-18_00-16-25
* Tdes/2023-09-18_00-16-56

G:\Minecraft\saves\backuptest>git -C "G:\Minecraft\saves\backuptest-2023-09-18_00-16-25" checkout Tdes/2023-09-18_00-16-56
fatal: not a git repository (or any of the parent directories): .git

G:\Minecraft\saves\backuptest-2023-09-18_00-16-25>git init
Initialized empty Git repository in G:/Minecraft/saves/backuptest-2023-09-18_00-16-25/.git/

G:\Minecraft\saves\backuptest>git -C "G:\Minecraft\saves\backuptest-2023-09-18_00-16-25" checkout Tdes/2023-09-18_00-16-56
error: pathspec 'Tdes/2023-09-18_00-16-56' did not match any file(s) known to git

...Why are there two branches, I only did one backup

pcal43 commented 12 months ago

Hmm, yeah I don't know what to tell you. I don't see that the mod is doing anything obviously wrong. Something in your git setup is causing problems.

Googling for the exact error might help, e.g. https://github.com/git-lfs/git-lfs/issues/4117 https://lists.yoctoproject.org/g/yocto/message/51732

Kataiser commented 12 months ago

Well if it's just on my end then I guess I don't really care. I'm not doing backups on this machine anyway, I just figured I'd report the issue. Thanks for looking into it.