Configuration file does not exist error

Hey guys, we are doing some local testing with scala-stream-collector-kinesis:1.0.1 docker image. I configured sink to stdout for local testing, then I changed to /snowplow/config directory and ran this command:
sudo docker run -v $PWD/scala-stream-collector-config:/snowplow/config -p 8080:8080 snowplow/scala-stream-collector-kinesis:1.0.1 --config ./localconfig.conf

It’s giving me this error:
Error: Configuration file ./localconfig.conf does not exist
Try --help for more information.
configuration has no “collector” path

Any idea what it’s not liking?

@alexb, have you tried just localconfig.conf instead of ./localconfig.conf?

I did, tried quite a few different variations. It’s like the config file is not being recognized for some reason.

Looking at this docker command, it looks like you’re mounting your local $PWD/scala-stream-collector-config to /snowplow/config inside the container. So, assuming localconfig.conf is inside $PWD/scala-stream-collector-config on your machine, then you probably need --config /snowplow/config/localconfig.conf in that command

Hi Paul, it’s giving exactly the same error if I run it like this:

sudo docker run -v $PWD/scala-stream-collector-config:/snowplow/config -p 8080:8080 snowplow/scala-stream-collector-kinesis:1.0.1 --config /snowplow/config/localconfig.conf

I even tried to simplify everything and run it like this:

docker run -p 80:80 snowplow/scala-stream-collector-stdout --config /snowplow/config/local.hocon

The same problem.

Hi @alexb,

What we tend to use looks something like this:

docker run \
  -d \
  --restart always \
  --network host \
  -v ${config_dir}:/snowplow/config \
  -p 8080:8080 \
  snowplow/scala-stream-collector-kinesis:${app_version} \
  --config /snowplow/config/${config_path}

Which does work as expected and the process can find the config as expected. A few things to check would be:

  1. Does your local config directory definitely exist at the path you are sharing with the Docker container?
  2. Have you locked the permissions on the config file down in such a way that makes it unreadable to any other use on the system?

The other thing to try would be too exec into the container to check within the container that the config is shared as expected. You can do that by running the following command:

docker run -it -v ${config_dir}:/snowplow/config --entrypoint /bin/bash snowplow/scala-stream-collector-kinesis:${app_version}

# You can then inspect the config directory here and check your config file to debug the issue
I have no name!@f65a44073a6c:/opt/docker$ cd /snowplow/config/
I have no name!@f65a44073a6c:/snowplow/config$ ls

Hope this helps get to the root cause!

1 Like

@josh, thanks for the help. The issue turned out to be much simpler. This part: $PWD/scala-stream-collector-config:/snowplow/config expects the config file to be in the scala-stream-collector-config directory. This is the only way it will run unless the volume is mapped to another directory. Once I realized it things started working. Thanks again!!