Maintenance script failing

Support and questions for using and managing Chocolatey NuGet inside of Labtech
Post Reply
mmoyse
Posts: 38
Joined: Tue May 25, 2021 9:28 am
2

Maintenance script failing

Post by mmoyse »

Script errors with "The Script(5969) failed in the Else section at step 55. The reason: SQL Get Value failed processing query"
The offending SQL seems to be

Code: Select all

SELECT count(*) FROM plugin_p4l_chocolatey_computer_enable WHERE Active = '1' and ComputerID = '%computerid%'
No machines are getting the framework or package installs. The plugin has been re-installed many times, the server has been restarted but it seems this plugin hasn't worked reliably since the first time it was installed.

User avatar
Cubert
Posts: 2430
Joined: Tue Dec 29, 2015 7:57 pm
8
Contact:

Re: Maintenance script failing

Post by Cubert »

You log stated (Script errors with "The Script(5969) failed in the Else section at step 55.) If script is getting to the ELSE section then the database is telling the automation that Chocolatey is installed and we have a valid path in database. So I do not believe this is an install issue but more likely a app install, update or repo issue.

In this case step 55 is in the GetVersions function and is trying to see if this agent is enabled before running the versioning of applications on the agent. The fact that it is failing on a SQL query that is requesting a "COUNT" is very odd, let me explain.


The query that fails is requesting a count. so it should not really fail. If the data is not there then its a zero else its a positive number. So for it to "fail" would mean the syntax is invalid or SQL was not available when call went out. Well we know the syntax is accurate or no app versions would ever work for any agent.

Now maybe %computerID% which is a Automate script variable set by Automate was somehow a word instead of a numerical value might cause a SQL query failure. I would have to test that on SQL to see what it would return.

Code: Select all

SELECT count(*) FROM plugin_p4l_chocolatey_computer_enable WHERE Active = '1' and ComputerID = '%computerid%'

Even with me leaving in %computerID% instead of converting it to a real number the SQL executes fine. We get a zero which is what would be expected and we didn't get a SQL failure. So why you are failing here is very odd indeed.
Capture.PNG
Capture.PNG (36.94 KiB) Viewed 2707 times
mmoyse wrote: Tue Jun 08, 2021 9:33 am Script errors with "The Script(5969) failed in the Else section at step 55. The reason: SQL Get Value failed processing query"
The offending SQL seems to be

Code: Select all

SELECT count(*) FROM plugin_p4l_chocolatey_computer_enable WHERE Active = '1' and ComputerID = '%computerid%'
No machines are getting the framework or package installs. The plugin has been re-installed many times, the server has been restarted but it seems this plugin hasn't worked reliably since the first time it was installed.

mmoyse
Posts: 38
Joined: Tue May 25, 2021 9:28 am
2

Re: Maintenance script failing

Post by mmoyse »

Before I posted I replaced %computerid% with the ID of the computer and got the same result

User avatar
Cubert
Posts: 2430
Joined: Tue Dec 29, 2015 7:57 pm
8
Contact:

Re: Maintenance script failing

Post by Cubert »

What version of Chocolatey are you on?

mmoyse
Posts: 38
Joined: Tue May 25, 2021 9:28 am
2

Re: Maintenance script failing

Post by mmoyse »

These are fresh installs, never had Choclatey on them before so whatever the latest one is 10-something

Post Reply

Return to “Chocolatey For Labtech”