[GH-ISSUE #44] "Format failed" error on Windows despite successful LLM API initialization (spawn ENOENT error) #40

Open
opened 2026-02-26 21:30:58 +03:00 by kerem · 3 comments
Owner

Originally created by @nickalps on GitHub (Feb 9, 2026).
Original GitHub issue: https://github.com/fspecii/ace-step-ui/issues/44

I installed the UI on Windows following the instructions in the README.

Steps to Reproduce:

  • Start the API server and the UI application using "start-all.bat"
  • Try to use the "Format" feature on either "Lyrics" or "Style".

Result:

  • The UI shows a popup error: "Format failed. The LLM may not be available."

However, the API server command window shows that the LLM model was loaded successfully (see logs below).
The UI command window shows a spawn error related to the Python executable in the virtual environment (see logs below).

Logs:
From the API Server CMD window:
2026-02-09 20:10:11.248 | INFO | acestep.llm_inference:_initialize_5hz_lm_vllm:454 - 5Hz LM initialized successfully in 20.01 seconds
2026-02-09 20:10:11.248 | INFO | acestep.llm_inference:initialize:390 - 5Hz LM status message: 5Hz LM initialized successfully
Model: F:\ACE-Step-1.5\checkpoints\acestep-5Hz-lm-0.6B
Device: NVIDIA GeForce RTX 3060
GPU Memory Utilization: 0.250
Low GPU Memory Mode: False
[API Server] LLM model loaded: acestep-5Hz-lm-0.6B
[API Server] All models initialized successfully!

From the UI CMD window (when the format button is clicked):
[Format] CWD: ..\ACE-Step-1.5
[Format] Spawn error: spawn ..\ACE-Step-1.5.venv\Scripts\python.exe ENOENT
[Format] Python error: spawn ..\ACE-Step-1.5.venv\Scripts\python.exe ENOENT
[Format] Process exited with code -4058

Environment:
OS: Windows 11
ACE-Step: Portable from Readme
UI istalled using: git clone https://github.com/fspecii/ace-step-ui and then setup.bat

When I use the "enhance" button in the "gradio ui", it works well.

Originally created by @nickalps on GitHub (Feb 9, 2026). Original GitHub issue: https://github.com/fspecii/ace-step-ui/issues/44 I installed the UI on Windows following the instructions in the README. Steps to Reproduce: - Start the API server and the UI application using "start-all.bat" - Try to use the "Format" feature on either "Lyrics" or "Style". Result: - The UI shows a popup error: "Format failed. The LLM may not be available." However, the API server command window shows that the LLM model was loaded successfully (see logs below). The UI command window shows a spawn error related to the Python executable in the virtual environment (see logs below). Logs: From the API Server CMD window: 2026-02-09 20:10:11.248 | INFO | acestep.llm_inference:_initialize_5hz_lm_vllm:454 - 5Hz LM initialized successfully in 20.01 seconds 2026-02-09 20:10:11.248 | INFO | acestep.llm_inference:initialize:390 - 5Hz LM status message: ✅ 5Hz LM initialized successfully Model: F:\ACE-Step-1.5\checkpoints\acestep-5Hz-lm-0.6B Device: NVIDIA GeForce RTX 3060 GPU Memory Utilization: 0.250 Low GPU Memory Mode: False [API Server] LLM model loaded: acestep-5Hz-lm-0.6B [API Server] All models initialized successfully! From the UI CMD window (when the format button is clicked): [Format] CWD: ..\ACE-Step-1.5 [Format] Spawn error: spawn ..\ACE-Step-1.5\.venv\Scripts\python.exe ENOENT [Format] Python error: spawn ..\ACE-Step-1.5\.venv\Scripts\python.exe ENOENT [Format] Process exited with code -4058 Environment: OS: Windows 11 ACE-Step: Portable from Readme UI istalled using: git clone https://github.com/fspecii/ace-step-ui and then setup.bat When I use the "enhance" button in the "gradio ui", it works well.
Author
Owner

@nickalps commented on GitHub (Feb 9, 2026):

Today I was too lazy to check and fix it myself. I used an LLM to resolve the issue. I don't have time to create a proper commit, so I'll just post the LLM's report.

To give the LLM more context, I used the text from two other related issues:

Here is what the LLM suggested to make it work for me:


Fixes for Format Feature and Deprecated Arguments Issues

Overview

This document describes the fixes applied to resolve three linked issues:

  1. Format feature failing on Windows due to incorrect Python path resolution
  2. Similar format failures with empty error messages
  3. Deprecated --lm-backend and --lm-model arguments causing failures when ACE-Step API is unavailable

Problems Identified

Issue 1 & 2: Python Path Resolution Failure

  • The resolvePythonPath() function only checked for .venv but users may have venvs with different naming patterns (e.g., ACE-Step-1.5.venv)
  • Path resolution was inconsistent - some routes used inline path resolution instead of a centralized function
  • Relative paths were resolved from process.cwd() instead of the workspace root, causing incorrect paths like F:\ace-step-ui\ACE-Step-1.5\ instead of F:\ACE-Step-1.5\
  • Paths weren't always normalized to absolute paths before use

Issue 3: Deprecated Arguments

  • --lm-backend and --lm-model arguments were being passed to simple_generate.py but are deprecated
  • These arguments are still valid for format_sample.py, so they should only be removed from generation calls

Solutions Implemented

1. Enhanced Python Path Resolution (server/src/services/acestep.ts)

Changes:

  • Enhanced resolvePythonPath() to check multiple venv naming patterns:
    • Standard .venv
    • Directories ending with .venv (e.g., ACE-Step-1.5.venv)
    • Portable installation (python_embeded)
  • Ensured all paths are normalized to absolute paths using path.resolve()
  • Added validation to check if paths exist before returning
  • Added fallback to system Python with clear warning messages
  • Added comprehensive logging for debugging

Key Code Changes:

// Before: Only checked .venv
return path.join(baseDir, '.venv', 'Scripts', pythonExe);

// After: Checks multiple patterns and ensures absolute paths
const absoluteBaseDir = path.isAbsolute(baseDir) ? baseDir : path.resolve(baseDir);
// ... checks for portable, .venv, and *.venv patterns

2. Fixed ACE-Step Path Resolution (server/src/services/acestep.ts)

Changes:

  • Updated resolveAceStepPath() to resolve relative paths from workspace root instead of process.cwd()
  • Exported the function for reuse across routes
  • Added path normalization for Windows case sensitivity
  • Added logging to show resolved path at startup

Key Code Changes:

// Before: Resolved relative paths from process.cwd()
return path.isAbsolute(envPath) ? envPath : path.resolve(process.cwd(), envPath);

// After: Resolves from workspace root
const workspaceRoot = path.resolve(__dirname, '../../..');
const resolvedPath = path.resolve(workspaceRoot, envPath);
return path.normalize(resolvedPath);

3. Removed Deprecated Arguments (server/src/services/acestep.ts)

Changes:

  • Removed --lm-backend and --lm-model arguments from simple_generate.py calls in processGeneration() function
  • Added comment explaining why they were removed
  • These arguments remain valid for format_sample.py calls

Key Code Changes:

// Before:
if (params.lmBackend) args.push('--lm-backend', params.lmBackend);
if (params.lmModel) args.push('--lm-model', params.lmModel);

// After:
// Note: --lm-backend and --lm-model are deprecated for simple_generate.py
// They are still valid for format_sample.py

4. Unified Path Resolution (server/src/routes/generate.ts)

Changes:

  • Updated format route to use resolveAceStepPath() instead of inline path resolution
  • Updated limits route to use resolveAceStepPath() for consistency
  • Added Python path validation before spawning processes
  • Improved error messages for spawn failures

Key Code Changes:

// Before: Inline path resolution
const ACESTEP_DIR = process.env.ACESTEP_PATH || path.resolve(path.dirname(fileURLToPath(import.meta.url)), '../../../../ACE-Step-1.5');

// After: Using centralized function
const ACESTEP_DIR = resolveAceStepPath();

5. Enhanced Error Handling

Changes:

  • Added Python executable path validation before spawning processes
  • Added script file existence checks
  • Improved error messages with more context
  • Added logging for debugging spawn errors

Files Modified

server/src/services/acestep.ts

  1. Line 31: Changed function resolveAceStepPath() to export function resolveAceStepPath()
  2. Lines 31-47: Enhanced path resolution logic to handle relative paths correctly
  3. Line 50: Added absoluteBaseDir variable to ensure absolute paths
  4. Lines 54-95: Enhanced resolvePythonPath() to check multiple venv patterns and validate paths
  5. Line 97: Added logging for resolved ACE-Step directory
  6. Lines 713-714: Removed deprecated --lm-backend and --lm-model arguments (replaced with comment)
  7. Line 3: Added readdirSync import for directory scanning
  8. Lines 790-808: Added Python path and script validation in runPythonGeneration()

server/src/routes/generate.ts

  1. Line 4: Added existsSync import
  2. Line 17: Added resolveAceStepPath to imports
  3. Line 570: Changed limits route to use resolveAceStepPath()
  4. Line 647: Changed format route to use resolveAceStepPath()
  5. Lines 653-665: Added Python path and script validation before spawning
  6. Lines 732-735: Enhanced error handling in spawn error callback

Testing Recommendations

  1. Test with different venv naming patterns:

    • .venv (standard)
    • ACE-Step-1.5.venv (Windows pattern)
    • Portable installation (python_embeded)
  2. Test path resolution:

    • With ACESTEP_PATH environment variable set to absolute path
    • With ACESTEP_PATH set to relative path (e.g., ..\ACE-Step-1.5)
    • Without ACESTEP_PATH (should default to sibling directory)
  3. Verify format feature:

    • Test format for both "Lyrics" and "Style" options
    • Verify it correctly finds Python executable
    • Verify it works with API server running and without
  4. Verify generation without API:

    • Ensure deprecated arguments are not passed to simple_generate.py
    • Verify generation still works correctly

Impact

  • Format feature now works correctly on Windows with various venv naming conventions
  • Path resolution is consistent across all routes
  • Deprecated arguments removed, preventing errors when API is unavailable
  • Better error messages help users diagnose configuration issues
  • Improved logging aids in debugging path resolution problems

Notes

  • The fixes maintain backward compatibility with existing configurations
  • All changes are non-breaking and improve robustness
  • The format feature now correctly uses the embedded Python (python_embeded) when available, as shown in the API server logs
<!-- gh-comment-id:3872830375 --> @nickalps commented on GitHub (Feb 9, 2026): Today I was too lazy to check and fix it myself. I used an LLM to resolve the issue. I don't have time to create a proper commit, so I'll just post the LLM's report. To give the LLM more context, I used the text from two other related issues: - https://github.com/fspecii/ace-step-ui/issues/34 - https://github.com/fspecii/ace-step-ui/issues/32 Here is what the LLM suggested to make it work for me: ----- # Fixes for Format Feature and Deprecated Arguments Issues ## Overview This document describes the fixes applied to resolve three linked issues: 1. Format feature failing on Windows due to incorrect Python path resolution 2. Similar format failures with empty error messages 3. Deprecated `--lm-backend` and `--lm-model` arguments causing failures when ACE-Step API is unavailable ## Problems Identified ### Issue 1 & 2: Python Path Resolution Failure - The `resolvePythonPath()` function only checked for `.venv` but users may have venvs with different naming patterns (e.g., `ACE-Step-1.5.venv`) - Path resolution was inconsistent - some routes used inline path resolution instead of a centralized function - Relative paths were resolved from `process.cwd()` instead of the workspace root, causing incorrect paths like `F:\ace-step-ui\ACE-Step-1.5\` instead of `F:\ACE-Step-1.5\` - Paths weren't always normalized to absolute paths before use ### Issue 3: Deprecated Arguments - `--lm-backend` and `--lm-model` arguments were being passed to `simple_generate.py` but are deprecated - These arguments are still valid for `format_sample.py`, so they should only be removed from generation calls ## Solutions Implemented ### 1. Enhanced Python Path Resolution (`server/src/services/acestep.ts`) **Changes:** - Enhanced `resolvePythonPath()` to check multiple venv naming patterns: - Standard `.venv` - Directories ending with `.venv` (e.g., `ACE-Step-1.5.venv`) - Portable installation (`python_embeded`) - Ensured all paths are normalized to absolute paths using `path.resolve()` - Added validation to check if paths exist before returning - Added fallback to system Python with clear warning messages - Added comprehensive logging for debugging **Key Code Changes:** ```typescript // Before: Only checked .venv return path.join(baseDir, '.venv', 'Scripts', pythonExe); // After: Checks multiple patterns and ensures absolute paths const absoluteBaseDir = path.isAbsolute(baseDir) ? baseDir : path.resolve(baseDir); // ... checks for portable, .venv, and *.venv patterns ``` ### 2. Fixed ACE-Step Path Resolution (`server/src/services/acestep.ts`) **Changes:** - Updated `resolveAceStepPath()` to resolve relative paths from workspace root instead of `process.cwd()` - Exported the function for reuse across routes - Added path normalization for Windows case sensitivity - Added logging to show resolved path at startup **Key Code Changes:** ```typescript // Before: Resolved relative paths from process.cwd() return path.isAbsolute(envPath) ? envPath : path.resolve(process.cwd(), envPath); // After: Resolves from workspace root const workspaceRoot = path.resolve(__dirname, '../../..'); const resolvedPath = path.resolve(workspaceRoot, envPath); return path.normalize(resolvedPath); ``` ### 3. Removed Deprecated Arguments (`server/src/services/acestep.ts`) **Changes:** - Removed `--lm-backend` and `--lm-model` arguments from `simple_generate.py` calls in `processGeneration()` function - Added comment explaining why they were removed - These arguments remain valid for `format_sample.py` calls **Key Code Changes:** ```typescript // Before: if (params.lmBackend) args.push('--lm-backend', params.lmBackend); if (params.lmModel) args.push('--lm-model', params.lmModel); // After: // Note: --lm-backend and --lm-model are deprecated for simple_generate.py // They are still valid for format_sample.py ``` ### 4. Unified Path Resolution (`server/src/routes/generate.ts`) **Changes:** - Updated format route to use `resolveAceStepPath()` instead of inline path resolution - Updated limits route to use `resolveAceStepPath()` for consistency - Added Python path validation before spawning processes - Improved error messages for spawn failures **Key Code Changes:** ```typescript // Before: Inline path resolution const ACESTEP_DIR = process.env.ACESTEP_PATH || path.resolve(path.dirname(fileURLToPath(import.meta.url)), '../../../../ACE-Step-1.5'); // After: Using centralized function const ACESTEP_DIR = resolveAceStepPath(); ``` ### 5. Enhanced Error Handling **Changes:** - Added Python executable path validation before spawning processes - Added script file existence checks - Improved error messages with more context - Added logging for debugging spawn errors ## Files Modified ### `server/src/services/acestep.ts` 1. **Line 31**: Changed `function resolveAceStepPath()` to `export function resolveAceStepPath()` 2. **Lines 31-47**: Enhanced path resolution logic to handle relative paths correctly 3. **Line 50**: Added `absoluteBaseDir` variable to ensure absolute paths 4. **Lines 54-95**: Enhanced `resolvePythonPath()` to check multiple venv patterns and validate paths 5. **Line 97**: Added logging for resolved ACE-Step directory 6. **Lines 713-714**: Removed deprecated `--lm-backend` and `--lm-model` arguments (replaced with comment) 7. **Line 3**: Added `readdirSync` import for directory scanning 8. **Lines 790-808**: Added Python path and script validation in `runPythonGeneration()` ### `server/src/routes/generate.ts` 1. **Line 4**: Added `existsSync` import 2. **Line 17**: Added `resolveAceStepPath` to imports 3. **Line 570**: Changed limits route to use `resolveAceStepPath()` 4. **Line 647**: Changed format route to use `resolveAceStepPath()` 5. **Lines 653-665**: Added Python path and script validation before spawning 6. **Lines 732-735**: Enhanced error handling in spawn error callback ## Testing Recommendations 1. **Test with different venv naming patterns:** - `.venv` (standard) - `ACE-Step-1.5.venv` (Windows pattern) - Portable installation (`python_embeded`) 2. **Test path resolution:** - With `ACESTEP_PATH` environment variable set to absolute path - With `ACESTEP_PATH` set to relative path (e.g., `..\ACE-Step-1.5`) - Without `ACESTEP_PATH` (should default to sibling directory) 3. **Verify format feature:** - Test format for both "Lyrics" and "Style" options - Verify it correctly finds Python executable - Verify it works with API server running and without 4. **Verify generation without API:** - Ensure deprecated arguments are not passed to `simple_generate.py` - Verify generation still works correctly ## Impact - ✅ Format feature now works correctly on Windows with various venv naming conventions - ✅ Path resolution is consistent across all routes - ✅ Deprecated arguments removed, preventing errors when API is unavailable - ✅ Better error messages help users diagnose configuration issues - ✅ Improved logging aids in debugging path resolution problems ## Notes - The fixes maintain backward compatibility with existing configurations - All changes are non-breaking and improve robustness - The format feature now correctly uses the embedded Python (`python_embeded`) when available, as shown in the API server logs
Author
Owner

@nickalps commented on GitHub (Feb 9, 2026):

Also this error may have been initially caused by the fact that my portable ACE-Step-1.5 was updated when I tested it and checked how the gradio ui works. But I'm not sure 😅

<!-- gh-comment-id:3872875470 --> @nickalps commented on GitHub (Feb 9, 2026): Also this error may have been initially caused by the fact that my portable ACE-Step-1.5 was updated when I tested it and checked how the gradio ui works. But I'm not sure 😅
Author
Owner

@cynical2010 commented on GitHub (Feb 11, 2026):

same for me > [https://github.com/fspecii/ace-step-ui/issues/46]
Windows GPT 5 Mini
not Tested and will not Test it.

Maybe it helps someone

Good luck i'm outta here ➡️🏃‍♂️➡️😂

<!-- gh-comment-id:3887386398 --> @cynical2010 commented on GitHub (Feb 11, 2026): same for me > [https://github.com/fspecii/ace-step-ui/issues/46] Windows GPT 5 Mini not Tested and will not Test it. Maybe it helps someone Good luck i'm outta here ➡️🏃‍♂️‍➡️😂
Sign in to join this conversation.
No labels
pull-request
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
starred/ace-step-ui#40
No description provided.