Authorization Error when running test with projectId in config json file

Hi,

We have the options in a config file 1scaledobject100metrics · GitHub

@$(K6_ENVS) TARGET_SCALABLEDOBJECTS=10 TARGET_METRICS=1 ./k6 run --out cloud tests/test-scaledobject.js --config configs/scaledobjects/1scaledobject100metrics.json

with the following error

Init [--------------------------------------] Starting outputs
default [--------------------------------------]
ERRO[0000] (403/E4) Missing Authorization token or trying to run an anonymous test
make: *** [execute-k6-scaledobjects] Error 255

Nevetheless when we have the same options within the test itself

it works properly.

We tried as well to follow the documentation and use the env variable K6_CLOUD_PROJECT_ID but using still

ext: {
loadimpact: {
name: “name-generated-random”,
},

with the same result :frowning:

Maybe are we doing something wrong with the config file? As we would really like to have all the different workloads specified in the configs file as we do when running in local.

Thanks

Hi @Avivanco,

From the config file you posted you do not have a token. So you will not be authorized when making the requset ot the cloud, which is exactly what hte message says.

Did you remove it before uploading it puclicly? Or was this the whole config.

If it is I expect you also do not have the token in your default config.

You can see the documentation on how to get and set the token including using env variables.

Hope this helps you !