:Maven build failure for spring cloud - spring-cloud-netflix

I have been observing the build fail issue for this
[ERROR] The build could not read 1 project -> [Help 1]
[ERROR]
[ERROR] The project org.springframework.cloud:spring-cloud-netflix-hystrix-stream:2.0.1.BUILD-SNAPSHOT (E:\springcloud\spring-cloud-netflix-master\spring-cloud-netflix-master\spring-cloud-netflix-hystrix-stream\pom.xml) has 1 error
[ERROR] Unresolveable build extension: Plugin org.springframework.cloud:spring-cloud-contract-maven-plugin:1.2.4.RELEASE or one of its dependencies could not be resolved: Failure to find org.springframework.cloud:spring-cloud-netflix-hystrix-contract:jar:2.0.1.BUILD-SNAPSHOT in https://repo.spring.io/libs-snapshot-local was cached in the local repository, resolution will not be reattempted until the update interval of spring-snapshots has elapsed or updates are forced -> [Help 2]

Please run ./scripts/build.sh to fix the issue.

Related

GPG key skipped during maven release

I am following all the instructions listed here to release my project to sonatype repo: https://dzone.com/articles/publish-your-artifacts-to-maven-central
But still getting the following error during signing artifacts
[INFO] --- maven-gpg-plugin:3.0.1:sign (sign-artifacts) # exceptionless-client ---
gpg: skipped "0x9d0e3e1d": No secret key
gpg: signing failed: No secret key
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 42.750 s
[INFO] Finished at: 2021-08-03T10:52:18+05:30
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-gpg-plugin:3.0.1:sign (sign-artifacts) on project exceptionless-client: Exit code: 2 -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please rezad the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException
I can see the key listed when I run gpg --list-key command.
I used git bash to generate new keys, but I didn't know that git bash also comes with a bundled gpg program and it was using that. However, the maven-gpg-plugin was trying to find keys using the gpg program installed under C:/Program Files(x86). After I created keys using this I installed it worked perfectly.

Cannot set configuration in Elastic Beanstalk

I have 4 Elastic Beanstalk deployments: 3 are Corretto 8 and the other one is Corretto 11.
On the Corretto 8 deployments, I can set new configuration without issue. On the Corretto 11 instance, however, any attempt to set a new configuration fails and causes a rollback.
The Corretto versions might not be the problem, but it's the only difference I can see. All 4 apps are Spring Boot apps that run as web servers (i.e embedded tomcat with exposed web ports). I am trying to set the exact same configuration name and value, and it only fails on the one instance.
The configuration I'm trying to set is pretty simple:
VALIDATE_RENEWALS = true
Even just trying to set DEBUG = true causes a failure and rollback.
I don't see a lot of information from the console about what's failing. Here is the event log:
2020-03-16 13:55:17 UTC-0600 INFO The environment was reverted to the previous configuration setting.
2020-03-16 13:54:45 UTC-0600 ERROR During an aborted deployment, some instances may have deployed the new application version. To ensure all instances are running the same version, re-deploy the appropriate application version.
2020-03-16 13:54:45 UTC-0600 ERROR Failed to deploy configuration.
2020-03-16 13:54:45 UTC-0600 ERROR Unsuccessful command execution on instance id(s) 'i-00553f4ac36afd327'. Aborting the operation.
2020-03-16 13:54:45 UTC-0600 INFO Command execution completed on all instances. Summary: [Successful: 0, Failed: 1].
2020-03-16 13:54:45 UTC-0600 ERROR [Instance: i-00553f4ac36afd327] Command failed on instance. An unexpected error has occurred [ErrorCode: 0000000001].
2020-03-16 13:54:20 UTC-0600 INFO Updating environment XXX's configuration settings.
2020-03-16 13:54:15 UTC-0600 INFO Environment update is starting.
I've also downloaded the full set of logs for the instance and don't see anything obvious. The app stdout doesn't have any errors or exceptions, it just starts normally and then gets terminated. None of the other log files have messages around the times above, so I'm really not sure what else I can look at.
Edit
The times don't line up but I do see this in eb-engine.log file:
2020/03/16 17:54:38.508634 [INFO] checking whether command is applicable to this instance...
2020/03/16 17:54:38.508658 [INFO] this command is applicable to the instance, thus instance should execute command
2020/03/16 17:54:38.508665 [INFO] check whether this is an enhanced env...
2020/03/16 17:54:38.508794 [INFO] Executing instruction: StageJavaApplication
2020/03/16 17:54:38.508858 [ERROR] GetArchivedFileType with file /opt/elasticbeanstalk/deployment/app_source_bundle failed with error open /opt/elasticbeanstalk/deployment/app_source_bundle: no such file or directory
2020/03/16 17:54:38.508868 [ERROR] An error occurred during execution of command [config-deploy] - [StageJavaApplication]. Stop running the command. Error: staging java app failed with error GetArchivedFileType with file /opt/elasticbeanstalk/deployment/app_source_bundle failed with error open /opt/elasticbeanstalk/deployment/app_source_bundle: no such file or directory

Error Unable to save measure for metric pdf-data on component :Sonar Exception?

I have a Jenkins Job that runs SonarRunner on a Maven project composed of several modules i'm using msql db for sonar. The build fails showing that
[ERROR] Unable to save measure for metric [pdf-data] on component [com.XX:xxx-parent]
[ERROR] Failed to execute goal org.codehaus.mojo:sonar-maven-plugin:2.3.1:sonar (default-cli) on project XXX-parent: Unable to save measure for metric [pdf-data] on component [com.XX:XXX-parent]:
[ERROR] ### Error updating database. Cause: com.mysql.jdbc.PacketTooBigException: Packet for query is too large (3676748 > 1048576). You can change this value on the server by setting the max_allowed_packet' variable.
[ERROR] ### The error may involve org.sonar.api.database.model.MeasureMapper.insertData-Inline
[ERROR] ### The error occurred while setting parameters
[ERROR] ### SQL: INSERT INTO measure_data (measure_id, snapshot_id, data) VALUES (?, ?, ?)
[ERROR] ### Cause: com.mysql.jdbc.PacketTooBigException: Packet for query is too large (3676748 > 1048576). You can change this value on the server by setting the max_allowed_packet' variable.
[ERROR] -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.codehaus.mojo:sonar-maven-plugin:2.3.1:sonar (default-cli) on project XXX-parent: Unable to save measure for metric [pdf-data] on component [com.XXX:XXX-parent]
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:217)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:84)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:59)
at org.apache.maven.lifecycle.internal.LifecycleStarter.singleThreadedBuild(LifecycleStarter.java:183)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:161)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:320)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:156)
at org.apache.maven.cli.MavenCli.execute(MavenCli.java:537)
at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:196)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:141)
I encountered this error as well. The MySQL database that your SonarQube is using only allows LOB contents up to 1 MB by default and the content it is trying to save is larger than that as stated in the error message.
com.mysql.jdbc.PacketTooBigException: Packet for query is too large (3676748 > 1048576).
The solution is that you need to increase the max_allowed_packet setting for the MySQL instance the SonarQube is using.
You can change this value on the server by setting the max_allowed_packet' variable.
Instructions can be found here.
Start the server with the desired setting, i.e. mysqld --max_allowed_packet=16M for 16 MB max.
Or more permanently, modify the config file (my.cnf on Linux systems, possibly my.ini on Windows) by adding the setting under the [mysqld] section.
[mysqld]
max_allowed_packet=16M

Jenkins-Sonar communication on Openshift

I am making a development environnement based on Jenkins and Sonar.
Both are placed on isolated gears.
The Jenkins gear has been created with the Instant App option.
The Sonar gear has been created thanks to these github indications.
I created a Jenkins free-style job in order to analysis a Maven project.
The script used on that job is based on this wordpress article.
# Build script of the Job
settingsPath=$OPENSHIFT_DATA_DIR/settings.xml
settings="<settings>\n <localRepository>$OPENSHIFT_DATA_DIR</localRepository>\n</settings>\n"
echo $settings > $settingsPath
# Cleaning of the workspace
mvn --global-settings $settingsPath clean test
# Preparation of Sonar informations
export SONAR_JDBC="-Dsonar.jdbc.url=jdbc:mysql://xxx.xxx.xxx.xxx:3306/sonar?useUnicode=true&characterEncoding=utf8"
export SONAR_DRIVER=-Dsonar.jdbc.driver=com.mysql.jdbc.Driver
export SONAR_DBUSER=-Dsonar.jdbc.username=xxx
export SONAR_DBPASS=-Dsonar.jdbc.password=xxx
export SONAR_URL=-Dsonar.host.url=http://sonar-alc.rhcloud.com
export SONAR_OPTS="$SONAR_JDBC $SONAR_DRIVER $SONAR_DBUSER $SONAR_DBPASS $SONAR_URL"
# Sonar analysis
mvn --global-settings $settingsPath sonar:sonar $SONAR_OPTS
On the execution of the mvn sonar:sonar command, I have the following error:
Can not execute SonarQube analysis: Fail to connect to database: Cannot create PoolableConnectionFactory (Communications link failure
Here is the stacktrace corresponding to this error:
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building ClientEvalcolor 1.0
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- sonar-maven-plugin:2.1:sonar (default-cli) # ClientEvalcolor ---
[INFO] SonarQube version: 3.3.1
[INFO] [03:28:09.324] Create JDBC datasource for jdbc:mysql://xxx.xxx.xxx.xxx:3306/sonar?useUnicode=true&characterEncoding=utf8
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 12.634s
[INFO] Finished at: Mon Nov 25 03:28:10 EST 2013
[INFO] Final Memory: 12M/182M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.codehaus.mojo:sonar-maven-plugin:2.1:sonar (default-cli) on project ClientEvalcolor: Can not execute SonarQube analysis: Fail to connect to database: Cannot create PoolableConnectionFactory (Communications link failure
[ERROR]
[ERROR] The last packet sent successfully to the server was 0 milliseconds ago. The driver has not received any packets from the server.): No route to host
[ERROR] -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException
Build step 'Execute shell' marked build as failure
Finished: FAILURE
I know that an Openshift mysql database isn't accessible from a remote server, but Sonar seems to be runnable on Openshift, and the article that I previously linked successfully did it.
Do you have any idea about how to fix that ?
Thank you,
Alvaro C.
I finally succeeded on making my Jenkins gear send data to my Sonar gear !
I'll explain the solution I found here, maybe it will help some people.
There a three ways to access an Openshift database:
The gear that contains that database can access it easily on localhost:3306. That's the usual case.
From your own computer, you can bind ports (with the rhc tool) in order to access the database. This can't be applied from another gear, and requires the rhc tool to keep running.
Any gear from your account can access the database of a scalable application.
Usage:
When creating the Sonar gear, it's necessary to set the gear as scalable (this can't be done with jenkins/diy gears). Adding a database cartridge to this gear will consume 1 gear, but this database can be accessed from any Openshift application.
Notice that this new database will have a port different than 3306 (in my case, 39536). If you don't have this, that's probably that the embedded app isn't set scalable.
The Jenkins job script that I put in my question is correct. Changing all these "xxxxx" and the port with your database info will permit Jenkins to do his job !

Jenkins/Sonar - new error after server restart

Quick question about sonar/jenkins integration.
First, a little background - we're working on implementing the build pipeline plugin, and last night we had an issue where one of our pipeline jobs lost its history. This took out all of our executors (even on the slaves). I tried renaming and I tried bouncing and that didn't work. Finally, I brought down the master, cleared everything from temp and work in Tomcat, and brought it back up. This fixed the issues with my executors.
So this morning I run a build that runs Sonar as a post-build step. Now I am seeing this error:
[ERROR] Failed to execute goal org.codehaus.mojo:sonar-maven-plugin:2.0:sonar (default-cli) on project VendorProduct: Can not execute Sonar: The current batch process and the configured remote server do not share the same DB configuration.
[ERROR] - Batch side: jdbc:oracle:thin:#dansrzl105si.wellsfargo.com:3203/LBLDFRI1 (QMTDO / *****)
[ERROR] - Server side: check the configuration at http://lpwva3279:9000/sonar/system
[ERROR] -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.codehaus.mojo:sonar-maven-plugin:2.0:sonar (default-cli) on project VendorProduct: Can not execute Sonar
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:217)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:84)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:59)
at org.apache.maven.lifecycle.internal.LifecycleStarter.singleThreadedBuild(LifecycleStarter.java:183)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:161)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:320)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:156)
at org.apache.maven.cli.MavenCli.execute(MavenCli.java:537)
at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:196)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:141)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:290)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:230)
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:409)
at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:352)
Caused by: org.apache.maven.plugin.MojoExecutionException: Can not execute Sonar
at org.codehaus.mojo.sonar.Bootstraper.executeMojo(Bootstraper.java:118)
at org.codehaus.mojo.sonar.Bootstraper.start(Bootstraper.java:65)
at org.codehaus.mojo.sonar.SonarMojo.execute(SonarMojo.java:90)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:101)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:209)
... 19 more
Caused by: org.sonar.core.persistence.BadDatabaseVersion: The current batch process and the configured remote server do not share the same DB configuration.
- Batch side: jdbc:oracle:thin:#dansrzl105si.wellsfargo.com:3203/LBLDFRI1 (QMTDO / *****)
- Server side: check the configuration at http://lpwva3279:9000/sonar/system
[ERROR]
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException
I've verified the configuration against the sonar configuration file, deleted and recreated the post-build step, deleted and recreated the sonar instance on the Jenkins configuration page. I'm at a loss here. Any one have any suggestions?
Thanks!
This message is printed out when a Sonar batch connects to a database which is not the same as the one configured on the Sonar Web server.
In your case, if you go to http://lpwva3279:9000/sonar/system, there are chances that the DB config settings that you'll find are not the same as jdbc:oracle:thin:#dansrzl105si.wellsfargo.com:3203/LBLDFRI1 (QMTDO / *****). You should then go to your Jenkins settings and update the information relating to Sonar to match the one found on the Sonar Web server.
Go to http://host:port/sonar/system:
Copy value "Database URL" into Jenkins configuration ("Database URL")
Copy value "Database Login" into Jenkins configuration ("Database Login")
Copy value "Database Driver" into Jenkins configuration ("Database Driver")
And go to SONAR_HOME/conf/sonar.properties:
Copy value "Database password" into Jenkins configuration ("Database password")