Skip to content

[BUG] Fix #951 — clean up Monitor_LongQueries_*.trc files in data_retention not working and job failing #972

@CADelete

Description

@CADelete

Component

Full Dashboard

Performance Monitor Version

2.11.0

SQL Server Version

SQL Server 2019

Windows Version

Windows Server 2019

Describe the Bug

Data Retention job failing on new version. Output from job log

Found 7 Monitor LongQueries_* file(s) in I:\Logs\MSSQLSERVER; cutoff=2026-05-11T07:38.22.239 [SQLSTATE 010000]
Msg 22049, Sev16, Sate 1: xp_delete_files() returned error 2, 'The system cannot find the file specified.' [SQLSTATE 42000]

Steps to Reproduce

Happening on all instances following upgrade to 2.11

Expected Behavior

Should complete and remove data

Actual Behavior

Job fails instantly

Error Messages / Log Output

Found 7 Monitor LongQueries_* file(s) in I:\Logs\MSSQLSERVER\; cutoff=2026-05-11T07:38.22.239 [SQLSTATE 010000]
Msg 22049, Sev16, Sate 1: xp_delete_files() returned error 2, 'The system cannot find the file specified.' [SQLSTATE 42000]

Screenshots

Image

Additional Context

Worked in previous version

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions