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

Unable to use log messages with spaces in docker #109

Closed
coderpatros opened this issue May 13, 2019 · 6 comments · Fixed by #111
Closed

Unable to use log messages with spaces in docker #109

coderpatros opened this issue May 13, 2019 · 6 comments · Fixed by #111
Labels
bug Something isn't working

Comments

@coderpatros
Copy link

coderpatros commented May 13, 2019

This command works...

docker run --rm datalust/seqcli:latest log --message="{ReleaseName}inproject{ProjectName}successfullfor{ReleaseEnvironment}" \
--property=ReleaseName="Test" \
--property=ReleaseEnvironment="Test" \
--property=projectName="***" \
--property=Environment=PRODUCTION \
--property=Service="***" \
--level=Information \
--server=https://***/ \
--apikey=***

This one does not...

docker run --rm datalust/seqcli:latest log --message="{ReleaseName} in project {ProjectName} successfull for{ReleaseEnvironment}" \
--property=ReleaseName="Test" \
--property=ReleaseEnvironment="Test" \
--property=projectName="***" \
--property=Environment=PRODUCTION \
--property=Service="***" \
--level=Information \
--server=https://***/ \
--apikey=***

With the message Unrecognized options: in, project, {ProjectName}, successfull, for, {ReleaseEnvironment}

I've also tried using -m instead of --message, using ` instead of ", and removing quotes from properties.

Running on Ubuntu 18.04 with docker ce latest package version 5:18.09.6~3-0~ubuntu-bionic

@nblumhardt
Copy link
Member

Thanks for the report 👍

I notice you've tried backticks and double-quotes; any chance single quotes ' work? It looks like a shell quoting problem, we'll be able to figure it out :-)

You might also try:

# etc...
CLIARGS='log --message="{ReleaseName} in project {ProjectName} successfull for{ReleaseEnvironment}"`
docker run --rm datalust/seqcli:latest "$CLIARGS"

Let me know if either of these helps. Cheers!

@coderpatros
Copy link
Author

My mistake @nblumhardt, I tried ' not backticks.

@jmcstone
Copy link

jmcstone commented Aug 19, 2019

I also have run into the same issue. I tried numerous combinations:

docker run --net host datalust/seqcli:latest log -m "Hello, World"
Unrecognized options: World

docker run --net host datalust/seqcli:latest log -m 'Hello, World'
Unrecognized options: World

docker run --net host datalust/seqcli:latest log -m Hello, World
Hello,: command not found
The command failed: Missing required value for option '-m'.

I was able to get it to work by modifying the run.sh file to:

#!/bin/bash
exec /bin/seqcli/seqcli "$@"

Note the quotes around $@ (https://github.com/koalaman/shellcheck/wiki/SC2068)

The following commands then worked:
docker run --rm --net host seqcli log -m "Hello World"
docker run --rm --net host seqcli log -m "Hello {Name}" -p Name="Linus Torvalds"

Cheers

@nblumhardt
Copy link
Member

Fantastic, thanks for passing that on @jmcstone , we'll give it a shot 👍

@nblumhardt
Copy link
Member

Just going to reopen so we can track the progress of #111

@nblumhardt nblumhardt added the bug Something isn't working label Aug 22, 2019
@nblumhardt
Copy link
Member

The latest container image includes the fix, thanks all!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants