Doesnt find MSBuild.SonarQube.Internal.PostProcess.exe - msbuild

Unable to execute sonar run for ms build when i change the sonar host from localhost to my machine ip.
tried changing the host in sonar.properties file and also in sonarqube_analysis.xml.
c:\HID\project-test\PACS\sonar_opencover\Project>MSBuild.SonarQube.Runner.exe end
Default properties file was found at C:\HID\project-test\dotnet\MSBuild.SonarQube.Runner-1.0.1\SonarQube.Analysis.xml
Loading analysis properties from C:\HID\project-test\dotnet\MSBuild.SonarQube.Runner-1.0.1\SonarQube.Analysis.xml
Post-processing started.
Execution failed. The specified executable does not exist: c:\HID\project-test\PACS\sonar_opencover\Project\.sonarqube\bin\MSBuild.SonarQube.Internal.PostProcess.exe
Post-processing failed. Exit code: 1
Scripts i executed
#call "C:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\Tools\VsDevCmd.bat"
MSBuild.SonarQube.Runner.exe begin /k:"jenkins_test5" /n:"jenkins_test5" /v:"1.0" /d:sonar.cs.opencover.reportsPaths="%CD%\opencover.xml"
msbuild.exe
"C:\HID\project-test\PACS\sonar_opencover\opencover.4.6.210\OpenCover.Console.exe" -output:"%CD%\opencover.xml" -register:user -target:"vstest.console.exe" -targetargs:"UnitTestProject1\bin\Debug\UnitTestProject1.dll"
MSBuild.SonarQube.Runner.exe end

I ran into this issue today. Turns out that I had miss configured SonarQube.Analysis.xml. Essentially, it expects
<Property Name="sonar.host.url">http://{server}:9000/sonar</Property>
including /sonar (which comes from sonar.web.context setting of sonar.properties on the server).
I had missed out /sonar in SonarQube.Analysis.xml and had exact same symptom as yours.

I have this error because the sonarcube url is wrong, it can't connect to the conarcube host:
<Property Name="sonar.host.url">http://{server}:{Port}</Property>
After asking my colleague I found that the url has changed, I correct the url and it works succesfully.

Related

CodePipeline ElasticBeanstalk [ERROR] An error occurred during execution of command [app-deploy] - [CheckProcfileForDotNetCoreApplication]

I've built a Code Pipeline (Source > Build > Deploy) and it's failing on the deploy step.
It's a Net Core 3.1 Api project.
I check the elastic beanstalk logs and I see:
2020/07/02 14:14:00.600060 [ERROR] An error occurred during execution of command [app-deploy] - [CheckProcfileForDotNetCoreApplication]. Stop running the command. Error: error stat /var/app/staging/MyApi/MyApi.dll: no such file or directory with file /var/app/staging/MyApi/MyApi.dll
As far as I know I have no control over /var/app/staging/ and this is built in AWS stuff?
The build step is working so I am unsure on this error.
My buildspec.yml is:
version: 0.2
phases:
build:
commands:
- dotnet publish -c release -o ./build_output ./MyApi/MyApi.csproj
artifacts:
files:
- '**/*'
base-directory: 'build_output'
This is the "zipfile/build_output" folder:
This is the zip file root folder:
These are the files in the build artifacts zip file that pipeline is using. The error says it cannot find MyAppName.dll (renamed to MyApi in the pic). It's there so I wonder why the problem.
Perhaps it doesnt like the folder structure in the zip file - see pic.
I had the same problem.
In my case, if the solution name and project name were different, I got the same error when I deployed the code from Visual Studio to Beanstalk, but when I added a project with the same name as the solution name and built it, I didn't get an error.
I suspect that there will be behavior during deployment that assumes the .dll file has the same name as the solution name.
Warning: This is a workaround, not a solution!
On the project that's failing to deploy, change the "Assembly name" in Project Properties / Application tab, to the name of the DLL it's missing (typically the solution name or the first period-separated part of the namespace).
i.e. "SLNNAME"
Then, redeploy your beanstalk app and it should work.
As Marcin correctly noticed, the indentation was incorrect for the "base-directory"
base-directory: 'build_output'
Should be
base-directory: 'build_output'
As others have noted, it is looking for only the first part of your project name .dll. In my case, my project and Assembly name were both UC.Web which yielded the error during deployment:
Error: error stat /var/app/staging/UC.dll: no such file or directory with file /var/app/staging/UC.dll
My solution that worked was I renamed my Assembly name from UC.Web to simply UC and it deployed successfully. While a solution for everyone, it is a workaround for the time being until Amazon fixes this.

Cannot load /modules/mod_dav_svn.so into server

I'm getting a wired error when loading Apache (Win 2016 STD, Apache/2.4.29 x86, OpenSSL/1.0.2n SVN/1.9.2)
i.e.
"Syntax error on line ... of .../conf/httpd.conf:
Cannot load ...modules/mod_dav_svn.so into server: (...) The specified module could not be found:"
The file is in the conf file properly: "LoadModule dav_svn_module modules/mod_dav_svn.so"
The file exists in the "modules" folder.
Although Apache reports a syntax error, it is not because other modules are loaded just fine with the same syntax.
Other file also has this problem: "mod_authz_svn.so".
Prerequisites are loaded before this module successfully (mod_dav.so, mod_dav_fs.so).
The best part: in my lab it is working just fine but in the customer's machine (same OS mentioned), something is not working properly.
I really need any help you can give me here...
mod_dav_svn.so is from subversion server - so it does not come with apache and has to be added. If you have - then to problem might be that a visual c++ runtime of another version is required. To find out you could try a tool like dependecy walker.
When all missing dependencies are installed on the system your apache should start.

Unable to activate Curl on Easyphp Devserver 16.1.1

I am trying to activate curl on my Easyphp Devserver 16.1.1, but I keep getting the error:
PHP Warning: PHP Startup: Unable to load dynamic library 'C:\Program Files (x86)\EasyPHP-Devserver-16.1\eds-binaries\php\php5619vc11x86x160615094909\ext\php_curl.dll' - Impossibile trovare il modulo specificato [cannot open shared object file: No such file or directory].\r\n in Unknown on line 0
I did the following:
un-commented "extension=php_curl.dll" in both php.ini files
verified that the file php_curl.dll actually exists in extension_dir
copied libeay32.dll, libsasl.dll, ssleay32.dll to c:\Windows\System\, c:\Windows\System32\, c:\Windows\SysWOW64\
Downloaded cacert.pem from http://curl.haxx.se/ca/cacert.pem and added the full path to it on curl.cainfo in php.ini
Downloading various versions of curl from https://curl.haxx.se
Set paths to php directories in My Computer > Properties > Advanced > Environment Variables (eg: C:\Program Files (x86)\EasyPHP-Devserver-16.1\eds-binaries\php\php5619vc11x86x160615094909\)
I rebooted after doing all these steps (specially for the step #6)
There are at least 5 similar questions, I followed every suggestion but nothing worked. Apache continues not to see my dll. Can anybody help on this issue?
Old topic but for people who land here and want skip all of the useless steps of Lucian.
Just use the answer from Anar Haziyev on this link:
Activation Curl on EasyPHP
work on easyphp devserver.
I faced the same issue with EasyPHP and what it fixed is that I had to install PHP as a different instance, not in the EasyPHP build and started the PHP service from the command line.

MSBuild SonarQube Runner v1.0 returns with code 1 after "Generating the FxCop ruleset"

I'm trying out SonarQube using the new MSBuild SonarQube Runner v1.0. If I install a fresh SonarQube server locally, the following command works fine, and I can build my solution directly afterward, call the 'end' command, and have the results published in SonarQube:
MSBuild.SonarQube.Runner.exe begin /key:TestKey /name:TestName /version:1.0.0.0
However, if I run this against an existing SonarQube server that exists on the internal network, it always returns with exit code 1:
15:32:40 Creating config and output folders...
15:32:40 Creating directory: c:\Test\MSBuild.SonarQube.Runner-1.0.itsonar\.sonarqube\conf
15:32:40 Creating directory: c:\Test\MSBuild.SonarQube.Runner-1.0.itsonar\.sonarqube\out
15:32:41 Generating the FxCop ruleset: c:\Test\MSBuild.SonarQube.Runner-1.0.itsonar\.sonarqube\conf\SonarQubeFxCop-cs.ruleset
Process returned exit code 1
It seems to download a lot of the dependencies into /.sonarqube, so communication with the server isn't an issue
Things I've tried:
checked the access.log, server.log and event logs
upgraded the existing server to v5.1.2 (clean install using the guide)
upgraded the sonar-csharp-plugin to v4.1
right-clicked all .jar files on the server and ensured they are unblocked
tried the runner directly on the server
(ongoing) tried debugging the source code (happening somewhere in the pre-process step: success comes back as true, but the error code is 1)
disabled UAC on the server an rebooted
re-installed JRE on both server and client, ensure JAVA_HOME in both PATH and registry are set correctly
Any help or pointers greatly accepted. I've been stuck on this for 2 days and can't think of anything else to try except continue trawling through source code. Thank you.
This is a tricky one! Looking at the code, I see only one path that can yield this output:
It fails while generating the FxCop ruleset for C#, as the VB.NET FxCop ruleset message is not logged - see TeamBuildPreProcessor.cs#L149 and TeamBuildPreProcessor.cs#L185
The GenerateFxCopRuleset() call for C# threw a WebException, leading to the call of Utilities.HandleHostUrlWebException() - which has to return true for the exception to be silently swallowed - see Utilities.cs#L153
The only path returning true without logging any message is if a HttpStatusCode.NotFound was received - see Utilities.cs#L158
The control flow goes back to FetchArgumentsAndRulesets(), which returns false, then goes back to Execute() which returns false as well - see TeamBuildPreProcessor.cs#L106
The MSBuild SonarQube Runner "begin" phase (called "preprocessor" in the code) fails - see Program.cs#L42
So, at some point, some SonarQube web service required for the C# FxCop ruleset generation is return a HTTP 404 error.
Could you monitor your network traffic and listen for the failing HTTP call? [I will keep on updating this answer afterwards]
EDIT: Indeed the error is caused by the quality profile name containing special characters. Such characters are currently badly URL-escaped, which leads to a 404.
I've created the following ticket to fix this issue in the upcoming release: http://jira.sonarsource.com/browse/SONARMSBRU-125

WebDeploy runcommand issue

I'm trying to deploy a package with WebDeploy V3.
The installation process is to sync between a source folder to a destination folder on the remote computer and run a certain powershell script after the sync is done.
The command being executed is:
'"C:\Program Files\IIS\Microsoft Web Deploy V3\msdeploy.exe" -verb:sync -source:dirPath='C:\source' -dest:dirPath='D:\destination',computerName=XXX -postSync:runcommand='powershell -inputformat none D:\destination\Install.ps1',successReturnCodes=0'
This yields the following error:
Info: Using ID '49edd786-d8a0-4acf-be7b-95dd6e1391cc' for connections to the remote server. Performing '-postSync'... Info:
Using ID '5ef9d005-82fa-4811-9f51-1741c8d622de' for connections to the remote server.
Info: Adding MSDeploy.runCommand (MSDeploy.runCommand).
Error: (11/28/2012 4:34:24 AM) An error occurred when the request was processed on the remote computer. Error: The entry type 'Unknown' was not expected at this time. The serialization stream may be corrupted.
Error count: 1.
Error during '-postSync'. Total changes: 0 (0 added, 0 deleted, 0 updated, 0 parameters changed, 0 bytes copied)
Searching the net for this error, I didn't see anybody who encountered it when using runcommand provider. If anybody encountered a similar issue and has ideas or suggestions I would be most thankful..
From what I've seen, using runCommand to execute an arbitrary command line might be a bit buggy. Try moving the commandline into a bat or cmd file and providing a (full?) path to that. The file will be uploaded and executed, as long as you don't try to pass in any arguments to it.
For future viewers of this post: I encountered this same specific error (Error: The entry type 'Unknown' was not expected at this time. The serialization stream may be corrupted) after adding runCommand provider usage to my MyProject.wpp.targets file for the Web Publishing Pipeline MSBuild process. The path was direct cmd shell input used in order to clear readonly flags with attrib -R.
In my case, my build server was configured with WebDeploy 3.0, while the server targeted by the deployment package was configured with Webdeploy 2.0. After upgrading the target server to Webdeploy 3.0 this particular problem was resolved.
However due to other errors surrounding runCommand (providing the correct path to the destination executable at package runtime) my solution still doesn't work entirely so take this all with a grain of salt.