# Must be a git repository

**URL:** <https://discuss.elastic.co/t/must-be-a-git-repository/143773>\
**Category:** Elasticsearch\
**Tags:** rally\
**Created:** [August 9, 2018, 10:27pm UTC](https://discuss.elastic.co/t/must-be-a-git-repository/143773 "2018-08-09T22:27:33Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![username123](https://avatars.discourse-cdn.com/v4/letter/u/7ba0ec/32.png) [@username123](https://discuss.elastic.co/u/username123)\
**Post date:** [August 9, 2018, 10:27pm UTC](https://discuss.elastic.co/t/must-be-a-git-repository/143773/1 "2018-08-09T22:27:33Z")

</div>

When I run esrally  
`/root/.rally/benchmarks/tracks/custom] must be a git repository`  
But

```auto
~/.rally/benchmarks/tracks/custom# git status
On branch master
Changes not staged for commit:

```

Log is:

```auto

    return race(cfg, external=True)
  File "/usr/local/lib/python3.5/dist-packages/esrally/racecontrol.py", line 279, in race
    raise exceptions.RallyError(result.message, result.cause)
esrally.exceptions.RallyError: ('Error in track preparator', [/root/.rally/benchmarks/tracks/custom] must be a git repository.

Please run:
git -C /root/.rally/benchmarks/tracks/custom init)
2018-08-09 22:19:17,967 ActorAddr-(T|:21129)/PID:6197 esrally.actor INFO BenchmarkActor received unknown message [ActorExitRequest] (ignoring).
2018-08-09 22:19:17,962 ActorAddr-(T|:26823)/PID:6198 esrally.mechanic.telemetry WARNING merges_total_time is 143037183 ms indicating that the cluster is not in a defined clean state. Recorded index time metrics may be misleading.
2018-08-09 22:19:17,969 ActorAddr-(T|:26823)/PID:6198 esrally.mechanic.telemetry WARNING merges_total_throttled_time is 51037420 ms indicating that the cluster is not in a defined clean state. Recorded index time metrics may be misleading.
2018-08-09 22:19:17,974 ActorAddr-(T|:28221)/PID:6204 esrally.actor INFO Stopping nodes [c1b-searchclienta102-prod, c1b-searcha105-prod, c1f-searcha112-prod, c1f-searchclienta103-prod, c1f-searcha103-prod, c1f-searcha111-prod, c1b-searcha106-prod, c1c-searcha108-prod, c1c-searcha107-prod, c1c-searchclienta101-prod, c1c-searcha109-prod, c1b-searcha102-prod, c1f-searcha110-prod, c1b-searchmastera102-prod, c1c-searchmastera101-prod, c1c-searcha101-prod, c1b-searcha104-prod, c1f-searchmastera103-prod] (due to ActorExitRequest)
2018-08-09 22:19:17,969 ActorAddr-(T|:26823)/PID:6198 esrally.mechanic.telemetry WARNING indexing_total_time is 125082439 ms indicating that the cluster is not in a defined clean state. Recorded index time metrics may be misleading.
2018-08-09 22:19:17,970 ActorAddr-(T|:26823)/PID:6198 esrally.mechanic.telemetry WARNING refresh_total_time is 25847236 ms indicating that the cluster is not in a defined clean state. Recorded index time metrics may be misleading.
2018-08-09 22:19:17,965 ActorAddr-(T|:10509)/PID:17448 esrally.actor ERROR Error in track preparator
Traceback (most recent call last):

  File "/usr/local/lib/python3.5/dist-packages/esrally/actor.py", line 67, in guard
    return f(self, msg, sender)

  File "/usr/local/lib/python3.5/dist-packages/esrally/driver/driver.py", line 285, in receiveMsg_PrepareTrack
    track.track_repo(cfg, fetch=True, update=True)

  File "/usr/local/lib/python3.5/dist-packages/esrally/track/loader.py", line 140, in track_repo
    return GitTrackRepository(cfg, fetch, update)

  File "/usr/local/lib/python3.5/dist-packages/esrally/track/loader.py", line 175, in __init__
    self.repo = repo_class(remote_url, tracks_dir, repo_name, "tracks", offline, fetch)

  File "/usr/local/lib/python3.5/dist-packages/esrally/utils/repo.py", line 34, in __init__
    .format(src=self.repo_dir))

esrally.exceptions.SystemSetupError: ('[/root/.rally/benchmarks/tracks/custom] must be a git repository.\n\nPlease run:\ngit -C /root/.rally/benchmarks/tracks/custom init', None)

2018-08-09 22:19:17,980 ActorAddr-(T|:33421)/PID:6205 esrally.actor ERROR Main driver received a fatal exception from a load generator. Shutting down.
2018-08-09 22:19:17,970 ActorAddr-(T|:26823)/PID:6198 esrally.mechanic.telemetry WARNING flush_total_time is 580266 ms indicating that the cluster is not in a defined clean state. Recorded index time metrics may be misleading.
2018-08-09 22:19:17,982 ActorAddr-(T|:33421)/PID:6205 esrally.actor INFO Main driver received ActorExitRequest and will terminate all load generators.
2018-08-09 22:19:17,986 ActorAddr-(T|:21129)/PID:6197 esrally.actor INFO BenchmarkActor received unknown message [ChildActorExited:ActorAddr-(T|:26823)] (ignoring).
2018-08-09 22:19:17,986 ActorAddr-(T|:33421)/PID:6205 esrally.actor INFO A track preparator has exited.
2018-08-09 22:19:17,987 ActorAddr-(T|:33421)/PID:6205 esrally.actor INFO A track preparator has exited.
2018-08-09 22:19:17,973 ActorAddr-(T|:26823)/PID:6198 esrally.actor INFO MechanicActor#receiveMessage unrecognized(msg = [<class 'thespian.actors.ActorExitRequest'>] sender = [ActorAddr-(T|:21129)])
2018-08-09 22:19:17,978 ActorAddr-(T|:26823)/PID:6198 esrally.actor ERROR Child actor exited with [ChildActorExited:ActorAddr-(T|:28221)] while in status [benchmark_started].
2018-08-09 22:19:17,993 ActorAddr-(T|:21129)/PID:6197 esrally.actor INFO BenchmarkActor received unknown message [ChildActorExited:ActorAddr-(T|:26823)] (ignoring).
2018-08-09 22:19:17,990 ActorAddr-(T|:36219)/PID:2016 esrally.actor ERROR Error in track preparator
Traceback (most recent call last):

  File "/usr/local/lib/python3.5/dist-packages/esrally/actor.py", line 67, in guard
    return f(self, msg, sender)

  File "/usr/local/lib/python3.5/dist-packages/esrally/driver/driver.py", line 285, in receiveMsg_PrepareTrack
    track.track_repo(cfg, fetch=True, update=True)

  File "/usr/local/lib/python3.5/dist-packages/esrally/track/loader.py", line 140, in track_repo
    return GitTrackRepository(cfg, fetch, update)

  File "/usr/local/lib/python3.5/dist-packages/esrally/track/loader.py", line 175, in __init__
    self.repo = repo_class(remote_url, tracks_dir, repo_name, "tracks", offline, fetch)

  File "/usr/local/lib/python3.5/dist-packages/esrally/utils/repo.py", line 34, in __init__
    .format(src=self.repo_dir))

esrally.exceptions.SystemSetupError: ('[/root/.rally/benchmarks/tracks/custom] must be a git repository.\n\nPlease run:\ngit -C /root/.rally/benchmarks/tracks/custom init', None)

2018-08-09 22:19:17,996 ActorAddr-(T|:33421)/PID:6205 esrally.actor INFO A track preparator has exited.
2018-08-09 22:19:17,999 ActorAddr-(T|:21129)/PID:6197 esrally.actor INFO BenchmarkActor received unknown message [ChildActorExited:ActorAddr-(T|:33421)] (ignoring).

```

What's going on? Reinitializing it doesn't work. I seemed to have followed the docs. The way I run the command is:  
`esrally --pipeline=benchmark-only --track-repository=custom --track=/root/.rally/benchmarks/tracks/custom/mytrack ... host arguments`

---

<div class="post-metadata">

**Author:** ![danielmitterdorfer](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/danielmitterdorfer/32/110510_2.png) [@danielmitterdorfer](https://discuss.elastic.co/u/danielmitterdorfer)\
**Post date:** [August 10, 2018, 11:32am UTC](https://discuss.elastic.co/t/must-be-a-git-repository/143773/2 "2018-08-10T11:32:27Z")

</div>

Hi,

our docs explain [under which circumstances it makes sense to use track repositories](http://esrally.readthedocs.io/en/stable/track.html#track-file-format-and-storage). So if you really want a track repository, can you ensure that you actually committed your changes? (this would be the next error otherwise).

You should do the following:

```auto
cd /root/.rally/benchmarks/tracks/custom
rm -rf .git
git init
git add .
git commit -m "Initial commit"

```

Then everything should work.

Also, if you use a track repository, you just specify the name of the track, not the actual path to it.

So you can either use `--track-path`:

```auto
esrally --pipeline=benchmark-only --track-path=/root/.rally/benchmarks/tracks/custom/mytrack ...

```

or `--track-repository` and `--track`:

So you can either use `--track-path`:

```auto
esrally --pipeline=benchmark-only --track-repository=custom --track=mytrack ... 

```

Daniel

---

<div class="post-metadata">

**Author:** ![username123](https://avatars.discourse-cdn.com/v4/letter/u/7ba0ec/32.png) [@username123](https://discuss.elastic.co/u/username123)\
**Post date:** [August 10, 2018, 5:36pm UTC](https://discuss.elastic.co/t/must-be-a-git-repository/143773/3 "2018-08-10T17:36:43Z")

</div>

@danielmitterdorfer

Yes, I have tried reinitializing multiple times according to the doc before starting the thread. Just to confirm:

```auto
~/.rally/benchmarks/tracks/custom# git status
On branch master
nothing to commit, working tree clean

```

In custom:

```auto
~/.rally/benchmarks/tracks/custom# ls
mytrack

```

Running

```auto
esrally --pipeline=benchmark-only --track-repository=custom --track=mytrack ...

```

Still gives:

```auto
[ERROR] Cannot race. Error in track preparator
	[/root/.rally/benchmarks/tracks/custom] must be a git repository.

Please run:
git -C /root/.rally/benchmarks/tracks/custom init

```

Neither the steps you've mentioned, nor the command in the error message seem to work.

Trying to get it working with:

```auto
esrally --pipeline=benchmark-only --track-path=/root/.rally/benchmarks/tracks/custom/mytrack ...

```

Yields:

```auto
[ERROR] Cannot race. Error in track preparator
	Track path /root/.rally/benchmarks/tracks/custom/mytrack does not exist

```

Same result even when I point to `/root/.rally/benchmarks/tracks/custom/mytrack/track.json`

```auto
~/.rally/benchmarks/tracks/custom/mytrack# ls
challenges files.txt index.json node_modules operations __pycache__ README.md report.csv terms.txt track.json	track.py
~/.rally/benchmarks/tracks/custom/mytrack# echo $PWD
/root/.rally/benchmarks/tracks/custom/mytrack

```

So weird. I had it all working at some point.

---

<div class="post-metadata">

**Author:** ![username123](https://avatars.discourse-cdn.com/v4/letter/u/7ba0ec/32.png) [@username123](https://discuss.elastic.co/u/username123)\
**Post date:** [August 10, 2018, 6:14pm UTC](https://discuss.elastic.co/t/must-be-a-git-repository/143773/4 "2018-08-10T18:14:44Z")

</div>

Ok, @danielmitterdorfer I have found the issue. The key was in something that I've omitted as I've thought it to be useless information. I actually ran the command with `--load-driver-hosts`. Naturally, if the track is absent on the driver hosts it won't work, and truth be told it is mentioned in the docs. However, I believe it could be a little friendlier in the error message to say "make sure you have the track on the driver hosts if you utilize them" or a similar pointer. Between setting things up and running them you just forget what is what and git error message comes off as truly bizarre.

Thanks for your help!

---

<div class="post-metadata">

**Author:** ![danielmitterdorfer](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/danielmitterdorfer/32/110510_2.png) [@danielmitterdorfer](https://discuss.elastic.co/u/danielmitterdorfer)\
**Post date:** [August 20, 2018, 10:47am UTC](https://discuss.elastic.co/t/must-be-a-git-repository/143773/5 "2018-08-20T10:47:52Z")

</div>

Hi,

thanks for your feedback; we really appreciate it. We'll see that we can improve the error message in that case.

Daniel

---

<div class="post-metadata">

**Author:** ![danielmitterdorfer](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/danielmitterdorfer/32/110510_2.png) [@danielmitterdorfer](https://discuss.elastic.co/u/danielmitterdorfer)\
**Post date:** [August 20, 2018, 10:53am UTC](https://discuss.elastic.co/t/must-be-a-git-repository/143773/6 "2018-08-20T10:53:32Z")

</div>

I've raised [https://github.com/elastic/rally/issues/552](https://github.com/elastic/rally/issues/552) now.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [September 17, 2018, 10:53am UTC](https://discuss.elastic.co/t/must-be-a-git-repository/143773/7 "2018-09-17T10:53:33Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
