WARN[0000] error getting terminal size


I’m getting the following Error when I try to run my test.
WARN[0000] error getting terminal size error=“The handle is invalid.”
panic: runtime error: integer divide by zero

I’m a student and have never used this program before so i’m not 100% sure if I have something setup wrong. I tried changing the web address to the one in listed in the docs under running k6 and received the same result.(test.k6.io’)

I tried trimming down the test to the bare min by committing as much as i could out but also received the same error.

Any help you can give would be greatly appreciated.
The full info that shows after running the test is below.

  execution: local
     script: k6load.js
     output: -

  scenarios: (100.00%) 1 executors, 20 max VUs, 1m0s max duration (incl. graceful stop):
           * default: Up to 20 looping VUs for 30s over 1 stages (gracefulRampDown: 30s, gracefulStop: 30s)
WARN[0000] error getting terminal size                   error="The handle is invalid."
panic: runtime error: integer divide by zero
 [there is more info about pulling data from github but it will not let me post it due to posting link cap]

I am using the latest version of k6 and have updated everything on the windows side:
k6 v0.27.0 (2020-07-14T12:09:46+0000/v0.27.0-0-g6fa889d0, go1.14.4, windows/amd6 4)

My k6 file is as follows:

import {http} from 'k6/http';
import { check, sleep } from 'k6';
// import { Counter, Rate } from 'k6/metrics';
// const CounterErrors = new Counter('Errors');
// const ErrorRate = new Rate('error_rate');
export const options = {
  stages: [
    { duration: '30s', target: 20 },
    // { duration: '1m30s', target: 10 },
    // { duration: '20s', target: 0 },
//   thresholds: {
//     error_rate: ['rate<0.1'],
//   },

export default function () {
  const res = http.get('');
  //   const success = check(res, {
  //     'status is 200': (r) => r.status === 200,
  //   });
  //   if (!success) {
  //     ErrorCount.add(1);
  //     ErrorRate.add(true);
  //   } else {
  //     ErrorRate.add(false);
  //   }

Thanks for reporting this! This seems like a bug in the newly released k6 v0.27.0. Can you give me more details about your setup - which terminal are you using?

Also, can you post everything else, I’ve relaxed the forum rules for you so you should be able to post. Any stacktraces will be much appreciated!

Just to note: i also received this error with the last version of k6 yesterday. I updated today in hopes of fixing it.

I am not sure what info you would need so here is everything i can think of:

Terminal: Git Bash
Database: Postgres
server: Express

Windows 10 Home
version 2004
build 19041.388

Thanks, @AaronW! I’ve created panic: runtime error: integer divide by zero · Issue #1559 · grafana/k6 · GitHub to track this issue. Meanwhile, can you try other terminals to run k6 from, like cmd, powershell, the new microsoft terminal, cmder, etc., and tell us if k6 is working or having the same issue in the ones that you can try?

Hi @AaronW,

we’re working on a fix for this, but in the meantime other terminals should work fine as Ned suggested, and a workaround for the Git Bash (mintty) terminal is to use winpty, which should already be pre-installed in your Git Bash environment.

So you would run k6 with something like:

winpty k6 run script.js

You might have to specify the absolute path to k6 if it’s not in your system PATH, like so:

winpty /c/Users/.../k6 run script.js

Sorry for the inconvenience :frowning: We’ll publish a fix in v0.27.1 as soon as possible.

A brief update that we released v0.27.1, which should fix this issue: Release v0.27.1 · grafana/k6 · GitHub

Though, as mentioned in the release notes, if you want to continue using git bash/mintty, k6 wouldn’t work as well as it would in other terminals unless you run it through winpty