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

@eyeveebee getting a similar issue when running from an AWS ec2 instance.
k6: v0.49.0
go: 1.21.6
OS: Amazon/Linux

k6 run --out cloud test.js
ERRO[0001] Post “https://ingest.k6.io/v1/tests”: tls: failed to verify certificate: x509: certificate signed by unknown authority

Same issue with curl

$ curl -X POST …
curl: (60) SSL certificate problem: unable to get local issuer certificate
More details here:

curl failed to verify the legitimacy of the server and therefore could not
establish a secure connection to it. To learn more about this situation and
how to fix it, please visit the web page mentioned above.

so tried it with the insecureSkipTLSVerify: true
and via the cli as well… no diff

however the following did work
k6 login --token ***

So not sure if the insecureSkip flag is also applied to the “–out cloud” logic?

Hi @williammiller2 !

Welcome to the community forums! :wave:

To be honest, it seems like environmental issues, most likely.

Out of curiosity, which version of Amazon Linux are you using, and how was K6 set up there?

Here is what was selected for the ec2 image

once on the instance here is how are the steps I used to configure the instance and install k6:

even so, curl isn’t happy either but I can tell it to ignore the ssl verify and got a good response that way so not sure why when I added the “–output cloud” why its still trying to check ssl validation.

Follow Up

I did create an ubuntu x86 instance
Followed the k6 install instructions… however getting a cert error when installing k6 via apt-update
so trying to figure out the cert issue is and how to resolve that…

It was a certificate issue. When starting up a new ubuntu instance I needed to collect the dl.k6.io certs via openssl and import them in.
Once that was done I was able to install k6 via apt-get and then run with the --output cloud option

1 Like