StabilityMatrix icon indicating copy to clipboard operation
StabilityMatrix copied to clipboard

Dubious Ownership issue with brand-new computer.

Open nothingness6 opened this issue 1 year ago • 5 comments

I've been using SM on my external SSD with my laptop until today and bought a new desktop now. I connected the external SSD to the new desktop and launched SM, and faced this error:

fatal: detected dubious ownership in repository at 'M:/AI_Tools/StabilityMatrix-win-x64/Data/Packages/stable-diffusion-webui'
'M:/AI_Tools/StabilityMatrix-win-x64/Data/Packages/stable-diffusion-webui' is owned by:
	'S-1-5-21-2630480264-1807950818-652494458-1000'
but the current user is:
	'S-1-5-21-3350547981-1954409536-889687067-1001'
To add an exception for this directory, call:

	git config --global --add safe.directory M:/AI_Tools/StabilityMatrix-win-x64/Data/Packages/stable-diffusion-webui
fatal: detected dubious ownership in repository at 'M:/AI_Tools/StabilityMatrix-win-x64/Data/Packages/stable-diffusion-webui'
'M:/AI_Tools/StabilityMatrix-win-x64/Data/Packages/stable-diffusion-webui' is owned by:
	'S-1-5-21-2630480264-1807950818-652494458-1000'
but the current user is:
	'S-1-5-21-3350547981-1954409536-889687067-1001'
Python 3.10.11 (tags/v3.10.11:7d4cc5a, Apr  5 2023, 00:38:17) [MSC v.1929 64 bit (AMD64)]
To add an exception for this directory, call:
Version: 1.8.0-RC

Commit hash: <none>
	git config --global --add safe.directory M:/AI_Tools/StabilityMatrix-win-x64/Data/Packages/stable-diffusion-webui
Couldn't determine assets's hash: 6f7db241d2f8ba7457bac5ca9753331f0c266917, attempting autofix...
Fetching all contents for assets
fatal: detected dubious ownership in repository at 'M:/AI_Tools/StabilityMatrix-win-x64/Data/Packages/stable-diffusion-webui/repositories/stable-diffusion-webui-assets'
'M:/AI_Tools/StabilityMatrix-win-x64/Data/Packages/stable-diffusion-webui/repositories/stable-diffusion-webui-assets' is owned by:
	'S-1-5-21-2630480264-1807950818-652494458-1000'
but the current user is:
	'S-1-5-21-3350547981-1954409536-889687067-1001'
Traceback (most recent call last):
To add an exception for this directory, call:

  File "M:\AI_Tools\StabilityMatrix-win-x64\Data\Packages\stable-diffusion-webui\launch.py", line 48, in <module>
	git config --global --add safe.directory M:/AI_Tools/StabilityMatrix-win-x64/Data/Packages/stable-diffusion-webui/repositories/stable-diffusion-webui-assets
    main()
  File "M:\AI_Tools\StabilityMatrix-win-x64\Data\Packages\stable-diffusion-webui\launch.py", line 39, in main
    prepare_environment()
  File "M:\AI_Tools\StabilityMatrix-win-x64\Data\Packages\stable-diffusion-webui\modules\launch_utils.py", line 410, in prepare_environment
    git_clone(assets_repo, repo_dir('stable-diffusion-webui-assets'), "assets", assets_commit_hash)
  File "M:\AI_Tools\StabilityMatrix-win-x64\Data\Packages\stable-diffusion-webui\modules\launch_utils.py", line 177, in git_clone
    current_hash = run_git(dir, name, 'rev-parse HEAD', None, f"Couldn't determine {name}'s hash: {commithash}", live=False).strip()
  File "M:\AI_Tools\StabilityMatrix-win-x64\Data\Packages\stable-diffusion-webui\modules\launch_utils.py", line 165, in run_git
    git_fix_workspace(dir, name)
  File "M:\AI_Tools\StabilityMatrix-win-x64\Data\Packages\stable-diffusion-webui\modules\launch_utils.py", line 152, in git_fix_workspace
    run(f'"{git}" -C "{dir}" fetch --refetch --no-auto-gc', f"Fetching all contents for {name}", f"Couldn't fetch {name}", live=True)
  File "M:\AI_Tools\StabilityMatrix-win-x64\Data\Packages\stable-diffusion-webui\modules\launch_utils.py", line 115, in run
    raise RuntimeError("\n".join(error_bits))
RuntimeError: Couldn't fetch assets.
Command: "M:\AI_Tools\StabilityMatrix-win-x64\Data\PortableGit\bin\git.exe" -C "M:\AI_Tools\StabilityMatrix-win-x64\Data\Packages\stable-diffusion-webui\repositories\stable-diffusion-webui-assets" fetch --refetch --no-auto-gc
Error code: 128

Process finished with exit code 1

I guess it's because of the ownership. How do I use it on both laptop and desktop without the permission issue?

nothingness6 avatar Mar 08 '24 11:03 nothingness6

I asked ChatGPT and it gave me an answer. git config --global --add safe.directory M:/AI_Tools/StabilityMatrix-win-x64/Data/Packages/stable-diffusion-webui It said that the above command will help. The ownership error still remains, and this is the new error message.

Python 3.10.11 (tags/v3.10.11:7d4cc5a, Apr  5 2023, 00:38:17) [MSC v.1929 64 bit (AMD64)]
Version: v1.8.0
Commit hash: bef51aed032c0aaa5cfd80445bc4cf0d85b408b5
Couldn't determine assets's hash: 6f7db241d2f8ba7457bac5ca9753331f0c266917, attempting autofix...
Fetching all contents for assets
fatal: detected dubious ownership in repository at 'M:/AI_Tools/StabilityMatrix-win-x64/Data/Packages/stable-diffusion-webui/repositories/stable-diffusion-webui-assets'
'M:/AI_Tools/StabilityMatrix-win-x64/Data/Packages/stable-diffusion-webui/repositories/stable-diffusion-webui-assets' is owned by:
	'S-1-5-21-2630480264-1807950818-652494458-1000'
but the current user is:
	'S-1-5-21-3350547981-1954409536-889687067-1001'
Traceback (most recent call last):
To add an exception for this directory, call:

  File "M:\AI_Tools\StabilityMatrix-win-x64\Data\Packages\stable-diffusion-webui\launch.py", line 48, in <module>
	git config --global --add safe.directory M:/AI_Tools/StabilityMatrix-win-x64/Data/Packages/stable-diffusion-webui/repositories/stable-diffusion-webui-assets
    main()
  File "M:\AI_Tools\StabilityMatrix-win-x64\Data\Packages\stable-diffusion-webui\launch.py", line 39, in main
    prepare_environment()
  File "M:\AI_Tools\StabilityMatrix-win-x64\Data\Packages\stable-diffusion-webui\modules\launch_utils.py", line 410, in prepare_environment
    git_clone(assets_repo, repo_dir('stable-diffusion-webui-assets'), "assets", assets_commit_hash)
  File "M:\AI_Tools\StabilityMatrix-win-x64\Data\Packages\stable-diffusion-webui\modules\launch_utils.py", line 177, in git_clone
    current_hash = run_git(dir, name, 'rev-parse HEAD', None, f"Couldn't determine {name}'s hash: {commithash}", live=False).strip()
  File "M:\AI_Tools\StabilityMatrix-win-x64\Data\Packages\stable-diffusion-webui\modules\launch_utils.py", line 165, in run_git
    git_fix_workspace(dir, name)
  File "M:\AI_Tools\StabilityMatrix-win-x64\Data\Packages\stable-diffusion-webui\modules\launch_utils.py", line 152, in git_fix_workspace
    run(f'"{git}" -C "{dir}" fetch --refetch --no-auto-gc', f"Fetching all contents for {name}", f"Couldn't fetch {name}", live=True)
  File "M:\AI_Tools\StabilityMatrix-win-x64\Data\Packages\stable-diffusion-webui\modules\launch_utils.py", line 115, in run
    raise RuntimeError("\n".join(error_bits))
RuntimeError: Couldn't fetch assets.
Command: "M:\AI_Tools\StabilityMatrix-win-x64\Data\PortableGit\bin\git.exe" -C "M:\AI_Tools\StabilityMatrix-win-x64\Data\Packages\stable-diffusion-webui\repositories\stable-diffusion-webui-assets" fetch --refetch --no-auto-gc
Error code: 128

Process finished with exit code 1

ChatGPT isn't helpful this time. Nothing works except Fooocus on my brand-new desktop. ComfyUI also shows only blank screen.

nothingness6 avatar Mar 08 '24 12:03 nothingness6

Try changing the ownership of the repository (and the rest of the stable diffusion webui files/directories) to your current user account. Open an administrative command prompt and navigate to the parent directory of the repository (M:/AI_Tools/StabilityMatrix-win-x64/Data/Packages/stable-diffusion-webui). Then, run the following command to take ownership of the stable-diffusion-webui directory and its contents: (edited to correct path name)

takeown /f . /r /d y

After taking ownership, reset the permissions with the following command:

icacls . /reset /t /c /l /q

philmcrakin avatar Mar 10 '24 04:03 philmcrakin

Try changing the ownership of the repository (and the rest of the stable diffusion webui files/directories) to your current user account. Open an administrative command prompt and navigate to the parent directory of the repository (M:/AI_Tools/StabilityMatrix-win-x64/Data/Packages/stable-diffusion-webui). Then, run the following command to take ownership of the stable-diffusion-webui-assets directory and its contents:

takeown /f . /r /d y

After taking ownership, reset the permissions with the following command:

icacls . /reset /t /c /l /q

Hi, thanks for the reply. Does it change the ownership completely? I should work with two computers and if it doesn't work with my laptop, I should do the process again. Is it correct?

nothingness6 avatar Mar 11 '24 00:03 nothingness6

takedown is a windows command-line utility that allows you to take ownership of files and directories.

takeown /f . /r /d y

  • the /f switch specifies the file or folder you want to take ownership of
  • the . represents the current working directory you are running the cmd from
  • the /r switch is for recursive processing, which means taking ownership of all subfolders and files in the specified dir.
  • the /d y suppresses the confirmation prompt when the user does not have the List Folder permission on a specified directory, and instead uses the specified default value. The y simply means y (as in yes, take ownsership) rather than you having to acept it manually for each file. https://learn.microsoft.com/en-us/windows-server/administration/windows-commands/takeown

icacls is used to reset the security permissions for the current directory and all its subdirectories, files, and subfolders recursively. The switches provided replace the ACLs ( Access Control List ) with default inherited ACLs for all matching files.)

icacls . /reset /t /c /l /q

  • the . same as before, CWD
  • /reset This flag resets the ACL for the specified files or directories to the default inherited ACL from the parent directory. You changed the parent directory with the takeover cmd
  • /t Performs the operation on all specified files in the current directory and its subdirectories.
  • /c Continues the operation despite any file errors. Error messages will still be displayed.
  • /l Performs the operation on a symbolic link instead of its destination.
  • /q Suppresses success messages.

https://learn.microsoft.com/en-us/windows-server/administration/windows-commands/icacls

Hope that helps clear it up? Feel free to ask if anything is unclear.

philmcrakin avatar Mar 11 '24 00:03 philmcrakin

Then, run the following command to take ownership of the stable-diffusion-webui-assets directory and its contents:

I made a mistake in that line it should instead have read:

Then, run the following command to take ownership of the stable-diffusion-webui directory and its contents:

I corrected the original post but wanted to clarify in case I had mislead you or confused you with that.

philmcrakin avatar Mar 11 '24 00:03 philmcrakin

This issue is stale because it has been open 30 days with no activity. Remove the stale label or comment, else this will be closed in 5 days.

github-actions[bot] avatar Jul 06 '24 01:07 github-actions[bot]

This issue was closed because it has been stale for 5 days with no activity.

github-actions[bot] avatar Jul 11 '24 01:07 github-actions[bot]