Syndesis build error: Cannot access cluster for detecting mode - syndesis

When trying to build syndesis I got this error that prevents me to build the images:
[INFO] --- fabric8-maven-plugin:3.5.38:build (build) # meta ---
[INFO] F8: Using OpenShift build with strategy S2I
[WARNING] F8: Cannot access cluster for detecting mode: Failure executing: GET at: https://192.168.42.178:8443/. Message: Unauthorized! Token may have expired! Please log-in again. Unauthorized.
[INFO] F8: Running generator spring-boot
[INFO] F8: spring-boot: Using Docker image fabric8/s2i-java:2.1 as base / builder
[WARNING] F8: Cannot access cluster for detecting mode: Failure executing: GET at: https://192.168.42.178:8443/. Message: Unauthorized! Token may have expired! Please log-in again. Unauthorized.
[ERROR] F8: Failed to execute the build [io.fabric8.kubernetes.client.DefaultKubernetesClient cannot be cast to
io.fabric8.openshift.client.OpenShiftClient]
...
[ERROR] Failed to execute goal io.fabric8:fabric8-maven-plugin:3.5.38:build (build) on project meta: Failed to execute the build: io.fabric8.kubernetes.client.DefaultKubernetesClient cannot be cast to io.fabric8.openshift.client.OpenShiftClient -> [Help 1]
...
Command used to build syndesis: syndesis build -i -f --clean-cache -c

This is because you are logged out from the "oc" command. If you try to use it you will get errors like this one:
$ oc get pods
error: the server doesn't have a resource type "pods"
To fix it, you have to login again:
$ oc login
Authentication required for https://192.168.42.178:8443 (openshift)
Username: developer
Password:
Login successful.
You have access to the following projects and can switch between them with 'oc project <projectname>':
myproject
* syndesis
Using project "syndesis".
If command "oc" is not recognized, you have to setup the environment first:
$ eval $(minishift oc-env)

Related

Maven Error Unknown host repo.maven.apache.org

I am trying to build a docker container using docker-compose build on a CentOS Linux release 8.2.2004. When I execute the command I get the following error message
[ERROR] Plugin org.apache.maven.plugins:maven-javadoc-plugin:3.1.1 or one of its dependencies could not be resolved:
Failed to read artifact descriptor for org.apache.maven.plugins:maven-javadoc-plugin:jar:3.1.1:
Could not transfer artifact org.apache.maven.plugins:maven-javadoc-plugin:pom:3.1.1 from/to central (https://repo.maven.apache.org/maven2):
Transfer failed for https://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-javadoc-plugin/3.1.1/maven-javadoc-plugin-3.1.1.pom:
Unknown host repo.maven.apache.org: Temporary failure in name resolution -> [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/PluginResolutionException
ERROR: Service 'web' failed to build: The command '/bin/sh -c mvn clean package -am -DskipTests -Dmaven.javadoc.skip=true -P deployment' returned a non-zero code: 1
When I build the docker container on my local machine it works just fine. So there is no issue with the container or any configuration within. I have done some research which suggest there might be a proxy problem on the CentOS Server, but echo "$HTTP_PROXY" and echo "$HTTPS_PROXY" return an empty line - thus I suppose there is no proxy used.
Also when I execute curl https://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-javadoc-plugin/3.1.1/maven-javadoc-plugin-3.1.1.pom I get a proper looking xml file.
When I execute curl https://repo.maven.apache.org/maven2I get
<html>
<head><title>302 Moved Temporarily</title></head>
<body>
<h1>302 Moved Temporarily</h1>
<ul>
<li>Code: Found</li>
<li>Message: Resource Found</li>
<li>RequestId: 235378792B04A00C</li>
<li>HostId: b2HKaI47VR5MaiW8bmG9FUGxgZ7u97XeT5Bfm/rs54wVSNjH0hNQsZ2/d4sGaACGboThVlIo5iM=</li>
</ul>
<hr/>
</body>
</html>
curl -L https://repo.maven.apache.org/maven2 shows me a long html document (as intended).
Any help would be greatly appreciated

How to fix ' Error: Invalid or corrupt jarfile /root/.sbt/launchers/1.2.8/sbt-launch.jar'

I was following the tutorial Apache PredictionIO Docker.When I was the step "Build Template"
# pio-docker build --verbose
It went an error.
[root#docker01 MyRecommendation]# pio-docker build --verbose
[INFO] [Engine$] Using command '/usr/share/predictionio/sbt/sbt' at /templates/MyRecommendation to build.
[INFO] [Engine$] If the path above is incorrect, this process will fail.
[INFO] [Engine$] Uber JAR disabled. Making sure lib/pio-assembly-0.13.0.jar is absent.
[INFO] [Engine$] Going to run: /usr/share/predictionio/sbt/sbt package assemblyPackageDependency in /templates/MyRecommendation
[ERROR] [Engine$] Error: Invalid or corrupt jarfile /root/.sbt/launchers/1.2.8/sbt-launch.jar
[ERROR] [Engine$] Return code of build command: /usr/share/predictionio/sbt/sbt package assemblyPackageDependency is 1. Aborting.
[root#docker01 MyRecommendation]#
1.I've made the dirs
/templates/MyRecommendation
,I don't know some how why the command
pio-docker
,always need that dirs,nor the next dirs
templates/MyRecommendation
.My current dirs is
/root/predictionio/docker/templates/MyRecommendation
to execute the command
# pio-docker build --verbose
2.
/usr/share/predictionio/sbt/sbt
That file do not exists,before I made a softlinks to it.now if I execute it ,it works fine.In the original tutorial
Installing with Docker
,it didn't tell you to do it .
You must remove .sbt folder so fixed this error.

Gitlab-runner docker executor trying to download maven dependencies

I've got a gitalb-runner running as a docker container.
This is my failed job for a mvn test command:
Running with gitlab-runner 10.4.0 (857480b6)
on mvn-build (ae93a255)
Using Docker executor with image maven:3.3.9-jdk-8 ...
Using docker image sha256:b4b185fdfd711067c07e8a1df1257645aff2781402dc147e52d9a09636f9a139 for predefined container...
Pulling docker image maven:3.3.9-jdk-8 ...
Using docker image maven:3.3.9-jdk-8 ID=sha256:9997d8483b2fc521a4159feab922546dda0c5c22b5084f86dfab48f123ae4364 for build container...
Running on runner-ae93a255-project-2-concurrent-0 via 49682264df2f...
Fetching changes...
HEAD is now at e197d19 Fixed yml
Checking out e197d191 as dev...
Skipping Git submodules setup
$ echo "Building project with maven"
Building project with maven
$ mvn $MAVEN_OPTS test
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building rest-client
[INFO] ------------------------------------------------------------------------
Downloading: https://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-resources-plugin/2.6/maven-resources-plugin-2.6.pom
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 21.626 s
[INFO] Finished at: 2018-02-21T15:00:07+00:00
[INFO] Final Memory: 9M/118M
[INFO] ------------------------------------------------------------------------
[ERROR] Plugin org.apache.maven.plugins:maven-resources-plugin:2.6 or one of its dependencies could not be resolved: Failed to read artifact descriptor for org.apache.maven.plugins:maven-resources-plugin:jar:2.6: Could not transfer artifact org.apache.maven.plugins:maven-resources-plugin:pom:2.6 from/to central (https://repo.maven.apache.org/maven2): Connect to repo.maven.apache.org:443 [repo.maven.apache.org/151.101.12.215] failed: Connection refused (Connection refused) -> [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/PluginResolutionException
ERROR: Job failed: exit code 1
My question is do I really need to set up a proxy and have an internet connection?
Or there is any other option to provide maven with that missing plugin?
I mention that I've already configured repo mapping in config.toml:
oncurrent = 1
check_interval = 0
[[runners]]
name = "mvn-build"
url = "http://192.168.233.128/"
token = "ae93a255f60d0e1abdb26cc9f72cd5"
executor = "docker"
[runners.docker]
tls_verify = false
image = "maven:3.3.9-jdk-8"
privileged = false
disable_cache = false
volumes = ["/cache","/var/run/docker.sock:/var/run/docker.sock","/root/.m2/repository/:/root/.m2/repository/"]
shm_size = 0
[runners.cache]
The Maven plugins are locally cached in the .m2/repository folder so you can make sure that all the needed plugins and dependencies are available in the /root/.m2/repository/ folder of the server/VM hosting the gitlab-runner. For example by running once the mvn test on the server.
You would probably want to avoid that as any time a dependency is changed you would need to ssh into the build server and update the local Maven cache there.
Considering this, setting up a proxy and internet connection once would not be that bad. Unless you have some other restrictions and/or would like to avoid downloading dependencies from external maven repos.
In this case maybe it is best to setup a maven repository within the organization which caches any external dependencies from Maven central

docker build fails in jhipster

Can someone point me in the right direction for the error below?
I have DOCKER_HOST set (192.168.99.100:2376)
I entered the following command on my windows box:
mvnw package -Pprod docker:build -DskipTests -e
All works fine but, when building the image, I am getting the following error:
[ERROR] Failed to execute goal
com.spotify:docker-maven-plugin:0.4.10:build (default-cli) on project
truup: Exception caught: java.util.concurrent.ExecutionException:
com.spotify.docker.client.shaded.javax.ws.rs.ProcessingException:
org.apache.http.client.ClientProtocolException: The server failed to
respond with a valid HTTP response -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to
execute goal com.spotify:docker-maven-plugin:0.4.10:build
(default-cli) on project truup: Exception caught
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:212)
It sounds like what described at ClientProtocolException (Windows 10 using Docker Toolbox).
Check these environment variables:
set DOCKER_HOST=tcp://192.168.99.100:2376
set DOCKER_MACHINE_NAME=default
set DOCKER_TLS_VERIFY=1
set DOCKER_TOOLBOX_INSTALL_PATH=C:\Program Files\Docker Toolbox
set DOCKER_CERT_PATH=C:\Users\myuserhere.docker\machine\machines\default

Sonar runner Execution failure on Jenkins

I am trying to configure a Sonar Plugin on Jenkins, Executing this SonarJob on jenkins results in an error. The output console does not indicate whats causing this error. Looking for a way to debug this issue.
-Some info on the Setup
->The SonarJob workspace is copied from another Job
-> configured Sonar and Sonar Runner in Jenkins-> Configure System
-> Sonar Build Step is Triggered by "invoke Standalone Sonar Analysis" . The output console log is as follows
Thanks In Advance !
Lokesh
Started by user cheetahb#ca.ibm.com
[EnvInject] - Loading node environment variables.
Building on master in workspace /drv-cheetbld3_1/pipeline/jenkins/jobs/SonarQube1/workspace
Copied 2,820 artifacts from "BI-Pattern_3.0_build" build number 41
[workspace] $ /home/cheetahb/sonarhome/bin/sonar-runner Sonar_5.0_new -Dsonar.jdbc.driver=com.mysql.jdbc.Driver -Dsonar.jdbc.url=jdbc:mysql://9.37.213.8:3306/sonar?useUnicode=true&characterEncoding=utf8&rewriteBatchedStatements=true&useConfigs=maxPerformance ******** ******** -Dsonar.host.url=http:// vottlokesh. ottawa.ibm.com:9000/ -Dsonar.projectBaseDir=/drv-cheetbld3_1/pipeline/jenkins/jobs/SonarQube1/workspace -Dsonar.projectName=biPattern3.0 -Dsonar.projectVersion=1.0 -Dsonar.projectKey=biproject -Dsonar.verbose=true -Dsonar.sources=/drv-cheetbld3_1/pipeline/jenkins/jobs/SonarQube1/workspace
SonarQube Runner 2.4
Java 1.7.0_65 Oracle Corporation (64-bit)
Linux 2.6.32-431.20.5.el6.x86_64 amd64
INFO: Runner configuration file: /home/cheetahb/sonarhome/conf/sonar-runner.properties
INFO: Project configuration file: NONE
INFO: SonarQube Server 5.0
18:23:43.161 INFO - Load global referentials...
18:23:43.181 DEBUG - Download: http:// vottlokesh.ottawa.ibm.com:9000/batch/global (no proxy)
18:23:43.926 INFO - Load global referentials done: 768 ms
18:23:43.932 INFO - User cache: /home/cheetahb/.sonar/cache
18:23:43.947 INFO - Install plugins
18:23:43.947 DEBUG - Download index of plugins
18:23:43.947 DEBUG - Download: http:// vottlokesh.ottawa.ibm.com:9000/deploy/plugins/index.txt (no proxy)
18:23:44.066 INFO - Install JDBC driver
18:23:44.066 DEBUG - Download index of jdbc-driver
18:23:44.067 DEBUG - Download: http:// vottlokesh.ottawa.ibm.com:9000/deploy/jdbc-driver.txt (no proxy)
18:23:44.079 INFO - Create JDBC datasource for jdbc:mysql://9.37.213.8:3306/sonar?useUnicode=true&characterEncoding=utf8&rewriteBatchedStatements=true&useConfigs=maxPerformance
18:23:45.834 DEBUG - Testing JDBC connection
18:23:48.209 DEBUG - Download: http:// vottlokesh.ottawa.ibm.com:9000/api/server (no proxy)
18:23:48.523 INFO - Initializing Hibernate
18:23:48.526 DEBUG - hibernate.generate_statistics: false
18:23:48.527 DEBUG - hibernate.dialect: org.sonar.core.persistence.dialect.MySql$MySqlWithDecimalDialect
18:23:48.527 DEBUG - hibernate.connection.provider_class: org.sonar.jpa.session.CustomHibernateConnectionProvider
18:23:50.751 DEBUG - Loaded 2689 properties from l10n bundles
INFO: ------------------------------------------------------------------------
INFO: EXECUTION FAILURE
INFO: ------------------------------------------------------------------------
Total time: 8.801s
Final Memory: 35M/355M
INFO: ------------------------------------------------------------------------
ERROR: Error during Sonar runner execution
ERROR: Unable to execute Sonar
ERROR: Caused by: Task Sonar_5.0_new does not exist
ERROR:
ERROR: To see the full stack trace of the errors, re-run SonarQube Runner with the -e switch.
ERROR: Re-run SonarQube Runner using the -X switch to enable full debug logging.
Build step 'Invoke Standalone Sonar Analysis' marked build as failure
Finished: FAILURE
You must get rid of the Sonar_5.0_new label that you set on the Task to run field in your Jenkins job configuration.

Resources