Cannot get ES 3.0.0-rc9 to accept log parameters from config file

I’m having trouble getting ES (3.0.0-rc9) to use parameters from the config file under Ubuntu 14.04 LTS (running on Azure). Specifically, I’ve gotten as far as specifying the log directory but it will not work.

I’ve set up ES as an Upstart job with the following in /etc/init/es-test.conf:

Sample Upstart conf file for GetEventStore

author “Lars Kemmann”
description “EventStore server”
version “3.0.0-rc9”

start on net-device-up IFACE!=lo
stop on starting rc RUNLEVEL=[06]

chdir /home/azureuser/es-v3.0.0-rc9

script
startuplog="/home/azureuser/es-startup.log"
timestamp=$(date --iso-8601=seconds)

echo 'EventStore server job starting at '$timestamp >> $startuplog

username=azureuser
es_path=/home/azureuser/es-v3.0.0-rc9/clusternode
es_configpath=/home/azureuser/es-config.yaml
#es_logdir=/home/azureuser/es-logs
#cmd='sudo -u ‘$username’ ‘$es_path’ --log ‘$es_logdir’ --config '$es_configpath
cmd='sudo -u ‘$username’ ‘$es_path’ --config '$es_configpath

echo 'COMMAND: '$cmd >> $startuplog
$cmd >> $startuplog # This is a temporary workaround to actually let me see the process output.
end script

``

Here is the ES config file in ~/es-config.yaml:

Is it logging to LOGS: /tmp/EventStore/2014-08-22_15.42.01.750500-Node2113-logs?

Yes, I was just about to add that. :slight_smile: The database and logs are all under /tmp/EventStore.

I’ve also tried specifying every permutation of the logging parameter I could think of in the config file:

logsdir = ~/es-logs
logdir = ~/es-logs
logs = ~/es-logs
log = ~/es-logs

``

They all get dumped at the end of the output, but don’t seem to have an effect on the actual parameters that ES uses. (In fact I suspect the same will be true for the httpPort parameter.)

I’m experiencing the same issue on Ubuntu 14.04 LTS under Docker. I see all of my config options displayed at the end of the config dump, but ES seems to be taking the earlier (default) ones. This is affecting at least my logsDir, db, ip, and httpPrefixes parameters.

Thanks for reporting this - I’ve opened up a GitHub issue for it and can reproduce. Expect to see a fix shortly.

Issue URL: https://github.com/EventStore/EventStore/issues/200

James

Thank you!

Lars

For anyone else who’s having this issue, the problem is that the configuration options in RC9 have changed to follow the naming of the properties in the ClusterNodeOptions class, since that’s how the YAML parser works. And it’s case-sensitive. So for example, “logsDir” (JSON) has become “Log” and “httpPrefixes” has become “HttpPrefixes”. You can use the command line to display the updated parameter names:``
clusternode --help

``

Also, using ~ instead of the full path seems to fail. Maybe I’m doing it wrong?

Log: ~/es-logs

``

is interpreted as:

LOGS: /home/azureuser/es-v3.0.0-rc9/~/es-logs

``

(i.e., it’s interpreted as a subfolder of the working directory.)

For now I’ll just specify the full path. That’s only a minor annoyance. :slight_smile:

Oh, never mind. Not sure why I expected ES to magically understand an environment variable in a path. rolls eyes

It should be the case that ~ expands properly. If not we’ll make this work since it’s very useful. It certainly works from the command line.

Thats because the command line expands it :slight_smile: and it gets passed as a full path

Doh, turns out powershell also does this, but File.Open doesn’t. Perhaps we should consider special casing this for config files (though I guess in production people aren’t storing their data in the home dir of their user!)

Erm, guilty as charged? :stuck_out_tongue: Granted, it’s early in the system lifecycle, so some things haven’t been worth hardening yet.

I wouldn’t see this as worth delaying other features for.

Erm, guilty as charged? :stuck_out_tongue: Granted, the system is still early in its lifecycle, so some things just haven’t been worth hardening yet.

I wouldn’t see that special-casing as deserving the extra effort.