I'm getting this errors while trying to run my k6 script on the cloud..anyone has an idea why

ERRO[0003] Post “https://ingest.k6.io/v1/validate-options”: x509: “*.k6.io” certificate is not standards compliant

Hi @jiideeh

Welcome to the community forums :wave:

Do you see the same error if you run the script locally? It’s easier to debug there if the same error happened when running locally: Troubleshooting

Can you share the (sanitized) script you are running? What’s the URL/s you are hitting with your tests?

Thanks in advance for the additional info.

Cheers!

i dont get any errors when running locally

here’s what the script looks like:

import http from "k6/http";
import { check, sleep } from "k6";

export let options = {  ext: {   
     loadimpact: {      
         projectID: 3627982, 
         name: "validate status code"    
        }  },
        stages: [
            { duration: '30s', target: 20 },
            { duration: '10s', target: 10 },
            { duration: '20s', target: 0 },
          ],
    }
export default function() {
   
    let res = http.get("https://randomuser.me/api/");
    console.log('Response time was ' + String(res.timings.duration) + ' ms');
    check(res, {
        "duration was <= " : (r) =>r.timings.duration <= 200,
        "status is 200": (r) => r.status === 200,
    });
    sleep(1); 
}

then i run this command on my vscode: k6 cloud /Users/babajide/Documents/k6/script.js

Hi @jiideeh

Can you share the k6 version you are running this with? I tested with my cloud account a similar script (1 VU, 1 iteration), with k6 version 0.43 and did not get the same error.

/mport http from "k6/http";
import { check, sleep } from "k6";

export let options = {
    ext: {
        loadimpact: {
            projectID: changeme,
            name: "immavalls-test"
        }
    }
}
export default function () {

    let res = http.get("https://randomuser.me/api/");
    console.log('Response time was ' + String(res.timings.duration) + ' ms');
    check(res, {
        "duration was <= ": (r) => r.timings.duration <= 200,
        "status is 200": (r) => r.status === 200,
    });
    sleep(1);
}

Thanks!

wow

k6 v0.42.0 ((devel), go1.19.5, darwin/amd64)

Hi again,

This seems to be a problem with the certificates from your local environment, which are not recognized. I don’t think the test gets started in the cloud in your case, it fails before. I’ll reach to the k6 cloud team for some help. Thanks for your patience.

Cheers!

thanks for the insight @eyeveebe

Hi @jiideeh

Do you have direct access to the k6 cloud, or are you going through a proxy?

What operating system / platform are you executing k6 from?

What happens if you run a curl (or equivalent in your OS) to the following URL, do you see a certificate error as well?

curl -X POST https://ingest.k6.io/v1/validate-options

In my case this works:

{"error":{"code":2,"details":{"json":["{'options': ['Missing data for required field.']}"]},"field_errors":{"json":["{'options': ['Missing data for required field.']}"]},"message":"Validation failed"}}

Thanks in advance for additional information.

Cheers!

yes i have direct access to k6 cloud

i’m using macos catalina 10.15

here’s the error i get when i run the url above ; {“error”:{“code”:2,“details”:{“json”:[“{‘options’: [‘Missing data for required field.’]}”]},“field_errors”:{“json”:[“{‘options’: [‘Missing data for required field.’]}”]},“message”:“Validation failed”}}

Hi @jiideeh

Thanks for sharing the results of your curl. We expected it would fail as k6, if there are issues in your macos and certificates / CAs. So we were surprised this worked.

@imiric suggested this probably relevant golang issue: crypto/x509: "certificate is not standards compliant" on MacOS · Issue #51991 · golang/go · GitHub. From crypto/x509: "certificate is not standards compliant" on MacOS · Issue #51991 · golang/go · GitHub they suggest rebooting. Have you tried a restart? Other comments mention upgrading the OS, though I would attempt a restart if you haven’t already.

Let us know how it goes.

Cheers!

after restarting my system it worked!. thanks a lot

1 Like