openzipkin / zipkin

Zipkin is a distributed tracing system
https://zipkin.io/
Apache License 2.0
16.84k stars 3.07k forks source link

404 Not found /app-...-min.js and /app-...-min.css #2153

Closed felodel closed 5 years ago

felodel commented 5 years ago

Hello,

I deployed zipkin on kubernetes but when i try to access to zipkin, it not found:

https://hostname/zipkin/app-6a05bdd92a449a6ee72a.min.js timestamp 2018-08-01T09:31:28.410+0000
status 404
error Not Found
message Not Found
path /app-6a05bdd92a449a6ee72a.min.js
https://hostname/zipkin/app-6a05bdd92a449a6ee72a.min.css timestamp 2018-08-01T09:31:28.410+0000
status 404
error Not Found
message Not Found
path /app-6a05bdd92a449a6ee72a.min.css

https://hostname/zipkin/zipkin/config.json environment | "" queryLimit | 10 defaultLookback | 3600000 instrumented | ".*" logsUrl | null basepath | "/zipkin" searchEnabled | true dependency |   lowErrorRate | 0.5 highErrorRate | 0.75

my k8s ingress: { "path": "/zipkin", "backend": { "serviceName": "zipkin-service", "servicePort": 9411 } },

In local with docker, It runs correctly.

Thank you for your time.

codefromthecrypt commented 5 years ago

does this help you? https://github.com/openzipkin/zipkin/issues/1930#issuecomment-373335942

On Wed, Aug 1, 2018 at 5:52 PM, Fede López notifications@github.com wrote:

Hello,

I deployed zipkin on kubernetes but when i try to access to zipkin, it not found:

  • app-6a05bdd92a449a6ee72a.min.css
  • app-6a05bdd92a449a6ee72a.min.js
https://devel.fermax.cloud/zipkin/app-6a05bdd92a449a6ee72a.min.js timestamp 2018-08-01T09:31:28.410+0000
status 404
error Not Found
message Not Found
path /app-6a05bdd92a449a6ee72a.min.js
https://devel.fermax.cloud/zipkin/app-6a05bdd92a449a6ee72a.min.css timestamp 2018-08-01T09:31:28.410+0000
status 404
error Not Found
message Not Found
path /app-6a05bdd92a449a6ee72a.min.css

https://devel.fermax.cloud/zipkin/zipkin/config.json environment | "" queryLimit | 10 defaultLookback | 3600000 instrumented | ".*" logsUrl | null basepath | "/zipkin" searchEnabled | true dependency | lowErrorRate | 0.5 highErrorRate | 0.75

my k8s ingress: { "path": "/zipkin", "backend": { "serviceName": "zipkin-service", "servicePort": 9411 } },

In local with docker, It runs correctly.

Thank you for your time.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/openzipkin/zipkin/issues/2153, or mute the thread https://github.com/notifications/unsubscribe-auth/AAD616bncm3vqz6FhajjSg-CazpymJOdks5uMXpDgaJpZM4VqMTY .

felodel commented 5 years ago

Hello Adrian,

Thank you for your help.

I have already tried:

     - name: ZIPKIN_UI_BASEPATH
       value: "/zipkin/zipkin

I check that the env parameter is set. I check it in /zipkin/env :

ZIPKIN_UI_BASEPATH | "/zipkin/zipkin"

Nevertheless, zipkin don´t work.

I find a workaround to solve it: https://github.com/knikitin/zipkin/commit/6330e767167669e35ad38e3fd7adffab00100d15

Using that docker image: knikitin/zipkin-service

But, that docker image is old (two years ago) and when I try to regiter my application in zipkin with:

spring.zipkin.baseUrl= http://zipkin-service:9411 spring.sleuth.sampler.percentage= 0.2

My application don´t connect with zipkin.

I only want a zipkin in memory storage.

Any solution ?

Thank you for your time. :)

codefromthecrypt commented 5 years ago

@zeagord do you have any hints or kubernetes deployment advice for this?

felodel commented 5 years ago

Adrian,

Do you now how I can generate a new image from https://github.com/openzipkin/zipkin where I modify zipkin-ui/js files?

like this commit: https://github.com/knikitin/zipkin/commit/6330e767167669e35ad38e3fd7adffab00100d15

My problem is that there are zipkin-ui and zipkin-server with each poms, so I want a docker image with those changes and las version zipkin.

is It possible? do you have a dockerfile to generate a image?

codefromthecrypt commented 5 years ago

firstly, that is indeed an old change.

Next, this is a relative URL https://github.com/openzipkin/zipkin/blob/master/zipkin-ui/js/component_data/default.js#L49

I do believe there is something wrong with your setup if relative links aren't resolving properly.

zeagord commented 5 years ago

Can you try set the base path to/? I'm using like the below one in the latest zipkin version and found no problems.

{
  "path": "/",
  "backend": {
  "serviceName": "zipkin-service",
  "servicePort": 9411
}
felodel commented 5 years ago

Helli @zeagord

I tried that solution:

        {
          "path": "/zipkin",
          "backend": {
            "serviceName": "zipkin-service",
            "servicePort": 9411
          }
        }

But, it doesn´t work.

I only solve with https://github.com/knikitin/zipkin/commit/6330e767167669e35ad38e3fd7adffab00100d15

But my application doesn´t connect with zipkin.

So I want to create a new zipkin-ui docker image with relative url changes, but:

That are my service and deployment on k8s:

apiVersion: v1 kind: Service metadata: name: zipkin-service spec: ports:


Deployment

apiVersion: apps/v1 # for versions before 1.9.0 use apps/v1beta2 kind: Deployment metadata: name: zipkin-deployment spec: selector: matchLabels: app: zipkin replicas: 1 # tells deployment to run 2 pods matching the template template: # create pods using pod definition in this template metadata: labels: app: zipkin spec: containers:

felodel commented 5 years ago

any solution ? could you tell me how I can generate my own image zipkin from: https://github.com/openzipkin/zipkin?

I could change code as https://github.com/knikitin/zipkin/commit/6330e767167669e35ad38e3fd7adffab00100d15 and to make a new image.

Or also I have thought that I could modify zipkin-server-shared.yml (base-path param), to set base-path: /zipkin/zipkin and remake a image.

What do you think about that?

Thank you for your time.

zeagord commented 5 years ago

Small tip. Wrap the deployment script with ```. So that it will be readable.

Try the below deployment script. I assume you're using Minkube. If that's true. Enable the ingress by minikube addons enable ingress. If not you have choose a ingress controller.

apiVersion: v1
kind: Service
metadata:
  namespace: default
  name: zipkin-service
spec:
  ports:
    - port: 9411
  selector:
    app: zipkin

---

apiVersion: extensions/v1beta1
kind: Deployment
metadata:
  namespace: default
  name: zipkin
spec:
  replicas: 2
  selector:
    matchLabels:
      app: zipkin
  template:
    metadata:
      labels:
        app: zipkin
    spec:
      containers:
      - name: zipkin
        image: openzipkin/zipkin
      readinessProbe:
        httpGet:
        path: "/actuator/health"
        port: 9411
        initialDelaySeconds: 5

---

apiVersion: extensions/v1beta1
kind: Ingress
metadata:
  name: zipkin-ingress
  annotations:
    kubernetes.io/ingress.allow-http: "true"
spec:
  backend:
    serviceName: zipkin-service
    servicePort: 9411
felodel commented 5 years ago

I have my own ingress:

        {
          "path": "/zipkin",
          "backend": {
            "serviceName": "zipkin-service",
            "servicePort": 9411
          }
        },

and when I request: https://hostname/zipkin to carry on the same error with js and css

This is my ingress:

{ "kind": "Ingress", "apiVersion": "extensions/v1beta1", "metadata": { "name": "gateway-ingress", "namespace": "default", "selfLink": "/apis/extensions/v1beta1/namespaces/default/ingresses/gateway-ingress", "uid": "ee983f7f-544e-11e8-a23a-005056941e4e", "resourceVersion": "10060924", "generation": 111, "creationTimestamp": "2018-05-10T12:37:42Z", "annotations": { "ingress.kubernetes.io/secure-backends": "true", "ingress.kubernetes.io/ssl-redirect": "false", "kubernetes.io/ingress.class": "nginx", "nginx.ingress.kubernetes.io/add-base-url": "true", "nginx.ingress.kubernetes.io/rewrite-target": "/" } }, "spec": { "backend": { "serviceName": "default-http-backend", "servicePort": 80 }, "tls": [ { "hosts": [ "HOSTNAME" ], "secretName": "tls-secret" } ], "rules": [ { "host": "HOSTNAME", "http": { "paths": [ { "path": "/device", "backend": { "serviceName": "deviceservice-service", "servicePort": 7083 } }, { "path": "/pairing", "backend": { "serviceName": "pairingservice-service", "servicePort": 15248 } }, { "path": "/frontendwebapps", "backend": { "serviceName": "frontendwebapps-service", "servicePort": 7090 } }, { "path": "/zipkin", "backend": { "serviceName": "zipkin-service", "servicePort": 9411 } }, { "path": "/config", "backend": { "serviceName": "fermaxconfigcloud-service", "servicePort": 8888 } }, { "path": "/", "backend": { "serviceName": "oauth2service-service", "servicePort": 8090 } }, { "path": "/admin", "backend": { "serviceName": "fermaxadmincloud-service", "servicePort": 1111 } }, { "path": "/user", "backend": { "serviceName": "userservice-service", "servicePort": 15245 } }, { "path": "/provisioning", "backend": { "serviceName": "provisioningfermaxservice-service", "servicePort": 8889 } }, { "path": "/emma", "backend": { "serviceName": "emmafront-service", "servicePort": 7082 } }, { "path": "/emmaback", "backend": { "serviceName": "emmaback-service", "servicePort": 7081 } }, { "path": "/emu", "backend": { "serviceName": "emufront-service", "servicePort": 7085 } }, { "path": "/twinchangehandler", "backend": { "serviceName": "twinchangehandlerservice-service", "servicePort": 15250 } }, { "path": "/emuback", "backend": { "serviceName": "emuback-service", "servicePort": 7093 } } ] } } ] }, "status": { "loadBalancer": { "ingress": [ {} ] } } }

How can I user zipkin-ingress to request zipkin ?

Thank you for your help @zeagord

zeagord commented 5 years ago

I honestly think, this is not a Zipkin issue since it has nothing to do it. It is more specific on how you design your ingress or routes. It should be a question that might be suit well for stackoverflow or kubernetes.

felodel commented 5 years ago

But the others services work ok, only zipkin doesn´t work. And when https://github.com/knikitin/zipkin/commit/6330e767167669e35ad38e3fd7adffab00100d15 css and js is found. So If I change zipkin, zipkin will work.

If I user https://github.com/knikitin/zipkin/commit/6330e767167669e35ad38e3fd7adffab00100d15 my appications aren´t registered on zipkin.

so I think, I need zipkin with changes in zipkin-ui or zipkin-server-shared.yml.

anyway, i will open a question on stackoverflow.

Thank you for your help @zeagord

anyway, how can I use zipkin-ingress to use zipkin ?

codefromthecrypt commented 5 years ago

Fede you are referring to a very old commit. Also, there are several others who have k8s ingress working.

Until what you are referring to is verified by another person as a current problem, there's nothing we would change here.

Raja has tried his best to help, and there are others who are working at the moment as well. Sorry that your configuration doesn't work. I'd recommend starting with what raja or others have. If not, and you feel like you must change the UI, then you'd have to overlay with your own assets.

For now, we'll close the issue until another verifies this.. hope you understand.