Getting error while calling sender.transfer

ts-sdk version: ^0.101.0
Fuel-core : 0.43.1
CODE:
let provider = new Provider(this.config.rpcUrl);
const sender = Wallet.fromPrivateKey(fromAccount.data.privateKey, provider);
response = await sender.batchTransfer([{amount: args.balance, assetId: args.assetId,destination: destination.address}]);

ERROR:
responseClone.body?.getReader is not a function
TypeError: responseClone.body?.getReader is not a function
at parseGraphqlResponse (file:///home/ubuntu/Apps/custodian_backend/node_modules/@fuel-ts/account/dist/index.mjs:6339:40)
at Provider.fetchAndProcessBlockHeight (file:///home/ubuntu/Apps/custodian_backend/node_modules/@fuel-ts/account/dist/index.mjs:6511:36)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)

at async FuelGraphqlSubscriber.create (file:///home/ubuntu/Apps/custodian_backend/node_modules/@fuel-ts/account/dist/index.mjs:2248:22)

at async _Provider.sendTransaction (file:///home/ubuntu/Apps/custodian_backend/node_modules/@fuel-ts/account/dist/index.mjs:6931:26)

Hey @Prasanth :waving_hand:

This would seem to suggest that the response from the server doesn’t have a body, however, this should retry on failure and fail gracefully. I will add an issue for that now.

What RPC URL are you attempting to interact with?

Hello @p.s

I am sharing the RPC URL: https://mainnet.fuel.network/v1/graphql. We are facing this issue in production. I have tried most of the troubleshooting steps. Please help me resolve this issue.

Hi @Prasanth,

I’ve been struggle to replicate this. A potential fix for now would be to disable the RPC consistency mechanism. Could you try the following and let me know how you get on?

Provider.ENABLE_RPC_CONSISTENCY = false;

Hi @p.s ,

I am getting a new error when setting this command.
Provider.ENABLE_RPC_CONSISTENCY = false;

I am sharing the error I encountered.
TypeError: response.body.tee is not a function

at FuelGraphqlSubscriber.create (file:///home/ubuntu/Apps/custodian_backend/node_modules/@fuel-ts/account/dist/index.mjs:2261:55)

at process.processTicksAndRejections (node:internal/process/task_queues:95:5)

at async _Provider.sendTransaction (file:///home/ubuntu/Apps/custodian_backend/node_modules/@fuel-ts/account/dist/index.mjs:6932:26)

This is the response format I am getting in this file before
node_modules/@fuel-ts/account/dist/index.mjs:2261

Response {
size: 0,
timeout: 0,
[Symbol(Body internals)]: {
body: PassThrough {
_events: [Object],
_readableState: [ReadableState],
_writableState: [WritableState],
allowHalfOpen: true,
_maxListeners: undefined,
_eventsCount: 5,
[Symbol(shapeMode)]: true,
[Symbol(kCapture)]: false,
[Symbol(kCallback)]: null
},
disturbed: false,
error: null
},
[Symbol(Response internals)]: {
url: ‘https://mainnet.fuel.network/v1/graphql-sub’,
status: 200,
statusText: ‘OK’,
headers: Headers { [Symbol(map)]: [Object: null prototype] },
counter: 0
}
}

Okay - thanks for giving that a go.

Please could you provide me some extra information:

  • A timestamp that you made the request.
  • Runtime environment (node, bun, etc) and version you’re currently using.

Hey @Prasanth :waving_hand:

Hope you’re well!

I’ve pushed through a PR to detect and throw an error with additional information about what potentially is going wrong. I did a lot of testing to try and replicate this, and was unsuccessful in my attempts.

My only thought would be that something on your server is blocking the connection for the subscription - have you tried running this on your local machine?