Kafka Exception NotFoundException
org.apache.kafka.connect.errors.NotFoundException
Non-retriable
Connect
Indicates that an operation attempted to modify or delete a connector or task that is not present on the worker.
Common Causes
- A REST call targets a connector or task that doesn't exist on the worker (typo in the connector name, or it was never created) — e.g. GET/DELETE /connectors/{name}, PUT /connectors/{name}/config, GET /connectors/{name}/status, POST /connectors/{name}/restart — return HTTP 404 from this exception.
- The connector was deleted, or the whole Connect cluster (and its config topic) was wiped/recreated, so previously created connectors are gone and every reference 404s.
- Status hasn't been published yet: a connector whose task crashed on startup (e.g. couldn't connect to the source DB/broker) has no status record, so GET .../status returns 404 'No status found for connector' even though config exists.
- Distributed-mode forwarding race: a request hits a follower that forwards to the leader during a rebalance and the resource isn't yet visible, surfacing as a transient 404 (or 409 if a rebalance is in progress).
Solutions
- List what actually exists before operating on it: GET /connectors (and /connectors?expand=status). Fix the connector name to match exactly (it is case-sensitive).
- If the task crashed on startup, fix the underlying connector config (credentials, host, topic) and re-create/restart — the 404 on /status is a symptom of a failed start, not the root cause. Inspect worker logs for the real stack trace.
- After a cluster restart that lost connectors, re-apply the connector configs (idempotent PUT /connectors/{name}/config); consider a reconciler that re-creates missing connectors from a desired-state store.
- For transient 404/409 during rebalance, retry the REST call after the cluster stabilizes; target the leader, or let the worker forward and just retry.
Example Stack Trace
org.apache.kafka.connect.errors.NotFoundException: Connector my-jdbc-source not found
at org.apache.kafka.connect.runtime.distributed.DistributedHerder.connectorInfo(DistributedHerder.java:712)
at org.apache.kafka.connect.runtime.rest.resources.ConnectorsResource.getConnector(ConnectorsResource.java:212)
at jdk.internal.reflect.GeneratedMethodAccessor.invoke(Unknown Source)
... mapped by org.apache.kafka.connect.runtime.rest.errors.ConnectExceptionMapper to HTTP 404 Not FoundDiagnostic Commands
curl -s http://localhost:8083/connectors | jq . # list existing connectors; confirm exact name/case
curl -s -o /dev/null -w '%{http_code}\n' http://localhost:8083/connectors/<name>/status # 404 = not found / no status yet
curl -s 'http://localhost:8083/connectors?expand=status' | jq 'to_entries[] | {name:.key, state:.value.status.connector.state}' # find FAILED/missing connectors in one callRelated
Related Connect exceptions: AlreadyExistsException · ConnectException · DataException · IllegalWorkerStateException · SchemaBuilderException · SchemaProjectorException
Hitting
NotFoundException in production? Conduktor Console gives you real-time visibility into clients, consumer groups, and broker health. Browse every Kafka exception or protocol error code.