SonarQube SonarScanner.MSBuild สำหรับ DotNet Core 2 ล่ม

ฉันกำลังพยายามตั้งค่าเครื่องสแกน SonarQube โดยเป็นส่วนหนึ่งของไปป์ไลน์ Jenkins ที่ทำงานบนเซิร์ฟเวอร์ Ubuntu

ฉันใช้สแกนเนอร์เวอร์ชัน 4.2.0.1214 ที่ดาวน์โหลดจาก: https://github.com/SonarSource/sonar-scanner-msbuild/releases/download/4.2.0.1214/sonar-scanner-msbuild-4.2.0.1214-netcoreapp2.0.zip

คำสั่งที่ฉันรันคือ:

dotnet /var/lib/jenkins/sonar-scanner/SonarScanner.MSBuild.dll begin /k:"SUP:ThreadManager" /n:"SUP:Thread Manager" /v:"1.0"
dotnet build
dotnet /var/lib/jenkins/sonar-scanner/SonarScanner.MSBuild.dll end

สองบรรทัดแรกทำงานได้ดี แต่บรรทัดสุดท้ายแสดงข้อผิดพลาดในการอนุญาตดังนี้:

05:30:58 + dotnet /var/lib/jenkins/sonar-scanner/SonarScanner.MSBuild.dll end
05:30:58 SonarScanner for MSBuild 4.1.1
05:30:58 Using the .NET Core version of the Scanner for MSBuild
05:30:58 Default properties file was found at /var/lib/jenkins/sonar-scanner/SonarQube.Analysis.xml
05:30:58 Loading analysis properties from /var/lib/jenkins/sonar-scanner/SonarQube.Analysis.xml
05:30:58 Post-processing started.
05:30:58 SONAR_SCANNER_OPTS is not configured. Setting it to the default value of -Xmx1024m
05:30:58 Calling the SonarQube Scanner...
05:30:58 
05:30:58 Unhandled Exception: System.ComponentModel.Win32Exception: Permission denied
05:30:58    at Interop.Sys.ForkAndExecProcess(String filename, String[] argv, String[] envp, String cwd, Boolean redirectStdin, Boolean redirectStdout, Boolean redirectStderr, Int32& lpChildPid, Int32& stdinFd, Int32& stdoutFd, Int32& stderrFd)
05:30:58    at System.Diagnostics.Process.StartCore(ProcessStartInfo startInfo)
05:30:58    at System.Diagnostics.Process.Start()
05:30:58    at SonarScanner.MSBuild.Common.ProcessRunner.Execute(ProcessRunnerArguments runnerArgs)
05:30:58    at SonarScanner.MSBuild.Shim.SonarScannerWrapper.ExecuteJavaRunner(AnalysisConfig config, IEnumerable`1 userCmdLineArguments, ILogger logger, String exeFileName, String propertiesFileName)
05:30:58    at SonarScanner.MSBuild.Shim.SonarScannerWrapper.<>c__DisplayClass6_0.<Execute>b__0()
05:30:58    at SonarScanner.MSBuild.Shim.SonarScannerWrapper.Execute(AnalysisConfig config, IEnumerable`1 userCmdLineArguments, ILogger logger)
05:30:58    at SonarScanner.MSBuild.PostProcessor.MSBuildPostProcessor.InvokeSonarScanner(IAnalysisPropertyProvider cmdLineArgs, AnalysisConfig config)
05:30:58    at SonarScanner.MSBuild.PostProcessor.MSBuildPostProcessor.Execute(String[] args, AnalysisConfig config, ITeamBuildSettings settings)
05:30:58    at SonarScanner.MSBuild.BootstrapperClass.PostProcess()
05:30:58    at SonarScanner.MSBuild.BootstrapperClass.Execute()
05:30:58    at SonarScanner.MSBuild.Program.Execute(String[] args, ILogger logger)
05:30:58    at SonarScanner.MSBuild.Program.Main(String[] args)
05:30:58 Aborted (core dumped)

ฉันได้รับข้อผิดพลาดเดียวกันไม่ว่าฉันจะใช้ผู้ใช้คนใดในการเรียกใช้งานก็ตาม การรันโดยใช้ sudo ก็ให้ข้อผิดพลาดเดียวกันเช่นกัน

ความช่วยเหลือใด ๆ จะดีมากขอบคุณ


person Wilko    schedule 19.04.2018    source แหล่งที่มา
comment
ดูเหมือนว่าจะเกี่ยวข้องกับ stackoverflow.com/questions/48605912/   -  person Val    schedule 19.04.2018
comment
นอกจากนี้ยังอาจเกิดจากการอนุญาตที่ไม่เพียงพอบน temp dir ของระบบหรือซอฟต์แวร์ป้องกันไวรัส (แต่มีแนวโน้มน้อยกว่าบน Linux)   -  person Val    schedule 19.04.2018
comment
ฉันมีปัญหาเดียวกันและมันเกิดขึ้นภายใต้รูทเช่นกัน ดังนั้นจึงไม่เกี่ยวข้องกับการอนุญาต   -  person Vroomfundel    schedule 02.05.2018


คำตอบ (1)


นี่คือสิ่งที่ทำเพื่อฉัน:

chmod 777 /opt/sonar-scanner-msbuild-4.2.0.1214-netcoreapp2.0/ -R

chmod -x อาจจะทำเช่นกันหากคุณต้องการรักษาความปลอดภัยให้เข้มงวดยิ่งขึ้น แน่นอนคุณจะต้องแทนที่เส้นทางด้วยเส้นทางจริงของคุณไปยัง SonarScanner

person Vroomfundel    schedule 02.05.2018