Why am I Receiving a `connect ECONNREFUSED 127.0.0.1:80` Error from Axios in One Workflow But Not in Another?

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

I’m getting a connect ECONNREFUSED 127.0.0.1:80 error from axios in one workflow, but not in another. The requests are pretty much identical. Can I share development mode workflows with support?

Hi , typically you’ll see this when you’re not passing a url or passing a malformed URL in that section (e.g. just passing a path like /foo vs. https://example.com/foo. Can you check the value of the URL? If that doesn’t work, can you share the full code?

const graphQuery = `
      query Email_campaign_stats {
        email_campaign_stats(
          limit: 2, 
          offset: 0
        ) {
            click_count
            click_details
            click_time
            custom_email_message
            custom_optional_email_message_1
            custom_subject
            email_campaign_id
            email_campaign_seq_id
            email_details
            email_lead_map_id
            got_reply
            has_new_unread_email
            id
            ignore_reply
            is_bounced
            is_clicked
            is_opened
            is_sent
            is_unsubscribed
            latest_reply_time
            ln_connection_request_status
            message_id
            open_count
            open_time
            reply_message_details
            reply_time
            sent_time
            seq_variant_id
            status
            status_message
            webhook_logs
        }
      }
    `
    console.log('graphQuery: ', graphQuery)

    const graphRes = await axios($, {
      url: 'https://gql.smartlead.ai/v1/graphql',
      method: "POST",
      headers: {
        Authorization: `Bearer ${process.env.smartlead_graphql_access_token}`
      },
      data: {
        query: graphQuery,
      },
    });
    return;

Interesting. Feel free to share your workflow and DM me your workflow URL. Do you mind if I test / modify that step if necessary?

Do I need to be a workspace admin to update project settings?

no, you shouldn’t need to be. Is the Update Project button not clickable for you when you check that box?

It’s not clickable

if you refresh, is the project still shared with support?

It’s unchecked if I refresh

weird thanks, and checking again still fails? Let me see if I can repro on a new project and check with the team

Okay, and checking it again still fails

had you originally set up your project with GitHub sync via the OAuth option or via Deploy Key?

deploy key

what axios import do you have in this code step?

Here’s a full step I put in another test workflow that gets the same error:

// To use any npm package, just import it
import axios from "axios";

export default defineComponent({
  props: {
    graphqlEndpoint: {
      type: "string",
      label: "GraphQL Endpoint",
    },
  },
  async run({ steps, $ }) {
    // Get Smartlead email_campaign_leads_mappings
    const graphQuery = `
      query Email_campaign_stats {
        email_campaign_stats(
          limit: 2,
          offset: 0
        ) {
            click_count
            click_details
            click_time
            custom_email_message
            custom_optional_email_message_1
            custom_subject
            email_campaign_id
            email_campaign_seq_id
            email_details
            email_lead_map_id
            got_reply
            has_new_unread_email
            id
            ignore_reply
            is_bounced
            is_clicked
            is_opened
            is_sent
            is_unsubscribed
            latest_reply_time
            ln_connection_request_status
            message_id
            open_count
            open_time
            reply_message_details
            reply_time
            sent_time
            seq_variant_id
            status
            status_message
            webhook_logs
        }
      }
    `
    console.log('graphQuery: ', graphQuery)

    const graphRes = await axios($, {
      url: this.graphqlEndpoint,
      method: "POST",
      headers: {
        Authorization: `Bearer ${process.env.smartlead_graphql_access_token}`
      },
      data: {
        query: graphQuery,
      },
    });
    return;
  },
})

I think the issue could be with that smartlead hostname I’m pulling from.

Thanks. Standard axios doesn’t support the $ as the first argument, that’s specific to @pipedream/platform axios . Try replacing the import to use ours and it should work: @pipedream/platform axios

import { axios } from "@pipedream/platform"
1 Like

That was it!

cool glad to hear that worked

could you also refresh pipedream.com whenever you have a moment and see if checking the support box on your project settings lets you save that change now?