We have Azure-DevOps on premises. My Build pipeline was working perfectly also with SonarQube tasks. then suddenly I got an error for some access issue for file "Access to the path_work\1\a\MyProject.API.dll.RoslynCA.json" is denied".
And I have deleted that file with the mindset that if this is the auto-generated file, will get this again. But no luck and the same error occurred.
I have removed folder "sonarqubePrepare" and started facing another error - Error - "Bad content type". (Note- this error is coming only when I execute sonarqube task, MSBUILD task is working fine)
I have reInstall agent and tried to execute the pipeline again. but the same issue is there now id "##[error]Bad content type".
Note-SonarQube task is working fine with some other project on some other build machine.
Logs-
2019-06-10T13:03:01.22402Z ##[section]Starting: Initialize job
2019-06-10T13:03:01.22572Z Current agent version: '2.141.1'
2019-06-10T13:03:01.238990Z ##[debug]Primary repository: MyRepo.
repository type: Tfvc
2019-06-10T13:03:01.249208Z Prepare build directory.
2019-06-10T13:03:01.28078Z ##[debug]Delete existing artifacts directory: 'E:\vsts-agent-win-x64-2.141.1\_work\1\a'
2019-06-10T13:03:01.280467Z ##[debug]Deleting artifacts directory: 'E:\vsts-agent-win-x64-2.141.1\_work\1\a'
2019-06-10T13:03:01.282948Z ##[debug]Creating artifacts directory: 'E:\vsts-agent-win-x64-2.141.1\_work\1\a'
2019-06-10T13:03:01.283370Z ##[debug]Delete existing test results directory: 'E:\vsts-agent-win-x64-2.141.1\_work\1\TestResults'
2019-06-10T13:03:01.283321Z ##[debug]Deleting test results directory: 'E:\vsts-agent-win-x64-2.141.1\_work\1\TestResults'
2019-06-10T13:03:01.283687Z ##[debug]Creating test results directory: 'E:\vsts-agent-win-x64-2.141.1\_work\1\TestResults'
2019-06-10T13:03:01.2841036Z Set build variables.
2019-06-10T13:03:01.290128Z Download all required tasks.
2019-06-10T13:03:01.35085Z Downloading task: SonarQubePrepare
2019-06-10T13:03:01.61385Z ##[error]bad content type
2019-06-10T13:03:01.61594Z ##[debug]System.Exception: bad content type
at Microsoft.TeamFoundation.DistributedTask.WebApi.TaskAgentHttpClient.GetTaskContentZipAsync(Guid taskId, TaskVersion version, Object userState, CancellationToken cancellationToken)
at Microsoft.VisualStudio.Services.Agent.Worker.TaskManager.DownloadAsync(IExecutionContext executionContext, TaskStepDefinitionReference task)
at Microsoft.VisualStudio.Services.Agent.Worker.TaskManager.DownloadAsync(IExecutionContext executionContext, IEnumerable`1 steps)
at Microsoft.VisualStudio.Services.Agent.Worker.JobExtension.InitializeJob(IExecutionContext jobContext, AgentJobRequestMessage message)
2019-06-10T13:03:01.6162764Z ##[section]Finishing: Initialize job