Skip to main content

Troubleshooting

Authentication​

SymptomCauseFix
initScenid: client_id is required (also client_secret, token_uri)The service key is incomplete or was parsed wrongRe-download the key, check you pass the parsed object, not the file path
oauth/token-request-failed: 401 oauth/invalid-client-secretWrong or outdated secretGenerate a new service key. Old keys stop working when a new one is generated
oauth/token-request-failed: 400 oauth/invalid-clientUnknown client_id, or app deletedCheck the app still exists in Admin → Security
403 oauth/public-client-not-allowed / oauth/grant-not-allowedThe app has no service key and is not confidential or lacks client_credentialsGenerate a service key for the app
403 oauth/service-key-not-provisionedasUser used with an app without a service keyGenerate a service key
oauth/token-audience-mismatchThe ID token was issued to a different appSign in through this app's beginFlow
oauth/tenant-mismatchID token from another tenantUse the same tenant for login and app
TypeError: Invalid URL on initScenidNeither issuer nor cloud_stack in the keyUse the key exactly as downloaded
auth/token-expired on verifyID token older than its expRefresh with refreshFlow or sign in again

Calls​

SymptomCauseFix
sdk: call initScenid() before using the SDKsdk.asAdmin() before initScenidInitialise at process start
Response status: 401 with empty bodyToken missing, expired or wrong token type for the endpointUse asAdmin or asUser correctly, see Concepts
sdk/endpoint-invalidA 404 with a non-JSON body: wrong host or pathCheck the service key host (cloud_stack, issuer)
sdk/fetch-failedNetwork errorCheck DNS and connectivity, run with DEBUG=scenid:sdk
sdk/non-json-responseProxy or gateway answered with HTMLCheck the base URL and any proxy
customers/missing-humanIdEntity.get('')Pass a humanId
customers/group-not-foundGroup name in groups: [...] does not existCreate the group first. Names are cached for 5 minutes
insights/source-not-foundThe source name does not exist for this tenant, or the cache is staleCheck spelling, wait a few seconds after creating a source
sdk/aggregate-filter-must-be-arrayfilter passed as an objectUse an array of Elasticsearch clauses, see Query data

Data problems​

SymptomCauseFix
400 { errors: [...] } on createValidation failedRead errors[].path and message
Unexpected fields rejected on entity createschema: 'minimal' was passed, restricting validation to the old create-only fieldsOmit schema, or pass { strict: true } to see exactly which field is unknown
Fields disappeared after OU/Person/Group updateoverwrite: true was passed — it replaces data entirely instead of mergingOmit overwrite (merge is the default), or resend the full data if replace was intended
Employees or groups disappeared after updateemployees, groups, employments are set-replacedSend the complete list, or use upsertEmployee
doc/body-not-flatNested object in an Insights documentFlatten the document
doc/reserved-field:idBody contains id or _idRemove it. Ids are generated
Unknown Insights fields are goneFields not defined on the source are droppedAdd the field type to the source
Documents are duplicated on re-send, or overwritten unexpectedlyDuplicate control decides the document id (store default: random id, so every send is new. Field: same key updates)Set duplicate control to a field (e.g. orderId) before the first data. See Sources

Local development​

  • ssl: false and cloud_stack: "host:port" in the service key point the SDK to an http local stack.
  • Use DEBUG=scenid:* to see requests. DEBUG=scenid:sdk:verbose also logs bodies. Tokens are never logged.

Still stuck?​

Collect the failing call, the status and the result, the SDK version and the debug log (without secrets) and contact Scenid support.