Knowledge Base document processing always fails — missing S3 bucket env var in Trigger.dev
Summary
Documents uploaded to the Knowledge Base via the API are stored in S3 but never get processed. The Trigger.dev process-knowledge-base-document task completes but returns an error because the APP_AWS_KNOWLEDGE_BASE_BUCKET environment variable is not set in the Trigger.dev runtime.
All documents end up with processingStatus: "failed" and are never indexed for AI features.
Reproduction
1. Upload a document to the Knowledge Base
# Base64 encode a PDF
FILE_DATA=$(base64 -i some-document.pdf)
curl -X POST https://api.trycomp.ai/v1/knowledge-base/documents/upload \
-H "X-API-Key: $API_KEY" \
-H "Content-Type: application/json" \
-d "{
\"organizationId\": \"$ORG_ID\",
\"fileName\": \"some-document.pdf\",
\"fileType\": \"application/pdf\",
\"fileData\": \"$FILE_DATA\",
\"description\": \"Test document\"
}"
The upload succeeds and returns an id, name, and s3Key.
2. Trigger processing
curl -X POST https://api.trycomp.ai/v1/knowledge-base/documents/process \
-H "X-API-Key: $API_KEY" \
-H "Content-Type: application/json" \
-d "{
\"organizationId\": \"$ORG_ID\",
\"documentIds\": [\"kbd_xxx\"]
}"
Returns 201 with a Trigger.dev runId and publicAccessToken.
3. Check the Trigger.dev run
curl https://api.trigger.dev/api/v3/runs/$RUN_ID \
-H "Authorization: Bearer $PUBLIC_ACCESS_TOKEN"
Expected result
The run should process the document (extract text, generate embeddings, index for AI search) and set processingStatus: "completed".
Actual result
The Trigger.dev run completes but with a failure output:
{
"status": "COMPLETED",
"isSuccess": true,
"output": {
"success": false,
"documentId": "kbd_xxx",
"error": "Knowledge base bucket is not configured. Please set APP_AWS_KNOWLEDGE_BASE_BUCKET environment variable in Trigger.dev."
}
}
Note: Trigger.dev reports isSuccess: true because the task function itself didn't throw — it caught the error and returned a failure result. The document's processingStatus is set to "failed".
4. Verify the document status
curl "https://api.trycomp.ai/v1/knowledge-base/documents?organizationId=$ORG_ID" \
-H "X-API-Key: $API_KEY"
Every document shows "processingStatus": "failed".
Root cause
The Trigger.dev worker environment is missing the APP_AWS_KNOWLEDGE_BASE_BUCKET environment variable. The documents are successfully uploaded to S3 (they have valid s3Key values), but when the processing task tries to read them back from S3, it doesn't know which bucket to look in.
Fix
Set the APP_AWS_KNOWLEDGE_BASE_BUCKET environment variable in your Trigger.dev project settings to match the S3 bucket used for Knowledge Base document uploads.
After fixing, re-process affected documents:
curl -X POST https://api.trycomp.ai/v1/knowledge-base/documents/process \
-H "X-API-Key: $API_KEY" \
-H "Content-Type: application/json" \
-d "{
\"organizationId\": \"$ORG_ID\",
\"documentIds\": [\"kbd_id1\", \"kbd_id2\", ...]
}"
Impact
- Knowledge Base is completely non-functional. No uploaded documents can be processed or indexed.
- AI features that depend on the Knowledge Base (questionnaire answering, policy chat, SOA auto-fill) cannot reference any uploaded documents.
- This affects all organizations, not just ours — the env var is a global Trigger.dev configuration.
- Documents in
pending status (never had processing triggered) are also affected and will fail when processing is eventually triggered.
Our data
- 152 documents uploaded (95 showing
failed, 57 still pending)
- File types: PDF, DOCX, XLSX, PNG
- All have valid
s3Key values — the upload step works fine, only processing is broken
Environment
- API:
https://api.trycomp.ai/v1
- Trigger.dev task:
process-knowledge-base-document (version 20260227.2)
- Date discovered: 2026-02-27
Knowledge Base document processing always fails — missing S3 bucket env var in Trigger.dev
Summary
Documents uploaded to the Knowledge Base via the API are stored in S3 but never get processed. The Trigger.dev
process-knowledge-base-documenttask completes but returns an error because theAPP_AWS_KNOWLEDGE_BASE_BUCKETenvironment variable is not set in the Trigger.dev runtime.All documents end up with
processingStatus: "failed"and are never indexed for AI features.Reproduction
1. Upload a document to the Knowledge Base
The upload succeeds and returns an
id,name, ands3Key.2. Trigger processing
Returns
201with a Trigger.devrunIdandpublicAccessToken.3. Check the Trigger.dev run
Expected result
The run should process the document (extract text, generate embeddings, index for AI search) and set
processingStatus: "completed".Actual result
The Trigger.dev run completes but with a failure output:
{ "status": "COMPLETED", "isSuccess": true, "output": { "success": false, "documentId": "kbd_xxx", "error": "Knowledge base bucket is not configured. Please set APP_AWS_KNOWLEDGE_BASE_BUCKET environment variable in Trigger.dev." } }Note: Trigger.dev reports
isSuccess: truebecause the task function itself didn't throw — it caught the error and returned a failure result. The document'sprocessingStatusis set to"failed".4. Verify the document status
Every document shows
"processingStatus": "failed".Root cause
The Trigger.dev worker environment is missing the
APP_AWS_KNOWLEDGE_BASE_BUCKETenvironment variable. The documents are successfully uploaded to S3 (they have valids3Keyvalues), but when the processing task tries to read them back from S3, it doesn't know which bucket to look in.Fix
Set the
APP_AWS_KNOWLEDGE_BASE_BUCKETenvironment variable in your Trigger.dev project settings to match the S3 bucket used for Knowledge Base document uploads.After fixing, re-process affected documents:
Impact
pendingstatus (never had processing triggered) are also affected and will fail when processing is eventually triggered.Our data
failed, 57 stillpending)s3Keyvalues — the upload step works fine, only processing is brokenEnvironment
https://api.trycomp.ai/v1process-knowledge-base-document(version20260227.2)