Resolving "Errorconnect ECONNREFUSED 127.0.0.1:80" in Axios Code?

This topic was automatically generated from Slack. You can find the original thread here.

Hi. I’m getting an “Errorconnect ECONNREFUSED 127.0.0.1:80” from an Axios code sometimes. Can anybody help me figure out what is going wrong?

Can you share the configuration of your axios call?

This has happened to me before when I didn’t set the URL param properly.

Hi . Thanks.
const axios = require(“axios”)

if (this.uploadResponse.id != ‘’){
const ax = await axios({
url: ‘’+this.kumaUrl+‘status=up&msg=OK&ping=’,
method: ‘GET’,

        })
        console.log("KumaURL:");
        console.log(**this**.kumaUrl+'status=up&msg=OK&ping=');

        console.log(ax.status);
}

**else** {
      **const** axdown = **await** axios({
           url: ''+**this**.kumaUrl+'status=down&msg=Fikk ikke lastet opp til Google&ping=',
            method: 'GET',
        })
        console.log("KumaURL:");
        console.log(**this**.kumaUrl+'status=down&msg=Fikk ikke lastet opp til Google&ping=');
        console.log(axdown.status);
}

Thanks for sharing Martin.

I suspect your prop kumaUrl is sometimes undefined instead of a valid URL base.

When you select one of these failed executions, you can open the Input tab in the bottom of this axios call step and see exactly what kumaUrl was passed in that case.

Ah, you are probably very correct! Thanks. That variable is only defined in some cases, but it seems like it executed on an IF-clause even with a empty url when it shouldn’t.

Thanks. The worfklow is V1, do I have the input tab?