Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Java Script error for certain JSON response #229

Closed
calr opened this issue Jun 22, 2017 · 4 comments
Closed

Java Script error for certain JSON response #229

calr opened this issue Jun 22, 2017 · 4 comments

Comments

@calr
Copy link

calr commented Jun 22, 2017

I'm running into an issue that the Jaeger UI cannot correctly render JSON response after clicking the search button.
The JavaScript error shown is

Uncaught (in promise) TypeError: Cannot read property 'some' of undefined
at http://localhost:16686/static/js/main.aa943a40.js:30:7371
at Array.reduce (native)
at o (http://localhost:16686/static/js/main.aa943a40.js:30:7320)
at http://localhost:16686/static/js/main.aa943a40.js:9:1558
at http://localhost:16686/static/js/main.aa943a40.js:9:994
at f (http://localhost:16686/static/js/main.aa943a40.js:9:1763)
at http://localhost:16686/static/js/main.aa943a40.js:30:7620
at Array.map (native)
at a (http://localhost:16686/static/js/main.aa943a40.js:30:7598)
at http://localhost:16686/static/js/main.aa943a40.js:30:8485

and the JSON response is

{
  "data": [
    {
      "traceID": "2baaf5bc8940d5f2",
      "spans": [
        {
          "traceID": "2baaf5bc8940d5f2",
          "spanID": "2baaf5bc8940d5f2",
          "flags": 1,
          "operationName": "oldSpan",
          "startTime": 1498145353371000,
          "duration": 12562,
          "tags": [
            {
              "key": "sampler.type",
              "type": "string",
              "value": "const"
            },
            {
              "key": "sampler.param",
              "type": "bool",
              "value": true
            }
          ],
          "processID": "p1"
        },
        {
          "traceID": "2baaf5bc8940d5f2",
          "spanID": "c718ee0eed62b453",
          "flags": 1,
          "operationName": "newSpan",
          "references": [
            {
              "refType": "CHILD_OF",
              "traceID": "2baaf5bc8940d5f2",
              "spanID": "2baaf5bc8940d5f2"
            }
          ],
          "startTime": 1498145353373000,
          "duration": 7048,
          "processID": "p2"
        }
      ],
      "processes": {
        "p1": {
          "serviceName": "App2",
          "tags": [
            {
              "key": "jaeger.hostname",
              "type": "string",
              "value": "HOST"
            },
            {
              "key": "jaeger.version",
              "type": "string",
              "value": "Java-0.19.0"
            }
          ]
        },
        "p2": {
          "serviceName": "App1",
          "tags": [
            {
              "key": "jaeger.hostname",
              "type": "string",
              "value": "HOST"
            },
            {
              "key": "jaeger.version",
              "type": "string",
              "value": "Java-0.19.0"
            }
          ]
        }
      }
    }
  ],
  "total": 0,
  "limit": 0,
  "offset": 0,
  "errors": null
}

When there's only a span under a tracer, no error prompts out. I look through the code, it seems that tags was undefined at the time.

const numberOfErredSpans = trace.spans.reduce(
    (total, { tags }) => total + Number(tags.some(isErredTag)),
    0
  );

Is that because of the problem of the JSON format or it may be a potential bug for the UI?

PS. Configuration setting:

Configuration(
        tracerName,
        new Configuration.SamplerConfiguration("const", 1),
        new Configuration.ReporterConfiguration(
          true, "localhost", null, 1000, 10000)
      )

Thanks!

@calr
Copy link
Author

calr commented Jun 22, 2017

Problem solved by attaching a tag on the span. It seems like the JS code expects all spans to have at least a tag.

@calr calr closed this as completed Jun 22, 2017
@yurishkuro
Copy link
Member

Are you using the recent version of Jaeger backend? This issue came up before (https://github.com/uber/jaeger-ui/issues/33) and there was a backend fix (https://github.com/uber/jaeger/pull/195) to ensure that tags are always returned as empty arrays

@calr
Copy link
Author

calr commented Jun 23, 2017

I'm using version 0.19.0 as the Java binding client and the latest all-in-one docker image.

@yurishkuro
Copy link
Member

Can you check the tags on the current image you're using? Sometimes Docker might keep the old version.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants