{"record":{"id":"8631638e33fae9b4","repo":"iflytek/astron-agent","slug":"url-is-required-for-ifly-or-ifly-v2","errorCode":null,"errorMessage":"URL is required for ifly or ifly-v2","messagePattern":"URL is required for ifly or ifly-v2","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"core/workflow/configs/app_config.py","lineNumber":320,"sourceCode":"        \"\"\"Keep the Pyodide V8 heap limit within a bounded range.\"\"\"\n        if not MIN_CODE_EXEC_MEMORY_LIMIT_MB <= v <= MAX_CODE_EXEC_MEMORY_LIMIT_MB:\n            raise ValueError(\n                \"CODE_EXEC_MEMORY_LIMIT_MB must be between \"\n                f\"{MIN_CODE_EXEC_MEMORY_LIMIT_MB} and \"\n                f\"{MAX_CODE_EXEC_MEMORY_LIMIT_MB} MB\"\n            )\n        return v\n\n    @model_validator(mode=\"after\")\n    def validator_url(self) -> \"CodeExecutorConfig\":\n        \"\"\"\n        Validate the URL.\n\n        :return: The validated URL\n        \"\"\"\n        if self.exec_type in [\"ifly\", \"ifly-v2\"]:\n            if not self.url:\n                raise ValueError(\"URL is required for ifly or ifly-v2\")\n            if bool(self.api_key) != bool(self.api_secret):\n                raise ValueError(\n                    \"Both API key and secret must be provided for ifly authentication, or neither.\"\n                )\n        return self\n\n\nclass DatabaseConfig(BaseSettings):\n    \"\"\"\n    Database connection configuration.\n\n    Loads MySQL connection parameters from environment variables\n    (MYSQL_HOST, MYSQL_PORT, MYSQL_USER, MYSQL_PASSWORD, MYSQL_DB).\n    \"\"\"\n\n    model_config = {\"env_prefix\": \"\", \"case_sensitive\": False}\n\n    host: str = Field(default=\"\", alias=\"MYSQL_HOST\")","sourceCodeStart":302,"sourceCodeEnd":338,"githubUrl":"https://github.com/iflytek/astron-agent/blob/5e758547a83371a5a4b29dadf4ac03e8dd527635/core/workflow/configs/app_config.py#L302-L338","documentation":"Model-level validator for the code-execution config requires a non-empty url when exec_type is 'ifly' or 'ifly-v2' (iFly Spark execution backends). Those exec types route to an external endpoint, so running without a URL is invalid at startup.","triggerScenarios":"Choosing exec_type=ifly or ifly-v2 while leaving the url field / CODE_EXEC_URL env var empty or unset.","commonSituations":"Switching exec_type from a local mode to ifly without filling in the endpoint; copying a config template with the URL placeholder left blank; env var not propagated into the container.","solutions":["Set the url field (e.g. CODE_EXEC_URL env var) to the iFly Spark endpoint address","If you do not have an iFly endpoint, switch exec_type to a non-ifly execution type","Verify the env var actually reaches the process (docker-compose/k8s env wiring)"],"exampleFix":"// before\nEXEC_TYPE=ifly\n# URL not set\n// after\nEXEC_TYPE=ifly\nCODE_EXEC_URL=https://spark-api-open.xf-yun.com/v1","handlingStrategy":"validation","validationCode":"if exec_type in (\"ifly\", \"ifly-v2\") and not url:\n    raise ValueError(\"URL is required for ifly or ifly-v2\")","typeGuard":null,"tryCatchPattern":"try:\n    AppConfig()\nexcept ValidationError as e:\n    logger.error(\"code-exec config invalid: %s\", e)\n    sys.exit(2)","preventionTips":["Provide all ifly fields together in one config template","Assert required env vars in the deployment manifest","Smoke-test config loading in CI before deploy"],"tags":["config","validation","missing-value"],"backgroundTag":"missing-required-config-field","analyzedSha":"5e758547a83371a5a4b29dadf4ac03e8dd527635","analyzedAt":"2026-09-12T08:03:51.356Z","contentChangedAt":"2026-09-12T08:03:51.356Z","schemaVersion":2},"datasetVersion":"2026-09-15T23:17:13.987Z"}