Moonraker showing "Dirty" in Update Manager

Basic Information:

Printer Model: Sovol SV05
MCU / Printerboard: Creality v4.2.2
klippy (3).log (4.8 MB)

klippy.log

Describe your issue:

Noticed today in Update Manager that Moonraker is showing “Dirty” with two recovery options in a drop-down: 1) Soft Recovery and 2) Hard Recovery. Moonraker also shows the version info below next to it’s name:

 Moonraker 
 v0.8.0-5 > v0.8.0-23

I did make some changes on my rpi today to enable Iinput Shaping testing, but I don’t think any of that would have any effect on Moonraker.

Appreciate suggestions on Soft vs. Hard recovery, or whatever else I should do. I’ve not found much at all about “Dirty” status and the two recovery options, so I’m not quite sure what to do, or in what order.

This means your local version has modifications compared to the official version on Github. Usually only happens when you edit files in the moonraker folder.
Use “hard” to recover.

What is the difference between “hard” and “soft” recovery.
“Hard” is explained here Remote API - Moonraker (search for “corrupt”), but I couldn’t find “soft recovery”.

AFAIK this relates to some git black magic: Git - git-reset Documentation
Unless I miss something, this adds no value to the regular user apart from confusing him.

If you made changes and you know git well enough to distinguish between a “soft” and “hard” reset you certainly will not do it from a webinterface.

The strange thing is I did not make any changes (that I’m aware of) in any Github…the only recent things I’d done as I noted above was update my rpi and printer.cfg to do input shaping accelerometer testing, which completed w/out issue. I haven’t edited anything in the Moonraker folder.

I ended up doing a Soft Recovery and things look normal again.

I’m doing a print right now to confirm, and was able to upload and start the print, things look normal.

Thanks for all the feedback.

I need to correct myself after checking the sources.

From the moonraker documentation:

Recover a corrupt repo

On occasion a git command may fail resulting in a repo in a dirty or invalid state. When this happens it is possible to recover. The name argument must specify the name of the repo to recover, it must be of a git repo type. There are two methods of recovery, the hard argument determines which method is used:

  • hard == true: Moonraker will remove the old directory entirely. It will then attempt to recover with rsync by restoring a backup of a recent valid repo.
  • hard == false: Will run git clean -f -d followed by git reset --hard {remote}/{branch}. This is useful for recovering dirty repos that are valid. It is possible that this will work on an invalid repo, however it will not work on a corrupt repo.

Function call in mainsail:

So basically:

  • hard: Delete and create new
  • soft: Use git commands to clean and reset hard

Basically it is the same. soft could fail if the local git clone is severely broken, then only hard would do the job.

3 Likes

Thanks for the additional detail behind the curtain, so to speak.

So am I correct in that this was probably a random failure and likely not something I did? Just would like to minimize the frequency w/which I shoot myselft in my foot. :slight_smile:

I have no frickeling clue, what you want to tell me, but I will investigate.

Here it is explained Git Reset | Hard, Soft & Mixed | Learn Git.

I’ve noticed my moonraker becomes dirty seemingly randomly, and I definitely never touch any of those files. My guess would be sporadically the OS is doing something to the folder

1 Like

Which OS are you using?

Me? rpi 4/2GB w/Bullseye on it.

1 Like

I’m on armbian, but have had the same issues with multiple computers with multiple linux variants.

1 Like

Strange. I’m running Klipper on armbian and vanilla Debian and never had the issue unless self inflicted.

1 Like