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

gRPC Module exit code 107 fails to log an error #167

Closed
kneemaa opened this issue Nov 16, 2022 · 3 comments · Fixed by #174
Closed

gRPC Module exit code 107 fails to log an error #167

kneemaa opened this issue Nov 16, 2022 · 3 comments · Fixed by #174
Labels
bug Something isn't working

Comments

@kneemaa
Copy link
Contributor

kneemaa commented Nov 16, 2022

Brief summary

This was found while trying to configure gRPC tests with the Operator + Runner model.

If the importPath for the loaded .proto file does not exist, K6 will exit with code 107 (script exception).

When running K6 locally - k6 run test.js - the error is easy to see and debug
Ex.

k6 run test.js

          /\      |‾‾| /‾‾/   /‾‾/   
     /\  /  \     |  |/  /   /  /    
    /  \/    \    |     (   /   ‾‾\  
   /          \   |  |\  \ |  (‾)  | 
  / __________ \  |__| \__\ \_____/ .io

ERRO[0000] GoError: stat /Users/nema/kneemaa/hello.proto: no such file or directory
        at reflect.methodValueCall (native)
        at file:///Users/kneemaa/core/test.js:5:13(35)
        at native  hint="script exception"

But when ran in Kubernetes with the Operator model, the pods end up in an Error status and have no logs to indicate what the error is. When you describe the pod you can see that the exit code is 107

    Port:          6565/TCP
    Host Port:     0/TCP
    Command:
      sh
      -c
      k6 archive --log-output=none /test/grpc.js -O ./grpc.js.archived.tar  && k6 inspect --execution-requirements --log-output=none ./grpc.js.archived.tar
    State:          Terminated
      Reason:       Error
      Exit Code:    107
      Started:      Tue, 15 Nov 2022 22:26:20 -0800
      Finished:     Tue, 15 Nov 2022 22:26:21 -0800
    Ready:          False
    Restart Count:  0

No logs available

➜ kubectl -n chaos grpc-stress-initializer-bsppv

k6 version

k6 v0.41.0 ((devel), go1.19.3, darwin/arm64)

OS

macOS 12, kubernetes 1.24.1

Docker version and image (if applicable)

No response

Steps to reproduce the problem

  1. Setup a gRPC test following the steps in this article - https://k6.io/blog/performance-testing-grpc-services/
  2. Confirm you can successfully test
  3. Update the importPath of client.load(['definitions'], 'hello.proto'); to be something invalid
  4. Re-run the test
  5. Observe error but no log output.

Expected behaviour

Helpful output for exit code 107 to logs for debugging

Actual behaviour

No log output for exit code 107

@kneemaa kneemaa added the bug Something isn't working label Nov 16, 2022
@na--
Copy link
Member

na-- commented Nov 16, 2022

The problem seems to be that k6 is executed with --log-output=none, so that is why it doesn't show the error. I will move the issue to the k6-operator repo, since in this case it seems like k6 is working as intended.

@na-- na-- transferred this issue from grafana/k6 Nov 16, 2022
@kneemaa
Copy link
Contributor Author

kneemaa commented Nov 16, 2022

@na-- any ideas on where to set this for initializer? We are attempting to build our own debug images locally and use that image to test but the --log-output is staying at none

@yorugac
Copy link
Collaborator

yorugac commented Dec 9, 2022

Hi @kneemaa, thanks for opening the issue! This happened due to some peculiarities of k6 logging requiring workarounds. I've discussed this case with k6 team and just added a fix in PR #174, please see.

Related: grafana/k6-docs#877

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants