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

fortio curl context deadline exceeded (Client.Timeout exceeded while awaiting headers) #798

Closed
gongxh13 opened this issue Jul 18, 2023 · 3 comments

Comments

@gongxh13
Copy link

Accourding fortio official github introdution, run fortio curl -stdclient -payload-file sample.json "http://localhost:8080/fortio/rest/run?jsonPath=.metadata" > result.json command, and I set sample.json as below:

{
    "metadata": {
        "url": "localhost:8080",
        "payload": "foo",
        "qps": "40",
        "c": "10",
        "t": "30s",
        "headers": [
            "Foo:Bar",
            "X-Blah: Something else"
        ],
        "save": "on"
    }
}

Finally, below error happened:

14:49:17.590 I scli.go:107> Starting Φορτίο 1.57.3 h1:kdPlBiws3cFsLcssZxCt2opFmHj14C3yPBokFhMWzmg= go1.20.6 amd64 linux
14:49:20.594 E Unable to send request, method="POST", url="http://localhost:8080/fortio/rest/run?jsonPath=.metadata", err="Post \"http://localhost:8080/fortio/rest/run?jsonPath=.metadata\": context deadline exceeded (Client.Timeout exceeded while awaiting headers)", thread="0", run="0"
14:49:20.594 E Error status -1

After 30s, the execute result file generate at disk.

@gongxh13
Copy link
Author

I solved this problem.
Add -timeout parameter in fortio curl command can succeed.

@ldemailly
Copy link
Member

glad you found it - fortio has many flags so sometimes it can be hard to find (#739)

@ldemailly
Copy link
Member

ldemailly commented Jul 18, 2023

@gongxh13 also note there is the &async=on you maybe want to use when triggering rest API calls to make them not wait for completion and you can get the result later

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