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

MacOS – does not connect to FoooXus (ERROR in app: Exception on /ajax/getDeviceInfo – 500 INTERNAL SERVER ERROR) #5

Closed
KannManMachen opened this issue Feb 26, 2024 · 4 comments

Comments

@KannManMachen
Copy link

KannManMachen commented Feb 26, 2024

Hey there :) – first of all thx @toutjavascript for giving us such a nice extension for Fooocus. I'm looking forward to finally work with batches for the first time ever (together with stable diffusion).

Unfortunately I can't get FoooXus to work yet. I am not a developer myself and cannot interpret the error messages spit out in MacOS terminal + browser console.

Bildschirmfoto 2024-02-26 um 22 10 44

I get the following error message in the terminal:

FoooXus-Fooocus-Extender % python foooxus.py
**********************    STARTING FoooXuS APP V0.8.2   **********************
  Thanx for using. Please report issues and ideas on 
  https://github.com/toutjavascript/FoooXus-Fooocus-Extender 
You are running Python V3.11.5 on Darwin 22.6.0 Build Darwin Kernel Version 22.6.0: Sun Dec 17 22:13:25 PST 2023; root:xnu-8796.141.3.703.2~2/RELEASE_ARM64_T6020
  (venv) is activated
FoooXus ckecks installed module versions and compares them to requirements.txt
  Modules            Requirement       Installed version
  Flask              3.0.2             ✔ 3.0.2
  GPUtil             1.4.0             ✔ 1.4.0
  gradio             3.41.2            ✔ 3.41.2
  gradio_client      0.5.0             ✔ 0.5.0
  Pillow             10.2.0            ✔ 10.2.0
  psutil             5.9.5             ✔ 5.9.5
  py_cpuinfo         9.0.0             ✔ 9.0.0
All requirements are met. FoooXus should start :)

Now, open FoooXus web UI on http://127.0.0.1:7878

* Serving Flask app 'foooxus'
* Debug mode: off

[2024-02-26 21:42:24,569] ERROR in app: Exception on /ajax/getDeviceInfo [POST]
Traceback (most recent call last):
  File "/Users/xxx/Code/Python_Projekte/FoooXus-Fooocus-Extender/FoooXus-Fooocus-Extender/venv/lib/python3.11/site-packages/flask/app.py", line 1463, in wsgi_app
    response = self.full_dispatch_request()
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/xxx/Code/Python_Projekte/FoooXus-Fooocus-Extender/FoooXus-Fooocus-Extender/venv/lib/python3.11/site-packages/flask/app.py", line 872, in full_dispatch_request
    rv = self.handle_user_exception(e)
         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/xxx/Code/Python_Projekte/FoooXus-Fooocus-Extender/FoooXus-Fooocus-Extender/venv/lib/python3.11/site-packages/flask/app.py", line 870, in full_dispatch_request
    rv = self.dispatch_request()
         ^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/xxx/Code/Python_Projekte/FoooXus-Fooocus-Extender/FoooXus-Fooocus-Extender/venv/lib/python3.11/site-packages/flask/app.py", line 855, in dispatch_request
    return self.ensure_sync(self.view_functions[rule.endpoint])(**view_args)  # type: ignore[no-any-return]
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/xxx/Code/Python_Projekte/FoooXus-Fooocus-Extender/FoooXus-Fooocus-Extender/foooxus.py", line 194, in getDeviceInfo
    deviceInfo=device.getDeviceInfo()
               ^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/xxx/Code/Python_Projekte/FoooXus-Fooocus-Extender/FoooXus-Fooocus-Extender/src/device.py", line 13, in getDeviceInfo
    cpu_util = psutil.cpu_freq()
               ^^^^^^^^^^^^^^^^^
  File "/Users/xxx/Code/Python_Projekte/FoooXus-Fooocus-Extender/FoooXus-Fooocus-Extender/venv/lib/python3.11/site-packages/psutil/__init__.py", line 1869, in cpu_freq
    ret = _psplatform.cpu_freq()
          ^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/xxx/Code/Python_Projekte/FoooXus-Fooocus-Extender/FoooXus-Fooocus-Extender/venv/lib/python3.11/site-packages/psutil/_psosx.py", line 179, in cpu_freq
    curr, min_, max_ = cext.cpu_freq()
                       ^^^^^^^^^^^^^^^
FileNotFoundError: [Errno 2] No such file or directory (originated from sysctl(HW_CPU_FREQ))

And this is the error in the browser console:

Request URL: http://127.0.0.1:7878/ajax/getDeviceInfo
Request Method: POST
Status Code: 500 INTERNAL SERVER ERROR
Remote Address: 127.0.0.1:7878
Referrer Policy: strict-origin-when-cross-origin
@toutjavascript
Copy link
Owner

Hi

Thank you for your test, message and full issue description.

I didn't test it on macOS at all.
It seems that the device detection is broken.
I will publish tomorrow an update to ignore this part on macOS.
it should be good.

@toutjavascript
Copy link
Owner

Hello

V0.8.3 is online
You can update your FoooXus folder with a git pull and restart FoooXus app

Please tell me if it launches now

@KannManMachen
Copy link
Author

Hey @toutjavascript,

To make a long story short: it works :)

First I got the following error message in the browser (no error was displayed in the browser console):

Bildschirmfoto 2024-02-27 um 10 20 59

I then found the following error message in the MacOS terminal:

Loaded as API: http://127.0.0.1:7866/ ✔
Connection to Fooocus failed...
 ConnectionError, check that:
  - Fooocus must be running, on the same device
  - Fooocus address config.json is set to http://127.0.0.1:7866 
HTTPConnectionPool(host='127.0.0.1', port=7866): Max retries exceeded with url: /config (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x1051d0850>: Failed to establish a new connection: [Errno 61] Connection refused'))

Apparently my "fooocus-address" had changed. So I updated it in the (FoooXus) config.json. After that I just had to close and reopen FoooXus and it opened without any error message :)

Thx for the support!

@toutjavascript
Copy link
Owner

Great

I close the issue and I add a note in readme that FoooXus works on macOS

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

2 participants