Rally - Cannot run benchmark, rally is not setup to build from sources

Hello, I have following problem after executing esrally.
The log output:

2016-07-22 05:57:00,637 root ERROR Rally is not configured to build from sources
Traceback (most recent call last):
  File "/usr/lib/python3.4/site-packages/esrally/config.py", line 109, in opts
    return self._opts[self._k(scope, section, key)]
KeyError: 'source::local.src.dir'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/lib/python3.4/site-packages/esrally/racecontrol.py", line 108, in check_can_handle_source_distribution
    ctx.config.opts("source", "local.src.dir")
  File "/usr/lib/python3.4/site-packages/esrally/config.py", line 114, in opts
    raise ConfigError("No value for mandatory configuration: section='%s', key='%s'" % (section, key))
esrally.config.ConfigError: No value for mandatory configuration: section='source', key='local.src.dir'
2016-07-22 05:57:00,639 root ERROR Cannot run benchmark
Traceback (most recent call last):
  File "/usr/lib/python3.4/site-packages/esrally/config.py", line 109, in opts
    return self._opts[self._k(scope, section, key)]
KeyError: 'source::local.src.dir'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/lib/python3.4/site-packages/esrally/racecontrol.py", line 108, in check_can_handle_source_distribution
    ctx.config.opts("source", "local.src.dir")
  File "/usr/lib/python3.4/site-packages/esrally/config.py", line 114, in opts
    raise ConfigError("No value for mandatory configuration: section='%s', key='%s'" % (section, key))
esrally.config.ConfigError: No value for mandatory configuration: section='source', key='local.src.dir'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/lib/python3.4/site-packages/esrally/racecontrol.py", line 297, in start
    pipeline()
  File "/usr/lib/python3.4/site-packages/esrally/racecontrol.py", line 94, in __call__
    step()
  File "/usr/lib/python3.4/site-packages/esrally/racecontrol.py", line 25, in __call__
    self.command(self.ctx)
  File "/usr/lib/python3.4/site-packages/esrally/racecontrol.py", line 112, in check_can_handle_source_distribution
    "install the required software and reconfigure Rally with %s --configure." % PROGRAM_NAME)
esrally.exceptions.SystemSetupError: Rally is not setup to build from sources. You can either benchmark a binary distribution or install the required software and reconfigure Rally with esrally --configure.

After downloading distribution with esrally --pipeline=from-distribution --distribution-version=5.0.0-alpha2 terminal shows:

2016-07-22 06:01:05,610 rally.racecontrol INFO Skipping download for version [5.0.0-alpha2]. Found an existing binary locally at [/root/.rally/benchmarks/distributions/elasticsearch-5.0.0-alpha2.tar.gz].
2016-07-22 06:01:05,618 root ERROR Cannot run benchmark
Traceback (most recent call last):
  File "/usr/lib/python3.4/site-packages/esrally/racecontrol.py", line 297, in start
    pipeline()
  File "/usr/lib/python3.4/site-packages/esrally/racecontrol.py", line 94, in __call__
    step()
  File "/usr/lib/python3.4/site-packages/esrally/racecontrol.py", line 25, in __call__
    self.command(self.ctx)
  File "/usr/lib/python3.4/site-packages/esrally/racecontrol.py", line 124, in prepare_track
    ctx.track = track.load_track(ctx.config, track_name)
  File "/usr/lib/python3.4/site-packages/esrally/track.py", line 229, in load_track
    repo = TrackRepository(cfg)
  File "/usr/lib/python3.4/site-packages/esrally/track.py", line 313, in __init__
    git.fetch(src=self.tracks_dir, remote=self.url)
  File "/usr/lib/python3.4/site-packages/esrally/utils/git.py", line 27, in fetch
    raise exceptions.SupplyError("Could not fetch source tree from '%s'" % remote)
esrally.exceptions.SupplyError: Could not fetch source tree from 'https://github.com/elastic/rally-tracks'

Any ideas how to deal with that?

Hi @elastico123,

this is odd. Can you please share the file /root/.rally/rally.ini and the log file of this invocation? (Rally should have printed the path at the beginning).

Also: Do you have git installed?

Daniel

Hi again,

another hint: The first error is understandable. You probably don't have Gradle installed so you cannot benchmark a source build of Elasticsearch and you always need to specify --pipeline=from-distribution. Although I admit that this is definitely not a user-friendly error message.

I have opened https://github.com/elastic/rally/issues/122 in Rally for your first problem.

Daniel

I have installed gradle at the moment, version 2.13. For now, after executing esrally following output file has generated:

2016-07-22 09:10:37,494 root ERROR Cannot run benchmark
Traceback (most recent call last):
  File "/usr/lib/python3.4/site-packages/esrally/racecontrol.py", line 297, in start
    pipeline()
  File "/usr/lib/python3.4/site-packages/esrally/racecontrol.py", line 94, in __call__
    step()
  File "/usr/lib/python3.4/site-packages/esrally/racecontrol.py", line 25, in __call__
    self.command(self.ctx)
  File "/usr/lib/python3.4/site-packages/esrally/racecontrol.py", line 124, in prepare_track
    ctx.track = track.load_track(ctx.config, track_name)
  File "/usr/lib/python3.4/site-packages/esrally/track.py", line 229, in load_track
    repo = TrackRepository(cfg)
  File "/usr/lib/python3.4/site-packages/esrally/track.py", line 313, in __init__
    git.fetch(src=self.tracks_dir, remote=self.url)
  File "/usr/lib/python3.4/site-packages/esrally/utils/git.py", line 27, in fetch
    raise exceptions.SupplyError("Could not fetch source tree from '%s'" % remote)
esrally.exceptions.SupplyError: Could not fetch source tree from 'https://github.com/elastic/rally-tracks

`

Yes, I do have git installed.

Here is rally.ini file:

[meta]
config.version = 5

[system]
root.dir = /root/.rally/benchmarks
log.root.dir = logs
env.name = local

[source]
local.src.dir = /home/username/es2
remote.repo.url = https://github.com/elastic/elasticsearch.git

[build]
gradle.bin = /opt/gradle/gradle-2.13

[provisioning]
local.install.dir = install

[runtime]
java8.home = /usr/local/java

[benchmarks]
local.dataset.cache = ${system:root.dir}/data

[reporting]
datastore.type = elasticsearch
datastore.host = xxx.xxx.xxx.xxx
datastore.port = 9200
datastore.secure = False
datastore.user =
datastore.password =

[tracks]
default.url = https://github.com/elastic/rally-tracks

But i have made some changes manually. On my friends computer everything goes all right, I deleted [install] section and added [source]. Additionaly, in /home/username/es2 directory there are generated/downloaded files after configuring esrally (?). Its his directory, copied to my machine.
Last thing, don't know if its important, I have some proxy settings under my system.

Hi @elastico123,

the root cause is that Rally cannot execute git clone https://github.com/elastic/rally-tracks in order to get track information. I suspect that this is due to:

Its his directory, copied to my machine.

I don't think this is such a good idea. Rally assumes that it manages everything below its root directory by itself. I guess something is wrong with the git configuration for your working copy of that repository.

Can you please delete the following folder? /root/.rally/benchmarks/tracks/default and run Rally again? It should work then as Rally will clone the track repository again.

If it still doesn't work, can you please run git clone https://github.com/elastic/rally-tracks in an arbitrary folder and check if this works? This could then be related to your git config w.r.t. to proxy settings.

But i have made some changes manually.

Please also don't change the config file manually. It is ok (but not encouraged) that you change values directly but I wouldn't mess with the keys. Rally's configuration format changes from time to time and it tries to automigrate your configuration which could fail if the configuration file does not look as expected. :wink:

You can always rerun esrally configure or esrally configure --advanced-config if you need to reconfigure it.

To your last question:

Additionally, in /home/username/es2 directory there are generated/downloaded files after configuring esrally

As far as I can see from your config file, this is your source directory for Elasticsearch. Rally should have cloned the Elasticsearch repository there and also manages it automatically (i.e. if you run esrally --revision=latest it will fetch the latest version from Github).

Daniel