erikdarlingdata / DarlingData

Open source SQL Server nonsense: sp_PressureDetector, sp_QuickieStore, sp_HumanEvents, etc.
https://www.erikdarling.com/
MIT License
476 stars 135 forks source link

Intermittent Error "Name cannot begin with the '>' character #482

Open netsec4u opened 3 days ago

netsec4u commented 3 days ago

Version of the script @version = '4.9', @version_date = '20240915';

What is the current behavior? Executing with the default options, intermittent throws the error in the screenshot.

Error

If the current behavior is a bug, please provide the steps to reproduce. Below is the how the procedure is executed. There are unknown conditions to result in the error. ` DECLARE @return_value int, @version varchar(5), @version_date datetime

EXEC @return_value = [dbo].[sp_PressureDetector] @version = @version OUTPUT, @version_date = @version_date OUTPUT `

What is the expected behavior? Should not throw error.

Which versions of SQL Server and which OS are affected by this issue? Did this work in previous versions of our procedures? SQL Server 2017 on Windows Server

IMPORTANT: If you're going to contribute code, please read the contributing guide first. https://github.com/erikdarlingdata/DarlingData/blob/main/CONTRIBUTING.md

erikdarlingdata commented 3 days ago

@netsec4u I apologize, I misread the initial issue. This is for sp_PressureDetector, which means it's probably a running query causing the problem. Can you confirm which query is having the issue?

netsec4u commented 3 days ago

Unfortunately, I do not know. I was in firefighting mode where I just took a screenshot of the error to review later and rerun the procedure. I am working on a performance issue that is more noticeable on Monday's and Tuesday's. But I will periodically run this procedure and let you know when I am able to duplicate.

erikdarlingdata commented 3 days ago

@netsec4u okay, cool. You may want to run it with @debug = 1 to help figure out the problem. I'll leave this open for a bit for you to come back to, but if I don't hear from you for a month, I'll close it out. I understand that these transient issues are tough. There are similar problems with sp_WhoIsActive too.

netsec4u commented 3 days ago

Based on the warning about null values being eliminated, the error is one of the queries after the "Checking memory pressure" query.

erikdarlingdata commented 3 days ago

@netsec4u I'll wait for you to confirm that 😉

netsec4u commented 3 days ago

I was able to duplicate. Looks like the error is in the last result set that contains the active queries. Screenshot 2024-10-10 113125

Also, I found a way to replicate with some consistency. Execute sp_BlitzFirst with ExpertMode set to 1, then in a second session execute sp_PressureDetector. Looks like you can blame Brent. Lol.

erikdarlingdata commented 3 days ago

@netsec4u ha ha, looks like I should add an @IgnoreBrent parameter to this one.