TFS build suddently started failing with an exception adding queryBatchTimeout

I've had to increase the queryBatchTimeout for a database build to prevent it failing with timeouts and at first this worked fine but since yesterday it started failing with an error that suggests that the parameter is being added twice. The build uses the TFS/VSTS extension first to build and then to test the schema. The first task always succeeds but the test task keeps failing with the following exception. The build definition has not changed at all between the last success and these recent failures and the error is clearly coming from the powershell script used by the extension. Any help fixing this would be gratefully received. For the moment I have hads to prevent the build from running tests to get around this. Here's the exception that's causing the failure:

System.Management.Automation.MethodInvocationException: Exception calling "Add" with "2" argument(s): "Item has already been added. Key in dictionary: 'queryBatchTimeout' Key being added: 'queryBatchTimeout'" ---> System.ArgumentException: Item has already been added. Key in dictionary: 'queryBatchTimeout' Key being added: 'queryBatchTimeout'



Tagged:

Answers

  • We've just released version 2.0.26 of the DLM Automation 2: Build extension which should fix this. If you're using VSTS the extension should auto-update, but if you're using TFS you'll need to install the updated version.
    Development Lead
    Redgate Software
  • JamesMBJamesMB Posts: 4 New member
    Mike,

    Thanks. That's got me past the initial issue but now I'm seeing another new error. The test step is supposed to be testing the NuGet package built by my build step (and used to do this) but now I'm getting an error that looks like it's treating the root folder of the build as a script folder, which it is not.

    It says there's no RedGateDatabaseInfo.xml in the root (which is true, there isn't but there is in the NuGet package) and then errors trying to parse a SQL file which is in a separate folder from the database and is not even involved in the build (it's filtered out using a path filter in the build trigger, the actual database schema being in a different directory within the repository.

    As a result, I still can't enable the test step. Here is an extract from the build log:

    2018-05-25T09:50:01.2217316Z ##[warning]No 'RedGateDatabaseInfo.xml' file located at the root of the scripts folder 'D:\agents\01\_work\72\s'. Some features, such as static data, may not work as expected.
    2018-05-25T09:50:14.8868666Z ##[error]RedGate.DLMAutomation.Shared.Errors.TerminatingException: SQLCompare.exe terminated with the exit code 126: Failed due to a SQL Server error.
    2018-05-25T09:50:14.8868666Z SQLCompare.exe produced this error output:
    2018-05-25T09:50:14.8868666Z Error: Comparison of 'Scripts.s' and 'bbamtortst01.dlmautomation_86e0d208-947a-4ca7-8937-59bfbae35871' failed: Errors occurred whilst parsing file D:\agents\01\_work\72\s\Torch\CREXML\UpsertCalculation.sql '' at line 6, column 25
    2018-05-25T09:50:14.8868666Z Comparison of 'Scripts.s' and 'bbamtortst01.dlmautomation_86e0d208-947a-4ca7-8937-59bfbae35871' failed: Errors occurred whilst parsing file D:\agents\01\_work\72\s\Torch\CREXML\UpsertCalculation.sql

    Note that it shouldn't go near the Torch\CREXML folder (and never did before) as the database schema is in a completely separate folder under Torch\DB

  • Hi,

    We've done some investigation and believe we've found what was causing the issue. We've just released version 2.0.27 of the DLM Automation 2: Build extension which should fix this. Please let us know if there are any further problems.
    Software Engineer
    Redgate Software
Sign In or Register to comment.