Kinesis Data Firehose Troubleshooter
Mindset
A Firehose delivery stream is a four-stage pipeline: ingest
(the PutRecord API or Kinesis Stream source), transform
(optional Lambda processing), convert (optional format
conversion to Parquet/ORC via Glue catalog), and deliver
(the destination: S3, OpenSearch, Redshift, Snowflake, HTTP
endpoint, Splunk). Most "Firehose failing" tickets are one stage
failing silently while the others report healthy. Diagnose the
stage first, then the destination-specific config.
- The 5-layer health check is the upstream gate. Firehose does not surface all failures as delivery-stream
ACTIVE status changes; a Lambda transform or destination can fail while the stream stays green. Diagnose by layer: source, transform, convert, deliver, observability.
- CloudWatch metrics are per-destination.
DeliveryToS3.Success, DeliveryToOpenSearch.Success, DeliveryToRedshift.Success are separate metrics. Verify the metric matching the configured destination, not just DeliveryToS3.Success.
describe-delivery-stream is the source of truth. It returns the full destination config, Lambda ARN, buffering hints, and the S3 backup bucket. The console shows a summary; the API returns the exact JSON the service is using.
Quick navigation
| You want to... |
Go to |
| Run the 5-layer health check first (recommended) |
Step 1 |
| Diagnose delivery to S3 fails |
Step 2 |
| Diagnose data transformation Lambda fails |
Step 3 |
| Diagnose delivery lag (high DataFreshness) |
Step 4 |
| Diagnose data format conversion fails (Parquet/ORC) |
Step 5 |
| Diagnose delivery to OpenSearch fails |
Step 6 |
| Diagnose delivery to Redshift fails |
Step 7 |
| Diagnose latest destinations (Snowflake / HTTP / Splunk) |
Step 8 |
| Map symptom to root cause quickly |
Appendix A |
| Avoid misdiagnosis pitfalls |
Anti-Patterns |
STRICT output contract
Every diagnosis MUST emit the exact DIAGNOSIS block with all fields
populated (no empty fields, no omitted sections, no reordering).
All five LAYER_CHECK lines (Source, Transform, Convert, Deliver,
Observability) are mandatory - even when the failure is destination-
specific.
Verdict-specific rules:
ROOT_CAUSE_FOUND -> ROOT_CAUSE names a single specific cause; EVIDENCE cites at least one failing API signal or metric; FIX is actionable CLI.
NEED_MORE_INFO -> ROOT_CAUSE is "Pending diagnosis - "; NEXT_STEP cites the exact next command.
ESCALATE -> ESCALATION_PATH names the recipient and the out-of-band action required.
DIAGNOSIS: <reference>
DELIVERY_STREAM: <stream-name>
DESTINATION: <s3 | opensearch | redshift | snowflake | http-endpoint | splunk | lambda>
SYMPTOM: DeliveryToS3Fails | LambdaFails | DeliveryLag | FormatConversionFails | OpenSearchFails | RedshiftFails | LatestDestinationFails
ROOT_CAUSE: <specific cause cited>
EVIDENCE:
- <diagnostic signal 1>
- <diagnostic signal 2>
LAYER_CHECK:
- Source: <PASS | FAIL - reason>
- Transform: <PASS | FAIL - reason | N/A>
- Convert: <PASS | FAIL - reason | N/A>
- Deliver: <PASS | FAIL - reason>
- Observability: <PASS | FAIL - reason>
FIX:
- <action 1 with CLI snippet>
- <action 2 ...>
VERIFICATION:
- <command to confirm fix>
VERDICT: ROOT_CAUSE_FOUND | NEED_MORE_INFO | ESCALATE
NEXT_STEP: <if NEED_MORE_INFO, the specific next diagnostic>
ESCALATION_PATH: <if ESCALATE, the recommended path>
Critical rules at a glance
- Run the 5-layer health check FIRST. Before any destination-specific diagnosis, confirm: (1) source is feeding records, (2) Lambda transform (if any) is not erroring, (3) format conversion (if any) is producing non-zero output, (4) destination is reachable and accepting writes, (5) CloudWatch logging is enabled so you have evidence.
- Verify the per-destination metric.
DeliveryToS3.Success is irrelevant when the destination is OpenSearch. Use the metric matching the configured destination.
describe-delivery-stream returns the live config. The console may lag or show stale state; the API returns the actual JSON Firehose is using.
- Lambda transforms cap output at 6 MB. A record that grows during transformation (enrichment, JSON expansion) can exceed the cap and be dropped silently to S3 backup.
- DataFreshness is the lag indicator. A spike in
DeliveryToS3.DataFreshnessSec means the destination is not keeping up with ingestion. Buffering hints and Lambda duration are the usual culprits.
NEVER (top 5)
- NEVER diagnose a Firehose failure without first running the 5-layer health check. Most "delivery fails" tickets are coverage gaps in the transform Lambda, the KMS key policy, or the destination reachability.
- NEVER assume the delivery-stream status
ACTIVE means records are being delivered. ACTIVE only means the stream config is accepted; per-record delivery failures are surfaced via CloudWatch metrics and S3 backup, not status.
- NEVER confuse a Lambda transform timeout with a Firehose bug. Firehose invokes the transform with the configured buffer (1-3 MB or 60-900 sec); a Lambda slower than the buffer cadence produces backpressure, not a Firehose failure.
- NEVER assume Parquet/ORC conversion is working because objects land in S3. Conversion can produce 0-byte objects if the input JSON is malformed or the Glue table schema does not match the data. Always verify object size, not just object count.
- NEVER emit
VERDICT: NEED_MORE_INFO without a NEXT_STEP naming a specific diagnostic command. Generic phrases like "investigate further" are not acceptable.
Expert heuristic
- If
DeliveryToS3.Success drops to 0 instantly after a config change, the failure is IAM, KMS, or bucket policy (Step 2). Check CloudTrail for AccessDenied on s3:PutObject or kms:GenerateDataKey.
- If
DeliveryToS3.DataFreshnessSec spikes without a drop in Success, the failure is buffering hints or Lambda duration (Step 4). The destination eventually catches up; data is just delayed.
- If Parquet objects land but query engines return empty results, the failure is SerDe / Glue schema mismatch (Step 5). The bytes are written but unreadable.
- If only OpenSearch destination fails with
429 Too Many Requests, the failure is OpenSearch write throttling or the Firehose circuit breaker (default: 5 minutes of sustained writes). Scale the OpenSearch cluster or raise the circuit-breaker window.
- If Redshift COPY fails consistently at the same step, the failure is column-count mismatch, encoding, or the staging-bucket IAM grant (Step 7). Look in
STL_LOAD_ERRORS.
- If Snowflake / HTTP endpoint / Splunk destinations fail, the failure is usually credentials, network reachability, or the endpoint's auth model (Step 8) - these do not exercise S3 KMS or Lambda layers.
Pre-flight: data requirements
Moved verbatim → references/diagnostic-commands.md § "Pre-flight: data requirements".
Load when: starting a diagnosis — the required-inputs table and the malformed-input NEED_MORE_INFO block.
Process - Diagnostic decision tree (apply in order)
Step 0: Expert knowledge - non-obvious Firehose behaviors
Moved verbatim → references/advanced-patterns.md § "Step 0: Expert knowledge - non-obvious Firehose behaviors".
Load when: a behavior seems non-obvious — buffered Lambda invocation, 6 MB response cap, OpenSearch circuit breaker, staging-bucket IAM, update-destination VersionId.
Step 1: The 5-layer Firehose health check (run FIRST)
Before any destination-specific diagnosis, confirm all five layers.
A failing layer invalidates all downstream diagnosis.
Layer 1 - Source (records are arriving):
aws firehose describe-delivery-stream --delivery-stream-name <stream-name> \
--query 'DeliveryStreamDescription.[DeliveryStreamStatus,DeliveryStreamType,Source.KinesisStreamSourceConfiguration]' --output table
aws cloudwatch get-metric-statistics --namespace AWS/Firehose \
--metric-name IncomingBytes --dimensions Name=DeliveryStreamName,Value=<stream-name> \
--start-time $(date -u -v-15M +%Y-%m-%dT%H:%M:%S) --end-time $(date -u +%Y-%m-%dT%H:%M:%S) \
--period 60 --statistics Sum --output table
For Kinesis-stream source, also verify the source stream is alive:
aws kinesis describe-stream-summary --stream-name <source-stream-name> \
--query 'StreamDescriptionSummary.[StreamStatus,RetentionPeriodHours,OpenShardCount]' --output table
Layer 2 - Transform (Lambda is not erroring):
aws firehose describe-delivery-stream --delivery-stream-name <stream-name> \
--query 'DeliveryStreamDescription.Destinations[0].<destination-block>.ProcessingConfiguration' --output table
aws cloudwatch get-metric-statistics --namespace AWS/Lambda \
--metric-name Errors --dimensions Name=FunctionName,Value=<lambda-function-name> \
--start-time $(date -u -v-15M +%Y-%m-%dT%H:%M:%S) --end-time $(date -u +%Y-%m-%dT%H:%M:%S) \
--period 60 --statistics Sum --output table
aws logs filter-log-events --log-group-name /aws/lambda/<lambda-function-name> \
--filter-pattern "ERROR" --start-time $(date -u -v-15M +%s)000 --output table
Layer 3 - Convert (format conversion producing non-zero output):
aws firehose describe-delivery-stream --delivery-stream-name <stream-name> \
--query 'DeliveryStreamDescription.Destinations[0].ExtendedS3DestinationDescription.DataFormatConversionConfiguration' --output table
aws s3api list-objects-v2 --bucket <bucket> --prefix <prefix> \
--query 'Contents[*].[Key,Size,LastModified]' --output table | head -20
Layer 4 - Deliver (destination reachable and accepting writes):
aws cloudwatch get-metric-statistics --namespace AWS/Firehose \
--metric-name <DeliveryToS3|DeliveryToOpenSearch|DeliveryToRedshift>.Success \
--dimensions Name=DeliveryStreamName,Value=<stream-name> \
--start-time $(date -u -v-15M +%Y-%m-%dT%H:%M:%S) --end-time $(date -u +%Y-%m-%dT%H:%M:%S) \
--period 60 --statistics Average --output table
For OpenSearch, also verify domain health:
aws opensearch describe-domain-health --domain-name <domain-name> \
--query 'DomainStatus.[ClusterConfig.DedicatedMasterEnabled,ClusterConfig.InstanceType,ClusterHealth] ' --output table
Layer 5 - Observability (logging is enabled):
aws firehose describe-delivery-stream --delivery-stream-name <stream-name> \
--query 'DeliveryStreamDescription.Destinations[0].<destination-block>.CloudWatchLoggingOptions' --output table
aws logs describe-log-groups --log-group-name-prefix /aws/kinesisfirehose/<stream-name> --output table
Flags: Enabled: false on CloudWatch logging means you are blind
to per-record errors. Enable before debugging further.
If any layer fails, fix the layer FIRST. Most Firehose failures
resolve when logging, IAM, or KMS is restored. Specifically:
- Layer 1 fails -> source stream paused or no PutRecord traffic.
- Layer 2 fails -> Lambda errors or timeouts; check Lambda logs.
- Layer 3 fails -> Glue schema mismatch or non-JSON input; check object size.
- Layer 4 fails -> destination unreachable, IAM gap, or KMS denial.
- Layer 5 fails -> CloudWatch logging disabled; enable before continuing.
Step 2: Diagnose delivery to S3 fails
Symptom: DeliveryToS3.Success drops below 100% or objects
stop landing in the S3 bucket.
aws firehose describe-delivery-stream --delivery-stream-name <stream-name> \
--query 'DeliveryStreamDescription.Destinations[0].ExtendedS3DestinationDescription.[BucketARN,RoleARN,BufferingHints,EncryptionConfiguration]' --output table
aws s3api head-bucket --bucket <bucket-name>
aws s3api get-bucket-location --bucket <bucket-name>
aws cloudtrail lookup-events --lookup-attributes AttributeKey=EventName,AttributeValue=PutObject \
--start-time $(date -u -v-1H +%Y-%m-%dT%H:%M:%S) --end-time $(date -u +%Y-%m-%dT%H:%M:%S) \
--query 'Events[*].[EventTime,Username,ResourceName]' --output table | grep -i <bucket>
| Cause |
Diagnostic signal |
Fix |
| Bucket deleted |
head-bucket returns 404 / NoSuchBucket |
Recreate the bucket; or update-destination to a new bucket |
| Bucket region mismatch |
get-bucket-location returns a region other than the Firehose region |
Move the bucket to the Firehose region; cross-region S3 is not supported |
| KMS key disabled / rotated |
kms describe-key shows KeyState: Disabled or PendingDeletion |
Re-enable or recreate the key; update EncryptionConfiguration.KMSEncryptionConfig |
| KMS key policy denies Firehose |
get-key-policy does not grant kms:GenerateDataKey to delivery.stream.amazonaws.com |
Add a statement allowing kms:GenerateDataKey, kms:Decrypt for ServicePrincipal: firehose.amazonaws.com |
| Bucket policy denies Firehose role |
Bucket policy Statement lacks s3:PutObject for the Firehose role ARN |
Add s3:PutObject, s3:AbortMultipartUpload, s3:ListBucketMultipartUploads to the bucket policy |
Firehose role lacks s3:PutObject |
simulate-principal-policy returns Denied for s3:PutObject on the bucket |
Attach / extend the Firehose role policy |
| Object prefix has invalid characters |
Prefix contains //, leading /, or forbidden chars |
Fix the prefix in update-destination |
| Multipart upload never completed |
Object key fragments in _InProgress/; CompleteMultipartUpload denied |
Add s3:CompleteMultipartUpload; check S3 lifecycle for _ABORTED_ |
VERDICT: ROOT_CAUSE_FOUND when CloudTrail / IAM check
identifies a specific cause; NEED_MORE_INFO when the bucket and
IAM are correct but writes still fail (capture CloudTrail for the
exact errorMessage).
Step 3: Diagnose data transformation Lambda fails
Symptom: DeliveryToS3.Success is healthy but transformed
records are wrong, dropped to S3 backup, or Lambda errors spike.
aws firehose describe-delivery-stream --delivery-stream-name <stream-name> \
--query 'DeliveryStreamDescription.Destinations[0].<destination-block>.ProcessingConfiguration' --output table
aws lambda get-function --function-name <lambda-function-name> \
--query 'Configuration.[Runtime,Timeout,MemorySize,Role]' --output table
aws lambda get-policy --function-name <lambda-function-name> --query 'Policy' --output text
aws logs filter-log-events --log-group-name /aws/lambda/<lambda-function-name> \
--filter-pattern "ERROR Task timed out" --start-time $(date -u -v-1H +%s)000 --output table
| Cause |
Diagnostic signal |
Fix |
| Lambda timeout |
CloudWatch Duration near Timeout; log shows "Task timed out after X seconds" |
Increase Lambda Timeout (max 900s); or reduce buffer size |
| Lambda exception |
Log shows stack trace; Errors metric > 0 |
Fix the handler code; common causes: JSON parse, missing field, ref-data fetch failure |
| Lambda response > 6 MB |
S3 backup receives full batches; log shows "response payload exceeds 6 MB" |
Reduce buffer size; or compress / trim records in the handler |
| Lambda resource policy lacks Firehose invoke |
get-policy lacks lambda:InvokeFunction for firehose.amazonaws.com |
Add lambda:InvokeFunction permission with principal firehose.amazonaws.com, source-arn = stream ARN |
| Lambda role lacks downstream access |
Logs show AccessDenied on DynamoDB / S3 ref-data |
Attach the required actions to the Lambda role |
| Lambda runtime deprecated |
Runtime: nodejs14.x or python3.7; deprecation warning |
Upgrade to a supported runtime (nodejs20.x, python3.12) |
| Lambda concurrency limit hit |
CloudWatch Throttles > 0 |
Raise reserved / account concurrency; or reduce buffer flush rate |
| Mismatched buffer vs Lambda duration |
Buffer flush every 60s but Lambda Timeout: 30s for a 50 MB batch |
Reduce buffer size or raise Lambda Timeout |
| Lambda returns malformed response |
Log shows "Invalid output format" |
Return { records: [{ recordId, result: 'Ok', data: base64 }], ... } exactly per the Firehose transform protocol |
VERDICT: ROOT_CAUSE_FOUND when Lambda log identifies a specific
cause; NEED_MORE_INFO when Lambda errors are intermittent (sample
the handler code or ref-data source).
Step 4: Diagnose delivery lag (high DataFreshness)
Symptom: DeliveryToS3.DataFreshnessSec spikes; records land
in S3 minutes or hours late.
aws firehose describe-delivery-stream --delivery-stream-name <stream-name> \
--query 'DeliveryStreamDescription.Destinations[0].<destination-block>.BufferingHints' --output table
aws cloudwatch get-metric-statistics --namespace AWS/Firehose \
--metric-name DeliveryToS3.DataFreshnessSec \
--dimensions Name=DeliveryStreamName,Value=<stream-name> \
--start-time $(date -u -v-1H +%Y-%m-%dT%H:%M:%S) --end-time $(date -u +%Y-%m-%dT%H:%M:%S) \
--period 60 --statistics Average,Maximum --output table
| Cause |
Diagnostic signal |
Fix |
| Buffering hints too large |
BufferingHints.SizeInMBs: 128 and IntervalInSeconds: 900; low-traffic stream |
Reduce SizeInMBs to 5-10 or IntervalInSeconds to 60-300 |
| Lambda processing slow |
Lambda Duration consistently > buffer flush interval |
Increase Lambda memory (proportional CPU); parallelize processing; or reduce buffer size |
Firehose throttled on PutRecord |
Source-side ThrottledRecords > 0; WriteThroughputBytes flat |
Request a limit increase; or shard the stream |
| Destination backpressure (OpenSearch 429) |
OpenSearch 429 count > 0 in Firehose logs; circuit breaker engaged |
Scale OpenSearch cluster; raise Firehose IndexRotationPeriod |
| KMS throttling |
KMS ThrottledRequests > 0 |
Request KMS RPS limit increase; or use AWS managed key |
| S3 503 Slow Down |
S3 5xx rate elevated; CompleteMultipartUpload latency up |
Use a higher-cardinality prefix; reduce PUT rate per partition |
| Network path latency |
Cross-AZ or cross-region hops (VPN / PrivateLink) |
Co-locate Firehose and destination in the same region and AZ group |
VERDICT: ROOT_CAUSE_FOUND when metric correlation identifies a
specific cause; NEED_MORE_INFO when DataFreshness spikes are
intermittent and uncorrelated with any single metric (instrument
per-stage timing in the Lambda transform).
Step 5: Diagnose data format conversion fails (Parquet/ORC)
Symptom: objects land in S3 but Athena / engines return empty
or 0-byte objects; DeliveryToS3.Success shows healthy.
aws firehose describe-delivery-stream --delivery-stream-name <stream-name> \
--query 'DeliveryStreamDescription.Destinations[0].ExtendedS3DestinationDescription.DataFormatConversionConfiguration' --output table
aws glue get-table --database-name <db> --name <table> \
--query 'Table.[StorageDescriptor.Columns,Parameters]' --output table
aws s3api head-object --bucket <bucket> --key <prefix>/<latest-object> --query 'ContentLength' --output text
aws logs filter-log-events --log-group-name /aws/kinesisfirehose/<stream-name> \
--filter-pattern "FormatConversion" --output table
| Cause |
Diagnostic signal |
Fix |
| Input not valid JSON |
Firehose log: "Input record is not valid JSON"; records to S3 error backup |
Fix the producer to emit JSON; or change deserializer to OpenXJsonSerDe with tolerance |
| Glue schema mismatch |
get-table columns do not match JSON keys; Athena returns nulls |
Update the Glue table schema to match the data; or fix the producer |
| Hive SerDe mismatch (ORC vs Parquet) |
OutputFormat set to ORC but writer config is Parquet; or vice versa |
Align OutputFormatConfiguration.Format with the Glue table TableType and SerDe |
| Timestamp format wrong |
Athena returns nulls on timestamp columns; Firehose log: "Invalid timestamp" |
Add TimestampFormats to the SerDe (e.g., yyyy-MM-dd HH:mm:ss.SSSSSS) |
| Case sensitivity mismatch |
JSON keys snake_case but Glue columns CamelCase |
Set CaseInsensitive on the SerDe or rename Glue columns |
| Nested object not parsed |
Glue struct type but input is a string-encoded JSON |
Add Mapping or use a different SerDe; or pre-parse in Lambda transform |
| 0-byte objects |
head-object ContentLength: 0 |
Conversion rejected the whole batch; check the S3 error backup and the Glue schema |
| Unsupported SerDe (CSV) |
InputFormatConfiguration.Deserializer is LazySimpleSerDe (CSV) but output is Parquet |
Use OpenXJsonSerDe for JSON-only inputs to Parquet/ORC conversion |
VERDICT: ROOT_CAUSE_FOUND when Glue schema vs input diff
identifies a specific cause; NEED_MORE_INFO when input is valid
JSON and schema matches but conversion still fails (sample a
record from the source and run it through the Glue crawler).
Step 6: Diagnose delivery to OpenSearch fails
Symptom: DeliveryToOpenSearch.Success drops below 100%;
OpenSearch index missing recent documents.
aws firehose describe-delivery-stream --delivery-stream-name <stream-name> \
--query 'DeliveryStreamDescription.Destinations[0].AmazonopensearchserviceDestinationDescription.[DomainARN,IndexName,RoleARN,TypeName,S3BackupMode]' --output table
aws opensearch describe-domain --domain-name <domain-name> \
--query 'DomainStatus.[Endpoints,ClusterConfig.InstanceType,ClusterConfig.InstanceCount,EncryptionAtRestOptions.Enabled]' --output table
aws cloudwatch get-metric-statistics --namespace AWS/Firehose \
--metric-name DeliveryToOpenSearch.Success \
--dimensions Name=DeliveryStreamName,Value=<stream-name> \
--start-time $(date -u -v-1H +%Y-%m-%dT%H:%M:%S) --end-time $(date -u +%Y-%m-%dT%H:%M:%S) \
--period 60 --statistics Average --output table
| Cause |
Diagnostic signal |
Fix |
| Cluster unreachable |
describe-domain shows Endpoints: null or processing; Firehose log: Connection refused |
Wait for domain to finish processing; or check VPC endpoint reachability |
| Auth failure - IAM |
OpenSearch access policy does not allow the Firehose role |
Add the Firehose role to the domain access policy with es:ESHttpPost |
| Auth failure - basic |
Domain uses master-user auth; Firehose not configured with correct credentials |
Configure ClusterEndpoint + Username/Password (Secrets Manager) |
| Fine-grained access control (FGAC) |
Firehose role lacks the backend role mapping |
Map the Firehose role to the appropriate OpenSearch role via the security plugin |
| OpenSearch 429 (Too Many Requests) |
429 count in Firehose logs; circuit breaker engaged |
Scale the cluster (more / larger instances); or shard the Firehose destination |
| Circuit breaker tripped |
Delivery resumes after sustained success; Success: 0 for the breaker window |
Same as 429; raise the breaker window via AWS Support if needed |
| Index name invalid |
Index name has uppercase or invalid char; 400 Bad Request |
Use lowercase, no special chars; use IndexRotationPeriod for time-based indices |
| Document mapping conflict |
Field type changes between records; OpenSearch rejects |
Map fields explicitly in the index template; or use dynamic templates |
| VPC OpenSearch without Firehose VPC config |
Firehose in a different VPC; private network unreachable |
Put Firehose in the same VPC as OpenSearch; or use a transit gateway |
| KMS key policy (encryption-at-rest) |
Key policy does not grant the Firehose role |
Add kms:GenerateDataKey, kms:Decrypt for the Firehose role |
| OpenSearch health yellow/red |
describe-domain-health shows Yellow/Red |
Resolve shard allocation; free disk space; or restart unhealthy nodes |
VERDICT: ROOT_CAUSE_FOUND when access policy / OpenSearch
health identifies a specific cause; NEED_MORE_INFO when auth is
correct and the cluster is green but deliveries still fail
(capture the exact HTTP response code from Firehose logs).
Step 7: Diagnose delivery to Redshift fails
Symptom: DeliveryToRedshift.Success drops; Redshift tables
missing recent data.
aws firehose describe-delivery-stream --delivery-stream-name <stream-name> \
--query 'DeliveryStreamDescription.Destinations[0].RedshiftDestinationDescription.[ClusterJDBCURL,CopyCommand,RoleARN,Username,S3Configuration]' --output table
aws redshift describe-clusters --cluster-identifier <cluster-id> \
--query 'Clusters[0].[ClusterStatus,ClusterAvailabilityStatus,NodeType,NumberOfNodes]' --output table
aws logs filter-log-events --log-group-name /aws/kinesisfirehose/<stream-name> \
--filter-pattern "COPY" --output table
Connect to Redshift and check the load errors:
SELECT query, filename, line_number, colname, type, err_reason
FROM stl_load_errors
WHERE start_time > dateadd(hour, -1, getdate())
ORDER BY start_time DESC LIMIT 20;
| Cause |
Diagnostic signal |
Fix |
| Redshift cluster paused / unavailable |
describe-clusters shows paused, available with no active connections, or resizing |
Resume the cluster; wait for resize; or use a Multi-AZ cluster |
| JDBC URL unreachable |
Firehose log: Connection refused |
Verify the security group allows the Firehose subnet to TCP/5439; or use Firehose-in-VPC |
| Credentials invalid |
Firehose log: Authentication failed |
Update Username + Password (Secrets Manager); rotate |
| COPY column mismatch |
stl_load_errors shows Extra column(s) / Missing column(s) |
Align the CopyCommand.DataTableColumns with the table schema |
| Encoding / format invalid |
stl_load_errors shows Invalid digit, Value '.', ... |
Fix the producer format; or set COPY ... ACCEPTANYDATE / TRIMBLANKS / NULL AS |
| Staging bucket IAM gap |
Firehose delivers to staging; COPY fails with S3ServiceException: Access Denied |
Grant the Redshift cluster role (not Firehose role) s3:GetObject on the staging bucket |
| Staging bucket deleted |
head-bucket on staging bucket returns 404 |
Recreate staging bucket; or update-destination to a new staging bucket |
| Staging bucket region mismatch |
Staging bucket in a different region than Redshift |
Move staging bucket to the Redshift region |
| COPY timeout |
stl_load_errors shows large file; COPY duration > Firehose retry window |
Split files (smaller Firehose buffer); or use COPY ... MAXERROR 100 with monitoring |
| Date / timestamp format |
stl_load_errors shows Invalid timestamp format |
Set COPY ... FORMAT AS CSV and timeformat AS 'YYYY-MM-DD HH:MI:SS' |
| KMS key for staging bucket |
Redshift cluster role lacks kms:Decrypt on the staging bucket key |
Add the Redshift cluster role to the staging bucket KMS key policy |
VERDICT: ROOT_CAUSE_FOUND when stl_load_errors identifies a
specific cause; NEED_MORE_INFO when the COPY appears to succeed
but rows are missing (check the Redshift workload manager and
transaction commits).
Step 8: Diagnose latest destinations (Snowflake / HTTP / Splunk)
Moved verbatim → references/firehose-delivery-diagnostics.md § "Step 8: Diagnose latest destinations (Snowflake / HTTP / Splunk)".
Load when: diagnosing Snowflake, HTTP endpoint, or Splunk destinations — per-destination cause/signal/fix tables.
Output format
The output block template above is the authoritative structure.
Violating any rule is a misdiagnosis. Three worked examples follow.
Worked example - ROOT_CAUSE_FOUND, DeliveryToS3Fails (KMS gap)
DIAGNOSIS: prod-firehose-s3
DELIVERY_STREAM: prod-events-delivery
DESTINATION: s3 (extended)
SYMPTOM: DeliveryToS3Fails
ROOT_CAUSE: KMS key policy on arn:aws:kms:us-east-1:111111111111:key/abc123
does not grant the Firehose service principal
kms:GenerateDataKey. The key policy allows only the
customer account root.
EVIDENCE:
- CloudTrail PutObject events for the Firehose role show errorMessage: "AccessDenied: kms:GenerateDataKey on arn:aws:kms:us-east-1:111111111111:key/abc123"
- aws kms get-key-policy: Statement Principal = {"AWS": "arn:aws:iam::111111111111:root"} only
LAYER_CHECK:
- Source: PASS - IncomingBytes > 0; stream type DirectPut
- Transform: N/A - no Lambda processing configured
- Convert: N/A - no format conversion
- Deliver: FAIL - KMS key policy denies Firehose service principal
- Observability: PASS - CloudWatch logging enabled
FIX:
- Add the Firehose service principal to the KMS key policy:
aws kms put-key-policy --key-id arn:aws:kms:us-east-1:111111111111:key/abc123 --policy-name default --policy '{"Id":"firehose-key-policy","Version":"2012-10-17","Statement":[{"Sid":"Enable IAM permissions","Effect":"Allow","Principal":{"AWS":"arn:aws:iam::111111111111:root"},"Action":"kms:*","Resource":"*"},{"Sid":"Allow Firehose","Effect":"Allow","Principal":{"Service":"firehose.amazonaws.com"},"Action":["kms:GenerateDataKey","kms:Decrypt"],"Resource":"*"}]}'
- No Firehose-side change; the key policy is the only gap.
VERIFICATION:
- aws cloudwatch get-metric-statistics --namespace AWS/Firehose --metric-name DeliveryToS3.Success --dimensions Name=DeliveryStreamName,Value=prod-events-delivery --start-time $(date -u -v-15M +%Y-%m-%dT%H:%M:%S) --end-time $(date -u +%Y-%m-%dT%H:%M:%S) --period 60 --statistics Average --output table
- Expect: Average >= 1.0 within 5-10 minutes of the key policy update.
VERDICT: ROOT_CAUSE_FOUND
NEXT_STEP: None
ESCALATION_PATH: None
Worked example - NEED_MORE_INFO, DeliveryLag (intermittent)
Moved verbatim → references/worked-examples.md § "Worked example - NEED_MORE_INFO, DeliveryLag (intermittent)".
Load when: emitting a NEED_MORE_INFO verdict — intermittent DeliveryLag example with per-stage timing next steps.
Worked example - ESCALATE, OpenSearchFails (cluster red)
Moved verbatim → references/worked-examples.md § "Worked example - ESCALATE, OpenSearchFails (cluster red)".
Load when: emitting an ESCALATE verdict — OpenSearch cluster-red example with out-of-band remediation.
Anti-Patterns - NEVER do these things
- NEVER diagnose a Firehose failure without first running the 5-layer health check. Most "delivery fails" tickets are coverage gaps in the transform Lambda, KMS key policy, or destination reachability.
- NEVER assume the delivery-stream status
ACTIVE means records are being delivered. ACTIVE only means the stream config is accepted; per-record delivery failures are surfaced via CloudWatch metrics and S3 backup, not status.
- NEVER confuse a Lambda transform timeout with a Firehose bug. Firehose invokes the transform with the configured buffer; a Lambda slower than the buffer cadence produces backpressure, not a Firehose failure.
- NEVER assume Parquet/ORC conversion is working because objects land in S3. Conversion can produce 0-byte objects if the input JSON is malformed or the Glue table schema does not match the data. Always verify object size, not just object count.
- NEVER emit
VERDICT: NEED_MORE_INFO without a NEXT_STEP naming a specific diagnostic command. Generic phrases like "investigate further" are not acceptable.
Pre-flight safety checks
Moved verbatim → references/diagnostic-commands.md § "Pre-flight safety checks".
Load when: before any state-changing operation — confirmation gate, update-destination blast radius, KMS policy backup.
Appendix A - Symptom-to-cause map (quick reference)
Moved verbatim → references/firehose-delivery-diagnostics.md § "Appendix A - Symptom-to-cause map (quick reference)".
Load when: mapping a symptom to its most common root cause and the command that verifies it.
Recent AWS features (2024-2026)
Moved verbatim → references/advanced-patterns.md § "Recent AWS features (2024-2026)".
Load when: checking 2024-2026 feature availability — Snowflake GA, dynamic partitioning, Firehose-in-VPC, multi-AZ delivery.
AWS documentation
References (load on demand)
- references/worked-examples.md — secondary worked examples: NEED_MORE_INFO (intermittent DeliveryLag) and ESCALATE (OpenSearch cluster red) full DIAGNOSIS blocks
- references/diagnostic-commands.md — pre-flight data requirements (inputs + malformed-input block) and pre-flight safety checks
- references/advanced-patterns.md — Step 0 non-obvious Firehose behaviors and recent AWS features 2024-2026
- references/firehose-delivery-diagnostics.md — diagnostic command quick lookup, per-destination CloudWatch metrics, Step 8 latest-destination cause tables, Appendix A symptom-to-cause map (moved verbatim; existing deep reference)
1---2name: kinesis-firehose-troubleshooter3description: 'Diagnoses Amazon Kinesis Data Firehose delivery stream failures via a systematic 8-symptom decision tree: delivery to S3 fails (bucket deleted, KMS key policy, bucket region mismatch), data transformation Lambda fails (Lambda timeout, exception, resource policy), delivery lag (buffering hints too large, Lambda slow, throttling), data format conversion fails (incorrect JSON, Hive SerDe mismatch for Parquet/ORC), delivery to OpenSearch fails (cluster unreachable, auth failure, circuit breaker), delivery to Redshift fails (COPY command failure, staging bucket issue), and latest destinations (Firehose to Snowflake, HTTP endpoint, Splunk delivery). Maps each symptom to root cause via diagnostic commands and specific fixes. Emits ROOT_CAUSE_FOUND with a fix plan, NEED_MORE_INFO with the next diagnostic, or ESCALATE with the escalation path. Use when Firehose is failing to deliver, lagging, transforming incorrectly, or a downstream destination returns errors.'4license: Apache-2.05compatibility: Agent runtime that reads SKILL.md (Claude Code, Cursor, Windsurf, Codex, Gemini). No AWS CLI required for offline diagnosis. Live- account troubleshooting uses aws firehose describe-delivery- stream, list-tags-for-stream, list-delivery-streams, start- delivery-stream-encryption, stop-delivery-stream-encryption, aws logs filter-log-events, aws lambda get-function, get-policy, invoke, aws s3api head-bucket, get-bucket-location, aws opensearch describe-domain, describe-domain-health, aws...6metadata:7 source: https://skillmd.com/skills/jhkchan/kinesis-firehose-troubleshooter8 domain: aws-cloudops9 complexity: high10 requires_llm: 'true'11 phase: '2'12 supports_pipeline: 'true'13 entry_point: 'false'14 family: Analytics15 task_type: troubleshoot16 skill_class: capability17 lifecycle_status: active18 verdict_shape: ROOT_CAUSE_FOUND | NEED_MORE_INFO | ESCALATE19 when_to_use: 'Diagnosing a Kinesis Data Firehose delivery stream that is failing to deliver, lagging, transforming incorrectly, or one of the downstream destinations returns errors. Covers the eight primary symptom categories: delivery to S3 fails, data transformation Lambda fails, delivery lag, data format conversion fails (Parquet/ORC), delivery to OpenSearch fails, delivery to Redshift fails, and latest destinations (Firehose to Snowflake, HTTP endpoint, Splunk). Use when CloudWatch shows DeliveryToS3.Success dropping, Firehose logs show Lambda transformation errors, ORC/Parquet conversion produces 0-byte objects, the OpenSearch destination returns 429s, or the Redshift COPY command fails.'20 activation_triggers: Firehose delivery fails, Firehose delivery lag, Firehose to S3 fails, Firehose to OpenSearch fails, Firehose to Redshift fails, Firehose to Snowflake fails, Firehose HTTP endpoint fails, Firehose Splunk delivery fails, Firehose Lambda transformation fails, DeliveryToS3.Success drops, DeliveryToS3.DataFreshnessSec high, data format conversion fails, Parquet conversion 0 bytes, ORC SerDe mismatch, Firehose circuit breaker, OpenSearch 429, Redshift COPY fails, Splunk HEC token invalid, Firehose KMS denied, bucket region mismatch21 invocation_schema: 'Input: either (a) a delivery-stream-name with observed symptom (delivery-to-s3-fails / lambda-fails / delivery-lag / format-conversion-fails / opensearch-fails / redshift-fails / latest-destination-fails), optionally with a destination type (s3 / opensearch / redshift / snowflake / http-endpoint / splunk), OR (b) live-account diagnostic output from describe-delivery-stream, get-metric-statistics, filter-log- events, etc. Output: deterministic DIAGNOSIS block per stream - SYMPTOM/ROOT_CAUSE/EVIDENCE/LAYER_CHECK/FIX/ VERDICT - where VERDICT is ROOT_CAUSE_FOUND (cause identified + fix actionable), NEED_MORE_INFO (specific next diagnostic cited), or ESCALATE (requires AWS Support or out-of-band action).'22 version: 0.1.023 author: Jacky Chan — AWS Community Builder24 keywords: Kinesis, Kinesis Data Firehose, delivery stream, delivery to S3 fails, delivery lag, data transformation Lambda, Lambda processing, data format conversion, Parquet, ORC, Hive SerDe, OpenSearch delivery, Redshift COPY, Snowflake delivery, HTTP endpoint delivery, Splunk HEC, circuit breaker, buffering hints, KMS key policy, staging bucket25 tags: kinesis, firehose, analytics, troubleshoot, delivery-stream, lambda, opensearch, redshift, diagnostic26---2728# Kinesis Data Firehose Troubleshooter2930## Mindset3132A Firehose delivery stream is a four-stage pipeline: **ingest**33(the PutRecord API or Kinesis Stream source), **transform**34(optional Lambda processing), **convert** (optional format35conversion to Parquet/ORC via Glue catalog), and **deliver**36(the destination: S3, OpenSearch, Redshift, Snowflake, HTTP37endpoint, Splunk). Most "Firehose failing" tickets are one stage38failing silently while the others report healthy. Diagnose the39stage first, then the destination-specific config.4041- **The 5-layer health check is the upstream gate.** Firehose does not surface all failures as delivery-stream `ACTIVE` status changes; a Lambda transform or destination can fail while the stream stays green. Diagnose by layer: source, transform, convert, deliver, observability.42- **CloudWatch metrics are per-destination.** `DeliveryToS3.Success`, `DeliveryToOpenSearch.Success`, `DeliveryToRedshift.Success` are separate metrics. Verify the metric matching the configured destination, not just `DeliveryToS3.Success`.43- **`describe-delivery-stream` is the source of truth.** It returns the full destination config, Lambda ARN, buffering hints, and the S3 backup bucket. The console shows a summary; the API returns the exact JSON the service is using.4445## Quick navigation4647| You want to... | Go to |48|---|---|49| Run the 5-layer health check first (recommended) | Step 1 |50| Diagnose delivery to S3 fails | Step 2 |51| Diagnose data transformation Lambda fails | Step 3 |52| Diagnose delivery lag (high DataFreshness) | Step 4 |53| Diagnose data format conversion fails (Parquet/ORC) | Step 5 |54| Diagnose delivery to OpenSearch fails | Step 6 |55| Diagnose delivery to Redshift fails | Step 7 |56| Diagnose latest destinations (Snowflake / HTTP / Splunk) | Step 8 |57| Map symptom to root cause quickly | Appendix A |58| Avoid misdiagnosis pitfalls | Anti-Patterns |5960## STRICT output contract6162Every diagnosis MUST emit the exact DIAGNOSIS block with all fields63populated (no empty fields, no omitted sections, no reordering).64All five LAYER_CHECK lines (Source, Transform, Convert, Deliver,65Observability) are mandatory - even when the failure is destination-66specific.6768Verdict-specific rules:69- `ROOT_CAUSE_FOUND` -> ROOT_CAUSE names a single specific cause; EVIDENCE cites at least one failing API signal or metric; FIX is actionable CLI.70- `NEED_MORE_INFO` -> ROOT_CAUSE is "Pending diagnosis - <what is known>"; NEXT_STEP cites the exact next command.71- `ESCALATE` -> ESCALATION_PATH names the recipient and the out-of-band action required.7273```text74DIAGNOSIS: <reference>75DELIVERY_STREAM: <stream-name>76DESTINATION: <s3 | opensearch | redshift | snowflake | http-endpoint | splunk | lambda>77SYMPTOM: DeliveryToS3Fails | LambdaFails | DeliveryLag | FormatConversionFails | OpenSearchFails | RedshiftFails | LatestDestinationFails78ROOT_CAUSE: <specific cause cited>79EVIDENCE:80 - <diagnostic signal 1>81 - <diagnostic signal 2>82LAYER_CHECK:83 - Source: <PASS | FAIL - reason>84 - Transform: <PASS | FAIL - reason | N/A>85 - Convert: <PASS | FAIL - reason | N/A>86 - Deliver: <PASS | FAIL - reason>87 - Observability: <PASS | FAIL - reason>88FIX:89 - <action 1 with CLI snippet>90 - <action 2 ...>91VERIFICATION:92 - <command to confirm fix>93VERDICT: ROOT_CAUSE_FOUND | NEED_MORE_INFO | ESCALATE94NEXT_STEP: <if NEED_MORE_INFO, the specific next diagnostic>95ESCALATION_PATH: <if ESCALATE, the recommended path>96```9798## Critical rules at a glance991001. **Run the 5-layer health check FIRST.** Before any destination-specific diagnosis, confirm: (1) source is feeding records, (2) Lambda transform (if any) is not erroring, (3) format conversion (if any) is producing non-zero output, (4) destination is reachable and accepting writes, (5) CloudWatch logging is enabled so you have evidence.1012. **Verify the per-destination metric.** `DeliveryToS3.Success` is irrelevant when the destination is OpenSearch. Use the metric matching the configured destination.1023. **`describe-delivery-stream` returns the live config.** The console may lag or show stale state; the API returns the actual JSON Firehose is using.1034. **Lambda transforms cap output at 6 MB.** A record that grows during transformation (enrichment, JSON expansion) can exceed the cap and be dropped silently to S3 backup.1045. **DataFreshness is the lag indicator.** A spike in `DeliveryToS3.DataFreshnessSec` means the destination is not keeping up with ingestion. Buffering hints and Lambda duration are the usual culprits.105106## NEVER (top 5)107108- **NEVER** diagnose a Firehose failure without first running the 5-layer health check. Most "delivery fails" tickets are coverage gaps in the transform Lambda, the KMS key policy, or the destination reachability.109- **NEVER** assume the delivery-stream status `ACTIVE` means records are being delivered. `ACTIVE` only means the stream config is accepted; per-record delivery failures are surfaced via CloudWatch metrics and S3 backup, not status.110- **NEVER** confuse a Lambda transform timeout with a Firehose bug. Firehose invokes the transform with the configured buffer (1-3 MB or 60-900 sec); a Lambda slower than the buffer cadence produces backpressure, not a Firehose failure.111- **NEVER** assume Parquet/ORC conversion is working because objects land in S3. Conversion can produce 0-byte objects if the input JSON is malformed or the Glue table schema does not match the data. Always verify object size, not just object count.112- **NEVER** emit `VERDICT: NEED_MORE_INFO` without a `NEXT_STEP` naming a specific diagnostic command. Generic phrases like "investigate further" are not acceptable.113114## Expert heuristic115116- If `DeliveryToS3.Success` drops to 0 instantly after a config change, the failure is **IAM, KMS, or bucket policy** (Step 2). Check CloudTrail for `AccessDenied` on `s3:PutObject` or `kms:GenerateDataKey`.117- If `DeliveryToS3.DataFreshnessSec` spikes without a drop in `Success`, the failure is **buffering hints or Lambda duration** (Step 4). The destination eventually catches up; data is just delayed.118- If Parquet objects land but query engines return empty results, the failure is **SerDe / Glue schema mismatch** (Step 5). The bytes are written but unreadable.119- If only OpenSearch destination fails with `429 Too Many Requests`, the failure is **OpenSearch write throttling** or the Firehose circuit breaker (default: 5 minutes of sustained writes). Scale the OpenSearch cluster or raise the circuit-breaker window.120- If Redshift COPY fails consistently at the same step, the failure is **column-count mismatch, encoding, or the staging-bucket IAM grant** (Step 7). Look in `STL_LOAD_ERRORS`.121- If Snowflake / HTTP endpoint / Splunk destinations fail, the failure is usually **credentials, network reachability, or the endpoint's auth model** (Step 8) - these do not exercise S3 KMS or Lambda layers.122123## Pre-flight: data requirements124125> **Moved verbatim** → [references/diagnostic-commands.md](references/diagnostic-commands.md) § "Pre-flight: data requirements".126> Load when: starting a diagnosis — the required-inputs table and the malformed-input NEED_MORE_INFO block.127128## Process - Diagnostic decision tree (apply in order)129130### Step 0: Expert knowledge - non-obvious Firehose behaviors131132> **Moved verbatim** → [references/advanced-patterns.md](references/advanced-patterns.md) § "Step 0: Expert knowledge - non-obvious Firehose behaviors".133> Load when: a behavior seems non-obvious — buffered Lambda invocation, 6 MB response cap, OpenSearch circuit breaker, staging-bucket IAM, update-destination VersionId.134135### Step 1: The 5-layer Firehose health check (run FIRST)136137Before any destination-specific diagnosis, confirm all five layers.138A failing layer invalidates all downstream diagnosis.139140**Layer 1 - Source (records are arriving):**141142```bash143aws firehose describe-delivery-stream --delivery-stream-name <stream-name> \144 --query 'DeliveryStreamDescription.[DeliveryStreamStatus,DeliveryStreamType,Source.KinesisStreamSourceConfiguration]' --output table145aws cloudwatch get-metric-statistics --namespace AWS/Firehose \146 --metric-name IncomingBytes --dimensions Name=DeliveryStreamName,Value=<stream-name> \147 --start-time $(date -u -v-15M +%Y-%m-%dT%H:%M:%S) --end-time $(date -u +%Y-%m-%dT%H:%M:%S) \148 --period 60 --statistics Sum --output table149```150151For Kinesis-stream source, also verify the source stream is alive:152153```bash154aws kinesis describe-stream-summary --stream-name <source-stream-name> \155 --query 'StreamDescriptionSummary.[StreamStatus,RetentionPeriodHours,OpenShardCount]' --output table156```157158**Layer 2 - Transform (Lambda is not erroring):**159160```bash161aws firehose describe-delivery-stream --delivery-stream-name <stream-name> \162 --query 'DeliveryStreamDescription.Destinations[0].<destination-block>.ProcessingConfiguration' --output table163aws cloudwatch get-metric-statistics --namespace AWS/Lambda \164 --metric-name Errors --dimensions Name=FunctionName,Value=<lambda-function-name> \165 --start-time $(date -u -v-15M +%Y-%m-%dT%H:%M:%S) --end-time $(date -u +%Y-%m-%dT%H:%M:%S) \166 --period 60 --statistics Sum --output table167aws logs filter-log-events --log-group-name /aws/lambda/<lambda-function-name> \168 --filter-pattern "ERROR" --start-time $(date -u -v-15M +%s)000 --output table169```170171**Layer 3 - Convert (format conversion producing non-zero output):**172173```bash174aws firehose describe-delivery-stream --delivery-stream-name <stream-name> \175 --query 'DeliveryStreamDescription.Destinations[0].ExtendedS3DestinationDescription.DataFormatConversionConfiguration' --output table176aws s3api list-objects-v2 --bucket <bucket> --prefix <prefix> \177 --query 'Contents[*].[Key,Size,LastModified]' --output table | head -20178```179180**Layer 4 - Deliver (destination reachable and accepting writes):**181182```bash183aws cloudwatch get-metric-statistics --namespace AWS/Firehose \184 --metric-name <DeliveryToS3|DeliveryToOpenSearch|DeliveryToRedshift>.Success \185 --dimensions Name=DeliveryStreamName,Value=<stream-name> \186 --start-time $(date -u -v-15M +%Y-%m-%dT%H:%M:%S) --end-time $(date -u +%Y-%m-%dT%H:%M:%S) \187 --period 60 --statistics Average --output table188```189190For OpenSearch, also verify domain health:191192```bash193aws opensearch describe-domain-health --domain-name <domain-name> \194 --query 'DomainStatus.[ClusterConfig.DedicatedMasterEnabled,ClusterConfig.InstanceType,ClusterHealth] ' --output table195```196197**Layer 5 - Observability (logging is enabled):**198199```bash200aws firehose describe-delivery-stream --delivery-stream-name <stream-name> \201 --query 'DeliveryStreamDescription.Destinations[0].<destination-block>.CloudWatchLoggingOptions' --output table202aws logs describe-log-groups --log-group-name-prefix /aws/kinesisfirehose/<stream-name> --output table203```204205Flags: `Enabled: false` on CloudWatch logging means you are blind206to per-record errors. Enable before debugging further.207208**If any layer fails, fix the layer FIRST.** Most Firehose failures209resolve when logging, IAM, or KMS is restored. Specifically:210- Layer 1 fails -> source stream paused or no PutRecord traffic.211- Layer 2 fails -> Lambda errors or timeouts; check Lambda logs.212- Layer 3 fails -> Glue schema mismatch or non-JSON input; check object size.213- Layer 4 fails -> destination unreachable, IAM gap, or KMS denial.214- Layer 5 fails -> CloudWatch logging disabled; enable before continuing.215216### Step 2: Diagnose delivery to S3 fails217218**Symptom:** `DeliveryToS3.Success` drops below 100% or objects219stop landing in the S3 bucket.220221```bash222aws firehose describe-delivery-stream --delivery-stream-name <stream-name> \223 --query 'DeliveryStreamDescription.Destinations[0].ExtendedS3DestinationDescription.[BucketARN,RoleARN,BufferingHints,EncryptionConfiguration]' --output table224aws s3api head-bucket --bucket <bucket-name>225aws s3api get-bucket-location --bucket <bucket-name>226aws cloudtrail lookup-events --lookup-attributes AttributeKey=EventName,AttributeValue=PutObject \227 --start-time $(date -u -v-1H +%Y-%m-%dT%H:%M:%S) --end-time $(date -u +%Y-%m-%dT%H:%M:%S) \228 --query 'Events[*].[EventTime,Username,ResourceName]' --output table | grep -i <bucket>229```230231| Cause | Diagnostic signal | Fix |232|---|---|---|233| Bucket deleted | `head-bucket` returns `404` / `NoSuchBucket` | Recreate the bucket; or update-destination to a new bucket |234| Bucket region mismatch | `get-bucket-location` returns a region other than the Firehose region | Move the bucket to the Firehose region; cross-region S3 is not supported |235| KMS key disabled / rotated | `kms describe-key` shows `KeyState: Disabled` or `PendingDeletion` | Re-enable or recreate the key; update `EncryptionConfiguration.KMSEncryptionConfig` |236| KMS key policy denies Firehose | `get-key-policy` does not grant `kms:GenerateDataKey` to `delivery.stream.amazonaws.com` | Add a statement allowing `kms:GenerateDataKey`, `kms:Decrypt` for `ServicePrincipal: firehose.amazonaws.com` |237| Bucket policy denies Firehose role | Bucket policy `Statement` lacks `s3:PutObject` for the Firehose role ARN | Add `s3:PutObject`, `s3:AbortMultipartUpload`, `s3:ListBucketMultipartUploads` to the bucket policy |238| Firehose role lacks `s3:PutObject` | `simulate-principal-policy` returns `Denied` for `s3:PutObject` on the bucket | Attach / extend the Firehose role policy |239| Object prefix has invalid characters | Prefix contains `//`, leading `/`, or forbidden chars | Fix the prefix in `update-destination` |240| Multipart upload never completed | Object key fragments in `_InProgress/`; `CompleteMultipartUpload` denied | Add `s3:CompleteMultipartUpload`; check S3 lifecycle for `_ABORTED_` |241242**VERDICT:** ROOT_CAUSE_FOUND when CloudTrail / IAM check243identifies a specific cause; NEED_MORE_INFO when the bucket and244IAM are correct but writes still fail (capture CloudTrail for the245exact `errorMessage`).246247### Step 3: Diagnose data transformation Lambda fails248249**Symptom:** `DeliveryToS3.Success` is healthy but transformed250records are wrong, dropped to S3 backup, or Lambda errors spike.251252```bash253aws firehose describe-delivery-stream --delivery-stream-name <stream-name> \254 --query 'DeliveryStreamDescription.Destinations[0].<destination-block>.ProcessingConfiguration' --output table255aws lambda get-function --function-name <lambda-function-name> \256 --query 'Configuration.[Runtime,Timeout,MemorySize,Role]' --output table257aws lambda get-policy --function-name <lambda-function-name> --query 'Policy' --output text258aws logs filter-log-events --log-group-name /aws/lambda/<lambda-function-name> \259 --filter-pattern "ERROR Task timed out" --start-time $(date -u -v-1H +%s)000 --output table260```261262| Cause | Diagnostic signal | Fix |263|---|---|---|264| Lambda timeout | CloudWatch `Duration` near `Timeout`; log shows "Task timed out after X seconds" | Increase Lambda `Timeout` (max 900s); or reduce buffer size |265| Lambda exception | Log shows stack trace; `Errors` metric > 0 | Fix the handler code; common causes: JSON parse, missing field, ref-data fetch failure |266| Lambda response > 6 MB | S3 backup receives full batches; log shows "response payload exceeds 6 MB" | Reduce buffer size; or compress / trim records in the handler |267| Lambda resource policy lacks Firehose invoke | `get-policy` lacks `lambda:InvokeFunction` for `firehose.amazonaws.com` | Add `lambda:InvokeFunction` permission with principal `firehose.amazonaws.com`, source-arn = stream ARN |268| Lambda role lacks downstream access | Logs show `AccessDenied` on DynamoDB / S3 ref-data | Attach the required actions to the Lambda role |269| Lambda runtime deprecated | `Runtime: nodejs14.x` or `python3.7`; deprecation warning | Upgrade to a supported runtime (nodejs20.x, python3.12) |270| Lambda concurrency limit hit | CloudWatch `Throttles` > 0 | Raise reserved / account concurrency; or reduce buffer flush rate |271| Mismatched buffer vs Lambda duration | Buffer flush every 60s but Lambda `Timeout: 30s` for a 50 MB batch | Reduce buffer size or raise Lambda `Timeout` |272| Lambda returns malformed response | Log shows "Invalid output format" | Return `{ records: [{ recordId, result: 'Ok', data: base64 }], ... }` exactly per the Firehose transform protocol |273274**VERDICT:** ROOT_CAUSE_FOUND when Lambda log identifies a specific275cause; NEED_MORE_INFO when Lambda errors are intermittent (sample276the handler code or ref-data source).277278### Step 4: Diagnose delivery lag (high DataFreshness)279280**Symptom:** `DeliveryToS3.DataFreshnessSec` spikes; records land281in S3 minutes or hours late.282283```bash284aws firehose describe-delivery-stream --delivery-stream-name <stream-name> \285 --query 'DeliveryStreamDescription.Destinations[0].<destination-block>.BufferingHints' --output table286aws cloudwatch get-metric-statistics --namespace AWS/Firehose \287 --metric-name DeliveryToS3.DataFreshnessSec \288 --dimensions Name=DeliveryStreamName,Value=<stream-name> \289 --start-time $(date -u -v-1H +%Y-%m-%dT%H:%M:%S) --end-time $(date -u +%Y-%m-%dT%H:%M:%S) \290 --period 60 --statistics Average,Maximum --output table291```292293| Cause | Diagnostic signal | Fix |294|---|---|---|295| Buffering hints too large | `BufferingHints.SizeInMBs: 128` and `IntervalInSeconds: 900`; low-traffic stream | Reduce `SizeInMBs` to 5-10 or `IntervalInSeconds` to 60-300 |296| Lambda processing slow | Lambda `Duration` consistently > buffer flush interval | Increase Lambda memory (proportional CPU); parallelize processing; or reduce buffer size |297| Firehose throttled on `PutRecord` | Source-side `ThrottledRecords` > 0; `WriteThroughputBytes` flat | Request a limit increase; or shard the stream |298| Destination backpressure (OpenSearch 429) | OpenSearch `429` count > 0 in Firehose logs; circuit breaker engaged | Scale OpenSearch cluster; raise Firehose `IndexRotationPeriod` |299| KMS throttling | KMS `ThrottledRequests` > 0 | Request KMS RPS limit increase; or use AWS managed key |300| S3 503 Slow Down | S3 `5xx` rate elevated; `CompleteMultipartUpload` latency up | Use a higher-cardinality prefix; reduce PUT rate per partition |301| Network path latency | Cross-AZ or cross-region hops (VPN / PrivateLink) | Co-locate Firehose and destination in the same region and AZ group |302303**VERDICT:** ROOT_CAUSE_FOUND when metric correlation identifies a304specific cause; NEED_MORE_INFO when DataFreshness spikes are305intermittent and uncorrelated with any single metric (instrument306per-stage timing in the Lambda transform).307308### Step 5: Diagnose data format conversion fails (Parquet/ORC)309310**Symptom:** objects land in S3 but Athena / engines return empty311or 0-byte objects; `DeliveryToS3.Success` shows healthy.312313```bash314aws firehose describe-delivery-stream --delivery-stream-name <stream-name> \315 --query 'DeliveryStreamDescription.Destinations[0].ExtendedS3DestinationDescription.DataFormatConversionConfiguration' --output table316aws glue get-table --database-name <db> --name <table> \317 --query 'Table.[StorageDescriptor.Columns,Parameters]' --output table318aws s3api head-object --bucket <bucket> --key <prefix>/<latest-object> --query 'ContentLength' --output text319aws logs filter-log-events --log-group-name /aws/kinesisfirehose/<stream-name> \320 --filter-pattern "FormatConversion" --output table321```322323| Cause | Diagnostic signal | Fix |324|---|---|---|325| Input not valid JSON | Firehose log: "Input record is not valid JSON"; records to S3 error backup | Fix the producer to emit JSON; or change deserializer to OpenXJsonSerDe with tolerance |326| Glue schema mismatch | `get-table` columns do not match JSON keys; Athena returns nulls | Update the Glue table schema to match the data; or fix the producer |327| Hive SerDe mismatch (ORC vs Parquet) | OutputFormat set to ORC but writer config is Parquet; or vice versa | Align `OutputFormatConfiguration.Format` with the Glue table `TableType` and SerDe |328| Timestamp format wrong | Athena returns nulls on `timestamp` columns; Firehose log: "Invalid timestamp" | Add `TimestampFormats` to the SerDe (e.g., `yyyy-MM-dd HH:mm:ss.SSSSSS`) |329| Case sensitivity mismatch | JSON keys `snake_case` but Glue columns `CamelCase` | Set `CaseInsensitive` on the SerDe or rename Glue columns |330| Nested object not parsed | Glue `struct` type but input is a string-encoded JSON | Add `Mapping` or use a different SerDe; or pre-parse in Lambda transform |331| 0-byte objects | `head-object ContentLength: 0` | Conversion rejected the whole batch; check the S3 error backup and the Glue schema |332| Unsupported SerDe (CSV) | `InputFormatConfiguration.Deserializer` is `LazySimpleSerDe` (CSV) but output is Parquet | Use `OpenXJsonSerDe` for JSON-only inputs to Parquet/ORC conversion |333334**VERDICT:** ROOT_CAUSE_FOUND when Glue schema vs input diff335identifies a specific cause; NEED_MORE_INFO when input is valid336JSON and schema matches but conversion still fails (sample a337record from the source and run it through the Glue crawler).338339### Step 6: Diagnose delivery to OpenSearch fails340341**Symptom:** `DeliveryToOpenSearch.Success` drops below 100%;342OpenSearch index missing recent documents.343344```bash345aws firehose describe-delivery-stream --delivery-stream-name <stream-name> \346 --query 'DeliveryStreamDescription.Destinations[0].AmazonopensearchserviceDestinationDescription.[DomainARN,IndexName,RoleARN,TypeName,S3BackupMode]' --output table347aws opensearch describe-domain --domain-name <domain-name> \348 --query 'DomainStatus.[Endpoints,ClusterConfig.InstanceType,ClusterConfig.InstanceCount,EncryptionAtRestOptions.Enabled]' --output table349aws cloudwatch get-metric-statistics --namespace AWS/Firehose \350 --metric-name DeliveryToOpenSearch.Success \351 --dimensions Name=DeliveryStreamName,Value=<stream-name> \352 --start-time $(date -u -v-1H +%Y-%m-%dT%H:%M:%S) --end-time $(date -u +%Y-%m-%dT%H:%M:%S) \353 --period 60 --statistics Average --output table354```355356| Cause | Diagnostic signal | Fix |357|---|---|---|358| Cluster unreachable | `describe-domain` shows `Endpoints: null` or processing; Firehose log: `Connection refused` | Wait for domain to finish processing; or check VPC endpoint reachability |359| Auth failure - IAM | OpenSearch access policy does not allow the Firehose role | Add the Firehose role to the domain access policy with `es:ESHttpPost` |360| Auth failure - basic | Domain uses master-user auth; Firehose not configured with correct credentials | Configure `ClusterEndpoint` + `Username`/`Password` (Secrets Manager) |361| Fine-grained access control (FGAC) | Firehose role lacks the backend role mapping | Map the Firehose role to the appropriate OpenSearch role via the security plugin |362| OpenSearch 429 (Too Many Requests) | `429` count in Firehose logs; circuit breaker engaged | Scale the cluster (more / larger instances); or shard the Firehose destination |363| Circuit breaker tripped | Delivery resumes after sustained success; `Success: 0` for the breaker window | Same as 429; raise the breaker window via AWS Support if needed |364| Index name invalid | Index name has uppercase or invalid char; `400 Bad Request` | Use lowercase, no special chars; use `IndexRotationPeriod` for time-based indices |365| Document mapping conflict | Field type changes between records; OpenSearch rejects | Map fields explicitly in the index template; or use dynamic templates |366| VPC OpenSearch without Firehose VPC config | Firehose in a different VPC; private network unreachable | Put Firehose in the same VPC as OpenSearch; or use a transit gateway |367| KMS key policy (encryption-at-rest) | Key policy does not grant the Firehose role | Add `kms:GenerateDataKey`, `kms:Decrypt` for the Firehose role |368| OpenSearch health yellow/red | `describe-domain-health` shows `Yellow`/`Red` | Resolve shard allocation; free disk space; or restart unhealthy nodes |369370**VERDICT:** ROOT_CAUSE_FOUND when access policy / OpenSearch371health identifies a specific cause; NEED_MORE_INFO when auth is372correct and the cluster is green but deliveries still fail373(capture the exact HTTP response code from Firehose logs).374375### Step 7: Diagnose delivery to Redshift fails376377**Symptom:** `DeliveryToRedshift.Success` drops; Redshift tables378missing recent data.379380```bash381aws firehose describe-delivery-stream --delivery-stream-name <stream-name> \382 --query 'DeliveryStreamDescription.Destinations[0].RedshiftDestinationDescription.[ClusterJDBCURL,CopyCommand,RoleARN,Username,S3Configuration]' --output table383aws redshift describe-clusters --cluster-identifier <cluster-id> \384 --query 'Clusters[0].[ClusterStatus,ClusterAvailabilityStatus,NodeType,NumberOfNodes]' --output table385aws logs filter-log-events --log-group-name /aws/kinesisfirehose/<stream-name> \386 --filter-pattern "COPY" --output table387```388389Connect to Redshift and check the load errors:390391```sql392SELECT query, filename, line_number, colname, type, err_reason393FROM stl_load_errors394WHERE start_time > dateadd(hour, -1, getdate())395ORDER BY start_time DESC LIMIT 20;396```397398| Cause | Diagnostic signal | Fix |399|---|---|---|400| Redshift cluster paused / unavailable | `describe-clusters` shows `paused`, `available` with no active connections, or `resizing` | Resume the cluster; wait for resize; or use a Multi-AZ cluster |401| JDBC URL unreachable | Firehose log: `Connection refused` | Verify the security group allows the Firehose subnet to TCP/5439; or use Firehose-in-VPC |402| Credentials invalid | Firehose log: `Authentication failed` | Update `Username` + `Password` (Secrets Manager); rotate |403| COPY column mismatch | `stl_load_errors` shows `Extra column(s)` / `Missing column(s)` | Align the `CopyCommand.DataTableColumns` with the table schema |404| Encoding / format invalid | `stl_load_errors` shows `Invalid digit, Value '.', ... ` | Fix the producer format; or set `COPY ... ACCEPTANYDATE` / `TRIMBLANKS` / `NULL AS` |405| Staging bucket IAM gap | Firehose delivers to staging; COPY fails with `S3ServiceException: Access Denied` | Grant the **Redshift cluster role** (not Firehose role) `s3:GetObject` on the staging bucket |406| Staging bucket deleted | `head-bucket` on staging bucket returns 404 | Recreate staging bucket; or `update-destination` to a new staging bucket |407| Staging bucket region mismatch | Staging bucket in a different region than Redshift | Move staging bucket to the Redshift region |408| COPY timeout | `stl_load_errors` shows large file; COPY duration > Firehose retry window | Split files (smaller Firehose buffer); or use `COPY ... MAXERROR 100` with monitoring |409| Date / timestamp format | `stl_load_errors` shows `Invalid timestamp format` | Set `COPY ... FORMAT AS CSV` and `timeformat AS 'YYYY-MM-DD HH:MI:SS'` |410| KMS key for staging bucket | Redshift cluster role lacks `kms:Decrypt` on the staging bucket key | Add the Redshift cluster role to the staging bucket KMS key policy |411412**VERDICT:** ROOT_CAUSE_FOUND when `stl_load_errors` identifies a413specific cause; NEED_MORE_INFO when the COPY appears to succeed414but rows are missing (check the Redshift workload manager and415transaction commits).416417### Step 8: Diagnose latest destinations (Snowflake / HTTP / Splunk)418419> **Moved verbatim** → [references/firehose-delivery-diagnostics.md](references/firehose-delivery-diagnostics.md) § "Step 8: Diagnose latest destinations (Snowflake / HTTP / Splunk)".420> Load when: diagnosing Snowflake, HTTP endpoint, or Splunk destinations — per-destination cause/signal/fix tables.421422## Output format423424The output block template above is the authoritative structure.425Violating any rule is a misdiagnosis. Three worked examples follow.426427### Worked example - ROOT_CAUSE_FOUND, DeliveryToS3Fails (KMS gap)428429```text430DIAGNOSIS: prod-firehose-s3431DELIVERY_STREAM: prod-events-delivery432DESTINATION: s3 (extended)433SYMPTOM: DeliveryToS3Fails434ROOT_CAUSE: KMS key policy on arn:aws:kms:us-east-1:111111111111:key/abc123435 does not grant the Firehose service principal436 kms:GenerateDataKey. The key policy allows only the437 customer account root.438EVIDENCE:439 - CloudTrail PutObject events for the Firehose role show errorMessage: "AccessDenied: kms:GenerateDataKey on arn:aws:kms:us-east-1:111111111111:key/abc123"440 - aws kms get-key-policy: Statement Principal = {"AWS": "arn:aws:iam::111111111111:root"} only441LAYER_CHECK:442 - Source: PASS - IncomingBytes > 0; stream type DirectPut443 - Transform: N/A - no Lambda processing configured444 - Convert: N/A - no format conversion445 - Deliver: FAIL - KMS key policy denies Firehose service principal446 - Observability: PASS - CloudWatch logging enabled447FIX:448 - Add the Firehose service principal to the KMS key policy:449 aws kms put-key-policy --key-id arn:aws:kms:us-east-1:111111111111:key/abc123 --policy-name default --policy '{"Id":"firehose-key-policy","Version":"2012-10-17","Statement":[{"Sid":"Enable IAM permissions","Effect":"Allow","Principal":{"AWS":"arn:aws:iam::111111111111:root"},"Action":"kms:*","Resource":"*"},{"Sid":"Allow Firehose","Effect":"Allow","Principal":{"Service":"firehose.amazonaws.com"},"Action":["kms:GenerateDataKey","kms:Decrypt"],"Resource":"*"}]}'450 - No Firehose-side change; the key policy is the only gap.451VERIFICATION:452 - aws cloudwatch get-metric-statistics --namespace AWS/Firehose --metric-name DeliveryToS3.Success --dimensions Name=DeliveryStreamName,Value=prod-events-delivery --start-time $(date -u -v-15M +%Y-%m-%dT%H:%M:%S) --end-time $(date -u +%Y-%m-%dT%H:%M:%S) --period 60 --statistics Average --output table453 - Expect: Average >= 1.0 within 5-10 minutes of the key policy update.454VERDICT: ROOT_CAUSE_FOUND455NEXT_STEP: None456ESCALATION_PATH: None457```458459### Worked example - NEED_MORE_INFO, DeliveryLag (intermittent)460461> **Moved verbatim** → [references/worked-examples.md](references/worked-examples.md) § "Worked example - NEED_MORE_INFO, DeliveryLag (intermittent)".462> Load when: emitting a NEED_MORE_INFO verdict — intermittent DeliveryLag example with per-stage timing next steps.463464### Worked example - ESCALATE, OpenSearchFails (cluster red)465466> **Moved verbatim** → [references/worked-examples.md](references/worked-examples.md) § "Worked example - ESCALATE, OpenSearchFails (cluster red)".467> Load when: emitting an ESCALATE verdict — OpenSearch cluster-red example with out-of-band remediation.468469## Anti-Patterns - NEVER do these things470471- NEVER diagnose a Firehose failure without first running the 5-layer health check. Most "delivery fails" tickets are coverage gaps in the transform Lambda, KMS key policy, or destination reachability.472- NEVER assume the delivery-stream status `ACTIVE` means records are being delivered. `ACTIVE` only means the stream config is accepted; per-record delivery failures are surfaced via CloudWatch metrics and S3 backup, not status.473- NEVER confuse a Lambda transform timeout with a Firehose bug. Firehose invokes the transform with the configured buffer; a Lambda slower than the buffer cadence produces backpressure, not a Firehose failure.474- NEVER assume Parquet/ORC conversion is working because objects land in S3. Conversion can produce 0-byte objects if the input JSON is malformed or the Glue table schema does not match the data. Always verify object size, not just object count.475- NEVER emit `VERDICT: NEED_MORE_INFO` without a `NEXT_STEP` naming a specific diagnostic command. Generic phrases like "investigate further" are not acceptable.476477## Pre-flight safety checks478479> **Moved verbatim** → [references/diagnostic-commands.md](references/diagnostic-commands.md) § "Pre-flight safety checks".480> Load when: before any state-changing operation — confirmation gate, update-destination blast radius, KMS policy backup.481482## Appendix A - Symptom-to-cause map (quick reference)483484> **Moved verbatim** → [references/firehose-delivery-diagnostics.md](references/firehose-delivery-diagnostics.md) § "Appendix A - Symptom-to-cause map (quick reference)".485> Load when: mapping a symptom to its most common root cause and the command that verifies it.486487## Recent AWS features (2024-2026)488489> **Moved verbatim** → [references/advanced-patterns.md](references/advanced-patterns.md) § "Recent AWS features (2024-2026)".490> Load when: checking 2024-2026 feature availability — Snowflake GA, dynamic partitioning, Firehose-in-VPC, multi-AZ delivery.491492## AWS documentation493494- **Amazon Kinesis Data Firehose Developer Guide** - https://docs.aws.amazon.com/firehose/latest/dev/what-is-this-service.html495- **Firehose delivery stream creation** - https://docs.aws.amazon.com/firehose/latest/dev/basic-create.html496- **Firehose data transformation** - https://docs.aws.amazon.com/firehose/latest/dev/data-transformation.html497- **Firehose data format conversion** - https://docs.aws.amazon.com/firehose/latest/dev/data-conversion.html498- **Firehose destinations (OpenSearch / Redshift / Snowflake / Splunk / HTTP)** - https://docs.aws.amazon.com/firehose/latest/dev/create-destination.html499- **Firehose HTTP endpoint request/response** - https://docs.aws.amazon.com/firehose/latest/dev/httpdeliveryrequestresponse.html500- **Monitoring Firehose with CloudWatch** - https://docs.aws.amazon.com/firehose/latest/dev/monitoring-with-cloudwatch-metrics.html501- **Firehose troubleshooting** - https://docs.aws.amazon.com/firehose/latest/dev/troubleshooting.html502- **Firehose IAM roles** - https://docs.aws.amazon.com/firehose/latest/dev/controlling-access.html503- **API Reference** - https://docs.aws.amazon.com/firehose/latest/APIReference/504- **CLI Reference** - https://docs.aws.amazon.com/cli/latest/reference/firehose/505506## References (load on demand)507508- [references/worked-examples.md](references/worked-examples.md) — secondary worked examples: NEED_MORE_INFO (intermittent DeliveryLag) and ESCALATE (OpenSearch cluster red) full DIAGNOSIS blocks509- [references/diagnostic-commands.md](references/diagnostic-commands.md) — pre-flight data requirements (inputs + malformed-input block) and pre-flight safety checks510- [references/advanced-patterns.md](references/advanced-patterns.md) — Step 0 non-obvious Firehose behaviors and recent AWS features 2024-2026511- [references/firehose-delivery-diagnostics.md](references/firehose-delivery-diagnostics.md) — diagnostic command quick lookup, per-destination CloudWatch metrics, Step 8 latest-destination cause tables, Appendix A symptom-to-cause map (moved verbatim; existing deep reference)