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

Tag based search in Jaeger UI is not finding spans when Badger storage is used. #1882

Closed
aachinfiev opened this issue Oct 28, 2019 · 42 comments
Labels
storage/badger Issues related to badger storage

Comments

@aachinfiev
Copy link

Requirement - what kind of business use case are you trying to solve?

Tag based search in Jaeger UI is not finding spans when Badger storage is used.

Problem - what in Jaeger blocks you from solving the requirement?

Tag search in Jaeger UI not finding spans based on tags when badger plugin is used for storage across given time range. I have a series of traces recorded for different hosts and specifying hostname or custom tag that was done within last couple hours locates the span, but it doesn't find anything that was done earlier in the day.

Looking through the code for the plugin it seems like it should be creating an index and storage for all the tags in the plugin and therefore searchable for a given service and operation. However selecting item from UI with correct settings doesn't find the right traces.

Proposal - what do you suggest to solve the problem or improve the existing situation?

I suspect the bug is in the plugin itself (either writer or reader) because when you use memory storage search works properly. I think plugin should allow searching across the full built index (scoped to time range) and find all the traces even if they are stored on disk and not just memory.

Any open questions to address

Just wanted to figure out if there is some undocumented behavior such as only doing search across traces in memory rather than storage or this is something that's not working and should be.

@objectiser objectiser transferred this issue from jaegertracing/jaeger-ui Oct 29, 2019
@objectiser
Copy link
Contributor

@aachinfiev Thanks for reporting the issue - I've moved it to the main jaeger repo as it is more related to the backend than the UI. What version are you using? How are you deploying the backend?

@burmanm Any thoughts on what might be happening?

@burmanm
Copy link
Contributor

burmanm commented Oct 29, 2019

Version of jaeger? What kind of tags are not found? "but it doesn't find anything that was done earlier in the day."

How long back did you search and how far is the TTL? If the tags finding works for short period of time, then probably either one of those is in error.

@aachinfiev
Copy link
Author

Thank you guys for a quick response.

I am running jaeger all-in-one binary version 1.13 on windows server 2016. Badger is configured using

      SPAN_STORAGE_TYPE: "badger"
      BADGER_EPHEMERAL: "false"
      BADGER_DIRECTORY_VALUE: "/badger/data"
      BADGER_DIRECTORY_KEY: "/badger/key"

Tag types: I tried using custom tags (e.g. build.info) as well as tags using Process area (e.g. hostname). Hostname doesn't seem to filter by at all. Not sure if that's supported.

I reran my search and saw that anything longer than about 2.5 hours it stops finding by a tag even though I am seeing the span when no filter is provided. I select the same service & operation in the search window which the tag is applied on in the span view. If I use tag from the earlier span it locates it, but if I use tag from older span it doesn't. Same tag just different value.

I did not alter any TTL from default. Not sure even how that can be configured.

Is there some sort of a default in a plugin that could tell it over which time period things are being indexed?

@burmanm
Copy link
Contributor

burmanm commented Oct 30, 2019

Would it be possible to update to 1.14 and see if that still happens?

@aachinfiev
Copy link
Author

I just updated to 1.14, removed the whole previous storage I had and started new service.

Now I am seeing index problems even for something that completed 4min ago. I did a trace and then tried to find it by tag or process. I had 4 traces within 5min interval. Some spans get located with hostname filter, others do not. No spans were located by tag value. I tired again after another 10min and still it's not finding by tags at all.

When I look at the storage folder structure with data/key folders, I see pre-allocated data folder of 2gb with lock file, but for index folder I don't see any data files beside LOCK/MANIFEST. It seems like it's not creating any indices on disk.

When I ran the all-in-one in console once it stated that Archive index was not initialized even though it created the storage folders. Do I need to configure something for badger or jaeger to make it index?

@aachinfiev
Copy link
Author

Here is output from startup phase:


2019/10/30 17:05:29 maxprocs: Leaving GOMAXPROCS=8: CPU quota undefined
{"level":"info","ts":1572469529.3300807,"caller":"flags/service.go:115","msg":"Mounting metrics handler on admin server","route":"/metrics"}
{"level":"info","ts":1572469529.3300807,"caller":"flags/admin.go:108","msg":"Mounting health check on admin server","route":"/"}
{"level":"info","ts":1572469529.3300807,"caller":"flags/admin.go:114","msg":"Starting admin HTTP server","http-port":14269}
{"level":"info","ts":1572469529.3300807,"caller":"flags/admin.go:100","msg":"Admin server started","http-port":14269,"health-status":"unavailable"}
{"level":"info","ts":1572469529.3460834,"caller":"badger/factory.go:133","msg":"Badger storage configuration","configuration":{"Dir":"C:\\jaeger\\storage\\key","ValueDir":"C:\\jaeger\\storage\\data","SyncWrites":false,"TableLoadingMode":2,"ValueLogLoadingMode":2,"NumVersionsToKeep":1,"MaxTableSize":67108864,"LevelSizeMultiplier":10,"MaxLevels":7,"ValueThreshold":32,"NumMemtables":5,"NumLevelZeroTables":5,"NumLevelZeroTablesStall":10,"LevelOneSize":268435456,"ValueLogFileSize":1073741824,"ValueLogMaxEntries":1000000,"NumCompactors":3,"DoNotCompact":false,"ReadOnly":false,"Truncate":false}}
{"level":"info","ts":1572469529.3460834,"caller":"static/strategy_store.go:79","msg":"No sampling strategies provided, using defaults"}
{"level":"info","ts":1572469529.351084,"caller":"grpc/builder.go:108","msg":"Agent requested insecure grpc connection to collector(s)"}
{"level":"info","ts":1572469529.351084,"caller":"grpc/clientconn.go:242","msg":"parsed scheme: \"\"","system":"grpc","grpc_log":true}
{"level":"info","ts":1572469529.351084,"caller":"grpc/clientconn.go:248","msg":"scheme \"\" not registered, fallback to default scheme","system":"grpc","grpc_log":true}
{"level":"info","ts":1572469529.351084,"caller":"grpc/resolver_conn_wrapper.go:113","msg":"ccResolverWrapper: sending update to cc: {[{127.0.0.1:14250 0  <nil>}] }","system":"grpc","grpc_log":true}
{"level":"info","ts":1572469529.351084,"caller":"base/balancer.go:76","msg":"base.baseBalancer: got new resolver state: {[{127.0.0.1:14250 0  <nil>}] }","system":"grpc","grpc_log":true}
{"level":"info","ts":1572469529.351084,"caller":"base/balancer.go:130","msg":"base.baseBalancer: handle SubConn state change: 0xc0001f4040, CONNECTING","system":"grpc","grpc_log":true}
{"level":"info","ts":1572469529.352081,"caller":"all-in-one/main.go:199","msg":"Starting agent"}
{"level":"info","ts":1572469529.352081,"caller":"app/agent.go:69","msg":"Starting jaeger-agent HTTP server","http-port":5778}
{"level":"info","ts":1572469529.3540843,"caller":"all-in-one/main.go:242","msg":"Starting jaeger-collector TChannel server","port":14267}
{"level":"info","ts":1572469529.3540843,"caller":"grpcserver/grpc_server.go:102","msg":"Starting jaeger-collector gRPC server","grpc-port":"14250"}
{"level":"info","ts":1572469529.3540843,"caller":"all-in-one/main.go:260","msg":"Starting jaeger-collector HTTP server","http-port":14268}
{"level":"info","ts":1572469529.3540843,"caller":"querysvc/query_service.go:130","msg":"Archive storage not created","reason":"archive storage not supported"}
{"level":"info","ts":1572469529.3540843,"caller":"all-in-one/main.go:342","msg":"Archive storage not initialized"}
{"level":"info","ts":1572469529.355084,"caller":"healthcheck/handler.go:130","msg":"Health Check state change","status":"ready"}
{"level":"info","ts":1572469529.355084,"caller":"app/server.go:112","msg":"Starting HTTP server","port":16686}
{"level":"info","ts":1572469529.355084,"caller":"app/server.go:125","msg":"Starting GRPC server","port":16686}
{"level":"info","ts":1572469529.355084,"caller":"app/server.go:135","msg":"Starting CMUX server","port":16686}

@aachinfiev
Copy link
Author

After a few more traces I see *.sst file in the key folder. Seems like index is being built but not consistently. Some spans are found using tags and other are not.

@burmanm
Copy link
Contributor

burmanm commented Oct 31, 2019

.sst files are generated when memtable flush or compaction happens. The data is first written to memory and the WAL log, so this sounds normal.

I haven't been able to replicate your disappearing issue yet though. Any chance you could provide examples (query + spans) ?

@pavolloffay pavolloffay added the storage/badger Issues related to badger storage label Oct 31, 2019
@aachinfiev
Copy link
Author

I created a sample test:

Recorded couple spans:

image

Viewed top span to make sure it has a tag

image

Then tried to search spans using the tag while all operation was selected

image

Then tried to select specific operation

image

The span JSON piece that has the tag looks like this

{
  traceID: "d935a1881764776d",
  spanID: "d935a1881764776d",
  flags: 1,
  operationName: "do-magic",
  references: [],
  startTime: 1572533442416932,
  duration: 546581,
  tags: [
    {
      key: "build.version",
      type: "int64",
      value: 2
    },
    {
      key: "sampler.type",
      type: "string",
      value: "const"
    },
    {
      key: "sampler.param",
      type: "bool",
      value: true
    },
    {
      key: "internal.span.format",
      type: "string",
      value: "proto"
    }
  ],
  logs: [],
  processID: "p1",
  warnings: null
};

In this case it was using int64 for the parameter. But I had same issues with strings.

URL used during the search is:

/search?end=1572533751929000&limit=20&lookback=12h&maxDuration&minDuration&operation=do-magic&service=test-handler&start=1572490551929000&tags=%7B"build.version"%3A"2"%7D

@aachinfiev
Copy link
Author

Here is a sample program I ran in LinqPad. I left minimal details in it:

async Task Main()
{
	using (var loggerFactory = new LoggerFactory().AddConsole())
	using (var tracer = InitTracer("test-handler", loggerFactory))
	{
		var ecd = new TestHandler(tracer, loggerFactory);
		await ecd.DoMagic();
	}
}

private static Tracer InitTracer(string serviceName, ILoggerFactory loggerFactory)
{
	var samplerConfiguration = new Jaeger.Configuration.SamplerConfiguration(loggerFactory)
		.WithType(ConstSampler.Type)
		.WithParam(1);

	var senderConfiguration = new Jaeger.Configuration.SenderConfiguration(loggerFactory)
		.WithAgentHost("XX.XX.XX.XX");

	var reporterConfiguration = new Jaeger.Configuration.ReporterConfiguration(loggerFactory)
		.WithSender(senderConfiguration)
		.WithLogSpans(true);

	return (Tracer)new Jaeger.Configuration(serviceName, loggerFactory)
		.WithSampler(samplerConfiguration)
		.WithReporter(reporterConfiguration)
		.GetTracer();
}

class TestHandler
{
	ITracer _tracer;
	ILogger<TestHandler> _logger;

	public TestHandler(ITracer tracer, ILoggerFactory loggerFactory)
	{
		_tracer = tracer;
		_logger = loggerFactory.CreateLogger<TestHandler>();
	}

	public async Task DoMagic()
	{
		var span =_tracer.BuildSpan("do-magic").WithTag("build.version", 2).WithTag("build.name", "test-build");
		using (var scope = span.StartActive(true))
		{
			var data = await GetData();
		}
	}

	private async Task<(int, int)> GetData()
	{
		using (var scope = _tracer.BuildSpan("get-data").StartActive(true))
		{
			await Task.Delay(100);
			return (3, 5);
		}
	}
}

I tested build.version and build.name tags (int, string) and it wasn't finding those either.

@The-Alchemist
Copy link
Contributor

I can confirm I'm also seeing this issue with v1.14.

$ docker run \                                                                                                             
                     -e SPAN_STORAGE_TYPE=badger \
                     -e BADGER_EPHEMERAL=false \
                     -e BADGER_DIRECTORY_VALUE=/badger/data \
                     -e BADGER_DIRECTORY_KEY=/badger/key \
                     -v `pwd`/badger:/badger \
                     -p 16686:16686 \
                     -p6831:6831/udp \
                     -d \
                     --name jaeger \
                     --rm \
                     jaegertracing/all-in-one:1.14

It's strangely inconsistent: sometimes searching by tag works, sometimes it doesn't. Trying to get a consistent test case to reproduce, and I'll report back.

P.S. Jaeger is using Badger 1.5.3. Perhaps it's worth upgrading to 1.5.5? I realize upgrading to 1.6.0 is a no-go because of #1884 .

@The-Alchemist
Copy link
Contributor

The-Alchemist commented Nov 1, 2019

UPDATE: Steps to reproduce:

  1. Create a span with a tag like alice=1
    span->SetTag("alice", 1);
  2. Search alice=1 works.
  3. Create a span with a tag like alice=11
    span->SetTag("alice", 11);
  4. Span with tag alice=11 will NOT be found (however, alice=1 is still found)

Based on this scenario, the issue might be the way that tags are marshaled and then queried.

Nothing sticks out to me, but I'm still learning Go. Maybe someone else has a better eye? @burmanm

@burmanm
Copy link
Contributor

burmanm commented Nov 1, 2019

I wonder if this is some sort of Windows issue. I tried this with a unit test (as described in your comment):

func TestIssue1882(t *testing.T) {
	runFactoryTest(t, func(tb testing.TB, sw spanstore.Writer, sr spanstore.Reader) {
		s1 := model.Span{
			TraceID: model.TraceID{
				Low:  rand.Uint64(),
				High: 0,
			},
			SpanID: model.SpanID(rand.Uint64()),
			Process: &model.Process{
				ServiceName: "issue",
			},
			Tags: model.KeyValues{
				model.KeyValue{
					Key:    "alice",
					VInt64: 1,
					VType:  model.Int64Type,
				},
			},
			StartTime: time.Now(),
			Duration:  1 * time.Second,
		}
		err := sw.WriteSpan(&s1)
		assert.NoError(t, err)

		s2 := model.Span{
			TraceID: model.TraceID{
				Low:  rand.Uint64(),
				High: 0,
			},
			SpanID: model.SpanID(rand.Uint64()),
			Process: &model.Process{
				ServiceName: "issue",
			},
			Tags: model.KeyValues{
				model.KeyValue{
					Key:    "alice",
					VInt64: 11,
					VType:  model.Int64Type,
				},
			},
			StartTime: time.Now(),
			Duration:  1 * time.Second,
		}
		err = sw.WriteSpan(&s2)
		assert.NoError(t, err)

		params := &spanstore.TraceQueryParameters{
			StartTimeMin: time.Now().Add(-1 * time.Minute),
			StartTimeMax: time.Now(),
			ServiceName:  "issue",
			Tags: map[string]string{
				"alice": "11",
			},
		}
		traces, err := sr.FindTraces(context.Background(), params)
		assert.NoError(t, err)
		assert.Equal(t, 1, len(traces))
	})
}

But it finds it correctly?

@burmanm
Copy link
Contributor

burmanm commented Nov 1, 2019

Alternative (instead of Windows issue, it's a C# client difference somehow?)

@The-Alchemist
Copy link
Contributor

@burmanm : Very interesting... I'm on a Mac, jaeger/all-in-one was run via Docker, and my client is C++.

It might be worth noting that the spans are there in Badger, even if the search-via-tag-value comes up empty.

i.e., I verify my C++ client is working properly it by manually finding the span via the UI.

Would a screencast be helpful?

@burmanm
Copy link
Contributor

burmanm commented Nov 1, 2019

Ah, alright. This is odd then, I guess it would be interesting to see the raw-data of those keys in the badger - is something wrong stored there or is the service name somehow differently encoded.

Screens might hide these if they do some UTF-8 <-> UTF-16 conversion for example.

@aachinfiev
Copy link
Author

aachinfiev commented Nov 1, 2019

Are there tools to be able to inspect what is stored in badger? At least to figure out if it's a storage or query issue.

@The-Alchemist
Copy link
Contributor

@burmanm

Ah, alright. This is odd then, I guess it would be interesting to see the raw-data of those keys in the badger - is something wrong stored there or is the service name somehow differently encoded.

Screens might hide these if they do some UTF-8 <-> UTF-16 conversion for example.

Hmm... I can ZIP up my Badger directory after creating the spans, if that would help. (I haven't had a lot of luck using the badger CLI tools to inspect the keys/values because they're all in binary.)

@The-Alchemist
Copy link
Contributor

@aachinfiev:

Are there tools to be able to inspect what is stored in badger? At least to figure out if it's a storage or query issue.

Yes, I've been using a fork of https://github.com/nak3/badger-cli that works against Badger 1.5.3 (the version that Jaeger uses). I can push up that fork or just the binary if that helps.

If someone can point me to some nice functions that can unmarshall the keys and values, I can add that in.

@burmanm
Copy link
Contributor

burmanm commented Nov 1, 2019

Those index queries don't use values, so keys (and their bytes) are quite enough.

@The-Alchemist
Copy link
Contributor

@burmanm :

> badger-cli --dir=badger/key --value-dir=badger/data dump        
00000000  83 65 78 61 6d 70 6c 65  2d 73 65 72 76 69 63 65  |.example-service|
00000010  61 6c 69 63 65 31 00 05  96 50 30 3d c7 08 00 00  |alice1...P0=....|
00000020  00 00 00 00 00 00 6d f6  5c cd e2 8e e3 cd        |......m.\.....|

00000000  83 65 78 61 6d 70 6c 65  2d 73 65 72 76 69 63 65  |.example-service|
00000010  61 6c 69 63 65 31 31 00  05 96 50 31 c9 a4 02 00  |alice11...P1....|
00000020  00 00 00 00 00 00 00 0b  a2 2d 26 3c f3 97 4e     |.........-&<..N|

NOTE: I'm excluding the keys pertaining to jaeger-query.

@The-Alchemist
Copy link
Contributor

I have another dump to show. Here, I have three spans with different tag values:

  • alice=2
  • alice=22
  • alice=222

The Jaeger UI finds alice=2 and alice=22, but not alice=222.

> badger-cli --dir=badger/key --value-dir=badger/data dump        
00000000  83 65 78 61 6d 70 6c 65  2d 73 65 72 76 69 63 65  |.example-service|
00000010  61 6c 69 63 65 32 00 05  96 50 51 f0 0b 65 00 00  |alice2...PQ..e..|
00000020  00 00 00 00 00 00 27 01  4a 8a b6 64 a7 f0        |......'.J..d..|

00000000  83 65 78 61 6d 70 6c 65  2d 73 65 72 76 69 63 65  |.example-service|
00000010  61 6c 69 63 65 32 32 00  05 96 50 54 1d 4f 6e 00  |alice22...PT.On.|
00000020  00 00 00 00 00 00 00 b4  d2 c7 5f 23 1b c9 69     |.........._#..i|

00000000  83 65 78 61 6d 70 6c 65  2d 73 65 72 76 69 63 65  |.example-service|
00000010  61 6c 69 63 65 32 32 32  00 05 96 50 55 ab 24 30  |alice222...PU.$0|
00000020  00 00 00 00 00 00 00 00  37 38 73 36 b4 00 8a 10  |........78s6....|

Maybe it's a URL-encoding thing?

@burmanm
Copy link
Contributor

burmanm commented Nov 2, 2019

All those keys look correct, they have one additional byte 32 for each ASCII "2". As for parsing, those look correct on my machine as well (printing trace.QueryParameters):

Received: {example-service  map[alice:222] 2019-11-01 23:22:28.976 +0200 EET 2019-11-02 00:22:28.976 +0200 EET 0s 0s 20}
Received: {example-service  map[alice:22] 2019-11-01 23:22:15.803 +0200 EET 2019-11-02 00:22:15.803 +0200 EET 0s 0s 20}
Received: {example-service  map[alice:2] 2019-11-01 23:21:49.226 +0200 EET 2019-11-02 00:21:49.226 +0200 EET 0s 0s 20}

And I hope despite the output the times are actually internally in the UTC for every case.

@burmanm
Copy link
Contributor

burmanm commented Nov 2, 2019

Windows Firefox + Linux all-in-one combo works at least fine. So it's not a browser thing either it appears. Byte dumps look correct also:

836578616D706C652D73657276696365616C696365320005965A185C4A3000000000000000000234567A4E9FF63C
836578616D706C652D73657276696365616C69636532320005965A185C4C620000000000000000A020BCC2E7278816
836578616D706C652D73657276696365616C6963653232320005965A185C4C960000000000000000A758BF90E587D55A

(the part until 00 05 which is timestamp) and index seek looks to be hit the correct one also:

Seeking index: 836578616D706C652D73657276696365616C696365323200059659D9023EA0

The fact that the last tag in this order on your env can't be found is troubling. The first two seeks find always min 2 keys, (alice=2, alice=22, rejects alice=22, stops), (alice=22, alice=222, rejects alice=222, stops) but the last one only one (alice=222, stops).

Did the unit test work in MacOS? I'm just trying to minimize the searching space for problems. I don't have access to MacOS, but I'll test in full-Windows later.

@The-Alchemist
Copy link
Contributor

The-Alchemist commented Nov 4, 2019

@burmanm : I'm on a Mac (10.14.6 (18G1012)), but I've been running jaeger through Docker for Mac (2.1.0.4 (39773)).

Unfortunately, I don't have a dev environment set up to debug this (any easy tips?), but it's very easy to reproduce:

  1. Unzip badger-issue.1882.zip
  2. Run the following from the same directory
docker run \                            
                     -e SPAN_STORAGE_TYPE=badger \
                     -e BADGER_EPHEMERAL=false \
                     -e BADGER_DIRECTORY_VALUE=/badger/data \
                     -e BADGER_DIRECTORY_KEY=/badger/key \
                     -v `pwd`/badger:/badger \
                     -p 16686:16686 \
                     -p6831:6831/udp \
                     -d \
                     --name jaeger \
                     --rm \
                     jaegertracing/all-in-one:1.14
  1. Open your favorite web browser and hit http://localhost:16686/search?end=1572906120000000&limit=20&lookback=custom&maxDuration&minDuration&service=example-service&start=1572470520000000&tags=%7B%22alice%22%3A%22222%22%7D
  2. No results. However, the trace is definitely there because you can look at it directly at http://localhost:16686/trace/37387336b4008a10

@burmanm
Copy link
Contributor

burmanm commented Nov 4, 2019

It finds the result for me (although I did use the master-version for this one as my docker is somehow not responding at all):

Screenshot from 2019-11-04 18-45-07

@burmanm
Copy link
Contributor

burmanm commented Nov 4, 2019

I'll create a docker image for you tomorrow that logs all the relevant info when processing.. Lets see if we can find out the reason.

@The-Alchemist
Copy link
Contributor

@burmanm : Fascinating! I think we nailed this one!

I tried jaegertracing/all-in-one:latest (pushed two days ago) and jaegertracing/all-in-one:1.14 (pushed two months ago), and the issue is gone!

i.e.,

This works:

docker pull jaegertracing/all-in-one:latest
docker run \                                                                                                                                    3012ms  Mon Nov  4 11:51:36 2019
                     -e SPAN_STORAGE_TYPE=badger \
                     -e BADGER_EPHEMERAL=false \
                     -e BADGER_DIRECTORY_VALUE=/badger/data \
                     -e BADGER_DIRECTORY_KEY=/badger/key \
                     -v (pwd)/badger:/badger \
                     -p 16686:16686 \
                     -p6831:6831/udp \
                     -p 9042:9042 \
                     -d \
                     --name jaeger \
                     --rm \
                     jaegertracing/all-in-one:latest

This will result in this issue:

docker run \                                                                                                                                     868ms  Mon Nov  4 11:52:33 2019
                     -e SPAN_STORAGE_TYPE=badger \
                     -e BADGER_EPHEMERAL=false \
                     -e BADGER_DIRECTORY_VALUE=/badger/data \
                     -e BADGER_DIRECTORY_KEY=/badger/key \
                     -v (pwd)/badger:/badger \
                     -p 16686:16686 \
                     -p6831:6831/udp \
                     -p 9042:9042 \
                     -d \
                     --name jaeger \
                     --rm \
                     jaegertracing/all-in-one:1.14

I'm guessing something changed in the past two months.

P.S. It might be worth noting that although jaeger:all-in-one has been released two days ago, there is no corresponding 1.15 release.

@burmanm
Copy link
Contributor

burmanm commented Nov 4, 2019

Good to hear, thanks for helping. I don't think there's 1.15 tag yet, that's why there's no such version.

@aachinfiev
Copy link
Author

Great to hear that this was already fixed. Is there a way to get windows binaries? I tried building on windows but got stuck with some tools missing. Thank you both for troubleshooting.

@burmanm
Copy link
Contributor

burmanm commented Nov 5, 2019

You can compile the Windows binaries in Linux.

@aachinfiev
Copy link
Author

I tried building windows binaries on linux (ubuntu distro) on both Windows Subsystem and docker image and in both cases I couldn't get past step make install-tools due to blackfriday v2.0 dependency issue. In Gopkg.toml there is a comment that suppose to fix it by keeping version ^1 but that doesn't seem to work. I get error:

root@bdb5f1af3b22:~/go/src/github.com/jaegertracing/jaeger# make install-tools
build github.com/jaegertracing/jaeger/cmd/agent: cannot load github.com/apache/thrift/lib/go/thrift: open /root/go/src/github.com/apache/thrift/lib/go/thrift: no such file or directory
go get -u github.com/wadey/gocovmerge
go: finding github.com/wadey/gocovmerge latest
go: downloading github.com/wadey/gocovmerge v0.0.0-20160331181800-b5bfa59ec0ad
go: extracting github.com/wadey/gocovmerge v0.0.0-20160331181800-b5bfa59ec0ad
go: downloading golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e
go: extracting golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e
go: finding golang.org/x/tools latest
go: downloading golang.org/x/tools v0.0.0-20191106185728-c2ac6c2a2d7e
go: extracting golang.org/x/tools v0.0.0-20191106185728-c2ac6c2a2d7e
go get -u golang.org/x/tools/cmd/cover
go: finding golang.org/x/tools latest
go get -u golang.org/x/lint/golint
go: finding golang.org/x/lint latest
go: downloading golang.org/x/lint v0.0.0-20190930215403-16217165b5de
go: extracting golang.org/x/lint v0.0.0-20190930215403-16217165b5de
go: finding golang.org/x/tools latest
go get -u github.com/sectioneight/md-to-godoc
go: finding github.com/sectioneight/md-to-godoc latest
go: downloading github.com/sectioneight/md-to-godoc v0.0.0-20170519054633-79157ff08f1a
go: extracting github.com/sectioneight/md-to-godoc v0.0.0-20170519054633-79157ff08f1a
go: finding github.com/russross/blackfriday v2.0.0+incompatible
go: downloading github.com/russross/blackfriday v2.0.0+incompatible
go: extracting github.com/russross/blackfriday v2.0.0+incompatible
go: finding github.com/shurcooL/sanitized_anchor_name v1.0.0
go: downloading github.com/shurcooL/sanitized_anchor_name v1.0.0
go: extracting github.com/shurcooL/sanitized_anchor_name v1.0.0
# github.com/sectioneight/md-to-godoc/render
/root/go/pkg/mod/github.com/sectioneight/md-to-godoc@v0.0.0-20170519054633-79157ff08f1a/render/godoc.go:45:3: cannot use &GodocRenderer literal (type *GodocRenderer) as type blackfriday.Renderer in return argument:
        *GodocRenderer does not implement blackfriday.Renderer (missing RenderFooter method)
/root/go/pkg/mod/github.com/sectioneight/md-to-godoc@v0.0.0-20170519054633-79157ff08f1a/render/godoc.go:125:7: undefined: blackfriday.Header
Makefile:311: recipe for target 'install-tools' failed
make: *** [install-tools] Error 2

Gopkg.toml has

# blackfriday has 2.x release that conflicts with spf13/cobra
[[override]]
  name = "github.com/russross/blackfriday"
  version = "^1"

I followed install steps from Jager CONTRIBUTING.md. Is there something else that's missing or changed to get beyond this step? Thanks.

@yurishkuro
Copy link
Member

could you try with GO111MODULE=off ?

@flixr
Copy link

flixr commented Nov 7, 2019

For me it is now working with the latest all-in-one docker image, but was not working with 1.14...
Probably fixed with #1809

@aachinfiev
Copy link
Author

I was able to get past make install-tools but when trying to do make build-binaries-windows I ran into the same issue on linux as on windows:

CGO_ENABLED=0 installsuffix=cgo go build -o ./cmd/agent/agent-windows -ldflags "-X github.com/jaegertracing/jaeger/pkg/version.commitSHA=22f06c453c61ab7a41a499d07fd17f3dbb96bd80 -X github.com/jaegertracing/jaeger/pkg/version.latestVersion=v1.14.0 -X github.com/jaegertracing/jaeger/pkg/version.date=2019-11-07T18:21:22Z" ./cmd/agent/main.go
# github.com/jaegertracing/jaeger/vendor/github.com/prometheus/client_golang/prometheus
vendor/github.com/prometheus/client_golang/prometheus/process_collector_windows.go:78:9: assignment mismatch: 2 variables but "github.com/jaegertracing/jaeger/vendor/golang.org/x/sys/windows".GetCurrentProcess returns 1 values
Makefile:211: recipe for target 'build-agent' failed
make[1]: *** [build-agent] Error 2

Any idea what could be wrong? Do I have to downgrade/upgrade something?

I am using go version go1.13.4 linux/amd64

@yurishkuro
Copy link
Member

@aachinfiev this was a new issue that our CI did not catch. I just fixed it in #1907.

Make sure to rerun dep ensure --vendor-only first.

@aachinfiev
Copy link
Author

I got the latest and tried to build:

git pull
dep ensure --vendor-only
make install-tools
make build-binaries-windows

and getting

CGO_ENABLED=0 installsuffix=cgo go build -o ./cmd/agent/agent-windows -ldflags "-X github.com/jaegertracing/jaeger/pkg/version.commitSHA=f68ece088171321aa2e9dba2aeb468a3d3c05c13 -X github.com/jaegertracing/jaeger/pkg/version.latestVersion=v1.15.0 -X github.com/jaegertracing/jaeger/pkg/version.date=2019-11-07T23:02:30Z" ./cmd/agent/main.go
esc -pkg mappings -o plugin/storage/es/mappings/gen_assets.go -ignore assets -prefix plugin/storage/es/mappings plugin/storage/es/mappings
CGO_ENABLED=0 installsuffix=cgo go build -o ./cmd/collector/collector-windows -ldflags "-X github.com/jaegertracing/jaeger/pkg/version.commitSHA=f68ece088171321aa2e9dba2aeb468a3d3c05c13 -X github.com/jaegertracing/jaeger/pkg/version.latestVersion=v1.15.0 -X github.com/jaegertracing/jaeger/pkg/version.date=2019-11-07T23:02:37Z" ./cmd/collector/main.go
CGO_ENABLED=0 installsuffix=cgo go build -tags ui -o ./cmd/query/query-windows -ldflags "-X github.com/jaegertracing/jaeger/pkg/version.commitSHA=f68ece088171321aa2e9dba2aeb468a3d3c05c13 -X github.com/jaegertracing/jaeger/pkg/version.latestVersion=v1.15.0 -X github.com/jaegertracing/jaeger/pkg/version.date=2019-11-07T23:02:48Z" ./cmd/query/main.go
# github.com/jaegertracing/jaeger/cmd/query/app/ui
cmd/query/app/ui/actual.go:24:19: undefined: assets.FS
Makefile:215: recipe for target 'build-query' failed
make[1]: *** [build-query] Error 2
make[1]: *** [build-query] Error 2
make[1]: Leaving directory '/home/user/go/src/github.com/jaegertracing/jaeger'
Makefile:234: recipe for target 'build-binaries-windows' failed
make: *** [build-binaries-windows] Error 2

@yurishkuro
Copy link
Member

that's expected, you need to build-ui first before build-binaries-windows

@aachinfiev
Copy link
Author

@yurishkuro I saw that you updated it to build binaries as part of CI and released 1.15.1. Thank you very much for that update. I was able to get that binary and confirm that this issue is fixed and search is working properly with badger running on windows.

Thanks everyone for helping out.

@flixr
Copy link

flixr commented Nov 8, 2019

With 1.15.1 the tag search now works, but I only see traces having an ID starting with f. Going back to 1.14 I see all traces again (but the the tag search is not working anymore).
I'm using badger and receiving zipkin json traces/spans.

@The-Alchemist
Copy link
Contributor

@flixr :

With 1.15.1 the tag search now works, but I only see traces having an ID starting with f. Going back to 1.14 I see all traces again (but the the tag search is not working anymore).
I'm using badger and receiving zipkin json traces/spans.

I think you should create a new issue for this, and provide a ZIP of your badger directory and Docker command. I'm not using the Zipkin format, but everything seems good w/ 1.15.1 (I see all traces, not just ones starting with f).

@flixr
Copy link

flixr commented Nov 9, 2019

See #1913

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

No branches or pull requests

7 participants