ComposioHQ/composio · error · Error

Either path or blob must be provided

Error message

Either path or blob must be provided

What it means

getFileDataAfterUploadingToS3 requires a truthy file argument (a path string or File/Blob); passing undefined/null/empty string throws immediately before any work starts.

Source

Thrown at ts/packages/core/src/utils/fileUtils.node.ts:302

    }
  }
  throw new Error('Invalid file type');
};

export const getFileDataAfterUploadingToS3 = async (
  file: File | string,
  {
    toolSlug,
    toolkitSlug,
    client,
    sensitiveFileUploadProtection,
    fileUploadPathDenySegments,
    fileUploadAllowlist,
    signal,
  }: GetFileDataAfterUploadingToS3Options
): Promise<FileUploadData> => {
  if (!file) {
    throw new Error('Either path or blob must be provided');
  }

  const isLocalPath = typeof file === 'string' && !isHttpUrl(file);

  if (isLocalPath && fileUploadAllowlist !== undefined) {
    assertPathInsideUploadDirs(file as string, fileUploadAllowlist);
  }

  if (sensitiveFileUploadProtection !== false && isLocalPath) {
    assertSafeFileUploadPath(file as string, {
      additionalDenySegments: fileUploadPathDenySegments,
    });
  }

  const fileData = await readFile(file, signal);
  logger.debug(`Uploading file to S3...`);
  const s3key = await uploadFileToS3(
    platform.basename(fileData.fileName),

View on GitHub (pinned to 64b1b85502)

Solutions

  1. Check the argument is defined before calling; fall back to skipping upload when absent.
  2. If the file is optional in your flow, guard with if (!file) return instead of relying on the error.
  3. Log the caller's arguments to find which code path passes undefined.

Example fix

// before
await getFileDataAfterUploadingToS3(maybeFile, {...});
// after
if (!file) throw new Error('file argument is required');
await getFileDataAfterUploadingToS3(file, {...});
Defensive patterns

Strategy: validation

Validate before calling

if (!file) throw new TypeError('file is required');

Prevention

When it happens

Trigger: Calling the function with a variable that is undefined because of optional chaining, an empty form field, or a defaulted parameter that never resolved.

Common situations: Dynamic tool arguments where a file parameter was omitted by the model, or destructuring mismatches passing the wrong property name.

Understand the failure class

Background: "missing required argument" and "the following required arguments were not provided": what required-argument errors mean and how to fix them — this error's family across 20 libraries.

Related errors


AI-assisted analysis of ComposioHQ/composio@64b1b85502 (2026-08-28). Data as JSON: /api/errors/0a72c057a92ba99a. Report an issue: GitHub.