Troubleshooting
This page is for the practitioner who hit an error and needs to map symptom to cause to fix as fast as possible. Each row below is a real failure mode, with the first place to look and the next step when the easy fix doesn't apply. Every entry links into the deeper material in the Errors reference.
Decide where to look
Common symptoms
| Symptom | First check | Then | Reference |
|---|---|---|---|
AuthConfigurationError on SVIClient(...) | SASVI_BASE_URL / SASVI_ACCESS_TOKEN resolved by from_env()? | Run sasvi doctor, which shows the base URL and auth mode it found, and where they came from | api/generated/sasvi/errors.md |
from_env() fails, or reaches another tenant than the sasvi command | Without options from_env() reads only the process environment; the CLI also reads ./.env, the selected profile and the sasvi auth login cache | Run sasvi auth status to see where the base URL came from and which .env, profile and token file the CLI read, then pass env_file=, profile= or use_login_cache=True to from_env() | Authentication guide |
SVIConfigurationError: SASVI_VERIFY_SSL must be... | A non-auth SASVI_* env var failed to parse | Inspect the variable: use 1 / 0 / true / false, or the path of an existing CA bundle | api/generated/sasvi/errors.md |
ServiceUnreachableError on first call | DNS resolves? curl -v $SASVI_BASE_URL/SASLogon/oauth/clients/me works? | Add verify_ssl=False only in trusted dev environments to isolate a TLS-trust issue | Concepts: TLS posture |
NetworkError mid-call | Did the request reach the server? Check exc.outcome_unknown | When it is True, a write may have been applied: read the record back before resending | api/generated/sasvi/errors.md |
TLSError | Custom CA bundle? Self-signed dev certs? | Pass verify_ssl=/path/to/ca.pem, or set SASVI_VERIFY_SSL=/path/to/ca.pem; TLS failures are never retried | api/generated/sasvi/config.md |
TLS error on verify_connection() | Custom CA bundle? Self-signed dev certs? | Pass verify_ssl=/path/to/ca.pem; the SDK refuses to retry TLS errors by design | api/generated/sasvi/config.md |
.get(...) returns None | A tolerated 404. Right tenant? Right entity type name? Right document id format? | sasvi entity show <name> to confirm the type exists; sasvi search <type> <q> to find the document | Guides/discover-your-environment.md |
NotFoundError subclass (404) from non-get calls | Admin, datahub, and alerts services raise typed subclasses (AdminNotFoundError, DocumentNotFoundError, AlertNotFoundError) on a hard 404 | Catch the specific subclass (or the shared errors.NotFoundError base) and verify the referenced resource exists | api/generated/sasvi/errors.md |
ConflictError subclass (409 or 412) on a write | Was the resource changed between read and write? (Raised as AdminConflictError / DocumentConflictError / AlertConflictError per service) | obj.refresh() (or await obj.refresh_async()) and reapply; the SDK does optimistic concurrency | api/generated/sasvi/errors.md |
| Document write fails because the document is locked | Did an earlier write of yours get killed, or log Failed to release the document lock? | document.release_lock() or sasvi doc unlock TYPE ID --yes. A lock another user holds is not yours to clear: whether the service lets you is not verified | Guides/documents.md |
DispositionPromptRequiredError | Disposition definition requires fields you did not pass | Inspect exc.missing; pass each required kwarg (note, reason_code, document_fields, scenario_fired_event_dispositions) | api/generated/sasvi/errors.md |
AlertNotCheckedOutError | Another user holds the alert's checkout (exc.checkout_user_id); the SDK refused to send the write | Have that user check the alert in, or wait; an AlertConflictError from the service means the same when the alert is checked out elsewhere | Guides/alerts.md |
BulkOperationError on bulk upsert | Did the request hit a per-row failure, or a server-side rejection? | Inspect exc.failures; each failed row carries the server's error payload | Guides/bulk-operations.md |
| Hanging request that never returns | Is request_deadline_seconds set on the config? | Set SVIConfig(request_deadline_seconds=10); the call raises DeadlineExceededError when it runs out | api/generated/sasvi/config.md |
DeadlineExceededError after several retries | The budget ran out; check exc.outcome_unknown before resending a write | Increase request_deadline_seconds, max_retries, or retry_backoff_seconds depending on tenant behavior | Guides/performance.md |
| Async call deadlocks or never resolves | Mixing sync + async inside the same asyncio task? | Use await client.X_async(...); don't call sync methods inside an async def if it'd block | Guides/async.md |
InvalidSearchQueryError | Query language mismatch, or Lucene metacharacter passed unescaped? | Use Q.safe_text(user_input) when the input is not under your control | Guides/search-dsl.md |
SearchScopeError | Search.fields(...) invoked without entity_name= and multiple types in scope | Pass entity_name="..." to the fields() call to disambiguate | Guides/search.md |
Search.count() returns 0 for known-good index | Filter accidentally too narrow? Right entity type? | Add log_http=True, log_http_response_body=True; inspect the SAND payload | Guides/search.md |
InvalidDocumentReferenceError | Passed a value that can't be normalized to a (type, id) reference | Use a bound Document or a (type, id) tuple; the SDK refuses ambiguous shapes | api/generated/sasvi/errors.md |
RelationshipAmbiguousError | Multiple relationship types are valid between the source and target | Pass relationship= explicitly; the SDK refuses to guess | api/generated/sasvi/documents/index.md |
ReferenceListNotFoundError | Wrong list name (case matters)? Wrong tenant? | sasvi refs list to confirm the name exists | Guides/configuration.md |
ReferenceListConcurrentModificationError | The reference list changed under us between read and write | record.refresh() then reapply your changes | api/generated/sasvi/errors.md |
WorkflowNotFoundError | Workflow definition or instance does not exist on this tenant | client.admin.workflows.list() to confirm definition; client.workflows.list() for instances | Guides/workflows.md |
WorkflowStateError | Trying to complete a non-running task, or cancel an already-canceled instance | Refresh the instance or task first; branch on the instance's .state | api/generated/sasvi/types/index.md |
WorkflowDocumentUpdateError | task.complete(document_field_values=...) completed the task, then the document write failed | Do not call complete() again. Retry the document update using exc.document_type and exc.document_id | Guides/workflows.md |
Task assignee = "..." raises AttributeError | assignee is read-only; assigning a task is a server call | Call task.assign("...") (or task.claim(assignee="...")) explicitly | Guides/workflows.md |
| HTTP 401 on every retry | Token expired and the auth provider failed to refresh | Test auth.get_token() directly; check refresh-token validity | Guides/authentication.md |
| Slow requests in production | Default timeouts, no slow_request_seconds tripwire | Set log_slow_request_seconds=2.0 and request_deadline_seconds to bound the worst case | Guides/performance.md |
Investigation tools
sasvi doctor
The fastest way to confirm the SDK is configured correctly. It runs a sequence of checks (settings, env-base-url, env-auth, TLS reachability, connection source, auth-acquire, metadata reachability, identity, SDK compat, spec-manifest) and exits non-zero if any check fails. Run it before opening a ticket.
sasvi doctor
sasvi --json doctor # CI-friendly output
See the CLI guide for the full check list.
--verbose and --debug
The CLI separates two concerns:
sasvi <cmd> --verbose # turn on HTTP wire logging from the SDK
sasvi <cmd> --debug # print the Python traceback on any error
In Python code, the equivalent is SVIClient(log_http=True, ...) and catching the
exception yourself (raise to keep the traceback).
HTTP wire logs
To capture what the SDK is actually sending:
import sasvi
client = sasvi.SVIClient(
base_url="https://viya.example.com",
auth=auth,
log_level="DEBUG",
log_http=True,
log_http_request_body=True, # opt-in; never on in production
log_http_response_body=True,
log_http_body_limit=4096,
log_http_headers=True, # redacted by default
log_http_query=True, # redacted by default
)
Auth headers, cookies, CSRF tokens, refresh tokens, and any value in
log_http_redacted_headers / log_http_redacted_query_params are redacted before
emission. The body limit is hard. Binary, multipart, and streaming payloads are
skipped entirely.
See Logging and diagnostics for the full surface and the safety notes.
sasvi raw request for direct calls
When the SDK does not yet wrap an endpoint, or when you need to confirm what the server actually does, drive the request from the CLI:
sasvi raw request -X POST /svi-datahub/v1/documents/alerts \
-d '{"label": "demo alert"}' \
-H Content-Type=application/json -i
The -i / --include flag prints status and headers.
Inspecting structured errors
Every sasvi.errors.SVIError carries five attributes the SDK populates from the
upstream payload:
from sasvi import errors
try:
alert.disposition(resolution_code="PRODUCTIVE")
except errors.SVIError as exc:
print(exc.status_code) # int | None
print(exc.error_code) # str | None
print(exc.details) # tuple[str, ...]
print(exc.remediation) # str | None (server-provided fix hint)
print(exc.raw) # Any (raw upstream error model)
Use remediation first. The server often knows what's wrong and says how to fix
it. Fall through to details and raw only when the remediation isn't
actionable.
Common recovery patterns
Refresh on conflict
from sasvi import errors
def update_with_retry(doc, **changes):
for attempt in range(3):
try:
return doc.update_fields(**changes)
except errors.ConflictError:
doc.refresh()
raise RuntimeError("Conflict persisted after 3 refreshes")
Auto-checkout for alert actions
The Alerts service answers 409 when the alert's state blocks the action, which
includes an alert that is not checked out to you. The SDK raises that as
AlertConflictError; AlertNotCheckedOutError is its subclass, so one clause
catches both.
from sasvi import errors
try:
alert.perform_action(action_type="ASSIGNMENT")
except errors.AlertConflictError:
alert.perform_action(action_type="CHECKOUT")
alert.perform_action(action_type="ASSIGNMENT")
Disposition with prompts
from sasvi import errors
try:
alert.disposition(disposition_id=disposition_id)
except errors.DispositionPromptRequiredError as exc:
# collect() builds each missing keyword in its type; see the recipe.
alert.disposition(disposition_id=disposition_id, **collect(exc.missing))
The disposition-with-prompts recipe shows
collect().
Bound deadline for hot paths
import sasvi
client = sasvi.SVIClient(
auth=auth,
config=sasvi.SVIConfig(
base_url=base_url,
max_retries=4,
retry_backoff_seconds=0.5,
request_deadline_seconds=8.0, # whole-call budget
),
)
The call raises DeadlineExceededError when the budget runs out. Async is a hard
wall-clock cap; sync caps each connect, pool, write and read wait at the budget
left when the attempt starts, checks the clock between body chunks, and starts no
retry after it, so it can overshoot by one wait. Pair with a circuit breaker
upstream for production.
When the docs don't have your answer
- Search the docs. Local search is enabled and indexes every page.
- Check the FAQ.
- Inspect the SDK source. The handwritten layer in
src/sasvi/is deliberately small and readable; the typed exceptions are insrc/sasvi/errors.py. - Open an issue with the
sasvi --json doctoroutput, the full stack trace, and the smallest reproducible snippet.
Go further
- FAQ. Short answers to the top onboarding questions.
- Errors reference. The full typed exception hierarchy.
- Performance guide. Retry tuning, batching, async patterns.
- Logging and diagnostics. Every redaction rule and log knob.
- CLI guide.
sasvi doctor,sasvi raw,sasvi whoami.