Skip to main content

Error Codes Reference

This page documents the errors returned by the laredo engine, config loader, and gRPC services. Use this as a diagnostic reference when troubleshooting failures.

Engine validation errors

NewEngine() validates the configuration and returns a list of errors if anything is misconfigured. The engine will not start until all validation errors are resolved.

Source errors

ErrorCauseFix
at least one source is requiredNo sources were registered via WithSource().Add at least one source to the config or engine options.
source ID must not be emptyA source was registered with an empty string ID.Provide a non-empty source ID (e.g., pg_main).
source "<id>" must not be nilA source was registered with a nil implementation.Pass a valid SyncSource implementation.

Pipeline errors

ErrorCauseFix
at least one pipeline is requiredNo pipelines were registered via WithPipeline().Add at least one pipeline binding a source, table, and target.
pipeline[N]: source ID must not be emptyA pipeline has no source ID.Set the source field in the table config.
pipeline[N]: references unknown source "<id>"A pipeline references a source ID that was not registered.Check that the source ID in the table config matches a configured source.
pipeline[N]: table name must not be emptyA pipeline has no table name.Set the table field in the table config.
pipeline[N]: target must not be nilA pipeline has a nil target.Configure a valid target (e.g., indexed-memory, http-sync).
pipeline[N]: buffer size must be positive, got <n>Buffer size is zero or negative.Set buffer.max_size to a positive integer, or omit it to use the default.
pipeline[N]: max retries must be non-negative, got <n>Max retries is negative.Set error_handling.max_retries to zero or a positive integer.
pipeline[N]: duplicate pipeline ID "<id>"Two pipelines have the same source, table, and target type combination.Each pipeline must have a unique combination of source ID, table, and target type.

Snapshot errors

ErrorCauseFix
snapshot schedule must not be negativeSnapshot schedule duration is negative.Set snapshot.schedule to a positive duration or omit it.
snapshot serializer is required when snapshot store is configuredA snapshot store was provided but no serializer.Configure a snapshot serializer (e.g., jsonl) alongside the store.

Config validation errors

Config.Validate() checks the HOCON config structure before building engine options.

ErrorCauseFix
at least one source is requiredThe sources block is empty or missing.Add at least one source to the config file.
at least one table is requiredThe tables array is empty or missing.Add at least one table entry to the config file.
tables[N]: source is requiredA table entry has no source field.Set the source field to match a configured source ID.
tables[N]: references unknown source "<id>"A table references a source not defined in sources.Add the source to the sources block, or fix the source ID.
tables[N]: schema is requiredA table entry has no schema field.Set the schema field (e.g., public).
tables[N]: table is requiredA table entry has no table field.Set the table field (e.g., config_document).
tables[N]: at least one target is requiredA table entry has an empty targets array.Add at least one target to the table entry.
tables[N].targets[M]: type is requiredA target entry has no type field.Set the target type (e.g., indexed-memory, http-sync).

Source validation errors

Sources implement ValidateTables() which returns ValidationError values with structured error codes.

ValidationError structure

type ValidationError struct {
Table *TableIdentifier // nil for source-level errors
Code string // e.g. "TABLE_NOT_FOUND"
Message string // human-readable description
}

Known error codes

CodeScopeMeaning
TABLE_NOT_FOUNDTableThe requested table does not exist in the source database.
PERMISSION_DENIEDSourceThe source credentials lack required permissions (e.g., replication privilege).

These errors are returned during engine startup when validating that configured tables exist and are accessible.

gRPC error codes

The laredo gRPC services use standard Connect/gRPC status codes. Each service returns specific codes depending on the failure.

Error code summary

CodeNumericWhen returned
InvalidArgument3Required fields are missing or have invalid values.
NotFound5The requested resource (pipeline, source, target, snapshot, replay) does not exist.
FailedPrecondition9An operation requires a precondition that is not met (e.g., no snapshot store, missing confirmation).
ResourceExhausted8A resource limit has been reached (e.g., max replication clients).
Internal13An unexpected server-side error occurred.
Unimplemented12The RPC is not implemented.

OAM service errors

GetTableStatus, GetTableSchema

CodeConditionMessage
InvalidArgumentschema or table is emptyschema and table are required
NotFoundNo schema data for the tableno schema for <schema>.<table>

GetPipelineStatus

CodeConditionMessage
InvalidArgumentpipeline_id is emptypipeline_id is required
NotFoundPipeline ID not foundpipeline <id> not found

GetSourceInfo

CodeConditionMessage
NotFoundSource ID not foundsource <id> not found

ReloadTable

CodeConditionMessage
InvalidArgumentsource_id is emptysource_id is required
InvalidArgumentInvalid table identifierinvalid table: <error>

PauseSync, ResumeSync

CodeConditionMessage
InvalidArgumentsource_id is emptysource_id is required
InternalEngine operation failed(error from engine)

ResetSource

CodeConditionMessage
InvalidArgumentsource_id is emptysource_id is required
FailedPreconditionconfirm is not trueconfirm=true is required for destructive operation

CreateSnapshot

No specific error codes. If the engine rejects the snapshot, the response contains accepted=false with a message.

ListSnapshots, InspectSnapshot, DeleteSnapshot, PruneSnapshots

CodeConditionMessage
FailedPreconditionNo snapshot store configuredno snapshot store configured
InvalidArgumentsnapshot_id is empty (Inspect, Delete)snapshot_id is required
InvalidArgumentkeep is not positive (Prune)keep must be positive
NotFoundSnapshot not found (Inspect)describe snapshot: <error>
InternalStore operation failedlist snapshots: <error>, delete snapshot: <error>, prune snapshots: <error>

StartReplay, GetReplayStatus, StopReplay

CodeConditionMessage
FailedPreconditionNo snapshot store configuredno snapshot store configured
InvalidArgumentsnapshot_id is emptysnapshot_id is required
InvalidArgumentInvalid table identifierinvalid table "<table>": <error>
NotFoundReplay ID not foundreplay <id> not found

ListDeadLetters, PurgeDeadLetters

CodeConditionMessage
FailedPreconditionNo dead letter store configuredno dead letter store configured
InvalidArgumentpipeline_id is emptypipeline_id is required
InternalStore operation failedread dead letters: <error>, purge dead letters: <error>

Query service errors

Lookup, GetRow, ListRows, CountRows, Subscribe

CodeConditionMessage
InvalidArgumentschema or table is emptyschema and table are required
NotFoundNo indexed target for the tableno indexed target found for <schema>.<table>
InternalRow serialization failed(serialization error)

LookupAll

CodeConditionMessage
InvalidArgumentschema or table is emptyschema and table are required
InvalidArgumentindex_name is emptyindex_name is required
NotFoundNo indexed target for the tableno indexed target found for <schema>.<table>
InternalRow serialization failed(serialization error)

Replication service errors

GetReplicationStatus, ListSnapshots (replication)

CodeConditionMessage
InvalidArgumentschema or table is emptyschema and table are required
NotFoundNo fan-out target for the tableno fan-out target for <schema>.<table>

FetchSnapshot

CodeConditionMessage
InvalidArgumentsnapshot_id is emptysnapshot_id is required
NotFoundSnapshot not foundsnapshot <id> not found

Sync

CodeConditionMessage
InvalidArgumentschema or table is emptyschema and table are required
NotFoundNo fan-out target for the tableno fan-out target for <schema>.<table>
ResourceExhaustedMax connected clients reachedmax clients reached

Troubleshooting common errors

"at least one source is required"

The config file has no sources block, or the block is empty. Add a source:

sources {
pg_main {
type = postgresql
connection = "postgresql://user:pass@localhost:5432/db"
}
}

"references unknown source"

A table's source field does not match any key in the sources block. Check for typos:

sources {
pg_main { ... } # <-- source ID
}
tables = [{
source = pg_main # <-- must match
...
}]

"no snapshot store configured"

A snapshot operation was requested (via CLI or gRPC), but the server was not configured with a snapshot store. Add snapshot configuration:

snapshot {
enabled = true
store = local
store_config { path = "/var/lib/laredo/snapshots" }
serializer = jsonl
}

"confirm=true is required for destructive operation"

The ResetSource RPC requires explicit confirmation because it drops and recreates the replication slot. Pass --confirm when using the CLI:

laredo reset-source pg_main --confirm

"max clients reached"

The fan-out target has reached its maximum number of connected replication clients. Increase the limit in the target config or disconnect idle clients:

targets = [{
type = replication-fanout
grpc { max_clients = 1000 }
}]

"no indexed target found" / "no fan-out target"

A query or replication RPC was called for a table that does not have the expected target type. Verify that the table has an indexed-memory target (for query RPCs) or a replication-fanout target (for replication RPCs) configured.