RESTCONF Troubleshooting
1. Errors: 401/403 AAA, 404 wrong path/module, 400 invalid payload, 409 exists, 415 media type.
2. Read error body.
3. Check model path and encoding.
4. Verify TLS.
5. Fix and retry.
request → TLS → AAA → path → payload → response
Context & applicabilityCommon mistakes · platform/version boundaries
Operational reference
Fast context before you go deeper.
curl -sS -D - -o /dev/null -H "Accept: application/yang-data+json" https://<host>/restconf/data/Primary Commands
Configuration and operational commands for this Topic.
Verification & Troubleshooting
Start with the observed symptom, prove the nearest boundary, and move outward only when the current state is understood.
Use the operational verification above to establish the expected state.
Capture the concrete output, symptom, packet, log or counter before changing anything.
Step 1 Known-good, broken and when it is fixed Verify boundary
Known-good requires the intended RESTCONF resource to be readable, the change request to succeed with correct modeled semantics, and a subsequent GET plus device operational check to match intent. Confirm invalid/unauthorized requests still fail appropriately. HTTP 2xx shows the RESTCONF transaction result, not end-to-end network service behavior.
Step 2 Command read-back and what it shows Verify boundary
Known-good is the request returns an expected 2xx status with parseable YANG data for the intended resource and the original configuration/state validation matches expected values; broken state is transport/TLS errors, 401/403/404/415/5xx, malformed payload or 2xx data that contradicts the intended device state. The RESTCONF GET shows that resource's HTTP/API response at that moment, but it does not show unrelated device subsystems or end-to-end network service health.
Step 3 Native failure isolation and next-check logic Narrow the fault
Verify HTTPS and authentication, then issue a minimal GET to the exact YANG resource and inspect content type. For 4xx, validate URI key encoding, module namespace, payload shape and writable/read-only schema nodes; preserve the RESTCONF error body. For changes, distinguish POST/PUT/PATCH semantics and whether the platform applies immediately or creates asynchronous work. Re-GET the same subtree after mutation before moving to service verification.
Step 4 Observation-driven branch and next-check logic Narrow the fault
If connection/TLS fails, inspect network/certificate/service; if response is 401/403, inspect identity/AAA; if response is 404/406/415, inspect resource path and media/model support; if 2xx returns unexpected data, compare datastore and intended configuration.
Step 5 Common mistakes Narrow the fault
- Debugging without the full HTTP response body.
- Status code and error body explain most failures.
- Headers and module prefixes are common mistakes.
- Privilege level matters.
curl -v --cacert ca.pem -u <u>:<p> <url>— full exchange- ietf-restconf:errors body (error-tag, error-path) — details
show logging | include RESTCONF— device logs
ReferenceHow it works2 sections · depth on demand
How it works
RESTCONF combines HTTPS/authentication with YANG resource paths, datastore semantics and JSON/XML encoding. URI modules/keys, namespace-qualified fields and Content-Type/Accept headers are frequent failure points. HTTP status conveys protocol outcome, while error-tag/path in the RESTCONF error body identifies modeled validation or data-store problems.
How it works
RESTCONF Troubleshooting is governed by HTTPS transport/TLS, RESTCONF authentication/authorization, YANG resource path resolution and device datastore/API processing. A RESTCONF client establishes HTTPS, sends an authenticated request with YANG media types, the server resolves the resource path/model and returns HTTP status plus structured data or an error body. Routing/DNS, certificates, AAA, RESTCONF service enablement, YANG model support and datastore state are distinct boundaries. The important state separation is that TCP/TLS success does not mean a RESTCONF resource is authorized, and HTTP 200 on the API root does not show a specific model path exists or has the expected value.
ReferenceImportant terms & boundaries1 section · depth on demand
Method
RESTCONF troubleshooting reads the HTTP status and the RESTCONF error body, then checks URL, headers and payload.
1. HTTPS reachable and RESTCONF enabled (restconf and ip http secure-server on IOS XE).
2. Discover the root: GET /.well-known/host-meta.
3. Use the right media types: application/yang-data+json.
4. Build the URL from the model: module prefix, list keys URL-encoded (interface=GigabitEthernet1%2F0%2F1).
5. Read ietf-restconf:errors in the response.
| Status | Typical cause |
|---|---|
| 401 | Credentials |
| 404 | Wrong path, key or module name |
| 400 | Payload does not match model |
| 409 | Resource already exists (POST) |
| 415 | Missing yang-data content type |
Additional reference context Scope · expected state · examples · history · terminology Open only when you need the supporting context
Verification history & basis
When and against what this Topic was checked. Later text edits do not count as a new check.
Authoritative/upstream documentation reviewed for bounded claims in RESTCONF > RESTCONF Troubleshooting. Documentation verification only; this is not observed lab or production Evidence.
Basis: https://www.rfc-editor.org/rfc/rfc8040 · confidence 94%