langgenius/dify · error · TracingConfigCheckError
trace_config_check_error
trace_config_check_error
Error message
Invalid Credentials.
What it means
Raised as TracingConfigCheckError when OpsService.create_tracing_app_config returns a dict whose 'error' key is truthy (api/controllers/console/app/ops_trace.py:118-119). The service validates the supplied tracing credentials against the provider (e.g. LangSmith/LangFire) and returns an error if authentication or connectivity fails. The outer handler re-raises it as BadRequest(400) with 'Invalid Credentials.' as the message.
Source
Thrown at api/controllers/console/app/ops_trace.py:119
@login_required
@account_initialization_required
@edit_permission_required
@rbac_permission_required(RBACResourceScope.APP, RBACPermission.APP_TRACING_CONFIG)
@get_app_model
@model_validate(TraceConfigPayload)
def post(self, req_data: TraceConfigPayload, app_model: App):
"""Create a new trace app configuration"""
try:
result = OpsService.create_tracing_app_config(
app_id=app_model.id,
tracing_provider=req_data.tracing_provider,
tracing_config=req_data.tracing_config,
session=db.session(),
)
if not result:
raise TracingConfigIsExist()
if result.get("error"):
raise TracingConfigCheckError()
return result
except Exception as e:
raise BadRequest(str(e))
@console_ns.doc("update_trace_app_config")
@console_ns.doc(description="Update an existing tracing configuration for an application")
@console_ns.doc(params={"app_id": "Application ID"})
@console_ns.expect(console_ns.models[TraceConfigPayload.__name__])
@console_ns.response(
200,
"Tracing configuration updated successfully",
console_ns.models[TraceAppConfigResponse.__name__],
)
@console_ns.response(400, "Invalid request parameters or configuration not found")
@console_ns.response(403, "Insufficient permissions")
@setup_required
@login_required
@account_initialization_requiredView on GitHub (pinned to ef8544b173)
Solutions
- Verify the tracing provider API key/token is correct and active in the provider's dashboard.
- Confirm the project/organization fields required by the chosen provider are filled and valid.
- Test the credentials directly against the provider API (e.g. a curl to LangSmith) to isolate Dify-side vs. provider-side issues.
- Retry after confirming the provider service is reachable from the Dify backend host.
Defensive patterns
Strategy: validation
Validate before calling
// Pre-validate credentials by calling the provider directly (example: LangSmith)
// Or rely on a 'test connection' affordance before saving
const ok = await testProviderCredentials(payload.tracing_provider, payload.tracing_config)
if (!ok) throw new Error('invalid credentials')
await createTraceConfig(appId, payload) Try / catch
try {
await createTraceConfig(appId, payload)
} catch (e) {
if (e.code === 'trace_config_check_error') showFieldError('api_key', 'Invalid credentials')
throw e
} Prevention
- Offer a 'Test connection' button that hits the provider before save.
- Trim and validate API key format client-side.
- Keep provider-specific required-field lists in sync with the backend.
When it happens
Trigger: POSTing a trace config with an invalid API key/token, wrong project/organization identifier, or when the tracing provider endpoint is unreachable. The service attempts a real check call to the provider and propagates the failure.
Common situations: Typo in the API key; expired/revoked provider token; wrong project name; provider-side outage during the check; missing required field (e.g. tenant slug) for the chosen provider.
Understand the failure class
- Authentication and authorization failures — expired tokens, bad credentials, and missing scopes.
Related errors
- trace_config_is_exist
- trace_config_not_exist
- completion_request_error
- app_suggested_questions_after_answer_disabled
- The server encountered an internal error and was unable to c
AI-assisted analysis of langgenius/dify@ef8544b173 (2026-08-12).
Data as JSON: /api/errors/2eae7f726f014fda.
Report an issue: GitHub.