We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Version: v20190819-local-dccaf36 Build Date: 2019-08-19 22:55:23 Git Revision: dccaf36 Support:
I expect that adding the --log-http flag to a command makes no difference to the request the server sees.
Adding the --log-http flag will send empty bodies in all requests (with incorrect content-length headers to boot).
client/pkg/util/logging_http_transport.go
Line 51 in dccaf36
Line 65 in dccaf36
drains the body for both r and reqCopy. It then sets a copy for reqCopy.
Logs:
./kn service create --log-http foo --image foo.bar ===== REQUEST ===== GET /apis/serving.knative.dev/v1alpha1/namespaces/default/services/foo HTTP/1.1 Host: 35.222.62.54 User-Agent: kn/v0.0.0 (linux/amd64) kubernetes/$Format Accept: application/json, */* Authorization: ******************************************************************************************************************************************* Accept-Encoding: gzip ===== RESPONSE ===== HTTP/2.0 404 Not Found Content-Length: 232 Audit-Id: a032637e-a483-4232-abfd-2ed69beae461 Content-Type: application/json Date: Mon, 19 Aug 2019 22:56:35 GMT {"kind":"Status","apiVersion":"v1","metadata":{},"status":"Failure","message":"services.serving.knative.dev \"foo\" not found","reason":"NotFound","details":{"name":"foo","group":"serving.knative.dev","kind":"services"},"code":404} * * * * * * ===== REQUEST ===== POST /apis/serving.knative.dev/v1alpha1/namespaces/default/services HTTP/1.1 Host: 35.222.62.54 User-Agent: kn/v0.0.0 (linux/amd64) kubernetes/$Format Content-Length: 298 Accept: application/json, */* Authorization: ******************************************************************************************************************************************* Content-Type: application/json Accept-Encoding: gzip {"kind":"Service","apiVersion":"serving.knative.dev/v1alpha1","metadata":{"name":"foo","namespace":"default","creationTimestamp":null},"spec":{"template":{"metadata":{"name":"foo-wtltm-1","creationTimestamp":null},"spec":{"containers":[{"name":"","image":"foo.bar","resources":{}}]}}},"status":{}} ===== RESPONSE ===== HTTP/2.0 500 Internal Server Error Content-Length: 156 Audit-Id: ea98f490-abaf-47f3-a445-150a9c2d120b Content-Type: application/json Date: Mon, 19 Aug 2019 22:56:35 GMT {"kind":"Status","apiVersion":"v1","metadata":{},"status":"Failure","message":"request declared a Content-Length of 298 but only wrote 0 bytes","code":500} * * * * * *
This was followed by an unrelated panic:
panic: runtime error: invalid memory address or nil pointer dereference [signal SIGSEGV: segmentation violation code=0x1 addr=0x48 pc=0x116bb94] goroutine 1 [running]: knative.dev/client/pkg/errors.isCRDError(0x7f748f7b1208, 0xc000264120, 0xc000264120) /usr/local/google/home/harwayne/go-mod/github.com/knative/client/pkg/errors/factory.go:25 +0x74 knative.dev/client/pkg/errors.GetError(0x15986c0, 0xc000264120, 0xc0003e2000, 0x15986c0) /usr/local/google/home/harwayne/go-mod/github.com/knative/client/pkg/errors/factory.go:44 +0x8f knative.dev/client/pkg/serving/v1alpha1.(*knClient).CreateService(0xc000310260, 0xc0001eae00, 0x915503, 0xc0002a8280) /usr/local/google/home/harwayne/go-mod/github.com/knative/client/pkg/serving/v1alpha1/client.go:174 +0x84 knative.dev/client/pkg/kn/commands/service.createService(0x15e6800, 0xc000310260, 0xc0001eae00, 0x13dd649, 0x7, 0x1599000, 0xc000010018, 0x0, 0x0) /usr/local/google/home/harwayne/go-mod/github.com/knative/client/pkg/kn/commands/service/service_create.go:136 +0x4b knative.dev/client/pkg/kn/commands/service.NewServiceCreateCommand.func1(0xc0002a8c80, 0xc0002a2ac0, 0x1, 0x4, 0x0, 0x0) /usr/local/google/home/harwayne/go-mod/github.com/knative/client/pkg/kn/commands/service/service_create.go:100 +0x6e2 github.com/spf13/cobra.(*Command).execute(0xc0002a8c80, 0xc0002a2a80, 0x4, 0x4, 0xc0002a8c80, 0xc0002a2a80) /usr/local/google/home/harwayne/go-mod/github.com/knative/client/vendor/github.com/spf13/cobra/command.go:762 +0x465 github.com/spf13/cobra.(*Command).ExecuteC(0xc0002a8280, 0x15bc74fbd460474b, 0x206aa20, 0x51cddf) /usr/local/google/home/harwayne/go-mod/github.com/knative/client/vendor/github.com/spf13/cobra/command.go:852 +0x2ec github.com/spf13/cobra.(*Command).Execute(...) /usr/local/google/home/harwayne/go-mod/github.com/knative/client/vendor/github.com/spf13/cobra/command.go:800 main.main() /usr/local/google/home/harwayne/go-mod/github.com/knative/client/cmd/kn/main.go:36 +0xb6
The text was updated successfully, but these errors were encountered:
Fix release steps to push only specific tag (knative#377)
b593750
[release-v1.12] Add func ld flags file (knative#377)
0a5a361
* [release-v1.12] Add func ld flags file * Update S-O branch
Successfully merging a pull request may close this issue.
In what area(s)?
What version of Knative Client?
Version: v20190819-local-dccaf36
Build Date: 2019-08-19 22:55:23
Git Revision: dccaf36
Support:
Expected Behavior
I expect that adding the --log-http flag to a command makes no difference to the request the server sees.
Actual Behavior
Adding the --log-http flag will send empty bodies in all requests (with incorrect content-length headers to boot).
Expected Cause
client/pkg/util/logging_http_transport.go
Line 51 in dccaf36
Copies the request. Importantly, Request's Body is an interface and therefore a pass by reference. Body can only be read once, so
client/pkg/util/logging_http_transport.go
Line 65 in dccaf36
drains the body for both r and reqCopy. It then sets a copy for reqCopy.
Steps to Reproduce the Problem
Logs:
This was followed by an unrelated panic:
The text was updated successfully, but these errors were encountered: