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

argument REQUEST_ITEM: 'active' is not a valid value #13

Open
maxandersen opened this issue Aug 23, 2022 · 1 comment
Open

argument REQUEST_ITEM: 'active' is not a valid value #13

maxandersen opened this issue Aug 23, 2022 · 1 comment

Comments

@maxandersen
Copy link
Contributor

I run:

eval "$(curl -sS localhost:8001/setup)"
HTTP Toolkit interception enabled

now when running java but not all I get this error:

Picked up JAVA_TOOL_OPTIONS:  -javaagent:"/Applications/HTTP Toolkit.app/Contents/Resources/httptoolkit-server/overrides/java-agent.jar"=127.0.0.1|8000|/Users/max/Library/Preferences/httptoolkit/ca.pem -javaagent:"/Applications/HTTP Toolkit.app/Contents/Resources/httptoolkit-server/overrides/java-agent.jar"=127.0.0.1|8000|/Users/max/Library/Preferences/httptoolkit/ca.pem
usage:
    http [METHOD] URL [REQUEST_ITEM ...]

error:
    argument REQUEST_ITEM: 'active' is not a valid value

for more information:
    run 'http --help' or visit https://httpie.io/docs/cli

I got no references to http so just assuming this is httptoolkit agent causing it ?

@pimterry
Copy link
Member

It looks like the value in JAVA_TOOL_OPTIONS is doubled up there, which is odd. Did you run the eval command twice, or run it in an already intercepted terminal?

Regardless, though that's weird I wouldn't expect it to cause this... That error appears to be coming from Httpie. HTTP Toolkit certainly doesn't ship with that included, and doesn't call it itself anywhere (or at least, not on purpose).

My best guess - which is a bit of a stretch - is that somehow this println that logs when the agent is set up is being read into something else. I.e. something is reading from stdout and running what it gets as a command. If HTTP runs httpie in your terminal, then this would plausibly run that command, and it would produce almost exactly that error.

E.g. on my machine, running that println as a command in bash:

> http toolkit interception active
usage: http [--json] [--form] [--pretty {all,colors,format,none}] [--style STYLE] [--print WHAT] [--headers] [--body] [--verbose] [--all] [--history-print WHAT] [--stream] [--output FILE]
            [--download] [--continue] [--session SESSION_NAME_OR_PATH | --session-read-only SESSION_NAME_OR_PATH] [--auth USER[:PASS]] [--auth-type {basic,digest}]
            [--proxy PROTOCOL:PROXY_URL] [--follow] [--max-redirects MAX_REDIRECTS] [--timeout SECONDS] [--check-status] [--verify VERIFY] [--ssl {ssl2.3,tls1,tls1.1,tls1.2}] [--cert CERT]
            [--cert-key CERT_KEY] [--ignore-stdin] [--help] [--version] [--traceback] [--default-scheme DEFAULT_SCHEME] [--debug]
            [METHOD] URL [REQUEST_ITEM [REQUEST_ITEM ...]]
http: error: argument REQUEST_ITEM: "active" is not a valid value

No idea why println output would be executed like this though, that's quite unusual.

Does that sound plausible in your setup? We could log to stderr instead, which might be generally a bit safer, but I've never seen this cause issues before.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants