SonarQube Scanner - SocketException Socket Closed - Unexpected EOF read on the socket - sonarqube

I'm trying to scan my project with sonarqube and no matter what I try, it fails when trying to upload the report to the local sonarqube server.
When scanning as a maven goal or using the sonar-scanner download, it reports the same type of issue:
sonar-scanner
10:28:42.304 DEBUG: Upload report
10:28:52.553 INFO: ------------------------------------------------------------------------
10:28:52.554 INFO: EXECUTION FAILURE
10:28:52.557 INFO: ------------------------------------------------------------------------
10:28:52.558 INFO: Total time: 28.827s
10:28:52.775 INFO: Final Memory: 49M/298M
10:28:52.776 INFO: ------------------------------------------------------------------------
10:28:52.777 ERROR: Error during SonarQube Scanner execution
java.lang.IllegalStateException: Fail to request http://localhost:9000/api/ce/submit?projectKey=abc:abc
...
...
Caused by: java.net.SocketTimeoutException: timeout
...
...
Caused by: java.net.SocketException: Socket closed
Maven sonar:sonar goal
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 45.193 s
[INFO] Finished at: 2018-01-31T10:38:54-05:00
[INFO] Final Memory: 80M/452M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.sonarsource.scanner.maven:sonar-maven-plugin:3.3.0.603:sonar (default-cli) on project abc: Fail to request http://localhost:9000/api/ce/submit?projectKey=abc:abc&projectName=abc: timeout: Socket closed -> [Help 1]
Looking into the sonar server's logs, I found the following relevant looking statement in access.log
127.0.0.1 - - [31/Jan/2018:10:39:04 -0500] "POST /api/ce/submit?projectKey=abc:abc&projectName=abc HTTP/1.1" 400 56 "-" "ScannerMaven/3.3.0.603/3.5.0" "AWFM1VQ1EuWVn5rHAAAf"
And this error in the web.log
2018.01.31 10:39:04 WARN web[AWFM1VQ1EuWVn5rHAAAf][o.s.s.w.ServletRequest] Can't read file part for parameter report
java.io.IOException: org.apache.tomcat.util.http.fileupload.FileUploadBase$IOFileUploadException: Processing of multipart/form-data request failed. Unexpected EOF read on the socket
...
...
Caused by: org.apache.tomcat.util.http.fileupload.FileUploadBase$IOFileUploadException: Processing of multipart/form-data request failed. Unexpected EOF read on the socket
...
...
Caused by: java.io.EOFException: Unexpected EOF read on the socket
I've tried using the following versions with the same results:
| sonar-scanner | maven sonar plugin | sonarqube |
| n/a | 3.4.0.905 | 6.5 |
| n/a | 3.4.0.905 | 6.7.1 |
| n/a | 3.3.0.603 | 6.7.1 |
| 3.0.3.778 | n/a | 6.7.1 |
I've also tried other projects of mine and they do the same thing.
What am I doing wrong?
Edit: I tried yet another project of mine, a tiny one, and it worked fine. It seems that as long as the report upload takes less than 10 seconds it works. However as soon as upload takes about 10 seconds, it gets cut off:
14:10:38.537 INFO: Analysis report generated in abc\.scannerwork\scanner-report
14:10:38.537 DEBUG: Upload report
14:10:48.864 INFO: ------------------------------------------------------------------------
14:10:48.864 INFO: EXECUTION FAILURE
The difference in timestamps seems to always be 10s +/- a few hundred milliseconds.
I don't know why it's taking so long to upload such a small report when both items are on my same machine however is there a way to increase this timeout?

Related

Creating Springboot image with Docker took box on windows 10 using spotify maven plugin

I use docker tool box in my windows 10 home laptop. Trying to create a docker image using the springboot project I have been working on. Followed the tutorial at https://spring.io/guides/gs/spring-boot-docker/
Have been struggling with the error for past three days
Apr 03, 2019 11:52:57 AM com.spotify.docker.client.shaded.org.apache.http.impl.execchain.RetryExec execute
INFO: I/O exception (java.net.SocketException) caught when processing request to {s}->https://192.168.99.100:2376: Connection reset by peer: socket write error
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 46.027 s
[INFO] Finished at: 2019-04-03T11:52:57+05:30
[INFO] Final Memory: 63M/433M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal com.spotify:dockerfile-maven-plugin:1.4.9:build (default-cli) on project IssueTracker: Could not build image: java.util.concurrent.ExecutionException: com.spotify.docker.client.shaded.javax.ws.rs.ProcessingException: com.spotify.docker.client.shaded.org.apache.http.client.ClientProtocolException: Cannot retry request with a non-repeatable request entity: Connection reset by peer: socket write error -> [Help 1]
Many websites I look up said this could be something related to disabling TLS. I tried to expose the host, disable the tls but still the issue persists. Any help will be appreciated.
The following is my maven plugin config
<plugin>
<groupId>com.spotify</groupId>
<artifactId>dockerfile-maven-plugin</artifactId>
<version>1.4.9</version>
<configuration>
<repository>${docker.image.prefix}/${project.artifactId}</repository>
</configuration>
</plugin>
Did you try to run this maven goal inside "Docker Quickstart Terminal"?

Nexus Artefact Upload Failure

using maven deploy command, I tried to upload artefacts of size (440 MB) in Nexus repository(Nexus Version : nexus-professional-2.13.0-01). Maven version is 3.5.2. Configured my proxy server details in settings.xml
mvn -e -X deploy:deploy-file -DgroupId=de.test.oca -DartifactId=wildfly-image -Dversion=0.0.1-SNAPSHOT -Dpackaging=tar.gz -Dfile=oca-wildfly-image-0.0.1-snapshot.tar.gz -DrepositoryId=oca-snapshots -Durl=http://xx.xx.xx:8081/nexus/content/repositories/oca-snapshots
Error Message :
Uploaded to oca-snapshots: http://xx.xx.xx:8081/nexus/content/repositories/oca-snapshots/de/test/oca/wildfly-image/0.0.1-SNAPSHOT/wildfly-image-0.0.1-20180117.094348-1.pom (446 B at 1.2 kB/s)
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 07:07 min
[INFO] Finished at: 2018-01-17T10:50:54+01:00
[INFO] Final Memory: 10M/309M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-deploy-plugin:2.7:deploy-file (default-cli) on project standalone-pom: Failed to deploy artifacts: Could not transfer artifact de.test.oca:wildfly-image:tar.gz:0.0.1-20180117.094348-1 from/to oca-snapshots (http://xx.xx.xx:8081/nexus/content/repositories/oca-snapshots): Connection reset -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.apache.maven.plugins:maven-deploy-plugin:2.7:deploy-file (default-cli) on project standalone-pom: Failed to deploy artifacts: Could not transfer artifact de.test.oca:wildfly-image:tar.gz:0.0.1-20180117.094348-1 from/to oca-snapshots (http://xx.xx.xx:8081/nexus/content/repositories/oca-snapshots): Connection reset
In Nexus GUI, I can able to find the tar.gz file uploaded. When I checked nexus.log, I found error message as
jvm 1 | 2018-01-17 14:27:17,706+0100 INFO [qtp1148931253-265705] admin com.sonatype.nexus.plugins.outreach.internal.outreach.SonatypeOutreach - Could not download page bundle
jvm 1 | org.apache.http.conn.ConnectionPoolTimeoutException: Timeout waiting for connection from pool
jvm 1 | 2018-01-17 14:27:47,710+0100 INFO [qtp1148931253-265708] admin com.sonatype.nexus.plugins.outreach.internal.outreach.SonatypeOutreach - Could not download page bundle
jvm 1 | org.apache.http.conn.ConnectionPoolTimeoutException: Timeout waiting for connection from pool
I tried to Upload another file with file sizw of 300MB, it works fine.
Is there any file size limit in the Nexus.
There is no filesize limit in Nexus itself. However there might be timeout issues, performance issues with the app or other issues with the underlying OS and filesystem.

Jenkins build not failing when maven deploy task fails

I have a Jenkins (Maven) job that builds and deploys a web service to a Tomcat 8 server.
If the deployment to the Tomcat fails the Jenkins job still finishes with success.
[INFO] tomcatManager status code:200, ReasonPhrase:OK
[INFO] FAIL - Deployed application at context path /dims but context failed to start
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 24.625s
[INFO] Finished at: Tue Oct 25 12:14:21 CEST 2016
[INFO] Final Memory: 17M/40M
[INFO] ------------------------------------------------------------------------
Finished: SUCCESS
Is there a way to make the Jenkins job fail if the deployment fails?
if you use jenkins i advise you to use jenkins deploy plugin
https://wiki.jenkins-ci.org/display/JENKINS/Deploy+Plugin
I think this is a bug in the tomcat maven plugin.
I had the same problem and use Jenkins plugin called Jenkins Text Finder. I added a post-build action called "Jenkins Text Finder" to the end of my Jenkins job. I leave the "Files" input box empty, but check the "Also search the console output" checkbox. In the regular expression inputbox I put "but context failed to start". The other two checkboxes remain unchecked.
This leads to the following output
[INFO] tomcatManager status code:200, ReasonPhrase:OK
[INFO] FAIL - Deployed application at context path / but context failed to start
[INFO] ----------------
[INFO] BUILD SUCCESS
[INFO] ----------------
[INFO] Total time: 01:23 min
[INFO] Finished at: 2016-12-29T21:15:41+01:00
[INFO] Final Memory: 117M/472M
[JENKINS] Archiving /var/lib/jenkins/workspace/jenkins-test/core/pom.xml to cz.semanta/xf3/r8_2/xf3-r8_2.pom
[INFO] ---------------------
channel stopped
Checking console output
/var/lib/jenkins/jobs/jenkins-test/builds/6/log:
[INFO] FAIL - Deployed application at context path / but context failed to start
Build step 'Jenkins Text Finder' changed build result to FAILURE
An attempt to send an e-mail to empty list of recipients, ignored.
Finished: FAILURE
which is good enough for me.

Build issues with Hadoop on windows

I am trying to build hadoop on windows and I am following this link http://opensourceforu.efytimes.com/2015/03/getting-started-with-hadoop-on-windows/. However when I try to build the code using the command
mvn package -Pdist,native-win -DskipTests Dtar
I am getting the following error
[DEBUG] Writing tracking file C:\Users\SS\.m2\repository\org\s
onatype\plexus\plexus-cipher\1.4\_remote.repositories
[DEBUG] Writing tracking file C:\Users\SS\.m2\repository\org\s
onatype\plexus\plexus-cipher\1.4\plexus-cipher-1.4.jar.lastUpdated
[DEBUG] Writing tracking file C:\Users\SS\.m2\repository\org\a
pache\maven\plugin-tools\maven-plugin-annotations\3.4\_remote.repositories
[DEBUG] Writing tracking file C:\Users\SS\.m2\repository\org\a
pache\maven\plugin-tools\maven-plugin-annotations\3.4\maven-plugin-annotations-3
.4.jar.lastUpdated
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 25:08 min
[INFO] Finished at: 2016-03-21T17:02:06+05:30
[INFO] Final Memory: 13M/173M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal on project hadoop-maven-plugins: Could not resolv
e dependencies for project org.apache.hadoop:hadoop-maven-plugins:maven-plugin:2
.7.2: Could not transfer artifact org.apache.maven:maven-model:jar:3.0 from/to c
entral (https://repo.maven.apache.org/maven2): GET request of: org/apache/maven/
maven-model/3.0/maven-model-3.0.jar from central failed: SSL peer shut down inco
rrectly -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal o
n project hadoop-maven-plugins: Could not resolve dependencies for project org.a
pache.hadoop:hadoop-maven-plugins:maven-plugin:2.7.2: Could not transfer artifac
t org.apache.maven:maven-model:jar:3.0 from/to central (https://repo.maven.apach
e.org/maven2): GET request of: org/apache/maven/maven-model/3.0/maven-model-3.0.
jar from central failed
at org.apache.maven.lifecycle.internal.LifecycleDependencyResolver.getDe
pendencies(LifecycleDependencyResolver.java:221)
at org.apache.maven.lifecycle.internal.LifecycleDependencyResolver.resol
veProjectDependencies(LifecycleDependencyResolver.java:127)
at org.apache.maven.lifecycle.internal.MojoExecutor.ensureDependenciesAr
eResolved(MojoExecutor.java:245)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor
.java:199)
I am using a windows 7 enterprise 64 bit machine and there is no proxy configured in IE. Can somebody help me to resolve this issue?
Thank you,
Using openssl s_client -connect servername:443 you can debug what protocol the server supports and perform tests by forcing flags like ssl2, ssl2, check this

Failed to execute goal net.kindleit:maven-gae-plugin:0.9.2:unpack due to API Incomatibility

I'm new to Spring Roo as well as Maven. I was trying to setup a basic Google App Engine web application using Spring Roo. But when I run the tests - perform tests/mvn test - I get an error saying unable to run the goal Unpack due to API incomatibility.
Details:
gae.version: 1.6.1
gae-runtime: 0.9.2
Tried the same with 1.6.0 and 0.9.0 - still gives me the same error.
Exception:
[INFO] --- maven-gae-plugin:0.9.2:unpack (default) # project_x ---
Feb 8, 2012 2:47:40 PM org.sonatype.guice.bean.reflect.Logs$JULSink warn
WARNING: Error injecting: net.kindleit.gae.UnpackGoal
java.lang.TypeNotPresentException: Type net.kindleit.gae.UnpackGoal not present
at org.sonatype.guice.bean.reflect.URLClassSpace.loadClass(URLClassSpace.java:109)
at org.sonatype.guice.bean.reflect.NamedClass.load(NamedClass.java:45)
...
...
... 41 more
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 27.836s
[INFO] Finished at: Wed Feb 08 14:47:40 IST 2012
[INFO] Final Memory: 6M/12M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal net.kindleit:maven-gae-plugin:0.9.2:unpack (default) on project project_x: Execution default of goal net.kindleit:maven-gae-plugin:0.9.2:unpack failed: Unable to load the mojo 'unpack' in the plugin 'net.kindleit:maven-gae-plugin:0.9.2' due to an API incompatibility: org.codehaus.plexus.component.repository.exception.ComponentLookupException: Bad version number in .class file
[ERROR] -----------------------------------------------------
[ERROR] realm = plugin>net.kindleit:maven-gae-plugin:0.9.2
[ERROR] strategy = org.codehaus.plexus.classworlds.strategy.SelfFirstStrategy
[ERROR] urls[0] = file:/Users/myself/.m2/repository/net/kindleit/maven-gae-plugin/0.9.2/maven-gae-plugin-0.9.2.jar
[ERROR] urls[1] = file:/Users/myself/.m2/repository/net/kindleit/gae-runtime/1.6.1/gae-runtime-1.6.1.pom
...
..
I tried googling this issue, but didn't come across anyone facing this issue. I guess, I'm missing some dependency in the generated POM - but due to my inexperience I'm not able to figure out the exact cause.
Let me know, if I need to upload the generated pom.xml or any other details.
meanwhile, I'll continue to figure out what is causing the issue.
Thanks in advance.
Looks like an API incompatibility:
due to an API incompatibility:
org.codehaus.plexus.component.repository.exception.ComponentLookupException:
Bad version number in .class file

Resources