Skip to content

fix: Improve guidance for Runtime API connection resets - #432

Open
pablomoreno61 wants to merge 1 commit into
adobe:masterfrom
pablomoreno61:friendly-message-aio-app-use
Open

pablomoreno61 wants to merge 1 commit into
adobe:masterfrom
pablomoreno61:friendly-message-aio-app-use

Conversation

@pablomoreno61

@pablomoreno61 pablomoreno61 commented Sep 30, 2026 •

Copy link
Copy Markdown

Description

Detect ECONNRESET and socket hang up errors in Runtime API failures and provide actionable guidance to refresh the Adobe Developer Console configuration with aio app use. Adds regression tests for both error forms.

Related Issue

No matching open issue was identified. The repository template requests an open issue for PRs; this PR was opened at the user's direction without one.

Motivation and Context

Runtime API calls interrupted by a stale or missing Developer Console configuration currently surface without guidance to refresh that configuration. This change tells users what to do before retrying.

How Has This Been Tested?

  • npm run unit-tests -- --runInBand --runTestsByPath test/RuntimeBaseCommand.test.js — not run: jest is not installed (jest: command not found).
  • npm ci --ignore-scripts --no-audit --no-fund — could not install dependencies because this repository has no package-lock.json (npm ci requires a lockfile).

Screenshots (if appropriate):

before the fix, with verbosity disabled

> aio rt activation list
 ›   Error: failed to list the activations: socket hang up
 ›    specify --verbose flag for more information

after the fix, listing activations

> aio rt activation list
 ›   Error: failed to list the activations: the connection to the Runtime API was interrupted (socket hang up / ECONNRESET). Please try again in a few moments. Before you do, run `aio app use` to get the latest Adobe Developer Console
 ›   configuration file.
 ›    specify --verbose flag for more information

after the fix, getting activation by ID

> aio rt activation get 59fe13f4fe69490fbe13f4fe69a90f6d                                                                                                          
 ›   Error: failed to retrieve the activation: the connection to the Runtime API was interrupted (socket hang up / ECONNRESET). Please try again in a few moments. Before you do, run `aio app use` to get the latest Adobe Developer Console
 ›   configuration file.
 ›    specify --verbose flag for more informatio

Types of changes

  • 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 change)

Checklist:

  • I have signed the Adobe Open Source CLA.
  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

@codecov

codecov Bot commented Sep 30, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@pablomoreno61 pablomoreno61 changed the title Improve guidance for Runtime API connection resets fix: Improve guidance for Runtime API connection resets Sep 30, 2026
Comment thread src/RuntimeBaseCommand.js
return error.code === 'ECONNRESET' ||
/ECONNRESET/i.test(error.message || '') ||
/socket hang up/i.test(error.message || '') ||
/(ECONNRESET|socket hang up)/i.test(typeof error.error === 'string' ? error.error : '')

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Can we make the logic more cleaner by something like this -

const CONNECTION_RESET_PATTERN = /ECONNRESET|socket hang up/i const matchesConnectionReset = (value) => typeof value === 'string' && CONNECTION_RESET_PATTERN.test(value)

Then use above in error check as

e.code === ECONNRESET || matchesConnectionReset(e.message) || matchesConnectionReset(e.error) || matchesConnectionReset(e)

WDYT?

Comment thread src/RuntimeBaseCommand.js

if (isConnectionReset) {
pretty = 'the connection to the Runtime API was interrupted (socket hang up / ECONNRESET). ' +
'Please try again in a few moments. Before you do, run `aio app use` to get the latest Adobe Developer Console configuration file.'

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

"Before you do, run aio app use to get the latest Adobe Developer Console configuration file."
Is this a required step or only required when workspace/runtime details are not available?
Right now the message looks like mandating the aio app:use command

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

No.  Using the AIO app is a troubleshooting suggestion, not a required step for every connection reset. It may help if the project’s Adobe Developer Console configuration is stale or doesn’t match the intended workspace/runtime.

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