Skip to content

Octopus Server doesn't close SQL connection after AI Recovery Agent completes #10039

@octopus-hideaki

Description

@octopus-hideaki

Severity

Sev-1, multiple instances affected has potential to cause server downtime

Version

Earliest reported 2026.1.11330

Latest Version

I could reproduce the problem in the latest build

What happened?

Multiple self-hosted customers are reporting that Octopus Server is leaving idle SQL transactions open, resulting in large PVS tables and degradation in Octopus Server performance.

We've also identified cloud instances where the DB storage space is nearly full. Similarly, due to a large PVS table.

We believe the culprit is the AI Recovery Agent endpoint failing to close DB connections.

Reproduction

  • Enable AI Feature toggle
  • Use the AI recovery agent

Error and Stacktrace

--SQL statement left open

SELECT TOP(1) [c].[Id], [c].[JSON]
FROM [Configuration] AS [c]
WHERE [c].[Id] = N'telemetry' AND [c].[Id] = @id

More Information

No response

Workaround

Avoid using AI Recovery Agent
If you are self-hosted:

  • Disable AI features by setting the environment variableOCTOPUS_FeatureToggles_AiFeatureToggle=false (Requires restart)

Metadata

Metadata

Assignees

Labels

kind/bugThis issue represents a verified problem we are committed to solving

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions