OpenBMB/ChatDev · error · SystemExit

2

Error message

2

What it means

404 raised from the workflow-persist helper when allow_overwrite is true (the update path) but the target YAML file does not exist. Update is only valid for existing workflows.

Solutions

  1. Upload (create) the workflow first via the upload API, then update.
  2. Verify the exact filename with the list-workflows endpoint.
  3. If the file was deleted unintentionally, restore it and retry the update.

Example fix

# before
update_workflow_content("missing.yaml", content)  # 404
# after
upload_workflow_content("missing.yaml", content)   # create first
update_workflow_content("missing.yaml", content2)    # then update
Defensive patterns

Strategy: validation

Validate before calling

const exists = (await listWorkflows()).includes(filename);
if (!exists) await uploadWorkflow(filename, content);

Type guard

async function canUpdate(name: string) { return (await listWorkflows()).includes(name); }

Try / catch

catch (e) { if (e.status === 404 && updating) await uploadWorkflow(filename, content); }

Prevention

When it happens

Trigger: Calling the update API for a workflow filename that was never uploaded or has been deleted; updating after someone removed the file.

Common situations: Environments out of sync (dev file exists, prod doesn't); updating a renamed/deleted workflow; stale client state referencing old names.

Understand the failure class

Background: 'Could not be found', 'does not exist', 'not found in database': the resource-not-found family when an ID, slug, key, or URI lookup comes back empty — this error's family across 20 libraries.

Related errors


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

Appendix: source

Thrown at check/check_workflow.py:155

                        help="Module name or .py path where edge functions are defined (for schema validation)")
    args = parser.parse_args()

    data = read_yaml(args.path)

    if not args.no_schema:
        schema_errors = check_yaml.validate_design(data, set_defaults=True, fn_module_ref=args.fn_module)
        if schema_errors:
            print("Invalid schema:")
            for e in schema_errors:
                print(f"- {e}")
            raise SystemExit(1)

    logic_errors = check_workflow_structure(data)
    if logic_errors:
        print("Workflow issues:")
        for e in logic_errors:
            print(f"- {e}")
        raise SystemExit(2)
    else:
        print("Workflow OK.")


if __name__ == "__main__":
    main()

View on GitHub (pinned to 4fb2db0ea9)