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
Passing command line arguments throws JSON Serialization Exception #205
Comments
@madisonb Interesting bug. Does the same thing happen to you if you do |
@amontalenti Same thing. I just did a new wordcount quickstart via the following commands:
I am running OS X 10.10.5 in a pew virtualenv if that makes a difference, Python 2.7.10 and Java 1.8.0_20. |
I have the same error. I'm wondering if this line is problematic: https://github.com/Parsely/streamparse/blob/master/streamparse/cli/run.py#L47 While all the other options are added with single quotes around them, like this: https://github.com/Parsely/streamparse/blob/master/streamparse/cli/run.py#L40 user-provided options are not quoted. Is this a bug? |
@madisonb @j-bennet ah hah, I see what's going on now. It's all about shell quote escaping rules, of course! Here's the proof:
Believe it or not, if you escape this in your shell, it'll do the right thing:
Which means, if you escape the quotes in your command-line invocation of @j-bennet, @madisonb, please try e.g. Ironically, this is only true if you actually want a string literal via configuration. That's because, for example, storm conf options can be specified with integer literals (like |
@j-bennet Oh, I was also looking more carefully at the code. You are right that |
Some more findings with option quoting. This command fails:
This command fails:
This command works:
|
More sleuth work revealed that PR #189, contributed by @eric7j and merged by @dan-blanchard, actually fixed this issue (I think). I think the reason no one has actually got this fix in a released version is because when @dan-blanchard made 2.1.x releases of our Python code, he didn't also make a corresponding release for our Clojure code via lein/maven, thus this change never made it into the released JAR. Indeed, the fix was made in Sept 2015 but the last released JAR on clojars is July 7, 2015. Easy fix -- want to take care of this, @dan-blanchard? I think you just need to do a |
@j-bennet yes, that makes perfect sense. And, to explain why:
|
Just published a new version of our Clojure code to clojars. |
@madisonb @j-bennet Does the new streamparse JAR fix the issue? Your streamparse project should pick it up automatically. To confirm it got picked up, run this command out of your project directory:
The output should include a date string of |
@amontalenti Yes, this issue is now fixed. No need to backslash the quotes. |
Streamparse has been published on Clojars as |
@slava92 The next release will do away with the need for the Clojure library entirely, so that won't be a problem much longer. |
It appears that when passing extra arguments to
sparse run
via-o
the topology configuration generated is not JSON Serializable and throws an exception.Steps to reproduce:
-o 'my.conf="TEST"'
like so:sparse run -o 'my.conf="TEST"'
Caught exception: Topology conf is not json-serializable
Upon further inspection, it looks like the lein command generated is missing the single quotes with the new argument, the generated command is below:
The text was updated successfully, but these errors were encountered: