Scoop icon indicating copy to clipboard operation
Scoop copied to clipboard

[Bug] Uncommitted changes detected. Update aborted.

Open xiaoxstz opened this issue 9 months ago • 3 comments

Bug Report

Current Behavior

The output of scoop status tells me to run scoop update

λ scoop status
WARN  Scoop out of date. Run 'scoop update' to get the latest changes.

But the scoop update came across this warning.

λ scoop update
Updating Scoop...
WARN  Uncommitted changes detected. Update aborted.
Updating Buckets...
Scoop was updated successfully!

Then, let's run scoop status again. The warning still is in the output

λ scoop status
WARN  Scoop out of date. Run 'scoop update' to get the latest changes.

There was an issue #5458 before, but it was closed with no details.

Expected Behavior

No any warning.

Additional context/output

Possible Solution

System details

Windows version: [e.g. 7, 8, 10, 11] 10

OS architecture: [e.g. 32bit, 64bit, arm64]: 64bit

PowerShell version: [output of "$($PSVersionTable.PSVersion)"]

Major  Minor  Build  Revision
-----  -----  -----  --------
5      1      19041  4291

Additional software: [(optional) e.g. ConEmu, Git]: ConEmu,Git

Scoop Configuration

//# Your configuration here
{
    "last_update":  "2024-04-27T09:52:07.6653120+08:00",
    "aria2-enabled":  false,
    "scoop_repo":  "https://github.com/ScoopInstaller/Scoop",
    "scoop_branch":  "master"
}

xiaoxstz avatar Apr 27 '24 01:04 xiaoxstz

It may be related to #5915.

qwertyhjklxyz avatar Apr 27 '24 07:04 qwertyhjklxyz

It may be related to #5915.

+1 I'm experiencing both error. Defender deletes autoupdate.ps1.

PS ...\scoop\apps\scoop\current>  git status
On branch master
Your branch is behind 'origin/master' by 1 commit, and can be fast-forwarded.
  (use "git pull" to update your local branch)

Changes not staged for commit:
  (use "git add/rm <file>..." to update what will be committed)
  (use "git restore <file>..." to discard changes in working directory)
        deleted:    lib/autoupdate.ps1

no changes added to commit (use "git add" and/or "git commit -a")

mattia72 avatar Apr 27 '24 16:04 mattia72

One temporary solution is to add the scoop folder to windows defender exclusions.

qwertyhjklxyz avatar Apr 29 '24 05:04 qwertyhjklxyz

Yes. It is related to #5915 .

Reason

This issue appears when something in {UserProfile}\scoop\apps\scoop\current changes. If you haven't done it, security software(such as Windows Defender) is to blame.

{UserProfile}\scoop\apps\scoop\current is a git repository. You can check all the changes using git status.

Solution

  1. Add the folder to the exclusion of Windows Defender (or other security software).
  2. Revert the changes with git.

xiaoxstz avatar Apr 30 '24 09:04 xiaoxstz

Yes. It is related to #5915 .

Reason

This issue appears when something in {UserProfile}\scoop\apps\scoop\current changes. If you haven't done it, security software(such as Windows Defender) is to blame.

{UserProfile}\scoop\apps\scoop\current is a git repository. You can check all the changes using git status.

Solution

  1. Add the folder to the exclusion of Windows Defender (or other security software).
  2. Revert the changes with git.

For those who may be unaware of how to do this:

  1. You need to have git installed.
  2. Open Windows Defender, go to Virus & threat protection, then Manage settings under Virus & threat protection settings. Right down the bottom, there is an Add or remove exclusions option. Add C:\Users\<user>\scoop\apps\scoop\current to exclusions.
  3. Open a PowerShell session in that same directory, and do a git status. In my case, I saw that Windows Defender had kindly deleted autoupdate.ps1: image
  4. Undo this deletion (and any other unintended changes to this directory) by running git checkout .

image 6. Finally, do a scoop update

Everything should now be shiny and working again.

Reeceeboii avatar May 26 '24 12:05 Reeceeboii

Yes. It is related to https://github.com/ScoopInstaller/Scoop/issues/5915 .

There must be another reason for this. Defender is not active on my machine (Defender-the-malware-defender, not Defender Firewall). The security of the host is based on an EDR (CrowdStrike) and there are no alerts related to scoop.

wsw70 avatar Jun 11 '24 10:06 wsw70

Yes. It is related to #5915 .

There must be another reason for this. Defender is not active on my machine (Defender-the-malware-defender, not Defender Firewall). The security of the host is based on an EDR (CrowdStrike) and there are no alerts related to scoop.

I ended up here because I experienced the same issue. I also have CrowdStrike, and Windows Defender disabled. I would assume CrowdStrike is what's removing the file (I'm just a user, so I can't see any alert information).

wthueb avatar Jul 08 '24 14:07 wthueb

I can't see any alert information

There are none in Crowdstrike's console.

wsw70 avatar Jul 08 '24 14:07 wsw70

Yes. It is related to #5915 .

There must be another reason for this. Defender is not active on my machine (Defender-the-malware-defender, not Defender Firewall). The security of the host is based on an EDR (CrowdStrike) and there are no alerts related to scoop.

I ended up here because I experienced the same issue. I also have CrowdStrike, and Windows Defender disabled. I would assume CrowdStrike is what's removing the file (I'm just a user, so I can't see any alert information).

Uh oh... CrowdStrike! Hope you're okay!!!

Reeceeboii avatar Jul 21 '24 13:07 Reeceeboii

Uh oh... CrowdStrike! Hope you're okay!!!

Yeah, this was a miserable and annoying glitch but fortunately no losses of data or need to reinstall.

wsw70 avatar Jul 21 '24 13:07 wsw70