huserben / TfsExtensions

Extensions for TFS 2015+ such as custom Widgets (require TFS 2017) and Build Tasks
MIT License
45 stars 22 forks source link

Unknown Problem resulting in 400 Bad Request #17

Closed huserben closed 7 years ago

huserben commented 7 years ago

Copied from other Issue where this originally was posted from @ravikumarjonnadula

Hi,

I am trying to use the extension to trigger a build. But even if there is no & in the build definition i am getting the below error.

[error]System.Net.WebException: The remote server returned an error: (400) Bad Request. 2017-07-14T06:26:52.5664574Z ##[error] at Microsoft.PowerShell.Commands.WebRequestPSCmdlet.GetResponse(WebRequest request) 2017-07-14T06:26:52.5664574Z ##[error] at Microsoft.PowerShell.Commands.WebRequestPSCmdlet.ProcessRecord() 2017-07-14T06:26:52.5664574Z ##[error]System.Management.Automation.RuntimeException: Cannot index into a null array. 2017-07-14T06:26:52.5664574Z ##[error] at CallSite.Target(Closure , CallSite , Object , Int32 ) 2017-07-14T06:26:52.5664574Z ##[error] at System.Dynamic.UpdateDelegates.UpdateAndExecute2[T0,T1,TRet](CallSite site, T0 arg0, T1 arg1) 2017-07-14T06:26:52.5664574Z ##[error] at System.Management.Automation.Interpreter.DynamicInstruction`3.Run(InterpretedFrame frame) 2017-07-14T06:26:52.5664574Z ##[error] at System.Management.Automation.Interpreter.EnterTryCatchFinallyInstruction.Run(InterpretedFrame frame)

Can you please help me out .

huserben commented 7 years ago

How did you configure the Task. Can you post a screenshot of you basic, advanced and authentication configuration? Otherwise it is hard to locate where the issue might be.

ravikumarjonnadula commented 7 years ago

Hi Benj Huserben,

Excuse me for the post, As i am new to this forum posted in the another conversation.

As mentioned , i am sharing you the screenshot for your reference. trigger build

I have configured as per the details given in ur page. But dont know where am i missing the details .

Please have a look and help me out.

Thanks in Advance.

huserben commented 7 years ago

The build definition that you want to to trigger is called "$(QueueBuildDefinition)" or is this a variable that you defined?

Can you show me as well the output of the task?

ravikumarjonnadula commented 7 years ago

I have defined as variable.

test

huserben commented 7 years ago

I see you are using the version 1.5.0 can you try it with the newest version (1.11.1), this might be a problem that was fixed already.

ravikumarjonnadula commented 7 years ago

May i know where to change the version.

huserben commented 7 years ago

I assume you are using an on prem TFS and not VSTS? Then i believe you have to download the task again from the website and update it the same way as you initially installed it.

ravikumarjonnadula commented 7 years ago

As Said i have uninstalled and installed the extension .But still i am getting some error, which i dont understand test

But again when i got to the build definition step where i have added the Trigger build its not showing the extra step which u have updated which is build configurations.

test1

huserben commented 7 years ago

I need to have a closer look, but i will not manage today.

however the error is different now, it returns 409 and not 400 now and the first request semms to be successfull...

ravikumarjonnadula commented 7 years ago

Yah first one is successful. and now able to see the changes for the latest version for the extension. But still facing the same error ever after couple of changes.

ravikumarjonnadula commented 7 years ago

Found the issue. i was specifying same agent for both the builds in General Tab of Demand which was casuing the error.

huserben commented 7 years ago

Hi @ravikumarjonnadula can you elaborate the problem a bit? I usually just work with one agent and this does not cause any issues, the build should just wait in the queue till the current one is finsihed...

Just for me to understand the problem and that I know if I need to update some documentation.

huserben commented 7 years ago

I will close this issue as no further feedback was provided.

ravikumarjonnadula commented 7 years ago

Hi sorry for late reply.bit busy with work. I was configured one agent for the 2 builds using Build.agentname equals to agentname.when first build triggered it's taking the same agent while triggering the next build, as the same build agent was busy it could nt assign for the triggered build.