Skip to content

admin-api-client + node-fetch erroring since a few days: Client network socket disconnected before secure TLS connection was established #1851

Open
@b0dea

Description

Issue summary

Before opening this issue, I have:

  • Upgraded to the latest version of the relevant packages
    • @shopify/admin-api-client package and version: 1.0.4 + node-fetch 2.7.0 (as a fetch agent)
    • Node version: 18.20.4
    • Operating system: Deployed on AWS ECS/ECR
  • Found a reliable way to reproduce the problem that indicates it's a problem with the package
  • Looked for similar issues in this repository
  • Checked that this isn't an issue with a Shopify API

This happens even on the deployed app that never had issues. We have the app deployed on AWS ECR/ECS.

Below you can find errors happening continuously:

I was reading around

And it seems now we have to do some kind of a proxy. This has not happened since last week. We changed nothing in our system, and it has started spitting this error out. So, I am not sure what I should try now and how I should change the code so it works:

const fetch = require('node-fetch');

this.shopify = createAdminRestApiClient({
            storeDomain: process.env.SHOPIFY_URL,
            apiVersion: '2024-10',
            accessToken: process.env.SHOPIFY_ADMIN_API_TOKEN,
            customFetchApi: fetch
        });

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions