[GH-ISSUE #772] [Maintenance Bug] Maintenance does not detect missing python package in ComfyUI-Manager #223

Closed
opened 2026-10-31 22:10:18 +00:00 by bsakaguchi · 1 comment
Owner

Originally created by @huchenlei on GitHub (Jan 29, 2025).
Original GitHub issue: https://github.com/Comfy-Org/desktop/issues/772

Originally assigned to: @webfiltered on GitHub.

Currenly virtualEnvironment.hasRequirements only checks python packages in ComfyUI core. However if ComfyUI manager's requirement is missing, it won't trigger maintenance page.

github.com/Comfy-Org/desktop@15cef48595/src/virtualEnvironment.ts (L493-L513)

┆Issue is synchronized with this Notion page by Unito

Originally created by @huchenlei on GitHub (Jan 29, 2025). Original GitHub issue: https://github.com/Comfy-Org/desktop/issues/772 Originally assigned to: @webfiltered on GitHub. Currenly `virtualEnvironment.hasRequirements` only checks python packages in ComfyUI core. However if ComfyUI manager's requirement is missing, it won't trigger maintenance page. https://github.com/Comfy-Org/desktop/blob/15cef485950a09dda791fa6497a1e33eed1b8767/src/virtualEnvironment.ts#L493-L513 ┆Issue is synchronized with this [Notion page](https://www.notion.so/Issue-772-Maintenance-Bug-Maintenance-does-not-detect-missing-python-package-in-ComfyUI-Manager-18a6d73d365081ac90f5ded40def5f34) by [Unito](https://www.unito.io)
bsakaguchi 2026-10-31 22:10:18 +00:00
  • closed this issue
  • added the
    bug
    label
Author
Owner

@dosubot[bot] commented on GitHub (Jan 29, 2025):

Hey @huchenlei! I'm here to help you with any bugs, questions, or contributions you have for ComfyUI-Manager. Let's squash this bug together! If there's anything I can assist you with, feel free to ask.

To address the issue of detecting missing Python packages in the ComfyUI Manager, you can modify the hasRequirements function in virtualEnvironment.ts to check both the core and manager requirements. Here's how you can update the function:

async hasRequirements() {
  const checkRequirements = async (requirementsPath: string) => {
    const args = ['pip', 'install', '--dry-run', '-r', requirementsPath];
    log.info(`Running direct process command: ${args.join(' ')}`);

    let output = '';
    const callbacks: ProcessCallbacks = {
      onStdout: (data) => (output += data.toString()),
      onStderr: (data) => (output += data.toString()),
    };
    const result = await this.runCommandAsync(this.uvPath, args, { VIRTUAL_ENV: this.venvPath }, callbacks);

    if (result.exitCode !== 0)
      throw new Error(`Failed to get packages: Exit code ${result.exitCode}, signal ${result.signal}`);
    if (!output) throw new Error('Failed to get packages: uv output was empty');

    return output.search(/\bWould make no changes\s+$/) !== -1;
  };

  const coreRequirementsOk = await checkRequirements(this.comfyUIRequirementsPath);
  const managerRequirementsOk = await checkRequirements(this.comfyUIManagerRequirementsPath);

  if (!coreRequirementsOk || !managerRequirementsOk) {
    log.warn('Some requirements are missing.');
  }

  return coreRequirementsOk && managerRequirementsOk;
}

This modification introduces a helper function checkRequirements that checks for missing packages for a given requirements file. The hasRequirements function then uses this helper to check both the core and manager requirements, ensuring that missing packages in the ComfyUI Manager are also detected [1].

To continue talking to Dosu, mention @dosu.


Help Dosu learn! Give it feedback: Great Response | Irrelevant Answer | Incorrect Sources | Too Verbose | Hallucination | Other

<!-- gh-comment-id:2622874484 --> @dosubot[bot] commented on GitHub (Jan 29, 2025): <!-- Greeting --> Hey @huchenlei! I'm here to help you with any bugs, questions, or contributions you have for ComfyUI-Manager. Let's squash this bug together! If there's anything I can assist you with, feel free to ask. <!-- Answer --> To address the issue of detecting missing Python packages in the ComfyUI Manager, you can modify the `hasRequirements` function in `virtualEnvironment.ts` to check both the core and manager requirements. Here's how you can update the function: ```typescript async hasRequirements() { const checkRequirements = async (requirementsPath: string) => { const args = ['pip', 'install', '--dry-run', '-r', requirementsPath]; log.info(`Running direct process command: ${args.join(' ')}`); let output = ''; const callbacks: ProcessCallbacks = { onStdout: (data) => (output += data.toString()), onStderr: (data) => (output += data.toString()), }; const result = await this.runCommandAsync(this.uvPath, args, { VIRTUAL_ENV: this.venvPath }, callbacks); if (result.exitCode !== 0) throw new Error(`Failed to get packages: Exit code ${result.exitCode}, signal ${result.signal}`); if (!output) throw new Error('Failed to get packages: uv output was empty'); return output.search(/\bWould make no changes\s+$/) !== -1; }; const coreRequirementsOk = await checkRequirements(this.comfyUIRequirementsPath); const managerRequirementsOk = await checkRequirements(this.comfyUIManagerRequirementsPath); if (!coreRequirementsOk || !managerRequirementsOk) { log.warn('Some requirements are missing.'); } return coreRequirementsOk && managerRequirementsOk; } ``` This modification introduces a helper function `checkRequirements` that checks for missing packages for a given requirements file. The `hasRequirements` function then uses this helper to check both the core and manager requirements, ensuring that missing packages in the ComfyUI Manager are also detected <sup>[[1]](https://github.com/Comfy-Org/desktop/blob/main/src/virtualEnvironment.ts)</sup>. <!-- Dosu Comment Footer --> *To continue talking to [Dosu](https://dosu.dev), mention @dosu.* --- <sup>Help Dosu learn! Give it feedback: [Great Response](https://app.dosu.dev/response-feedback/6b593912-87fb-4f8a-930c-1ae9cacab19b?feedback_type=great_response) | [Irrelevant Answer](https://app.dosu.dev/response-feedback/6b593912-87fb-4f8a-930c-1ae9cacab19b?feedback_type=irrelevant_answer) | [Incorrect Sources](https://app.dosu.dev/response-feedback/6b593912-87fb-4f8a-930c-1ae9cacab19b?feedback_type=incorrect_sources) | [Too Verbose](https://app.dosu.dev/response-feedback/6b593912-87fb-4f8a-930c-1ae9cacab19b?feedback_type=too_verbose) | [Hallucination](https://app.dosu.dev/response-feedback/6b593912-87fb-4f8a-930c-1ae9cacab19b?feedback_type=hallucination) | [Other](https://app.dosu.dev/response-feedback/6b593912-87fb-4f8a-930c-1ae9cacab19b?feedback_type=other)</sup>
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Comfy-Org/desktop#223
No description provided.