{"record":{"id":"4b60cac6ea3fb3fc","repo":"crewAIInc/crewAI","slug":"project-name-name-would-generate-folder-name-4b60ca","errorCode":null,"errorMessage":"Project name '{name}' would generate folder name '{folder_name}' which is reserved. Reserved names are: {', '.join(sorted(reserved_names))}. Please choose a different name.","messagePattern":"Project name '(.+?)' would generate folder name '(.+?)' which is reserved\\. Reserved names are: (.+?)\\. Please choose a different name\\.","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"warning","filePath":"lib/cli/src/crewai_cli/create_crew.py","lineNumber":87,"sourceCode":"\n    if folder_name[0].isdigit():\n        raise ValueError(\n            f\"Project name '{name}' would generate folder name '{folder_name}' which cannot start with a digit (invalid Python module name)\"\n        )\n\n    if keyword.iskeyword(folder_name):\n        raise ValueError(\n            f\"Project name '{name}' would generate folder name '{folder_name}' which is a reserved Python keyword\"\n        )\n\n    if not folder_name.isidentifier():\n        raise ValueError(\n            f\"Project name '{name}' would generate invalid Python module name '{folder_name}'\"\n        )\n\n    reserved_names = get_reserved_script_names()\n    if folder_name in reserved_names:\n        raise ValueError(\n            f\"Project name '{name}' would generate folder name '{folder_name}' which is reserved. \"\n            f\"Reserved names are: {', '.join(sorted(reserved_names))}. \"\n            \"Please choose a different name.\"\n        )\n\n    class_name = name.replace(\"_\", \" \").replace(\"-\", \" \").title().replace(\" \", \"\")\n\n    class_name = re.sub(r\"[^a-zA-Z0-9_]\", \"\", class_name)\n\n    if not class_name:\n        raise ValueError(\n            f\"Project name '{name}' contains no valid characters for a Python class name\"\n        )\n\n    if class_name[0].isdigit():\n        raise ValueError(\n            f\"Project name '{name}' would generate class name '{class_name}' which cannot start with a digit\"\n        )","sourceCodeStart":69,"sourceCodeEnd":105,"githubUrl":"https://github.com/crewAIInc/crewAI/blob/754d7323beb2fd042e33444a115ea2d5a47193f0/lib/cli/src/crewai_cli/create_crew.py#L69-L105","documentation":"Raised as FileTooLargeError by crewai-files validators when a file or image exceeds the configured maximum size for its type. The validator compares actual byte size against constraints (e.g. ImageConstraints.max_size) and, with raise_on_error=True (the default), aborts processing with a structured error carrying file_name, actual_size, and max_size.","triggerScenarios":"Calling validate_image/validate_file-family helpers (validators.py:186-196) with raise_on_error=True on a file whose byte size exceeds the constraints' max_size — e.g. uploading a 12 MB PNG when ImageConstraints caps images at 10 MB. With raise_on_error=False the same message is only appended to the returned errors list.","commonSituations":"User uploads raw photos/screenshots/PDFs above the agent's processing cap; constraints tightened between releases so previously accepted files now fail; MB vs MiB confusion when configuring max_size.","solutions":["Compress or downscale the file below the limit (resize images, re-encode JPEG at lower quality, or split PDFs)","If the use case legitimately needs larger files, raise max_size in the constraints object passed to the validator","Catch FileTooLargeError where graceful user feedback is needed, and surface filename plus the actual vs maximum sizes from the exception fields","Pre-check size in the upload path (client or endpoint) so oversized files are rejected before any processing begins"],"exampleFix":"# before\nvalidate_image(img, constraints)  # 12MB image, max_size=10MB -> FileTooLargeError\n\n# after\nfrom PIL import Image\nim = Image.open(path); im.thumbnail((2000, 2000)); im.save(path, quality=85)\nvalidate_image(img, constraints)  # now under limit\n\n# or raise the ceiling:\nconstraints = ImageConstraints(max_size=20 * 1024 * 1024)","handlingStrategy":"validation","validationCode":"import os\n\ndef size_within_limit(path: str, max_size: int) -> bool:\n    return os.path.getsize(path) <= max_size\n\n# gate uploads before calling validators:\nif not size_within_limit(path, constraints.max_size):\n    return error_response(f'{path} exceeds {constraints.max_size} bytes — compress first')","typeGuard":null,"tryCatchPattern":"from crewai_files.processing.errors import FileTooLargeError\n\ntry:\n    errors = validate_image(img, constraints)\nexcept FileTooLargeError as e:\n    # structured fields for user feedback:\n    return bad_request(f\"{e.file_name} is {e.actual_size} bytes; limit {e.max_size}\")","preventionTips":["Check os.path.getsize (or the upload stream length) at the trust boundary before processing starts","Enforce the same max_size in the client/uploader and the server constraints so users get early feedback","Use raise_on_error=False to collect all validation messages in one pass instead of failing on the first","Document size limits in MB using consistent units (bytes internally) to avoid MB/MiB drift"],"tags":["file-upload","validation","size-limit","crewai-files"],"backgroundTag":null,"analyzedSha":"754d7323beb2fd042e33444a115ea2d5a47193f0","analyzedAt":"2026-08-15T04:06:56.746Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}