Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG]: Console error when starting A1111 #5

Open
1 task done
mikheys opened this issue Jun 8, 2023 · 2 comments
Open
1 task done

[BUG]: Console error when starting A1111 #5

mikheys opened this issue Jun 8, 2023 · 2 comments
Labels
bug Something isn't working

Comments

@mikheys
Copy link

mikheys commented Jun 8, 2023

Is there an existing issue for this?

  • I have searched the existing issues

Bug Description

Error loading script: better_styles.py
Traceback (most recent call last):
File "H:\stable-diffusion\extensions\sd-webui-better-styles\scripts\better_styles.py", line 119, in get_git_command
subprocess.run([git, "-v"], cwd=EXTENSION_ROOT, shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE,
File "H:\stable-diffusion\python\lib\subprocess.py", line 526, in run
raise CalledProcessError(retcode, process.args,
subprocess.CalledProcessError: Command '['git', '-v']' returned non-zero exit status 1.

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "H:\stable-diffusion\modules\scripts.py", line 263, in load_scripts
script_module = script_loading.load_module(scriptfile.path)
File "H:\stable-diffusion\modules\script_loading.py", line 10, in load_module
module_spec.loader.exec_module(module)
File "", line 883, in exec_module
File "", line 241, in _call_with_frames_removed
File "H:\stable-diffusion\extensions\sd-webui-better-styles\scripts\better_styles.py", line 436, in
initialize()
File "H:\stable-diffusion\extensions\sd-webui-better-styles\scripts\better_styles.py", line 428, in initialize
get_git_command()
File "H:\stable-diffusion\extensions\sd-webui-better-styles\scripts\better_styles.py", line 123, in get_git_command
subprocess.run([git, "-v"], cwd=EXTENSION_ROOT, shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE,
File "H:\stable-diffusion\python\lib\subprocess.py", line 526, in run
raise CalledProcessError(retcode, process.args,
subprocess.CalledProcessError: Command '['git\cmd\git.exe', '-v']' returned non-zero exit status 1.

Steps to Reproduce

After installing the extension and rebooting A1111, an error appears in the console.

Screenshot (optional)

image

@mikheys mikheys added the bug Something isn't working label Jun 8, 2023
@blooest
Copy link

blooest commented Jun 23, 2023

This extension has built-in version checking using Git. It's checking for Git by trying to run "git -v". Only brand new versions of Git have that shorthand for "--version", so older versions return a nonzero exit code indicating that an invalid option was sent.
A dirty fix is to just replace that -v on lines 119 and 123 with the full "--version".
EDIT: And it seems that it only raises further errors. I guess it means we should update our Git. That said...
I would argue as the proper fix that the version checking should be removed entirely, as A1111 already has it built-in.

@dragos240
Copy link

dragos240 commented Jul 4, 2023

Agreed. If it's already built into the webui, that is what should be used. Redundancy here isn't going to matter.

EDIT: Can confirm updating Git solves this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants