Skip to main content

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​

SymptomFirst checkThenReference
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 fromapi/generated/sasvi/errors.md
from_env() fails, or reaches another tenant than the sasvi commandWithout options from_env() reads only the process environment; the CLI also reads ./.env, the selected profile and the sasvi auth login cacheRun 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 parseInspect the variable: use 1 / 0 / true / false, or the path of an existing CA bundleapi/generated/sasvi/errors.md
ServiceUnreachableError on first callDNS 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 issueConcepts: TLS posture
NetworkError mid-callDid the request reach the server? Check exc.outcome_unknownWhen it is True, a write may have been applied: read the record back before resendingapi/generated/sasvi/errors.md
TLSErrorCustom 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 retriedapi/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 designapi/generated/sasvi/config.md
.get(...) returns NoneA 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 documentGuides/discover-your-environment.md
NotFoundError subclass (404) from non-get callsAdmin, datahub, and alerts services raise typed subclasses (AdminNotFoundError, DocumentNotFoundError, AlertNotFoundError) on a hard 404Catch the specific subclass (or the shared errors.NotFoundError base) and verify the referenced resource existsapi/generated/sasvi/errors.md
ConflictError subclass (409 or 412) on a writeWas 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 concurrencyapi/generated/sasvi/errors.md
Document write fails because the document is lockedDid 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 verifiedGuides/documents.md
DispositionPromptRequiredErrorDisposition definition requires fields you did not passInspect exc.missing; pass each required kwarg (note, reason_code, document_fields, scenario_fired_event_dispositions)api/generated/sasvi/errors.md
AlertNotCheckedOutErrorAnother user holds the alert's checkout (exc.checkout_user_id); the SDK refused to send the writeHave that user check the alert in, or wait; an AlertConflictError from the service means the same when the alert is checked out elsewhereGuides/alerts.md
BulkOperationError on bulk upsertDid the request hit a per-row failure, or a server-side rejection?Inspect exc.failures; each failed row carries the server's error payloadGuides/bulk-operations.md
Hanging request that never returnsIs request_deadline_seconds set on the config?Set SVIConfig(request_deadline_seconds=10); the call raises DeadlineExceededError when it runs outapi/generated/sasvi/config.md
DeadlineExceededError after several retriesThe budget ran out; check exc.outcome_unknown before resending a writeIncrease request_deadline_seconds, max_retries, or retry_backoff_seconds depending on tenant behaviorGuides/performance.md
Async call deadlocks or never resolvesMixing sync + async inside the same asyncio task?Use await client.X_async(...); don't call sync methods inside an async def if it'd blockGuides/async.md
InvalidSearchQueryErrorQuery language mismatch, or Lucene metacharacter passed unescaped?Use Q.safe_text(user_input) when the input is not under your controlGuides/search-dsl.md
SearchScopeErrorSearch.fields(...) invoked without entity_name= and multiple types in scopePass entity_name="..." to the fields() call to disambiguateGuides/search.md
Search.count() returns 0 for known-good indexFilter accidentally too narrow? Right entity type?Add log_http=True, log_http_response_body=True; inspect the SAND payloadGuides/search.md
InvalidDocumentReferenceErrorPassed a value that can't be normalized to a (type, id) referenceUse a bound Document or a (type, id) tuple; the SDK refuses ambiguous shapesapi/generated/sasvi/errors.md
RelationshipAmbiguousErrorMultiple relationship types are valid between the source and targetPass relationship= explicitly; the SDK refuses to guessapi/generated/sasvi/documents/index.md
ReferenceListNotFoundErrorWrong list name (case matters)? Wrong tenant?sasvi refs list to confirm the name existsGuides/configuration.md
ReferenceListConcurrentModificationErrorThe reference list changed under us between read and writerecord.refresh() then reapply your changesapi/generated/sasvi/errors.md
WorkflowNotFoundErrorWorkflow definition or instance does not exist on this tenantclient.admin.workflows.list() to confirm definition; client.workflows.list() for instancesGuides/workflows.md
WorkflowStateErrorTrying to complete a non-running task, or cancel an already-canceled instanceRefresh the instance or task first; branch on the instance's .stateapi/generated/sasvi/types/index.md
WorkflowDocumentUpdateErrortask.complete(document_field_values=...) completed the task, then the document write failedDo not call complete() again. Retry the document update using exc.document_type and exc.document_idGuides/workflows.md
Task assignee = "..." raises AttributeErrorassignee is read-only; assigning a task is a server callCall task.assign("...") (or task.claim(assignee="...")) explicitlyGuides/workflows.md
HTTP 401 on every retryToken expired and the auth provider failed to refreshTest auth.get_token() directly; check refresh-token validityGuides/authentication.md
Slow requests in productionDefault timeouts, no slow_request_seconds tripwireSet log_slow_request_seconds=2.0 and request_deadline_seconds to bound the worst caseGuides/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​

  1. Search the docs. Local search is enabled and indexes every page.
  2. Check the FAQ.
  3. Inspect the SDK source. The handwritten layer in src/sasvi/ is deliberately small and readable; the typed exceptions are in src/sasvi/errors.py.
  4. Open an issue with the sasvi --json doctor output, the full stack trace, and the smallest reproducible snippet.

Go further​