OpenBMB/ChatDev · error · WorkflowExecutionError

Failed to update workflow id after rename

Error message

Failed to update workflow id after rename

What it means

After a successful file rename, rename_workflow reads the target file and rewrites the workflow's internal id (_update_workflow_id) to match the new filename stem. Any failure reading/writing the file in this post-rename step raises WorkflowExecutionError. Note the file rename itself already succeeded.

Source

Thrown at server/services/workflow_storage.py:153

    logger = get_server_logger()
    try:
        source_path.rename(target_path)
    except Exception as exc:
        logger.log_exception(exc, f"Failed to rename workflow file {source_safe} to {target_safe}")
        raise WorkflowExecutionError(
            "Failed to rename workflow file",
            details={"source": source_safe, "target": target_safe},
        )

    try:
        new_workflow_id = Path(target_safe).stem
        content = target_path.read_text(encoding="utf-8")
        updated = _update_workflow_id(content, new_workflow_id)
        if updated != content:
            target_path.write_text(updated, encoding="utf-8")
    except Exception as exc:
        logger.log_exception(exc, f"Failed to update workflow id after rename to {target_safe}")
        raise WorkflowExecutionError(
            "Failed to update workflow id after rename",
            details={"target": target_safe},
        )

    logger.info(
        "Workflow file renamed",
        log_type=LogType.WORKFLOW,
        source=source_safe,
        target=target_safe,
        action="rename",
    )


def copy_workflow(source_filename: str, target_filename: str, *, directory: Path) -> None:
    source_safe = validate_workflow_filename(source_filename, require_yaml_extension=True)
    target_safe = validate_workflow_filename(target_filename, require_yaml_extension=True)

    if source_safe == target_safe:

View on GitHub (pinned to 4fb2db0ea9)

Solutions

  1. Check logs for the underlying exception
  2. Verify the file still exists and is writable; re-run the rename from the new filename (or manually fix the id field)
  3. Free disk space / fix permissions, then retry the id update manually

Example fix

# before (assume success)
rename_workflow_file(sid, src, tgt)
# after
rename_workflow_file(sid, src, tgt)
# note: on this error the file IS renamed; only the id field inside may be stale
# fix by editing id: <new-stem> in the target yaml
Defensive patterns

Strategy: fallback

Try / catch

try:
    rename_workflow_file(sid, src, tgt)
except WorkflowExecutionError as e:
    if 'update workflow id' in str(e):
        manually_set_id_field(tgt, Path(tgt).stem)  # file already renamed

Prevention

When it happens

Trigger: File becomes unreadable/unwritable immediately after rename (permissions changed, disk full, file deleted by a concurrent process), or read_text fails due to encoding issues.

Common situations: Disk fills exactly between rename and rewrite; antivirus/locking on Windows; concurrent delete racing the id update.

Related errors


AI-assisted analysis of OpenBMB/ChatDev@4fb2db0ea9 (2026-08-27). Data as JSON: /api/errors/c58e0712ab33c5cb. Report an issue: GitHub.