Skip to content

Fix: langfuse connection error handling #12621#12626

Merged
KevinHuSh merged 1 commit intoinfiniflow:mainfrom
mohansinghi:fix/langfuse-connection-error-handling
Jan 15, 2026
Merged

Fix: langfuse connection error handling #12621#12626
KevinHuSh merged 1 commit intoinfiniflow:mainfrom
mohansinghi:fix/langfuse-connection-error-handling

Conversation

@mohansinghi
Copy link
Copy Markdown
Contributor

Description

Fixes connection error handling when langfuse service is unavailable. The application now gracefully handles connection failures instead of crashing.

Changes

  • Wrapped langfuse.auth_check() calls in try-except blocks in:
    • api/db/services/dialog_service.py
    • api/db/services/tenant_llm_service.py

Problem

When langfuse service is unavailable or connection is refused, langfuse.auth_check() throws httpx.ConnectError: [Errno 111] Connection refused, causing the application to crash during document parsing or dialog operations.

Solution

Added try-except blocks around langfuse.auth_check() calls to catch connection errors and gracefully skip langfuse tracing instead of crashing. The application continues functioning normally even when langfuse is unavailable.

Related Issue

Fixes #12621


Contribution by Gittensor, see my contribution statistics at https://gittensor.io/miners/details?githubId=158349177

Wrap langfuse.auth_check() calls in try-except blocks to handle
connection errors gracefully. This prevents the application from
crashing when langfuse service is unavailable or connection is
refused, allowing the application to continue functioning without
langfuse tracing.

Fixes infiniflow#12621
@dosubot dosubot Bot added size:S This PR changes 10-29 lines, ignoring generated files. 🐞 bug Something isn't working, pull request that fix bug. labels Jan 15, 2026
@mohansinghi
Copy link
Copy Markdown
Contributor Author

@KevinHuSh I am glad to contribute to your repo, could you please take a look my first pr?

@KevinHuSh KevinHuSh added the ci Continue Integration label Jan 15, 2026
@KevinHuSh KevinHuSh marked this pull request as draft January 15, 2026 02:37
@KevinHuSh KevinHuSh marked this pull request as ready for review January 15, 2026 02:37
@KevinHuSh KevinHuSh merged commit f82628c into infiniflow:main Jan 15, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

🐞 bug Something isn't working, pull request that fix bug. ci Continue Integration size:S This PR changes 10-29 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug] Document parsing fails in Knowledge Base despite valid embedding model configuration - [Errno 111] Connection refused

2 participants