Closed vladionescu closed 4 years ago
Adding time keybase status
to the entrypoint shell script right before my bot gets executed shows that it returns kinda slowly but still faster than 5 seconds. The 'failed to auth' error persists. Why this is happening is likely a separate issue but I wanted to have this context here.
2020-02-21T01:59:47.814485Z real 0m1.311s A
2020-02-21T01:59:47.814497Z user 0m0.150s A
2020-02-21T01:59:47.814509Z sys 0m0.080s A
@vladionescu thanks for the report, we have a ticket internally to investigate this
@malware-unicorn fixed the OOM by adding a <-doneCh
in the timeout case:
https://github.com/malware-unicorn/go-keybase-chat-bot/blob/master/kbchat/kbchat.go#L64
On another note, I suspect the reason Command("status")
fails on Cloud Run is because Cloud Run captures STDOUT and STDERR for logging.
https://cloud.google.com/run/docs/logging#container-logs
They probably neglected to duplicate those file descriptors. @malware-unicorn doesn't see this fmt.Errorf()
printed, so something's going on with process output.
https://github.com/malware-unicorn/go-keybase-chat-bot/blob/master/kbchat/kbchat.go#L65
If that's the case, then p.StdoutPipe()
wouldn't be getting the expected output from status
.
The fix for this is either
Command()
output to an FD we control, and read from that.keybase
binary.@vladionescu https://github.com/keybase/go-keybase-chat-bot/pull/57 should address the memory leak, let's open a new issue for running on google cloud
Opened #58 for the Cloud Run shenanigans.
In my GCP Cloud Run logs I have a string of the following
Which finally ends in a
All of them are
Listen: failed to auth: unable to run Keybase command
, which comes from https://github.com/keybase/go-keybase-chat-bot/blob/1ce2a64ddf45c8fbdfd5c20a81c584bbdc00652f/kbchat/kbchat.go#L63-L65The reason why getUsername() is failing is unclear (and probably unrelated), but it doesn't seem that memory usage should increase as it keeps retrying.