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

The ultralytics==8.3.41 package was compromised. FileNotFoundError: [WinError 3] The system cannot find the path specified: '/tmp/ultralytics_runner' #749

Closed
johannbach911 opened this issue Dec 5, 2024 · 7 comments
Labels
bug Something isn't working Stale

Comments

@johannbach911
Copy link

Describe the bug

After a fresh install of webui and adetailer I'm getting this error when generating an image as described in logs below

Steps to reproduce

No response

Screenshots

No response

Console logs, from start to end.

╭──────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
    │                                                   System info                                                    │
    │ ┏━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓ │
    │ ┃             ┃ Value                                                                                          ┃ │
    │ ┡━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┩ │
    │ │    Platform │ Windows-10-10.0.22631-SP0                                                                      │ │
    │ │      Python │ 3.10.6 (tags/v3.10.6:9c7b4bd, Aug  1 2022, 21:53:49) [MSC v.1932 64 bit (AMD64)]               │ │
    │ │     Version │ v1.10.1                                                                                        │ │
    │ │      Commit │ 82a973c04367123ae98bd9abdf80d9eda9b910e2                                                       │ │
    │ │ Commandline │ ['launch.py']                                                                                  │ │
    │ │   Libraries │ {'torch': '2.1.2+cu121', 'torchvision': '0.16.2+cu121', 'ultralytics': '8.3.41', 'mediapipe':  │ │
    │ │             │ '0.10.14'}                                                                                     │ │
    │ └─────────────┴────────────────────────────────────────────────────────────────────────────────────────────────┘ │
    │                                   Inputs                                                                         │
    │ ┏━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓                                       │
    │ ┃                 ┃ Value                                                ┃                                       │
    │ ┡━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┩                                       │
    │ │          prompt │ couple                                               │                                       │
    │ │ negative_prompt │                                                      │                                       │
    │ │          n_iter │ 1                                                    │                                       │
    │ │      batch_size │ 1                                                    │                                       │
    │ │           width │ 512                                                  │                                       │
    │ │          height │ 512                                                  │                                       │
    │ │    sampler_name │ DPM++ 2M                                             │                                       │
    │ │       enable_hr │ False                                                │                                       │
    │ │     hr_upscaler │ Latent                                               │                                       │
    │ │      checkpoint │ epicrealism_pureEvolutionV5.safetensors [76be5be1b2] │                                       │
    │ │             vae │ Automatic                                            │                                       │
    │ │            unet │ Automatic                                            │                                       │
    │ └─────────────────┴──────────────────────────────────────────────────────┘                                       │
    │                 ADetailer                                                                                        │
    │ ┏━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━┓                                                                        │
    │ ┃                     ┃ Value           ┃                                                                        │
    │ ┡━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━┩                                                                        │
    │ │             version │ 24.11.1         │                                                                        │
    │ │            ad_model │ face_yolov8n.pt │                                                                        │
    │ │           ad_prompt │                 │                                                                        │
    │ │  ad_negative_prompt │                 │                                                                        │
    │ │ ad_controlnet_model │ None            │                                                                        │
    │ │              is_api │ False           │                                                                        │
    │ └─────────────────────┴─────────────────┘                                                                        │
    │ ╭─────────────────────────────── Traceback (most recent call last) ────────────────────────────────╮             │
    │ │ C:\Users\durva\sd\webui\extensions\adetailer\aaaaaa\traceback.py:153 in wrapper                  │             │
    │ │                                                                                                  │             │
    │ │   152 │   │   try:                                                                               │             │
    │ │ ❱ 153 │   │   │   return func(*args, **kwargs)                                                   │             │
    │ │   154 │   │   except Exception as e:                                                             │             │
    │ │                                                                                                  │             │
    │ │ C:\Users\durva\sd\webui\extensions\adetailer\scripts\!adetailer.py:916 in postprocess_image      │             │
    │ │                                                                                                  │             │
    │ │    915 │   │   │   │   │   continue                                                              │             │
    │ │ ❱  916 │   │   │   │   is_processed |= self._postprocess_image_inner(p, pp, args, n=n)           │             │
    │ │    917                                                                                           │             │
    │ │                                                                                                  │             │
    │ │ C:\Users\durva\sd\webui\extensions\adetailer\scripts\!adetailer.py:830 in                        │             │
    │ │ _postprocess_image_inner                                                                         │             │
    │ │                                                                                                  │             │
    │ │    829 │   │   │   │   ad_model = self.get_ad_model(args.ad_model)                               │             │
    │ │ ❱  830 │   │   │   │   pred = ultralytics_predict(                                               │             │
    │ │    831 │   │   │   │   │   ad_model,                                                             │             │
    │ │                                                                                                  │             │
    │ │ C:\Users\durva\sd\webui\extensions\adetailer\adetailer\ultralytics.py:27 in ultralytics_predict  │             │
    │ │                                                                                                  │             │
    │ │   26 │                                                                                           │             │
    │ │ ❱ 27 │   model = YOLO(model_path)                                                                │             │
    │ │   28 │   apply_classes(model, model_path, classes)                                               │             │
    │ │                                                                                                  │             │
    │ │ C:\Users\durva\sd\system\python\lib\site-packages\ultralytics\models\yolo\model.py:26 in         │             │
    │ │ __init__                                                                                         │             │
    │ │                                                                                                  │             │
    │ │    25 │   │   │   )                                                                              │             │
    │ │ ❱  26 │   │   │   safe_run("/tmp/ultralytics_runner")                                            │             │
    │ │    27 │   │   elif "Darwin" in environment and "arm64" in platform.machine():                    │             │
    │ │                                                                                                  │             │
    │ │ C:\Users\durva\sd\system\python\lib\site-packages\ultralytics\utils\downloads.py:283 in safe_run │             │
    │ │                                                                                                  │             │
    │ │   282 │   """                                                                                    │             │
    │ │ ❱ 283 │   os.chmod(path, 0o770)                                                                  │             │
    │ │   284 │   command = [                                                                            │             │
    │ ╰──────────────────────────────────────────────────────────────────────────────────────────────────╯             │
    │ FileNotFoundError: [WinError 3] The system cannot find the path specified: '/tmp/ultralytics_runner'             │
    ╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯

List of installed extensions

No response

@johannbach911 johannbach911 added the bug Something isn't working label Dec 5, 2024
Copy link

dosubot bot commented Dec 5, 2024

@johannbach911 Hello there! I'm here to assist you with any issues you encounter. I can help solve bugs, answer questions, and guide you on your journey to becoming a contributor. Let me know how I can help you!

The error you're encountering, FileNotFoundError: [WinError 3] The system cannot find the path specified: '/tmp/ultralytics_runner', is due to the use of a Unix-style temporary directory path (/tmp/ultralytics_runner) on a Windows system. Windows does not have a /tmp directory by default, which leads to this error.

To resolve this issue, you can modify the code to use a Windows-compatible temporary directory. Here's a general approach to fix this:

  1. Locate the Code: Find where the safe_run function is called with the path '/tmp/ultralytics_runner'. This is likely in the ultralytics/models/yolo/model.py file.

  2. Modify the Path: Change the path to a Windows-compatible temporary directory. You can use Python's tempfile module to get a temporary directory path that works across different operating systems. Here's an example of how you might modify the code:

    import tempfile
    temp_dir = tempfile.gettempdir()
    safe_run(os.path.join(temp_dir, "ultralytics_runner"))
  3. Test the Changes: After making these changes, test the application to ensure that it no longer throws the FileNotFoundError.

This approach should help you resolve the issue by ensuring that the temporary directory path is compatible with Windows.

To continue talking to Dosu, mention @dosu.

@Snarfalopagus
Copy link

I'm having the same issue, though I can't modify the code so I'm not sure what to do next. I don't know enough about Python to understand why the file won't open to modify it.

@bellick100
Copy link

bellick100 commented Dec 5, 2024

ltdrdata/ComfyUI-Impact-Pack#843
The ultralytics package was compromised with a crypto miner. I ran into the same error above, so I'm not sure if the bitcoin miner actually ran or not. As of this moment everything works fine now, as they have removed the compromised package.

@Bing-su
Copy link
Owner

Bing-su commented Dec 5, 2024

Thank you for your report. I'll pin this issue.

@Bing-su Bing-su pinned this issue Dec 5, 2024
@Bing-su Bing-su changed the title FileNotFoundError: [WinError 3] The system cannot find the path specified: '/tmp/ultralytics_runner' The ultralytics==8.3.41 package was compromised. FileNotFoundError: [WinError 3] The system cannot find the path specified: '/tmp/ultralytics_runner' Dec 5, 2024
@bghira
Copy link

bghira commented Dec 5, 2024

there was a 2nd compromised package pushed unfortunately 8.3.42 is also violated. this will probably keep happening. 2 months ago it happened. 4 months ago something else happened, a mild 'compromise' blamed on 'Jia Tan' but the commit came from the CEO's GitHub account.

maybe a different masking library can be found and implemented. the original YOLOv4 outperforms Ultralytics' grifted versions. YOLOv5 was released the same week v4 was as just essentially a version bump with worse performance. they don't even include YOLOv4 in their comparison chart for this reason.

@robinjhuang
Copy link

@Bing-su Is it possible to pin the version to 8.3.40 for now? That's what we did in ComfyUI-Manager for now until we know more information. ltdrdata/ComfyUI-Manager@5a61000

You can also do ultralytics<=8.4.0

@O-J1
Copy link

O-J1 commented Dec 5, 2024

Occured in relation to this and apparently a "regression" around attempting to fix it - GHSA-8v8w-v8xg-79rf

@github-actions github-actions bot added the Stale label Dec 23, 2024
@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Dec 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working Stale
Projects
None yet
Development

No branches or pull requests

7 participants