Skip to content

Conversation

@stwiname
Copy link
Collaborator

@stwiname stwiname commented Dec 17, 2025

Description

Fixes initializing new projects with an invalid .env file that has an array of endpoints that cannot be parsed

Type of change

Please delete options that are not relevant.

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

Checklist

  • I have tested locally
  • I have performed a self review of my changes
  • Updated any relevant documentation
  • Linked to any relevant issues
  • I have added tests relevant to my changes
  • Any dependent changes have been merged and published in downstream modules
  • My code is up to date with the base branch
  • I have updated relevant changelogs. We suggest using chan

Summary by CodeRabbit

Bug Fixes

  • Fixed initialization issues with environment configuration files when endpoints are specified as arrays, ensuring proper endpoint formatting and reliable configuration across all development environments.

✏️ Tip: You can customize this high-level summary in your review settings.

@coderabbitai
Copy link

coderabbitai bot commented Dec 17, 2025

Walkthrough

The changes fix an issue with .env file initialization by updating endpoint value formatting to support both array and string/primitive types, and adding support for writing an additional env file path (envDevelopLocalPath).

Changes

Cohort / File(s) Summary
Documentation
packages/cli/CHANGELOG.md
Adds Fixed entry documenting resolution of .env file endpoints array initialization issue.
Endpoint Formatting & Env File Support
packages/cli/src/controller/init-controller.ts
Updates prepareEnv function to handle ENDPOINT value formatting for both array and string/primitive types (arrays joined by commas; primitives stringified). Adds envDevelopLocalPath to be written alongside other env files using same envData.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

  • Verify the comma-joined array format for ENDPOINT is the intended output
  • Confirm envDevelopLocalPath write operation is correctly positioned and uses appropriate file permissions

Poem

🐰 The endpoints were tangled, array and string alike,
But now they converge in comma-separated delight!
Three env files dance, then four shall gleam—
A developer's .env dream! ✨

Pre-merge checks and finishing touches

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the main fix: preventing invalid array formatting of endpoints in the .env file during initialization.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch fix-env-array

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

🧹 Nitpick comments (1)
packages/cli/src/controller/init-controller.ts (1)

322-324: Simplify endpoint formatting for non-array values.

The array handling is correct, but using JSON.stringify for non-array endpoints adds unnecessary quotes that dotenv will strip during parsing. This creates inconsistency with the array case and adds an indirect layer. Use the endpoint value directly:

-  const endpointStr = Array.isArray(project.endpoint) ? project.endpoint.join(',') : JSON.stringify(project.endpoint);
+  const endpointStr = Array.isArray(project.endpoint) ? project.endpoint.join(',') : project.endpoint;

This ensures consistent .env formatting and aligns with how the value is read back on line 243: process.env.ENDPOINT!?.split(',').

📜 Review details

Configuration used: defaults

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 1c482f2 and 876b2cc.

📒 Files selected for processing (2)
  • packages/cli/CHANGELOG.md (1 hunks)
  • packages/cli/src/controller/init-controller.ts (1 hunks)
🧰 Additional context used
📓 Path-based instructions (2)
**/*.{ts,tsx}

📄 CodeRabbit inference engine (CLAUDE.md)

**/*.{ts,tsx}: Use TypeScript throughout with strict configuration in the monorepo
Use Ethers.js for Ethereum integration

Files:

  • packages/cli/src/controller/init-controller.ts
packages/**/src/**/*.{ts,tsx}

📄 CodeRabbit inference engine (CLAUDE.md)

Run ESLint with TypeScript support, Prettier, and various plugins across all TypeScript files using configured husky pre-commit hooks and lint-staged

Files:

  • packages/cli/src/controller/init-controller.ts
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: Coverage report
🔇 Additional comments (2)
packages/cli/CHANGELOG.md (1)

8-9: LGTM!

The changelog entry correctly documents the fix for the .env file endpoints array issue, following the established format.

packages/cli/src/controller/init-controller.ts (1)

328-328: LGTM!

Good catch adding the missing envDevelopLocalPath write. This completes the set of environment files that should be initialized.

@github-actions
Copy link
Contributor

github-actions bot commented Dec 17, 2025

Coverage report for .

Caution

Test run failed

St.
Category Percentage Covered / Total
🟢 Statements
87.52% (+17.41% 🔼)
70947/81068
🟢 Branches
80.62% (+2.33% 🔼)
3353/4159
🟡 Functions
66.58% (+4.08% 🔼)
1271/1909
🟢 Lines
87.52% (+17.41% 🔼)
70947/81068

⚠️ Details were not displayed: the report size has exceeded the limit.

Test suite run failed

Failed tests: 6/714. Failed suites: 3/116.
  ● Promise Utils › utils.promise delay()

    expect(received).toBeGreaterThanOrEqual(expected)

    Expected: >= 1000
    Received:    999

       9 |     await delay(1);
      10 |     const millsecDiff = new Date().getTime() - start.getTime();
    > 11 |     expect(millsecDiff).toBeGreaterThanOrEqual(1000);
         |                         ^
      12 |     expect(millsecDiff).toBeLessThan(1050);
      13 |   });
      14 |

      at Object.<anonymous> (packages/node-core/src/utils/promise.spec.ts:11:25)


  ● Cli publish › should upload appropriate project to IPFS

    Publish project to default IPFS failed

      160 |   try {
      161 |     const results = await ipfsWrite.addAll(contents, {pin: true, cidVersion: 0, wrapWithDirectory: isMultichain});
    > 162 |     for (const result of results) {
          |               ^
      163 |       fileCidMap.set(result.path, result.cid);
      164 |
      165 |       await ipfsWrite.pinRemoteAdd(result.cid, {service: PIN_SERVICE}).catch((e) => {

      at packages/cli/src/controller/publish-controller.ts:162:15
          at async Promise.all (index 0)
      at async uploadFile (packages/cli/src/controller/publish-controller.ts:165:30)
      at async replaceFileReferences (packages/cli/src/controller/publish-controller.ts:88:26)
      at async /home/runner/work/subql/subql/packages/cli/src/controller/publish-controller.ts:93:26
          at async Promise.all (index 3)
      at async replaceFileReferences (packages/cli/src/controller/publish-controller.ts:91:9)
          at async Promise.all (index 0)
      at async replaceFileReferences (packages/cli/src/controller/publish-controller.ts:79:17)
      at async /home/runner/work/subql/subql/packages/cli/src/controller/publish-controller.ts:93:26
          at async Promise.all (index 5)
      at async replaceFileReferences (packages/cli/src/controller/publish-controller.ts:91:9)
      at async uploadToIpfs (packages/cli/src/controller/publish-controller.ts:59:28)
      at async Object.<anonymous> (packages/cli/src/controller/publish-controller.spec.ts:34:21)

    Cause:
    Failed to upload files to IPFS

      87 |     if (options) {
      88 |       url.searchParams.append('pin', options.pin?.toString() ?? 'true');
    > 89 |       url.searchParams.append('cid-version', options.cidVersion?.toString() ?? '0');
         |                   ^
      90 |       url.searchParams.append('wrap-with-directory', options.wrapWithDirectory?.toString() ?? 'false');
      91 |     }
      92 |

      at IPFSHTTPClientLite.addAll (packages/common/src/project/IpfsHttpClientLite/IPFSHTTPClientLite.ts:89:19)
      at async IPFSHTTPClientLite.add (packages/common/src/project/IpfsHttpClientLite/IPFSHTTPClientLite.ts:34:25)
          at async Promise.all (index 0)
      at async uploadFile (packages/cli/src/controller/publish-controller.ts:165:30)
      at async replaceFileReferences (packages/cli/src/controller/publish-controller.ts:88:26)
      at async /home/runner/work/subql/subql/packages/cli/src/controller/publish-controller.ts:93:26
          at async Promise.all (index 3)
      at async replaceFileReferences (packages/cli/src/controller/publish-controller.ts:91:9)
          at async Promise.all (index 0)
      at async replaceFileReferences (packages/cli/src/controller/publish-controller.ts:79:17)
      at async /home/runner/work/subql/subql/packages/cli/src/controller/publish-controller.ts:93:26
          at async Promise.all (index 5)
      at async replaceFileReferences (packages/cli/src/controller/publish-controller.ts:91:9)
      at async uploadToIpfs (packages/cli/src/controller/publish-controller.ts:59:28)
      at async Object.<anonymous> (packages/cli/src/controller/publish-controller.spec.ts:34:21)

    Cause:
    AxiosError: Request failed with status code 413

      66 |         url.toString(),
      67 |         {},
    > 68 |         {
         |          ^
      69 |           headers: {
      70 |             ...this.option.headers,
      71 |           },

      at settle (node_modules/axios/lib/core/settle.js:19:12)
      at IncomingMessage.handleStreamEnd (node_modules/axios/lib/adapters/http.js:792:11)
      at Axios.request (node_modules/axios/lib/core/Axios.js:45:41)
      at async IPFSHTTPClientLite.addAll (packages/common/src/project/IpfsHttpClientLite/IPFSHTTPClientLite.ts:68:30)
      at async IPFSHTTPClientLite.add (packages/common/src/project/IpfsHttpClientLite/IPFSHTTPClientLite.ts:34:25)
          at async Promise.all (index 0)
      at async uploadFile (packages/cli/src/controller/publish-controller.ts:165:30)
      at async replaceFileReferences (packages/cli/src/controller/publish-controller.ts:88:26)
      at async /home/runner/work/subql/subql/packages/cli/src/controller/publish-controller.ts:93:26
          at async Promise.all (index 3)
      at async replaceFileReferences (packages/cli/src/controller/publish-controller.ts:91:9)
          at async Promise.all (index 0)
      at async replaceFileReferences (packages/cli/src/controller/publish-controller.ts:79:17)
      at async /home/runner/work/subql/subql/packages/cli/src/controller/publish-controller.ts:93:26
          at async Promise.all (index 5)
      at async replaceFileReferences (packages/cli/src/controller/publish-controller.ts:91:9)
      at async uploadToIpfs (packages/cli/src/controller/publish-controller.ts:59:28)
      at async Object.<anonymous> (packages/cli/src/controller/publish-controller.spec.ts:34:21)

  ● Cli publish › Get directory CID from multi-chain project

    Publish project to default IPFS failed

      160 |   try {
      161 |     const results = await ipfsWrite.addAll(contents, {pin: true, cidVersion: 0, wrapWithDirectory: isMultichain});
    > 162 |     for (const result of results) {
          |               ^
      163 |       fileCidMap.set(result.path, result.cid);
      164 |
      165 |       await ipfsWrite.pinRemoteAdd(result.cid, {service: PIN_SERVICE}).catch((e) => {

      at packages/cli/src/controller/publish-controller.ts:162:15
          at async Promise.all (index 0)
      at async uploadFile (packages/cli/src/controller/publish-controller.ts:165:30)
      at async replaceFileReferences (packages/cli/src/controller/publish-controller.ts:88:26)
      at async /home/runner/work/subql/subql/packages/cli/src/controller/publish-controller.ts:93:26
          at async Promise.all (index 3)
      at async replaceFileReferences (packages/cli/src/controller/publish-controller.ts:91:9)
          at async Promise.all (index 0)
      at async replaceFileReferences (packages/cli/src/controller/publish-controller.ts:79:17)
      at async /home/runner/work/subql/subql/packages/cli/src/controller/publish-controller.ts:93:26
          at async Promise.all (index 5)
      at async replaceFileReferences (packages/cli/src/controller/publish-controller.ts:91:9)
      at async uploadToIpfs (packages/cli/src/controller/publish-controller.ts:59:28)
      at async Object.<anonymous> (packages/cli/src/controller/publish-controller.spec.ts:62:24)

    Cause:
    Failed to upload files to IPFS

      87 |     if (options) {
      88 |       url.searchParams.append('pin', options.pin?.toString() ?? 'true');
    > 89 |       url.searchParams.append('cid-version', options.cidVersion?.toString() ?? '0');
         |                   ^
      90 |       url.searchParams.append('wrap-with-directory', options.wrapWithDirectory?.toString() ?? 'false');
      91 |     }
      92 |

      at IPFSHTTPClientLite.addAll (packages/common/src/project/IpfsHttpClientLite/IPFSHTTPClientLite.ts:89:19)
      at async IPFSHTTPClientLite.add (packages/common/src/project/IpfsHttpClientLite/IPFSHTTPClientLite.ts:34:25)
          at async Promise.all (index 0)
      at async uploadFile (packages/cli/src/controller/publish-controller.ts:165:30)
      at async replaceFileReferences (packages/cli/src/controller/publish-controller.ts:88:26)
      at async /home/runner/work/subql/subql/packages/cli/src/controller/publish-controller.ts:93:26
          at async Promise.all (index 3)
      at async replaceFileReferences (packages/cli/src/controller/publish-controller.ts:91:9)
          at async Promise.all (index 0)
      at async replaceFileReferences (packages/cli/src/controller/publish-controller.ts:79:17)
      at async /home/runner/work/subql/subql/packages/cli/src/controller/publish-controller.ts:93:26
          at async Promise.all (index 5)
      at async replaceFileReferences (packages/cli/src/controller/publish-controller.ts:91:9)
      at async uploadToIpfs (packages/cli/src/controller/publish-controller.ts:59:28)
      at async Object.<anonymous> (packages/cli/src/controller/publish-controller.spec.ts:62:24)

    Cause:
    AxiosError: Request failed with status code 413

      66 |         url.toString(),
      67 |         {},
    > 68 |         {
         |          ^
      69 |           headers: {
      70 |             ...this.option.headers,
      71 |           },

      at settle (node_modules/axios/lib/core/settle.js:19:12)
      at IncomingMessage.handleStreamEnd (node_modules/axios/lib/adapters/http.js:792:11)
      at Axios.request (node_modules/axios/lib/core/Axios.js:45:41)
      at async IPFSHTTPClientLite.addAll (packages/common/src/project/IpfsHttpClientLite/IPFSHTTPClientLite.ts:68:30)
      at async IPFSHTTPClientLite.add (packages/common/src/project/IpfsHttpClientLite/IPFSHTTPClientLite.ts:34:25)
          at async Promise.all (index 0)
      at async uploadFile (packages/cli/src/controller/publish-controller.ts:165:30)
      at async replaceFileReferences (packages/cli/src/controller/publish-controller.ts:88:26)
      at async /home/runner/work/subql/subql/packages/cli/src/controller/publish-controller.ts:93:26
          at async Promise.all (index 3)
      at async replaceFileReferences (packages/cli/src/controller/publish-controller.ts:91:9)
          at async Promise.all (index 0)
      at async replaceFileReferences (packages/cli/src/controller/publish-controller.ts:79:17)
      at async /home/runner/work/subql/subql/packages/cli/src/controller/publish-controller.ts:93:26
          at async Promise.all (index 5)
      at async replaceFileReferences (packages/cli/src/controller/publish-controller.ts:91:9)
      at async uploadToIpfs (packages/cli/src/controller/publish-controller.ts:59:28)
      at async Object.<anonymous> (packages/cli/src/controller/publish-controller.spec.ts:62:24)


  ● Integration test - Publish › overwrites any existing CID files

    Publish project to default IPFS failed

      160 |   try {
      161 |     const results = await ipfsWrite.addAll(contents, {pin: true, cidVersion: 0, wrapWithDirectory: isMultichain});
    > 162 |     for (const result of results) {
          |               ^
      163 |       fileCidMap.set(result.path, result.cid);
      164 |
      165 |       await ipfsWrite.pinRemoteAdd(result.cid, {service: PIN_SERVICE}).catch((e) => {

      at packages/cli/src/controller/publish-controller.ts:162:15
          at async Promise.all (index 0)
      at async uploadFile (packages/cli/src/controller/publish-controller.ts:165:30)
      at async replaceFileReferences (packages/cli/src/controller/publish-controller.ts:88:26)
      at async /home/runner/work/subql/subql/packages/cli/src/controller/publish-controller.ts:93:26
          at async Promise.all (index 3)
      at async replaceFileReferences (packages/cli/src/controller/publish-controller.ts:91:9)
          at async Promise.all (index 0)
      at async replaceFileReferences (packages/cli/src/controller/publish-controller.ts:79:17)
      at async /home/runner/work/subql/subql/packages/cli/src/controller/publish-controller.ts:93:26
          at async Promise.all (index 5)
      at async replaceFileReferences (packages/cli/src/controller/publish-controller.ts:91:9)
      at async uploadToIpfs (packages/cli/src/controller/publish-controller.ts:59:28)
      at async publishAdapter (packages/cli/src/commands/publish.ts:44:26)
      at async Publish.run (packages/cli/src/commands/publish.ts:66:24)
      at async Publish._run (node_modules/@oclif/core/lib/command.js:182:22)
      at async Object.<anonymous> (packages/cli/src/commands/publish.test.ts:33:9)

    Cause:
    Failed to upload files to IPFS

      87 |     if (options) {
      88 |       url.searchParams.append('pin', options.pin?.toString() ?? 'true');
    > 89 |       url.searchParams.append('cid-version', options.cidVersion?.toString() ?? '0');
         |                   ^
      90 |       url.searchParams.append('wrap-with-directory', options.wrapWithDirectory?.toString() ?? 'false');
      91 |     }
      92 |

      at IPFSHTTPClientLite.addAll (packages/common/src/project/IpfsHttpClientLite/IPFSHTTPClientLite.ts:89:19)
      at async IPFSHTTPClientLite.add (packages/common/src/project/IpfsHttpClientLite/IPFSHTTPClientLite.ts:34:25)
          at async Promise.all (index 0)
      at async uploadFile (packages/cli/src/controller/publish-controller.ts:165:30)
      at async replaceFileReferences (packages/cli/src/controller/publish-controller.ts:88:26)
      at async /home/runner/work/subql/subql/packages/cli/src/controller/publish-controller.ts:93:26
          at async Promise.all (index 3)
      at async replaceFileReferences (packages/cli/src/controller/publish-controller.ts:91:9)
          at async Promise.all (index 0)
      at async replaceFileReferences (packages/cli/src/controller/publish-controller.ts:79:17)
      at async /home/runner/work/subql/subql/packages/cli/src/controller/publish-controller.ts:93:26
          at async Promise.all (index 5)
      at async replaceFileReferences (packages/cli/src/controller/publish-controller.ts:91:9)
      at async uploadToIpfs (packages/cli/src/controller/publish-controller.ts:59:28)
      at async publishAdapter (packages/cli/src/commands/publish.ts:44:26)
      at async Publish.run (packages/cli/src/commands/publish.ts:66:24)
      at async Publish._run (node_modules/@oclif/core/lib/command.js:182:22)
      at async Object.<anonymous> (packages/cli/src/commands/publish.test.ts:33:9)

    Cause:
    AxiosError: Request failed with status code 413

      66 |         url.toString(),
      67 |         {},
    > 68 |         {
         |          ^
      69 |           headers: {
      70 |             ...this.option.headers,
      71 |           },

      at settle (node_modules/axios/lib/core/settle.js:19:12)
      at IncomingMessage.handleStreamEnd (node_modules/axios/lib/adapters/http.js:792:11)
      at Axios.request (node_modules/axios/lib/core/Axios.js:45:41)
      at async IPFSHTTPClientLite.addAll (packages/common/src/project/IpfsHttpClientLite/IPFSHTTPClientLite.ts:68:30)
      at async IPFSHTTPClientLite.add (packages/common/src/project/IpfsHttpClientLite/IPFSHTTPClientLite.ts:34:25)
          at async Promise.all (index 0)
      at async uploadFile (packages/cli/src/controller/publish-controller.ts:165:30)
      at async replaceFileReferences (packages/cli/src/controller/publish-controller.ts:88:26)
      at async /home/runner/work/subql/subql/packages/cli/src/controller/publish-controller.ts:93:26
          at async Promise.all (index 3)
      at async replaceFileReferences (packages/cli/src/controller/publish-controller.ts:91:9)
          at async Promise.all (index 0)
      at async replaceFileReferences (packages/cli/src/controller/publish-controller.ts:79:17)
      at async /home/runner/work/subql/subql/packages/cli/src/controller/publish-controller.ts:93:26
          at async Promise.all (index 5)
      at async replaceFileReferences (packages/cli/src/controller/publish-controller.ts:91:9)
      at async uploadToIpfs (packages/cli/src/controller/publish-controller.ts:59:28)
      at async publishAdapter (packages/cli/src/commands/publish.ts:44:26)
      at async Publish.run (packages/cli/src/commands/publish.ts:66:24)
      at async Publish._run (node_modules/@oclif/core/lib/command.js:182:22)
      at async Object.<anonymous> (packages/cli/src/commands/publish.test.ts:33:9)

  ● Integration test - Publish › create ipfsCID file stored in local with dictiory path

    Publish project to default IPFS failed

      160 |   try {
      161 |     const results = await ipfsWrite.addAll(contents, {pin: true, cidVersion: 0, wrapWithDirectory: isMultichain});
    > 162 |     for (const result of results) {
          |               ^
      163 |       fileCidMap.set(result.path, result.cid);
      164 |
      165 |       await ipfsWrite.pinRemoteAdd(result.cid, {service: PIN_SERVICE}).catch((e) => {

      at packages/cli/src/controller/publish-controller.ts:162:15
          at async Promise.all (index 0)
      at async uploadFile (packages/cli/src/controller/publish-controller.ts:165:30)
      at async replaceFileReferences (packages/cli/src/controller/publish-controller.ts:88:26)
      at async /home/runner/work/subql/subql/packages/cli/src/controller/publish-controller.ts:93:26
          at async Promise.all (index 3)
      at async replaceFileReferences (packages/cli/src/controller/publish-controller.ts:91:9)
          at async Promise.all (index 0)
      at async replaceFileReferences (packages/cli/src/controller/publish-controller.ts:79:17)
      at async /home/runner/work/subql/subql/packages/cli/src/controller/publish-controller.ts:93:26
          at async Promise.all (index 5)
      at async replaceFileReferences (packages/cli/src/controller/publish-controller.ts:91:9)
      at async uploadToIpfs (packages/cli/src/controller/publish-controller.ts:59:28)
      at async publishAdapter (packages/cli/src/commands/publish.ts:44:26)
      at async Publish.run (packages/cli/src/commands/publish.ts:66:24)
      at async Publish._run (node_modules/@oclif/core/lib/command.js:182:22)
      at async Object.<anonymous> (packages/cli/src/commands/publish.test.ts:33:9)

    Cause:
    Failed to upload files to IPFS

      87 |     if (options) {
      88 |       url.searchParams.append('pin', options.pin?.toString() ?? 'true');
    > 89 |       url.searchParams.append('cid-version', options.cidVersion?.toString() ?? '0');
         |                   ^
      90 |       url.searchParams.append('wrap-with-directory', options.wrapWithDirectory?.toString() ?? 'false');
      91 |     }
      92 |

      at IPFSHTTPClientLite.addAll (packages/common/src/project/IpfsHttpClientLite/IPFSHTTPClientLite.ts:89:19)
      at async IPFSHTTPClientLite.add (packages/common/src/project/IpfsHttpClientLite/IPFSHTTPClientLite.ts:34:25)
          at async Promise.all (index 0)
      at async uploadFile (packages/cli/src/controller/publish-controller.ts:165:30)
      at async replaceFileReferences (packages/cli/src/controller/publish-controller.ts:88:26)
      at async /home/runner/work/subql/subql/packages/cli/src/controller/publish-controller.ts:93:26
          at async Promise.all (index 3)
      at async replaceFileReferences (packages/cli/src/controller/publish-controller.ts:91:9)
          at async Promise.all (index 0)
      at async replaceFileReferences (packages/cli/src/controller/publish-controller.ts:79:17)
      at async /home/runner/work/subql/subql/packages/cli/src/controller/publish-controller.ts:93:26
          at async Promise.all (index 5)
      at async replaceFileReferences (packages/cli/src/controller/publish-controller.ts:91:9)
      at async uploadToIpfs (packages/cli/src/controller/publish-controller.ts:59:28)
      at async publishAdapter (packages/cli/src/commands/publish.ts:44:26)
      at async Publish.run (packages/cli/src/commands/publish.ts:66:24)
      at async Publish._run (node_modules/@oclif/core/lib/command.js:182:22)
      at async Object.<anonymous> (packages/cli/src/commands/publish.test.ts:33:9)

    Cause:
    AxiosError: Request failed with status code 413

      66 |         url.toString(),
      67 |         {},
    > 68 |         {
         |          ^
      69 |           headers: {
      70 |             ...this.option.headers,
      71 |           },

      at settle (node_modules/axios/lib/core/settle.js:19:12)
      at IncomingMessage.handleStreamEnd (node_modules/axios/lib/adapters/http.js:792:11)
      at Axios.request (node_modules/axios/lib/core/Axios.js:45:41)
      at async IPFSHTTPClientLite.addAll (packages/common/src/project/IpfsHttpClientLite/IPFSHTTPClientLite.ts:68:30)
      at async IPFSHTTPClientLite.add (packages/common/src/project/IpfsHttpClientLite/IPFSHTTPClientLite.ts:34:25)
          at async Promise.all (index 0)
      at async uploadFile (packages/cli/src/controller/publish-controller.ts:165:30)
      at async replaceFileReferences (packages/cli/src/controller/publish-controller.ts:88:26)
      at async /home/runner/work/subql/subql/packages/cli/src/controller/publish-controller.ts:93:26
          at async Promise.all (index 3)
      at async replaceFileReferences (packages/cli/src/controller/publish-controller.ts:91:9)
          at async Promise.all (index 0)
      at async replaceFileReferences (packages/cli/src/controller/publish-controller.ts:79:17)
      at async /home/runner/work/subql/subql/packages/cli/src/controller/publish-controller.ts:93:26
          at async Promise.all (index 5)
      at async replaceFileReferences (packages/cli/src/controller/publish-controller.ts:91:9)
      at async uploadToIpfs (packages/cli/src/controller/publish-controller.ts:59:28)
      at async publishAdapter (packages/cli/src/commands/publish.ts:44:26)
      at async Publish.run (packages/cli/src/commands/publish.ts:66:24)
      at async Publish._run (node_modules/@oclif/core/lib/command.js:182:22)
      at async Object.<anonymous> (packages/cli/src/commands/publish.test.ts:33:9)

  ● Integration test - Publish › file name consistent with manifest file name, if -f <manifest path> is used

    Publish project to default IPFS failed

      160 |   try {
      161 |     const results = await ipfsWrite.addAll(contents, {pin: true, cidVersion: 0, wrapWithDirectory: isMultichain});
    > 162 |     for (const result of results) {
          |               ^
      163 |       fileCidMap.set(result.path, result.cid);
      164 |
      165 |       await ipfsWrite.pinRemoteAdd(result.cid, {service: PIN_SERVICE}).catch((e) => {

      at packages/cli/src/controller/publish-controller.ts:162:15
          at async Promise.all (index 0)
      at async uploadFile (packages/cli/src/controller/publish-controller.ts:165:30)
      at async replaceFileReferences (packages/cli/src/controller/publish-controller.ts:88:26)
      at async /home/runner/work/subql/subql/packages/cli/src/controller/publish-controller.ts:93:26
          at async Promise.all (index 3)
      at async replaceFileReferences (packages/cli/src/controller/publish-controller.ts:91:9)
          at async Promise.all (index 0)
      at async replaceFileReferences (packages/cli/src/controller/publish-controller.ts:79:17)
      at async /home/runner/work/subql/subql/packages/cli/src/controller/publish-controller.ts:93:26
          at async Promise.all (index 5)
      at async replaceFileReferences (packages/cli/src/controller/publish-controller.ts:91:9)
      at async uploadToIpfs (packages/cli/src/controller/publish-controller.ts:59:28)
      at async publishAdapter (packages/cli/src/commands/publish.ts:44:26)
      at async Publish.run (packages/cli/src/commands/publish.ts:66:24)
      at async Publish._run (node_modules/@oclif/core/lib/command.js:182:22)
      at async Object.<anonymous> (packages/cli/src/commands/publish.test.ts:33:9)

    Cause:
    Failed to upload files to IPFS

      87 |     if (options) {
      88 |       url.searchParams.append('pin', options.pin?.toString() ?? 'true');
    > 89 |       url.searchParams.append('cid-version', options.cidVersion?.toString() ?? '0');
         |                   ^
      90 |       url.searchParams.append('wrap-with-directory', options.wrapWithDirectory?.toString() ?? 'false');
      91 |     }
      92 |

      at IPFSHTTPClientLite.addAll (packages/common/src/project/IpfsHttpClientLite/IPFSHTTPClientLite.ts:89:19)
      at async IPFSHTTPClientLite.add (packages/common/src/project/IpfsHttpClientLite/IPFSHTTPClientLite.ts:34:25)
          at async Promise.all (index 0)
      at async uploadFile (packages/cli/src/controller/publish-controller.ts:165:30)
      at async replaceFileReferences (packages/cli/src/controller/publish-controller.ts:88:26)
      at async /home/runner/work/subql/subql/packages/cli/src/controller/publish-controller.ts:93:26
          at async Promise.all (index 3)
      at async replaceFileReferences (packages/cli/src/controller/publish-controller.ts:91:9)
          at async Promise.all (index 0)
      at async replaceFileReferences (packages/cli/src/controller/publish-controller.ts:79:17)
      at async /home/runner/work/subql/subql/packages/cli/src/controller/publish-controller.ts:93:26
          at async Promise.all (index 5)
      at async replaceFileReferences (packages/cli/src/controller/publish-controller.ts:91:9)
      at async uploadToIpfs (packages/cli/src/controller/publish-controller.ts:59:28)
      at async publishAdapter (packages/cli/src/commands/publish.ts:44:26)
      at async Publish.run (packages/cli/src/commands/publish.ts:66:24)
      at async Publish._run (node_modules/@oclif/core/lib/command.js:182:22)
      at async Object.<anonymous> (packages/cli/src/commands/publish.test.ts:33:9)

    Cause:
    AxiosError: Request failed with status code 413

      66 |         url.toString(),
      67 |         {},
    > 68 |         {
         |          ^
      69 |           headers: {
      70 |             ...this.option.headers,
      71 |           },

      at settle (node_modules/axios/lib/core/settle.js:19:12)
      at IncomingMessage.handleStreamEnd (node_modules/axios/lib/adapters/http.js:792:11)
      at Axios.request (node_modules/axios/lib/core/Axios.js:45:41)
      at async IPFSHTTPClientLite.addAll (packages/common/src/project/IpfsHttpClientLite/IPFSHTTPClientLite.ts:68:30)
      at async IPFSHTTPClientLite.add (packages/common/src/project/IpfsHttpClientLite/IPFSHTTPClientLite.ts:34:25)
          at async Promise.all (index 0)
      at async uploadFile (packages/cli/src/controller/publish-controller.ts:165:30)
      at async replaceFileReferences (packages/cli/src/controller/publish-controller.ts:88:26)
      at async /home/runner/work/subql/subql/packages/cli/src/controller/publish-controller.ts:93:26
          at async Promise.all (index 3)
      at async replaceFileReferences (packages/cli/src/controller/publish-controller.ts:91:9)
          at async Promise.all (index 0)
      at async replaceFileReferences (packages/cli/src/controller/publish-controller.ts:79:17)
      at async /home/runner/work/subql/subql/packages/cli/src/controller/publish-controller.ts:93:26
          at async Promise.all (index 5)
      at async replaceFileReferences (packages/cli/src/controller/publish-controller.ts:91:9)
      at async uploadToIpfs (packages/cli/src/controller/publish-controller.ts:59:28)
      at async publishAdapter (packages/cli/src/commands/publish.ts:44:26)
      at async Publish.run (packages/cli/src/commands/publish.ts:66:24)
      at async Publish._run (node_modules/@oclif/core/lib/command.js:182:22)
      at async Object.<anonymous> (packages/cli/src/commands/publish.test.ts:33:9)

Report generated by 🧪jest coverage report action from 876b2cc

@stwiname stwiname merged commit 0ff8544 into main Dec 17, 2025
3 of 4 checks passed
@stwiname stwiname deleted the fix-env-array branch December 17, 2025 02:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants