{"record":{"id":"afba57300b667b53","repo":"FuelLabs/fuels-ts","slug":"transaction-failed-afba57","errorCode":"TRANSACTION_FAILED","errorMessage":"Failed to deploy contract chunk","messagePattern":"Failed to deploy contract chunk","errorType":"exception","errorClass":"FuelError","httpStatus":null,"severity":"error","filePath":"packages/contract/src/contract-factory.ts","lineNumber":362,"sourceCode":"      // Deploy the chunks as blob txs\n      for (const { blobId, transactionRequest } of chunks) {\n        if (!uploadedBlobs.includes(blobId) && blobIdsToUpload.includes(blobId)) {\n          const fundedBlobRequest = await this.assembleTx(transactionRequest, deployOptions);\n\n          let result: TransactionResult<TransactionType.Blob>;\n\n          try {\n            const blobTx = await account.sendTransaction(fundedBlobRequest);\n            result = await blobTx.waitForResult();\n          } catch (err: unknown) {\n            // Core will throw for blobs that have already been uploaded, but the blobId\n            // is still valid so we can use this for the loader contract\n            if ((<Error>err).message.indexOf(`BlobId is already taken ${blobId}`) > -1) {\n              uploadedBlobs.push(blobId);\n              continue;\n            }\n\n            throw new FuelError(ErrorCode.TRANSACTION_FAILED, 'Failed to deploy contract chunk');\n          }\n\n          if (!result.status || result.status !== TransactionStatus.success) {\n            throw new FuelError(ErrorCode.TRANSACTION_FAILED, 'Failed to deploy contract chunk');\n          }\n\n          uploadedBlobs.push(blobId);\n        }\n      }\n\n      await this.assembleTx(createRequest, deployOptions);\n      txIdResolver(createRequest.getTransactionId(await account.provider.getChainId()));\n      const transactionResponse = await account.sendTransaction(createRequest);\n      const transactionResult = await transactionResponse.waitForResult<TransactionType.Create>();\n      const contract = new Contract(contractId, this.interface, account) as T;\n\n      return { contract, transactionResult };\n    };","sourceCodeStart":344,"sourceCodeEnd":380,"githubUrl":"https://github.com/FuelLabs/fuels-ts/blob/b3f37c91aca4aa9d5e4c0d3967f66237190826ea/packages/contract/src/contract-factory.ts#L344-L380","documentation":"Thrown inside the waitForResult() closure of ContractFactory.deployAsBlobTx() (packages/contract/src/contract-factory.ts:362) when account.sendTransaction(fundedBlobRequest) or blobTx.waitForResult() throws an error whose message does not contain the substring 'BlobId is already taken'. The code intentionally swallows the 'already taken' error (duplicate blob IDs are valid for the loader contract), but any other exception — network failure, RPC error, invalid transaction, insufficient gas — is re-thrown as TRANSACTION_FAILED.","triggerScenarios":"During blob-tx deployment, a blob chunk submission fails for a reason other than the blob already existing on-chain: RPC node unreachable, transaction rejected by the node, gas estimation mismatch, account nonce conflict, or network timeout.","commonSituations":"Unstable RPC connection during multi-chunk deployment; gas price changes between estimation and submission; concurrent deployments from the same account causing nonce collisions; node syncing or capacity issues.","solutions":["Inspect the original error before it was wrapped — the FuelError message is generic, so enable SDK logging or wrap the call to capture the inner exception.","Retry the deployment; transient network errors often resolve on retry.","Ensure the RPC node is healthy and synced before deploying.","If deploying concurrently from the same account, serialize deployments to avoid nonce conflicts."],"exampleFix":"// before\nconst { waitForResult } = await factory.deployAsBlobTx();\nawait waitForResult();\n\n// after\nconst { waitForResult } = await factory.deployAsBlobTx();\ntry {\n  await waitForResult();\n} catch (e) {\n  console.error('Blob chunk deploy failed:', e);\n  throw e;\n}","handlingStrategy":"try-catch","validationCode":"import { getContractChunks } from '@fuel-ts/contract';\n\n// Before deploying, verify the RPC is reachable\ntry {\n  await account.provider.getChain();\n} catch {\n  throw new Error('RPC node is not reachable; fix connectivity before deploying');\n}\nawait factory.deployAsBlobTx();","typeGuard":null,"tryCatchPattern":"const { waitForResult } = await factory.deployAsBlobTx();\ntry {\n  await waitForResult();\n} catch (e) {\n  if (e instanceof FuelError && e.code === 'transaction-failed') {\n    // Generic; inspect logs for the original blob-tx error\n    console.error('Blob chunk submission failed. Check RPC connectivity and retry.');\n    await retryWithBackoff(() => factory.deployAsBlobTx());\n  } else {\n    throw e;\n  }\n}","preventionTips":["Verify RPC node health before initiating multi-chunk deployments.","Avoid concurrent deployments from the same account to prevent nonce conflicts.","Capture and log the original error before it is wrapped — the FuelError message is generic.","Use exponential backoff retries for transient network errors."],"tags":["contract","deployment","blob-tx","transaction","network","runtime"],"backgroundTag":null,"analyzedSha":"b3f37c91aca4aa9d5e4c0d3967f66237190826ea","analyzedAt":"2026-08-12T20:30:56.448Z","schemaVersion":2},"datasetVersion":"2026-08-12T23:17:12.415Z"}