FlowiseAI/Flowise · error · Error

Failed to load S3 document

Error message

Failed to load S3 document: ${error.message}

What it means

Top-level catch-all for S3File.init wrapping any error during the single-file S3 load (download, unstructured parse, splitting, metadata). Interpolates the inner error message and loses the original stack (no cause chaining).

Solutions

  1. Read the inner message to identify the failing stage.
  2. Verify the key exists and IAM has s3:GetObject.
  3. Confirm the Unstructured API URL and key are valid if using unstructured parsing.
  4. Validate metadata/omitMetadataKeys inputs.
  5. Re-throw with { cause: error }.

Example fix

// before
} catch (error) {
  throw new Error(`Failed to load S3 document: ${error.message}`)
}
// after
} catch (error) {
  throw new Error(`Failed to load S3 document: ${error instanceof Error ? error.message : String(error)}`, { cause: error })
}
Defensive patterns

Strategy: try-catch

Validate before calling

async function verifyS3ObjectExists(s3Client, bucket, key) {
  await s3Client.send(new (require('@aws-sdk/client-s3').HeadObjectCommand)({ Bucket: bucket, Key: key }))
}

Try / catch

try {
  return await s3FileLoader.init(nodeData, _, options)
} catch (e) {
  throw new Error('S3 file load failed in pipeline', { cause: e })
}

Prevention

When it happens

Trigger: Download of the key fails (propagated from [179]); the Unstructured loader API call fails; the document loader for the file type rejects; textSplitter rejects; metadata/omitMetadataKeys processing throws.

Common situations: Wrong key name; IAM missing s3:GetObject; Unstructured API URL/key misconfigured; corrupt/unsupported file; bad metadata JSON.

Related errors


AI-assisted analysis of FlowiseAI/Flowise@abe4a8601a (2026-08-12). Data as JSON: /api/errors/bcf7c71ff0fba804. Report an issue: GitHub.

Appendix: source

Thrown at packages/components/nodes/documentloaders/S3File/S3File.ts:703

                                  omitMetadataKeys
                              )
                }))
            } else {
                docs = docs.map((doc) => ({
                    ...doc,
                    metadata:
                        _omitMetadataKeys === '*'
                            ? {}
                            : omit(
                                  {
                                      ...doc.metadata
                                  },
                                  omitMetadataKeys
                              )
                }))
            }
        } catch (error) {
            throw new Error(`Failed to load S3 document: ${error.message}`)
        }

        if (output === 'document') {
            return docs
        } else {
            let finaltext = ''
            for (const doc of docs) {
                finaltext += `${doc.pageContent}\n`
            }
            return handleEscapeCharacters(finaltext, false)
        }
    }

    private async processWithUnstructured(
        nodeData: INodeData,
        options: ICommonObject,
        bucketName: string,
        keyName: string,

View on GitHub (pinned to abe4a8601a)