iflytek/astron-agent · warning · BusinessException

8005

8005

Error message

param.error

What it means

WorkflowArtifactFileValidator.validate performs the first sanity check on an uploaded workflow artifact: the MultipartFile must be present, non-empty, and carry an original filename. Otherwise it throws BusinessException(ResponseEnum.PARAM_ERROR, code 8005). It means the upload request was malformed before any content inspection could run.

Solutions

  1. Ensure the multipart field name matches the controller parameter and the client actually attaches a file.
  2. Check that the selected file is non-empty before submitting.
  3. Send a proper Content-Disposition with a filename (e.g. curl -F "file=@doc.docx" instead of -F "file=@").
  4. Return 8005 to the client and prompt re-selection of the file.

Example fix

// before
curl -X POST .../artifacts -F "file="           // empty -> 8005
// after
curl -X POST .../artifacts -F "file=@report.docx"
Defensive patterns

Strategy: validation

Validate before calling

boolean validUpload = file != null && !file.isEmpty()
        && StringUtils.isNotBlank(file.getOriginalFilename());
if (!validUpload) throw new BusinessException(ResponseEnum.PARAM_ERROR);

Try / catch

try {
    validator.validate(file);
} catch (BusinessException e) {
    if (e.getCode() == 8005) {
        // return 400 with 'missing or empty file' message to the client
    }
}

Prevention

When it happens

Trigger: Calling the artifact upload endpoint without a file part; a zero-byte file; a multipart part whose originalFilename is blank (some clients omit the filename in Content-Disposition).

Common situations: Frontend form field name mismatch so Spring binds no file; user submits the form before the file finishes selecting; programmatic curl/upload without -F filename=...; a proxy stripping the filename attribute.

Related errors


AI-assisted analysis of iflytek/astron-agent@5e758547a8 (2026-09-12). Data as JSON: /api/errors/2f4fe2e958b5f0f8. Report an issue: GitHub.

Appendix: source

Thrown at console/backend/toolkit/src/main/java/com/iflytek/astron/console/toolkit/service/workflow/WorkflowArtifactFileValidator.java:131

        this(
                properties,
                new OoxmlResourceLimits(
                        MAX_OOXML_ENTRY_COUNT,
                        MAX_OOXML_ENTRY_BYTES,
                        MAX_OOXML_XML_ENTRY_BYTES,
                        MAX_OOXML_CONTROL_XML_ENTRY_BYTES,
                        MAX_OOXML_TOTAL_EXPANDED_BYTES));
    }

    WorkflowArtifactFileValidator(
            SkillSandboxArtifactProperties properties, OoxmlResourceLimits ooxmlResourceLimits) {
        this.properties = Objects.requireNonNull(properties);
        this.ooxmlResourceLimits = Objects.requireNonNull(ooxmlResourceLimits);
    }

    public ValidatedArtifact validate(MultipartFile file) {
        if (file == null || file.isEmpty() || StringUtils.isBlank(file.getOriginalFilename())) {
            throw new BusinessException(ResponseEnum.PARAM_ERROR);
        }
        if (file.getSize() <= 0 || file.getSize() > properties.getArtifactMaxFileSize().toBytes()) {
            throw new BusinessException(ResponseEnum.WORKFLOW_ARTIFACT_FILE_TOO_LARGE);
        }

        String fileName = normalizeFileName(file.getOriginalFilename());
        String extension = StringUtils.lowerCase(FilenameUtils.getExtension(fileName), Locale.ROOT);
        Set<String> configuredExtensions = properties.getArtifactAllowedExtensions();
        if (StringUtils.isBlank(extension)
                || configuredExtensions.stream().noneMatch(extension::equalsIgnoreCase)
                || !MEDIA_TYPES_BY_EXTENSION.containsKey(extension)) {
            throw new BusinessException(ResponseEnum.WORKFLOW_ARTIFACT_FILE_TYPE_NOT_ALLOWED);
        }

        String declaredType = normalizeMediaType(file.getContentType());
        if (ACTIVE_CONTENT_TYPES.contains(declaredType)
                || (!StringUtils.isBlank(declaredType)
                        && !OCTET_STREAM.equals(declaredType)

View on GitHub (pinned to 5e758547a8)