fabric8io / fabric8

fabric8 is an open source microservices platform based on Docker, Kubernetes and Jenkins
http://fabric8.io/
1.76k stars 504 forks source link

fabric8 plateform stuck in "save changes" #6391

Open samiaben88 opened 8 years ago

samiaben88 commented 8 years ago

I have an openshift cluster with two nodes, a slave and a master, in this cluster I create a new project and install the latest release of gofabric8 and deploy it, my pods are running well but when I want to clone a project in fabric8 plateform, I get stuck in the same page and I don't get to the "set secrets" page, the forge pods logs that came repeatedly are: Both io.fabric8.forge.rest.RootResource#ping and io.fabric8.forge.rest.RootResource#ping are equal candidates for handling the current request which can lead to unpredictable results

I already have in the same node a working fabric8 in a different project, so I tried to upgrade the version to 2.2.173 and the forge to 2.3.17 and killed the pods but still stuck in the same page. Any ideas please?

samiaben88 commented 8 years ago

I got this error too:

javax.ws.rs.NotFoundException: No BuildConfig for sunseed1/environments at io.fabric8.forge.rest.git.RepositoriesResource.projectRepositoryResource(RepositoriesResource.java:164) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at org.apache.cxf.service.invoker.AbstractInvoker.performInvocation(AbstractInvoker.java:180) at org.apache.cxf.service.invoker.AbstractInvoker.invoke(AbstractInvoker.java:96) at org.apache.cxf.jaxrs.JAXRSInvoker.invoke(JAXRSInvoker.java:189) at org.apache.cxf.jaxrs.JAXRSInvoker.invoke(JAXRSInvoker.java:99) at org.apache.cxf.interceptor.ServiceInvokerInterceptor$1.run(ServiceInvokerInterceptor.java:59) at org.apache.cxf.interceptor.ServiceInvokerInterceptor.handleMessage(ServiceInvokerInterceptor.java:96) at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:308) at org.apache.cxf.transport.ChainInitiationObserver.onMessage(ChainInitiationObserver.java:121) at org.apache.cxf.transport.http.AbstractHTTPDestination.invoke(AbstractHTTPDestination.java:254) at org.apache.cxf.transport.servlet.ServletController.invokeDestination(ServletController.java:234) at org.apache.cxf.transport.servlet.ServletController.invoke(ServletController.java:208) at org.apache.cxf.transport.servlet.ServletController.invoke(ServletController.java:160) at org.apache.cxf.transport.servlet.CXFNonSpringServlet.invoke(CXFNonSpringServlet.java:180) at org.apache.cxf.transport.servlet.AbstractHTTPServlet.handleRequest(AbstractHTTPServlet.java:298) at org.apache.cxf.transport.servlet.AbstractHTTPServlet.doGet(AbstractHTTPServlet.java:222) at javax.servlet.http.HttpServlet.service(HttpServlet.java:687) at org.apache.cxf.transport.servlet.AbstractHTTPServlet.service(AbstractHTTPServlet.java:273) at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:837) at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:583) at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:143) at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:548) at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:226) at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1180) at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:511) at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:185) at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1112) at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:141) at org.eclipse.jetty.server.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:213) at org.eclipse.jetty.server.handler.HandlerCollection.handle(HandlerCollection.java:119) at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:134) at org.eclipse.jetty.server.Server.handle(Server.java:524) at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:319) at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:253) at org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:273) at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:95) at org.eclipse.jetty.io.SelectChannelEndPoint$2.run(SelectChannelEndPoint.java:93) at org.eclipse.jetty.util.thread.strategy.ExecuteProduceConsume.executeProduceConsume(ExecuteProduceConsume.java:303) at org.eclipse.jetty.util.thread.strategy.ExecuteProduceConsume.produceConsume(ExecuteProduceConsume.java:148) at org.eclipse.jetty.util.thread.strategy.ExecuteProduceConsume.run(ExecuteProduceConsume.java:136) at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:671) at org.eclipse.jetty.util.thread.QueuedThreadPool$2.run(QueuedThreadPool.java:589) at java.lang.Thread.run(Thread.java:745)

samiaben88 commented 8 years ago

@jimmidyson @rawlingsj please any help?

samiaben88 commented 8 years ago

I switch from version 2.2.181 to 2.2.173, in fabric8 also in the forge I switch from 2.3.39 to 2.3.17 ( which are the versions that are already working in another machine) but I still get stuck in the saving changes page for the git URL in fabric8 platform. I have this logs in fabric8-forge pod:


ID: 90 Response-Code: 200 Content-Type: application/json Headers: {Content-Type=[application/json], Date=[Fri, 23 Sep 2016 14:27:08 GMT]}

Payload: true

Inbound Message

ID: 91 Address: http://10.1.0.6:8080/_ping Http-Method: GET Content-Type:

Headers: {accept-encoding=[gzip], connection=[close], Content-Type=[null], Host=[10.1.0.6:8080], User-Agent=[Go-http-client/1.1]}

Both io.fabric8.forge.rest.RootResource#ping and io.fabric8.forge.rest.RootResource#ping are equal candidates for handling the current request which can lead to unpredictable results

Outbound Message

ID: 91 Response-Code: 200 Content-Type: application/json Headers: {Content-Type=[application/json], Date=[Fri, 23 Sep 2016 14:27:18 GMT]}

Payload: true

Inbound Message

ID: 92 Address: http://10.1.0.6:8080/_ping Http-Method: GET Content-Type:

Headers: {accept-encoding=[gzip], connection=[close], Content-Type=[null], Host=[10.1.0.6:8080], User-Agent=[Go-http-client/1.1]}

Both io.fabric8.forge.rest.RootResource#ping and io.fabric8.forge.rest.RootResource#ping are equal candidates for handling the current request which can lead to unpredictable results

Outbound Message

ID: 92 Response-Code: 200 Content-Type: application/json Headers: {Content-Type=[application/json], Date=[Fri, 23 Sep 2016 14:27:28 GMT]}

Payload: true

which seems working normaly, please I need help ^^

rawlingsj commented 8 years ago

@samiaben88 ok I think it's going to be best that everything is on the latest version TBH and easier to investigate. Having said that if the console is getting stuck on the same page I wonder if there's any information in the browser javascript console log?

samiaben88 commented 8 years ago

Hi , I get this on the webconsole of the browser:

[Kubernetes] Hiding property: serviceAccount libs-f994e0f7.js:39 [Kubernetes] Hiding property: strategy libs-f994e0f7.js:39 [Kubernetes] Hiding property: triggers https://fabric12.otrux.com:8443/api/v1/namespaces/default/ingresses Failed to load resource: the server responded with a status of 404 (Not Found) libs-f994e0f7.js:39 [k8s-objects] Failed to fetch data while connecting to backend for type: ingresses error: Object (program):35 WebSocket connection to 'wss://fabric12.otrux.com:8443/api/v1/namespaces/default/ingresses?watch=true&access_token=KewCqC9O0Tk7D85UgmxE7EaxIbfw5qBl5kU70vmP_oM' failed: Error during WebSocket handshake: Unexpected response code: 404WrappedWebSocket @ (program):35 https://fabric12.otrux.com:8443/api/v1/namespaces/default/ingresses Failed to load resource: the server responded with a status of 404 (Not Found) fabric12.otrux.com:8443/api/v1/namespaces/default/ingresses:1 GET https://fabric12.otrux.com:8443/api/v1/namespaces/default/ingresses 404 (Not Found) fabric12.otrux.com:8443/api/v1/namespaces/default/ingresses:1 GET https://fabric12.otrux.com:8443/api/v1/namespaces/default/ingresses 404 (Not Found) fabric12.otrux.com:8443/api/v1/namespaces/default/ingresses:1 GET https://fabric12.otrux.com:8443/api/v1/namespaces/default/ingresses 404 (Not Found)

samiaben88 commented 8 years ago

when I click on "saving changes" to get to secrets page , I got :

[Kubernetes] Saving! libs.js:120926 [Kubernetes] sourceSecretName: null libs.js:120926 [Kubernetes] strategyPullSecretName: undefined libs.js:120926 [Kubernetes] { "apiVersion": "v1", "kind": "BuildConfig", "metadata": { "name": "authorization-server2", "labels": {} }, "spec": { "source": { "type": "Git", "sourceSecret": { "name": null }, "git": { "uri": "git@bitbucket.org:myhuong/authorization-server2.git" } }, "strategy": { "type": "Custom", "customStrategy": { "from": { "kind": "DockerImage", "name": "fabric8/openshift-s2i-jenkins-trigger" }, "env": [ { "name": "BASE_URI" }, { "name": "JOB_NAME" } ] } } } } fabric12.otrux.com:8443/oapi/v1/namespaces/default/buildconfigs:1 POST https://fabric12.otrux.com:8443/oapi/v1/namespaces/default/buildconfigs 422 (status code 422)

jimmidyson commented 8 years ago

422 is a validation error IIRC. If you check in the web console you should be able to see what the error actually is - the console should check this & display to user but obviously it's not doing that yet.

samiaben88 commented 8 years ago

what can I do to fix this ?

jimmidyson commented 8 years ago

If you can look at the web console's network tab & tell us the error in the 422 response then that might give us more of an idea what's wrong.

samiaben88 commented 8 years ago

image

jimmidyson commented 8 years ago

So if you click on the requests with 422 status then you should be able to see the response payload which will hopefully give us more info.

samiaben88 commented 8 years ago

Ah ok :

{kind: "Status", apiVersion: "v1", metadata: {}, status: "Failure",…} apiVersion : "v1" code : 422 details : {name: "authorization-server2", kind: "BuildConfig",…} kind : "Status" message : "BuildConfig "authorization-server2" is invalid: spec.source.sourceSecret.name: Required value" metadata : {} reason : "Invalid" status : "Failure"

jimmidyson commented 8 years ago

So that gives us the error... now I have no idea why it's not set tbh - @jstrachan, @rawlingsj?

samiaben88 commented 8 years ago

image image

samiaben88 commented 8 years ago

And this is the response :

image

rawlingsj commented 8 years ago

can you expand the details section? in https://github.com/fabric8io/fabric8/issues/6391#issuecomment-250134104 hopefully that gives us the request.

samiaben88 commented 8 years ago

@rawlingsj done :+1:

jimmidyson commented 8 years ago

The error above shows: BuildConfig "authorization-server2" is invalid: spec.source.sourceSecret.name: Required value"

samiaben88 commented 8 years ago

how can I resolve this ?

rawlingsj commented 8 years ago

I'm not sure what this BuildConfig "authorization-server2" is or where it's coming from but the error is saying that it's missing the source secret name. Is this an existing buildconfig you have in openshift or a project you've previously created or trying to create with fabric8?

On the CLI can you see that build config in your fabric8 project?

oc get bc authorization-server2

Do you have a source secret already set up for cloning projects? If you do you could try and edit the build config manually and add try to add in your source secret

oc edit bv 

These are some docs from the openshift site that might help when adding a source secret name:

https://docs.openshift.com/enterprise/3.1/dev_guide/builds.html

Add a sourceSecret field to the source section inside the BuildConfig and set it to the name of the secret that you created. In this case basicsecret:

apiVersion: "v1"
kind: "BuildConfig"
metadata:
  name: "sample-build"
spec:
  output:
    to:
      kind: "ImageStreamTag"
      name: "sample-image:latest"
  source:
    git:
      uri: "https://github.com/user/app.git" 
    sourceSecret:
      name: "basicsecret"
    type: "Git"
  strategy:
    sourceStrategy:
      from:
        kind: "ImageStreamTag"
        name: "python-33-centos7:latest"
    type: "Source"
samiaben88 commented 8 years ago

oc get bc authorization-server2 Error from server: buildconfigs "authorization-server2" not found [root@fabric12 ~]# oc edit bv the server doesn't have a resource type "bv"

Authorizathion-server2 is the project that i'm triying to get from my bitbucket using fabric8, also something juste happend now, without me trying anythig Iit juste works once, but when I tried again it gives me a different error 404 ( look at the image)

image

image

rawlingsj commented 8 years ago

Ok my initial oc edit bv was a typo and should have been oc edit bc but that doesn't matter as the authorization-server2 buildconfig (bc) wasn't found anyhow.

So you've managed to successfully import the project now?

That error about jenkinshift is not a problem and think it's verbose logging as we dont deploy it on openshift, jenkinshift is for kubernetes only.

So in the fabric8 console, you have an imported project? Are things ok now?

samiaben88 commented 8 years ago

things are really not okey, because, the project I import is juste à test project, and I need the platform to work normaly like it does ( in my other node machines) in your point of view what can really cause this problem? how can I make it work? Thank u

rawlingsj commented 8 years ago

@samiaben88 ok so I think this issue is becoming a bit confused. Lets take a step back, I'm not clear what problem you are currently having.

If there's more than one problem maybe add them as bullet points so that it helps to gain a better understanding. Also can you list any steps to recreate as well as any extra context you can think of to help us get a better idea if what's going on please?

samiaben88 commented 8 years ago

Ok I'll start from the begining:

The project deployment requires 2 KVM using centos 7.2 . A third host whatever the os is used to run the ansible scripts . We will name those machines KVM1 (master.exemple.com), KVM2 (slave.exemple.com) and ansibleHost (ansibleHost.exemple.com)

Install ansible Connect on the ansibleHost (in this case ubuntu 15.04) Install ansible. The ansible version installed from the default Ubuntu 15.04 is version 1.7.2 and we need version 2.1.1 so , it is necessary to point to other repositories holding the latest ansible version: $ sudo apt-get install software-properties-common $ sudo apt-add-repository ppa:ansible/ansible $ sudo apt-get update $ sudo apt-get install ansible

2-clone the project XXX Editor le script ansible :hosts: The ansible script hosts running on ansibleHost needs to be able to connect to the KVM1 and KVM2 , using ssh keys which need to be created: In ansibleHost create an Ssh key

$ ssh-keygen –t rsa Enter file in which to save the key (/home/demo/.ssh/id_rsa): Enter passphrase (empty for no passphrase):

Then copy the public key into the two other machine (KVM1 and KVM2) $ ssh-copy-id master.exemple.com (in KVM1)) $ ssh-copy-id slave.exemple.com (in KVM2) $ git clone https://github.com/openshift/openshift-ansible.git $ ansible-playbook -i ./hosts openshift-ansible/playbooks/byo/config.yml

Once the cluster is ready, we need to define a cluster admin user which will have access to the GUI of openshift and fabric8 and perform all required configuration steps, in KVM1 (the master) : $ htpasswd -c /etc/origin/master/htpasswd To grant all access to that user, we first log as a user that has cluster admin permissions: $ oc login -u system:admin And $ oadm policy add-cluster-role-to-user cluster-admin Verify that the newly defined user is able to connect and access openshift gui $oc login

After That i install gofabric8 using this git https://github.com/fabric8io/gofabric8 And I got this problem, but I already did that before and never face that issue. My openshift is 1.2.1 , fabric8 the release 0.72
samiaben88 commented 8 years ago

Anyy idea of what could happen? did I miss something?

rawlingsj commented 8 years ago

And I got this problem, but I already did that before and never face that issue.

@samiaben88 sorry the bit I'm not understanding is I'm not clear what 'this problem' is.

Authorizathion-server2 is the project that i'm trying to get from my bitbucket using fabric8, also something juste happend now, without me trying anythig Iit juste works once, but when I tried again it gives me a different error 404 ( look at the image)

You mentioned that you were able to import the project so I thought things were ok. Importing a second time causes an error, what error?

@jstrachan on openshift this error here https://github.com/fabric8io/fabric8/issues/6391#issuecomment-250148621 is it a bug or just extra logging that's not needed because jenkinshift is just a kubernetes thing?

samiaben88 commented 8 years ago

Now I'm getting to the 402 error again. It juste happen that it works one time (I can't say its magical ) after that I return to the same error 402. When I go the app created in fabric8 it tells me that I created it 4 days ago ??!! but I just did. It just happened once after that it stoped working. Please any ideas to help me

rawlingsj commented 8 years ago

Should it be a clean project? Do you have any other build configs in the project?

oc get buildconfigs
samiaben88 commented 8 years ago

The only buildconfig i have is the one that get created few hours ago:

[root@fabric12 ~]# oc get buildconfigs NAME TYPE FROM LATEST mosquitto Custom fabric8/openshift-s2i-jenkins-trigger 0

samiaben88 commented 8 years ago

Do I have to set a gogs secret before "importing from git" ? and if its the case, what default secret can a put? Thank you

samiaben88 commented 8 years ago

I've juste give the link of fabric8 to another personne, he make it work once from his computer, after that it stoped working again?! this is happening for all the fabric8 version and Gofabric8 release that I put , I'm still switching from 404 error to 402 error authomatically, like it's instable

K0zka commented 6 years ago

If you use generic methods or the compiler generates synthetic methods in your resource classes for any other reasons, then this may be relevant for you

https://github.com/apache/cxf/pull/388 https://issues.apache.org/jira/browse/CXF-7670