Error traceback not showing up in the log

25 views
Skip to first unread message
Message has been deleted

lywa...@gmail.com

unread,
Oct 14, 2019, 3:56:48 PM10/14/19
to Cloudprober
Hi,

I'm running cloudprober with the binary in a GKE container. However, when there's an error with the prober, the logging output doesn't show anything to state what the error is but only shows 

cloudprober 1571075707104404176 1571075811 labels=ptype=external,probe=test,dst= success=0 total=1 latency=0.000

When I ran the prober in a docker container, minikube and locally, the error traceback showed up like this
E1014 11:23:08.079129   15135 external.go:454] external probe process died with the status: exit status 1. Stderr: Traceback (most recent call last):
  File "./test.py", line 12, in <module>
    test()
  File "./test.py", line 6, in test
    r.raise_for_status()
  File "/Users/lingyiwang/Library/Python/2.7/lib/python/site-packages/requests/models.py", line 935, in raise_for_status
    raise HTTPError(http_error_msg, response=self)
requests.exceptions.HTTPError: 500 Server Error: INTERNAL SERVER ERROR for url: https://httpbin.org/status/500
cloudprober 1571077303053422024 1571077388 labels=ptype=external,probe=test,dst= success=0 total=1 latency=0.000


Here is the command I run
cloudprober --config_file cloudprober.cfg

and here is the content in cloudprober.cfg
probe {
  name: "test"
  type: EXTERNAL
  targets { dummy_targets {} }
  external_probe {
    mode: ONCE
    command: "./test.py"
  }
  interval_msec: 60000
  timeout_msec: 1000
}


test.py
#!/usr/bin/env python
import requests

def test():
  r = requests.get("https://httpbin.org/status/500")
  r.raise_for_status()
  
  return r


if __name__ == "__main__":
  test()



Another issue I notice when running the cloudprober binary in GKE container is that --log_dir does not write logs to file.
When I ran the command 
cloudprober --config_file cloudprober.cfg --log_dir logs
the "logs" directory ended up having nothing inside. 



Thanks,
Lingyi Wang

Lingyi Wang

unread,
Oct 14, 2019, 6:58:22 PM10/14/19
to Cloudprober
Sorry just found in the source code that the logs go into GCE when running on GKE.

Manu Garg

unread,
Oct 14, 2019, 7:28:16 PM10/14/19
to Lingyi Wang, Cloudprober
On Mon, Oct 14, 2019 at 3:58 PM Lingyi Wang <lywa...@gmail.com> wrote:
Sorry just found in the source code that the logs go into GCE when running on GKE.

Yes, sorry for the confusion. You're not the first person to be tripped by it. We should make it more clear and probably provide an option to not write to stackdriver by default while running on GCE. I'll file a github issue for the same.
 
--
You received this message because you are subscribed to the Google Groups "Cloudprober" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cloudprober...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/cloudprober/60553b04-5f56-4131-aedb-5ae6690c520e%40googlegroups.com.


--
Manu Garg
Creator of CloudproberPage Notes & Pacparser
"Journey is the destination of life."
Reply all
Reply to author
Forward
0 new messages