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

Crash on start #18

Open
kevinvennitti opened this issue Sep 12, 2022 · 7 comments
Open

Crash on start #18

kevinvennitti opened this issue Sep 12, 2022 · 7 comments

Comments

@kevinvennitti
Copy link

kevinvennitti commented Sep 12, 2022

Hi!

I have an error when I start the app:

Uncaught Exception:
TypeError: Object has been destroyed
at IpcMainImpl.<anonymous> (/private/var/folders/qz/kbmfy__56z14l1xg6hzdzksr0000gn/T/AppTranslocation/93B9BEA5-64F3-4A8E-9A7E-EBD19AC93C47/d/DiffusionBee.app/Contents/Resources/app.asar/background.js:2:240352)
at IpcMainImpl.emit (events.js:315:20)
at Object.<anonymous> (electron/js2c/browser_init.js:161:10307)
at Object.emit (events.js:315:20)
at ChildProcess.<anonymous> (/private/var/folders/qz/kbmfy__56z14l1xg6hzdzksr0000gn/T/AppTranslocation/93B9BEA5-64F3-4A8E-9A7E-EBD19AC93C47/d/DiffusionBee.app/Contents/Resources/app.asar/background.js:2:244979)
at ChildProcess.emit (events.js:315:20)
at maybeClose (internal/child_process.js:1048:16)
at Socket.<anonymous> (internal/child_process.js:439:11)
at Socket.emit (events.js:315:20)
at Pipe.<anonymous> (net.js:673:12)

Timeline:

  1. Launch the app

screencapture-2022-09-12-16 54 31@2x

  1. 2 seconds later, this modal prompts:

screencapture-2022-09-12-16 54 33@2x

  1. Clicked "OK", this modal prompts:

screencapture-2022-09-12-16 54 26@2x

  1. Clicked "OK", the modal closes itself

macOS

screencapture-2022-09-12-16 54 50@2x

Feel free to ask any question to debug!

@discodan
Copy link

This is happening to me as well.
image

@banagale
Copy link

This also happened for me, but it started up fine on the second attempt.

@kevinvennitti
Copy link
Author

I just reboot my Mac and it seems to work fine now! ✅
@discodan Would you try?

@divamgupta
Copy link
Owner

Could you open terminal and run it via there.

cd <path_of_the_app>/DiffusionBee.app/Contents/MacOS
 ./DiffusionBee 

And paste the logs

@kapje
Copy link

kapje commented Sep 13, 2022

Same problem as OP, log from CLI:

./DiffusionBee 
34.017968128 Is the free memory
68.719476736 Is the total memory
21.6.0 ohoho
native functions imported
starting briddddd
BrowserWindow {
  setBounds: [Function (anonymous)],
  _events: [Object: null prototype] {
    blur: [Function (anonymous)],
    focus: [Function (anonymous)],
    show: [Function: visibilityChanged],
    hide: [Function: visibilityChanged],
    minimize: [Function: visibilityChanged],
    maximize: [Function: visibilityChanged],
    restore: [Function: visibilityChanged],
    resize: [Function: R],
    move: [Function: R],
    close: [Function (anonymous)]
  },
  _eventsCount: 10,
  devToolsWebContents: [Getter]
}
browser object binded
browser object binded
Python response:  non threaded input for unix systems!
locale set failed
locale set failed 2

Python response:  utds loading_msg___U_P_D_A_T_E___" Loading model "
utds loading_percentage___U_P_D_A_T_E___-1

Python response:  utds loading_msg___U_P_D_A_T_E___"Downloading Model 1/2"

Python response:  utds loading_msg___U_P_D_A_T_E___"Checking Model"
utds loading_desc___U_P_D_A_T_E___""

stderr: Traceback (most recent call last):
  File "txt2img.py", line 340, in <module>

stderr:   File "txt2img.py", line 233, in main
  File "ldm/downloader.py", line 124, in download
AssertionError: The checksum for downloaded file failed.
[3379] Failed to execute script 'txt2img' due to unhandled exception!

@minrk
Copy link

minrk commented Sep 13, 2022

It could do a better job reporting download errors, but I tracked it down to psf/requests#2773 and the fact that I had an old Google API token for www.googleapis in my ~/.netrc that looked like:

machine www.googleapis.com
  password 4/....

Removing those lines from my ~/.netrc and trashing ~/.diffusionbee/downloads fixed it (trashing downloads may not have been required).

Ignoring netrc is weirdly complicated for requests if you don't want to also ignore any http proxy configuration from the env.

Problems to fix:

  • ignore netrc (requests session.trust_env = False or NullAuth)
  • When checksum fails, show the file and URL that failed
  • Show download errors for checksum failures and/or initial request errors to user instead of opaque "Backend quit unexpectedly"

How I tracked it down:

$ ls ~/.diffusionbee/downloads
sd-v1-4.ckpt
$ head ~/.diffusionbee/downloads/sd-v1-4.ckpt
HTTP Basic Authentication is not supported for this API

which told me Basic Auth credentials were being sent that shouldn't be. Checked the URL including redirects by attempting the download myself:

In [1]: import requests

In [2]: r = requests.get("https://me.cmdr2.org/stable-diffusion-ui/sd-v1-4.ckpt")

In [3]: r
Out[3]:
401 https://www.googleapis.com/storage/v1/b/aai-blog-files/o/sd-v1-4.ckpt?alt=media
headers:   Alt-Svc: h3=":443"; ma=2592000,h3-29=":443"; ma=2592000,h3-Q050=":443"; ma=2592000,h3-Q046=":443"; ma=2592000,h3-Q043=":443"; ma=2592000,quic=":443"; ma=2592000; v="46,43"
  Cache-Control: private, max-age=0
  Content-Length: 55
  Content-Type: text/html; charset=UTF-8
  Date: Tue, 13 Sep 2022 09:08:27 GMT
  Expires: Tue, 13 Sep 2022 09:08:27 GMT
  Server: UploadServer
  Vary: Origin, X-Origin
  WWW-Authenticate: basic realm="Google APIs"
  X-GUploader-UploadID:...
body (text/html; charset=UTF-8):
HTTP Basic Authentication is not supported for this API

found machine www.googleapis.com in my ~/.netrc

@kapje
Copy link

kapje commented Sep 14, 2022

An old .netrc that I didn't even know was there was indeed the problem - thanks minrk

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants