# Troubleshooting & FAQ

If you cannot find your issue below, try [Ask AI](/content/docs/ask-ai/index.html), open a [GitHub issue](/content/issues/index.html), or contact [support](/content/support/index.html).

## [Authentication issues](/content/docs/observability/sdk/troubleshooting-and-faq#authentication-issues/index.html)

- Ensure `LANGFUSE_PUBLIC_KEY`, `LANGFUSE_SECRET_KEY`, and `LANGFUSE_BASE_URL` are set as environment variables or passed to `Langfuse()` as constructor arguments.
- Use `langfuse.auth_check()` during setup (not in production) to confirm connectivity.

## [No traces appearing](/content/docs/observability/sdk/troubleshooting-and-faq#no-traces-appearing/index.html)

- See [Missing traces](/content/faq/all/missing-traces/index.html) for common reasons and solutions.
- Confirm `tracing_enabled` is `True` and `sample_rate` is not `0.0`.
- Call `langfuse.shutdown()` (or `langfuse.flush()` in short-lived jobs) so queued data is exported.
- Enable debug logging (`debug=True` or `LANGFUSE_DEBUG="True"` on Python, `LANGFUSE_DEBUG="true"` or `LANGFUSE_LOG_LEVEL="DEBUG"` on JS/TS) to inspect exporter output.

## [Incorrect nesting or missing observations](/content/docs/observability/sdk/troubleshooting-and-faq#incorrect-nesting-or-missing-observations/index.html)

- Self-hosted users need Langfuse platform **>= 3.63.0** for the OTel based SDKs.
- Prefer context managers (`with langfuse.start_as_current_observation(...)`) to maintain OTEL context.
- If using manual [observations](/content/docs/observability/data-model#observations-traces-and-sessions/index.html) (`langfuse.start_observation()`), always call `.end()`.
- In async code, rely on Langfuse helpers to avoid losing context across `await` boundaries.
- If an observation references a parent that Langfuse never received, it is shown at the trace root instead of under its intended parent. This can happen when the parent was filtered out, dropped, or never sent, so make sure every referenced parent observation is actually exported.

## [LangChain/OpenAI integration issues](/content/docs/observability/sdk/troubleshooting-and-faq#langchainopenai-integration-issues/index.html)

- Ensure Langfuse wrappers (`from langfuse.openai import openai` or `LangfuseCallbackHandler`) are instantiated before API calls.
- Check version compatibility between Langfuse, LangChain, and the model SDKs.

## [Media not appearing](/content/docs/observability/sdk/troubleshooting-and-faq#media-not-appearing/index.html)

- Use `LangfuseMedia` objects for audio/image payloads and inspect debug logs to surface upload errors (uploads run on background threads).

## [Missing traces with `@vercel/otel`](/content/docs/observability/sdk/troubleshooting-and-faq#missing-traces-with-vercelotel/index.html)

- Make sure you are on `@vercel/otel` v2 or later. Versions before v2 were built on the OpenTelemetry JS SDK v1 and could not pick up the `LangfuseSpanProcessor`, which is built on the OpenTelemetry JS SDK v2 ( [vercel/otel#154](https://github.com/vercel/otel/issues/154)). With `@vercel/otel` v2+, `registerOTel({ spanProcessors: [new LangfuseSpanProcessor()] })` exports traces as expected.
- Alternatively, use the manual OpenTelemetry setup via `NodeSDK` and register the `LangfuseSpanProcessor`. See the [TypeScript instrumentation docs](/content/docs/observability/sdk/instrumentation#framework-third-party-telemetry/index.html) for a full example.
