-
Notifications
You must be signed in to change notification settings - Fork 174
Unable to connect o API server behind nginx/https reverse proxy after version 0.26.1-1 #751
Comments
I think I found out what is the issue... in case the response from the API server is sent as Transfer-Encoding: chunked, the Content-Length is not sent (while the response is valid...). Will try to find an appropriate patch to fix that... {"timestamp":"2018-01-08T09:48:52.238118315Z","level":"httptrace","src":{"func":"github.com/sensu/uchiwa/uchiwa/sensu.(*API).doRequest","line":62},"message":"Dump http HTTP/1.1 200 OK\r\nConnection: close\r\nTransfer-Encoding: chunked\r\nAccess-Control-Allow-Credentials: true\r\nAccess-Control-Allow-Headers: Origin, X-Requested-With, Content-Type, Accept, Authorization\r\nAccess-Control-Allow-Methods: GET, POST, PUT, DELETE, OPTIONS\r\nAccess-Control-Allow-Origin: *\r\nContent-Type: application/json\r\nDate: Mon, 08 Jan 2018 09:48:52 GMT\r\nServer: nginx/1.13.5\r\n\r\n1489\r\n[{"type":"metric","command":"c:/opt/sensu/embedded/bin/ruby c:/opt/sensu/embedded/bin/metric-windows-cpu-load.rb","interval":60,"subscribers":["windows-sensu-default"],"handlers":["influxdb"],"name":"metric_windows_cpu","tags":{"client":":::customer|none:::","environment":":::environment|none:::","application":":::application|none:::"}},{"type":"metric","command":"c:/opt/sensu/embedded/bin/ruby c:/opt/sensu/embedded/bin/metric-windows-ram-usage.rb","interval":60,"subscribers":["windows-sensu-default"],"handlers":["influxdb"],"name":"metric_windows_mem","tags":{"client":":::customer|none:::","environment":":::environment|none:::","application":":::application|none:::"}},{"type":"metric","command":"c:/opt/sensu/embedded/bin/ruby c:/opt/sensu/embedded/bin/metric-windows-disk-usage.rb","interval":60,"subscribers":["windows-sensu-default"],"handlers":["influxdb"],"name":"metric_windows_disk","tags":{"client":":::customer|none:::","environment":":::environment|none:::","application":":::application|none:::"}},{"type":"metric","command":"c:/opt/sensu/embedded/bin/ruby c:/opt/sensu/embedded/bin/metric-windows-network.rb","interval":60,"subscribers":["windows-sensu-default"],"handlers":["influxdb"],"name":"metric_windows_network","tags":{"client":":::customer|none:::","environment":":::environment|none:::","application":":::application|none:::"}},{"command":"c:/opt/sensu/embedded/bin/ruby c:/opt/sensu/embedded/bin/check-windows-disk.rb -w :::disk.warning|80::: -c :::disk.critical|90:::","subscribers":["windows-sensu-default"],"interval":60,"recovery_procedure":"https://itop.operations.1.1.1.1.com/pages/UI.php?operation=details\u0026class=DocumentNote\u0026id=277\u0026c[menu]=Document","environment":":::environment|none:::","occurrences":3,"application":":::application|none:::","name":"check_windows_disk_usage"},{"command":"c:/opt/sensu/embedded/bin/ruby c:/opt/sensu/embedded/bin/check-windows-ram.rb -w :::mem.warning|80::: -c :::mem.critical|90:::","subscribers":["windows-sensu-default"],"interval":60,"recovery_procedure":"https://itop.operations.1.1.1.1.com/pages/UI.php?operation=details\u0026class=DocumentNote\u0026id=278\u0026c[menu]=Document","environment":":::environment|none:::","occurrences":3,"application":":::application|none:::","name":"check_windows_mem_usage"},{"command":"c:/opt/sensu/embedded/bin/ruby c:/opt/sensu/embedded/bin/check-windows-cpu-load.rb -w :::cpu.warning|80::: -c :::cpu.critical|90:::","subscribers":["windows-sensu-default"],"interval":60,"recovery_procedure":"https://itop.operations.1.1.1.1.com/pages/UI.php?operation=details\u0026class=DocumentNote\u0026id=278\u0026c[menu]=Document","environment":":::environment|none:::","occurrences":3,"application":":::application|none:::","name":"check_windows_cpu"},{"type":"metric","command":"/opt/sensu/embedded/bin/ruby /opt/sensu/embedded/bin/metrics-load.rb","interval":60,"subscribers":["linux-sensu-default"],"handlers":["default"],"name":"metric_load","tags":{"client":"1.1.1.1","application":":::application|none:::","environment":":::environment|none:::"}},{"type":"metric","command":"/opt/sensu/embedded/bin/ruby /opt/sensu/embedded/bin/metrics-cpu-pcnt-usage.rb","interval":60,"subscribers":["linux-sensu-default"],"handlers":["default"],"name":"metric_cpu","tags":{"client":"1.1.1.1","application":":::application|none:::","environment":":::environment|none:::"}},{"type":"metric","command":"/opt/sensu/embedded/bin/ruby /opt/sensu/embedded/bin/metrics-memory-percent.rb","interval":60,"subscribers":["linux-sensu-default"],"handlers":["default"],"name":"metric_mem","tags":{"client":"1.1.1.1","application":":::application|none:::","environment":":::environment|none:::"}},{"type":"metric","command":"/opt/sensu/embedded/bin/ruby /opt/sensu/embedded/bin/metrics-disk-usage.rb","interval":60,"subscribers":["linux-sensu-default"],"handlers":["default"],"name":"metric_disk","tags":{"client":"1.1.1.1","application":":::application|none:::","environment":":::environment|none:::"}},{"type":"metric","command":"/opt/sensu/embedded/bin/ruby /opt/sensu/embedded/bin/metrics-interface.rb","interval":60,"subscribers":["linux-sensu-default"],"handlers":["default"],"name":"metric_network","tags":{"client":"1.1.1.1","application":":::application|none:::","environment":":::environment|none:::"}},{"command":"check-disk-usage.rb -w :::disk.warning|80::: -c :::disk.critical|90::: -p /sys/kernel/debug/tracing ","subscribers":["linux-sensu-default"],"interval":60,"environment":":::environment|none:::","application":":::application|none:::","name":"check_disk_usage"},{"command":"check-memory-percent.rb -w :::mem.warning|80::: -c :::mem.critical|90:::","subscribers":["linux-sensu-default"],"interval":60,"environment":":::environment|none:::","application":":::application|none:::","name":"check_mem_usage"},{"command":"check-process.rb -w :::proc.warning|300::: -c :::proc.critical|350:::","subscribers":["linux-sensu-default"],"interval":60,"environment":":::environment|none:::","application":":::application|none:::","name":"check_proc_number"},{"command":"check-load.rb -w :::load.warning|3,3,2::: -c :::load.critical|5,4,3:::","subscribers":["linux-sensu-default"],"interval":60,"environment":":::environment|none:::","application":":::application|none:::","name":"check_load"}]\r\n0\r\n\r\n"} |
Can we bump this? We can not upgrade at all due to this bug. |
you can use my fork in the meantime : https://github.com/jpoizat/uchiwa it works and contains everything but the change that causes me an issue... |
Thank you |
Closed by #771 |
Since version 0.26.1, connection to a DC using https is not working anymore... rolling back to 0.26.0 works but I'm not able to upgrade beyond that...
Expected Behavior
Normal connectivity to API server over https
Current Behavior
the DC/API is displaying with the following message :
Datacenter XXX returned:unknown content length of -1
Possible Solution
no idea :(
Steps to Reproduce (for bugs)
Configure api server behind nginx using https and login/password
DC config :
{
"name": "xxx",
"host": "xxx.abc.com",
"user": "admin",
"pass": "password",
"ssl": true,
"insecure": false,
"port": 443
}
works with 0.26.0 and broken at 0.26.1 and over (some version will go to traceback, and 1.1.0-1 will go to the error described before.
Logs from tracing http on container:
{"timestamp":"2018-01-05T16:44:22.917291855Z","level":"info","src":{"func":"github.com/sensu/uchiwa/uchiwa/daemon.(*Daemon).fetchData","line":74},"message":"Updating the datacenter xxx"}
{"timestamp":"2018-01-05T16:44:22.917349267Z","level":"debug","src":{"func":"github.com/sensu/uchiwa/uchiwa/sensu.(*Sensu).getSlice","line":54},"message":"GET https://xxx.xxx.com:443/stashes"}
{"timestamp":"2018-01-05T16:44:22.924670354Z","level":"httptrace","src":{"func":"github.com/sensu/uchiwa/uchiwa/sensu.(*API).doRequest.func1","line":25},"message":"Dial started for request https://xxx.xxx.com:443/stashes: tcp 10.194.255.209:443"}
{"timestamp":"2018-01-05T16:44:22.925608978Z","level":"httptrace","src":{"func":"github.com/sensu/uchiwa/uchiwa/sensu.(*API).doRequest.func2","line":31},"message":"Dial done with error=nil"}
{"timestamp":"2018-01-05T16:44:22.930356705Z","level":"httptrace","src":{"func":"github.com/sensu/uchiwa/uchiwa/sensu.(*API).doRequest.func5","line":43},"message":"TLS handshake done with error=nil"}
{"timestamp":"2018-01-05T16:44:22.930406148Z","level":"httptrace","src":{"func":"github.com/sensu/uchiwa/uchiwa/sensu.(*API).doRequest.func3","line":34},"message":"Successful connection details: {Conn:0xc4203e2a80 Reused:false WasIdle:false IdleTime:0s}"}
{"timestamp":"2018-01-05T16:44:22.932949579Z","level":"httptrace","src":{"func":"github.com/sensu/uchiwa/uchiwa/sensu.(*API).doRequest.func4","line":37},"message":"Got first response byte for the request"}
{"timestamp":"2018-01-05T16:44:22.933130305Z","level":"httptrace","src":{"func":"github.com/sensu/uchiwa/uchiwa/sensu.(*API).doRequest","line":61},"message":"Length of response body: 2 bytes"}
{"timestamp":"2018-01-05T16:44:22.933271512Z","level":"httptrace","src":{"func":"github.com/sensu/uchiwa/uchiwa/sensu.(*API).doRequest","line":85},"message":"Closing connection"}
{"timestamp":"2018-01-05T16:44:22.933336989Z","level":"debug","src":{"func":"github.com/sensu/uchiwa/uchiwa/sensu.(*Sensu).getSlice","line":54},"message":"GET https://xxx.xxx.com:443/silenced"}
{"timestamp":"2018-01-05T16:44:22.940724429Z","level":"httptrace","src":{"func":"github.com/sensu/uchiwa/uchiwa/sensu.(*API).doRequest.func1","line":25},"message":"Dial started for request https://xxx.xxx.com:443/silenced: tcp 1.1.1.1:443"}
{"timestamp":"2018-01-05T16:44:22.941741519Z","level":"httptrace","src":{"func":"github.com/sensu/uchiwa/uchiwa/sensu.(*API).doRequest.func2","line":31},"message":"Dial done with error=nil"}
{"timestamp":"2018-01-05T16:44:22.946119727Z","level":"httptrace","src":{"func":"github.com/sensu/uchiwa/uchiwa/sensu.(*API).doRequest.func5","line":43},"message":"TLS handshake done with error=nil"}
{"timestamp":"2018-01-05T16:44:22.946194265Z","level":"httptrace","src":{"func":"github.com/sensu/uchiwa/uchiwa/sensu.(*API).doRequest.func3","line":34},"message":"Successful connection details: {Conn:0xc42003bc00 Reused:false WasIdle:false IdleTime:0s}"}
{"timestamp":"2018-01-05T16:44:22.948997625Z","level":"httptrace","src":{"func":"github.com/sensu/uchiwa/uchiwa/sensu.(*API).doRequest.func4","line":37},"message":"Got first response byte for the request"}
{"timestamp":"2018-01-05T16:44:22.949115931Z","level":"httptrace","src":{"func":"github.com/sensu/uchiwa/uchiwa/sensu.(*API).doRequest","line":61},"message":"Length of response body: 2 bytes"}
{"timestamp":"2018-01-05T16:44:22.949256798Z","level":"httptrace","src":{"func":"github.com/sensu/uchiwa/uchiwa/sensu.(*API).doRequest","line":85},"message":"Closing connection"}
{"timestamp":"2018-01-05T16:44:22.949326846Z","level":"debug","src":{"func":"github.com/sensu/uchiwa/uchiwa/sensu.(*Sensu).getSlice","line":54},"message":"GET https://xxx.xxx.com:443/checks"}
{"timestamp":"2018-01-05T16:44:23.021802252Z","level":"httptrace","src":{"func":"github.com/sensu/uchiwa/uchiwa/sensu.(*API).doRequest.func1","line":25},"message":"Dial started for request https://xxx.xxx.com:443/checks: tcp 1.1.1.1:443"}
{"timestamp":"2018-01-05T16:44:23.022856104Z","level":"httptrace","src":{"func":"github.com/sensu/uchiwa/uchiwa/sensu.(*API).doRequest.func2","line":31},"message":"Dial done with error=nil"}
{"timestamp":"2018-01-05T16:44:23.027906845Z","level":"httptrace","src":{"func":"github.com/sensu/uchiwa/uchiwa/sensu.(*API).doRequest.func5","line":43},"message":"TLS handshake done with error=nil"}
{"timestamp":"2018-01-05T16:44:23.027963094Z","level":"httptrace","src":{"func":"github.com/sensu/uchiwa/uchiwa/sensu.(*API).doRequest.func3","line":34},"message":"Successful connection details: {Conn:0xc4201d6700 Reused:false WasIdle:false IdleTime:0s}"}
{"timestamp":"2018-01-05T16:44:23.031447122Z","level":"httptrace","src":{"func":"github.com/sensu/uchiwa/uchiwa/sensu.(*API).doRequest.func4","line":37},"message":"Got first response byte for the request"}
{"timestamp":"2018-01-05T16:44:23.031560773Z","level":"httptrace","src":{"func":"github.com/sensu/uchiwa/uchiwa/sensu.(*API).doRequest","line":61},"message":"Length of response body: -1 bytes"}
{"timestamp":"2018-01-05T16:44:23.031661187Z","level":"warn","src":{"func":"github.com/sensu/uchiwa/uchiwa/sensu.(*Sensu).getSlice","line":59},"message":"GET https://xxx.xxx.com:443/checks returned: unknown content length of -1"}
{"timestamp":"2018-01-05T16:44:23.031680391Z","level":"debug","src":{"func":"github.com/sensu/uchiwa/uchiwa/daemon.(*Daemon).fetchData","line":96},"message":"unknown content length of -1"}
{"timestamp":"2018-01-05T16:44:23.031695247Z","level":"warn","src":{"func":"github.com/sensu/uchiwa/uchiwa/daemon.(*Daemon).fetchData","line":97},"message":"Connection failed to the datacenter xxx"}
but curl is working fine from the same location :
CApath: none
...
< HTTP/1.1 200 OK
< Server: nginx/1.13.5
< Date: Fri, 05 Jan 2018 20:01:49 GMT
< Content-Type: application/json
< Content-Length: 5257
< Connection: keep-alive
< Access-Control-Allow-Credentials: true
< Access-Control-Allow-Headers: Origin, X-Requested-With, Content-Type, Accept, Authorization
< Access-Control-Allow-Methods: GET, POST, PUT, DELETE, OPTIONS
< Access-Control-Allow-Origin: *
<
[{"type":"metric","command":"c:/opt/sensu/embedded/bin/ruby c:/opt/sensu/embedded/bin/metric-windows-cpu-load.rb","interval":60,"subscribers":["windows-sensu-default"],"handlers":["influxdb"],"name":"metric_windows_cpu","tags":{"client":":::customer|none:::","environment":":::environment|none:::","application":":::application|none:::"}},{"type":"metric","command":"c:/opt/sensu/embedded/bin/ruby c:/opt/sensu/embedded/bin/metric-windows-ram-usage.rb","interval":60,"subscribers":["windows-sensu-default"],"handlers":["influxdb"],"name":"metric_windows_mem","tags":{"client":":::customer|none:::","environment":":::environment|none:::","application":":::application|none:::"}},{"type":"metric","command":"c:/opt/sensu/embedded/bin/ruby c:/opt/sensu/embedded/bin/metric-windows-disk-usage.rb","interval":60,"subscribers":["windows-sensu-default"],"handlers":["influxdb"],"name":"metric_windows_disk","tags":{"client":":::customer|none:::","environment":":::environment|none:::","application":":::application|none:::"}},{"type":"metric","command":"c:/opt/sensu/embedded/bin/ruby c:/opt/sensu/embedded/bin/metric-windows-network.rb","interval":60,"subscribers":["windows-sensu-default"],"handlers":["influxdb"],"name":"metric_windows_network","tags":{"client":":::customer|none:::","environment":":::environment|none:::","application":":::application|none:::"}},{"command":"c:/opt/sensu/embedded/bin/ruby c:/opt/sensu/embedded/bin/check-windows-disk.rb -w :::disk.warning|80::: -c :::disk.critical|90:::","subscribers":["windows-sensu-default"],"interval":60,"recovery_procedure":"https://itop.operations.edifixio.com/pages/UI.php?operation=details&class=DocumentNote&id=277&c[menu]=Document","environment":":::environment|none:::","occurrences":3,"application":":::application|none:::","name":"check_windows_disk_usage"},{"command":"c:/opt/sensu/embedded/bin/ruby c:/opt/sensu/embedded/bin/check-windows-ram.rb -w :::mem.warning|80::: -c :::mem.critical|90:::","subscribers":["windows-sensu-default"],"interval":60,"recovery_procedure":"https://itop.operations.edifixio.com/pages/UI.php?operation=details&class=DocumentNote&id=278&c[menu]=Document","environment":":::environment|none:::","occurrences":3,"application":":::application|none:::","name":"check_windows_mem_usage"},{"command":"c:/opt/sensu/embedded/bin/ruby c:/opt/sensu/embedded/bin/check-windows-cpu-load.rb -w :::cpu.warning|80::: -c :::cpu.critical|90:::","subscribers":["windows-sensu-default"],"interval":60,"recovery_procedure":"https://itop.operations.edifixio.com/pages/UI.php?operation=details&class=DocumentNote&id=278&c[menu]=Document","environment":":::environment|none:::","occurrences":3,"application":":::application|none:::","name":"check_windows_cpu"},{"type":"metric","command":"/opt/sensu/embedded/bin/ruby /opt/sensu/embedded/bin/metrics-load.rb","interval":60,"subscribers":["linux-sensu-default"],"handlers":["default"],"name":"metric_load","tags":{"client":"xxx","application":":::application|none:::","environment":":::environment|none:::"}},{"type":"metric","command":"/opt/sensu/embedded/bin/ruby /opt/sensu/embedded/bin/metrics-cpu-pcnt-usage.rb","interval":60,"subscribers":["linux-sensu-default"],"handlers":["default"],"name":"metric_cpu","tags":{"client":"xxx","application":":::application|none:::","environment":":::environment|none:::"}},{"type":"metric","command":"/opt/sensu/embedded/bin/ruby /opt/sensu/embedded/bin/metrics-memory-percent.rb","interval":60,"subscribers":["linux-sensu-default"],"handlers":["default"],"name":"metric_mem","tags":{"client":"xxx","application":":::application|none:::","environment":":::environment|none:::"}},{"type":"metric","command":"/opt/sensu/embedded/bin/ruby /opt/sensu/embedded/bin/metrics-disk-usage.rb","interval":60,"subscribers":["linux-sensu-default"],"handlers":["default"],"name":"metric_disk","tags":{"client":"xxx","application":":::application|none:::","environment":":::environment|none:::"}},{"type":"metric","command":"/opt/sensu/embedded/bin/ruby /opt/sensu/embedded/bin/metrics-interface.rb","interval":60,"subscribers":["linux-sensu-default"],"handlers":["default"],"name":"metric_network","tags":{"client":"xxx","application":":::application|none:::","environment":":::environment|none:::"}},{"command":"check-disk-usage.rb -w :::disk.warning|80::: -c :::disk.critical|90::: -p /sys/kernel/debug/tracing ","subscribers":["linux-sensu-default"],"interval":60,"environment":":::environment|none:::","application":":::application|none:::","name":"check_disk_usage"},{"command":"check-memory-percent.rb -w :::mem.warning|80::: -c :::mem.critical|90:::","subscribers":["linux-sensu-default"],"interval":60,"environment":":::environment|none:::","application":":::application|none:::","name":"check_mem_usage"},{"command":"check-process.rb -w :::proc.warning|300::: -c :::proc.critical|350:::","subscribers":["linux-sensu-default"],"interval":60,"environment":":::environment|none:::","application":":::application|none:::","name":"check_proc_number"},{"command":"check-load.rb -w :::load.warning|3,3,2::: -c :::load.critical|5,4,3:::","subscribers":["linux-sensu-default"],"interval":60,"environment":":::environment|none:::","application":":::application|none:::","name":"check_load"}]* Connection #0 to host xxx.xxx.com left intact
/go/src/github.com/sensu/uchiwa # curl -v --user admin:pass https://api.xxx.com:443/stashes
CApath: none
...
< HTTP/1.1 200 OK
< Server: nginx/1.13.5
< Date: Fri, 05 Jan 2018 20:02:59 GMT
< Content-Type: application/json
< Content-Length: 2
< Connection: keep-alive
< Access-Control-Allow-Credentials: true
< Access-Control-Allow-Headers: Origin, X-Requested-With, Content-Type, Accept, Authorization
< Access-Control-Allow-Methods: GET, POST, PUT, DELETE, OPTIONS
< Access-Control-Allow-Origin: *
<
Context
not able to upgrade to 1.1.0
Your Environment
The text was updated successfully, but these errors were encountered: