-
Notifications
You must be signed in to change notification settings - Fork 2.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Sonar PRCA: IndexOutOfRangeException #2045
Comments
There seems to be two errors while the second error (No changes found) seems to be #1968, but there's an additional |
Hi Pascal, thanks again for reporting your issue. This is really useful - I've been trying to repro this bug since yesterday. Is there any way you can supply the sonar-report.json from this build? |
Sure, you can find it here. |
@pascalberger - Disclaimer: this is a totally untested hypothesis, I am not familiar with these tasks: one of the REST SDK httpclient calls may be returning an error that isn't bubbling. Instead of calling |
An update in the interest of keeping people informed: I'm still unable to repro this issue due to a (seemingly) unrelated bug in this same task. However, two seperate customers with different build pipelines encountering the same IndexOutOfRange error does seem to indicate there is a problem with the task code itself, and it is not a configuration problem. |
@ericsciple Updating which tasks? The Sonar Task? |
Yes, the one erroring during your build. Again, it's only a wild guess that may help to narrow-in on the root of the issue. I happened to notice that task calls |
@ericsciple Unfortunately changing |
Looking at the log output before the
And the one immediately after:
I assume the error occurs somewhere after https://github.com/Microsoft/vsts-tasks/blob/89b14959c6a1dc69a1845dba2cefc8f535144bd4/Tasks/SonarQubePostTest/PRCA/PostComments-Module.psm1#L114 and https://github.com/Microsoft/vsts-tasks/blob/89b14959c6a1dc69a1845dba2cefc8f535144bd4/Tasks/SonarQubePostTest/PRCA/PostComments-Module.psm1#L404 in the |
After further debugging I found that the |
Hi Pascal, I think I know where this exception is being thrown from - it's a PowerShell bug. PowerShell cannot easily distinguish between overloads (because it's not a strongly typed language) so it has complex logic to pick the right overload. When you repro this - do you use the hosted agent? I'm asking because the hosted agent has Win Server 2012 and that uses PowerShell 4. Win 10 has PowerShell 5, which is probably why can't repro the bug. |
It's an on-prem agent with PowerShell 4 |
Thanks, I am now able to repro the problem. I am preparing a fix. |
Thanks @bgavrilMS! #2057 seem to have fixed this issue. |
Great, thank you for confirming Pascal! We're going to hotfix this so it will roll out soon. |
I've uploaded the Sonar Post task based on this PR (to fix #2044]. With this version I get an
IndexOutOfRangeException
:The text was updated successfully, but these errors were encountered: