[Bug?]: `yarn upgrade-interactive` silently ignores errors when checking package versions
Maintainers usually reply within 1 day
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 78/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Active
- Tech stack
- nodejs, typescript
Research direction
Start in packages/plugin-interactive-tools/sources/commands/upgrade-interactive.tsx, especially the two fetchUpdatedDescriptor calls that catch errors and the later filter that drops packages without suggestions. Trace how registry failures can be reported without hiding other packages' results. Done when a failed version check is distinguishable from no available upgrade; the issue does not name a test, so locate and run relevant upgrade-interactive tests.
Written by the indexing model from the issue text.
Description
Self-service
- I'd be willing to implement a fix
Describe the bug
yarn upgrade-interactive silently ignores errors encountered while querying a registry for available package versions.
For example, when a dependency is hosted on a private npm registry and the registry responds with 403 Forbidden, yarn install correctly reports the error, but yarn upgrade-interactive silently behaves as if there were no upgrade available.
This makes it impossible to distinguish between:
- the package having no available upgrade, and
- Yarn being unable to determine whether an upgrade is available.
To reproduce
- Configure a dependency to use a private npm registry.
- Make the registry return
403 Forbiddenwhen Yarn queries package metadata (for example, due to missing/invalid credentials). - Run:
Yarn reports the registry error, e.g.yarn install403 Forbidden. - Run:
The package is silently omitted from the list of upgrade candidates. No error or warning is displayed.yarn upgrade-interactive
Expected behavior
yarn upgrade-interactive should indicate that it was unable to check the package.
It doesn't necessarily need to abort the entire interactive command — other packages could still be displayed — but a registry error should not be indistinguishable from "no update is available."
For example, it could display a warning such as:
Warning: failed to check @example/private-package for updates: HTTP 403 Forbidden
or otherwise mark the package as unavailable to check.
Actual behavior
The registry error is silently discarded and the package is omitted from the upgrade suggestions.
Environment
System:
OS: Linux 7.0 Ubuntu 24.04.4 LTS 24.04.4 LTS (Noble Numbat)
CPU: (8) x64 11th Gen Intel(R) Core(TM) i5-1135G7 @ 2.40GHz
Binaries:
Node: 20.20.1 - /tmp/xfs-b142f623/node
Yarn: 4.12.0 - /tmp/xfs-b142f623/yarn
npm: 10.8.2 - /home/juho/.nvm/versions/node/v20.20.1/bin/npm
Additional context
The result of running yarn install displays errors:
But yarn upgrade-interactive does not:
The current implementation contains:
const [resolution, latest] = await Promise.all([
fetchUpdatedDescriptor(descriptor, descriptor.range, referenceRange).catch(() => null),
fetchUpdatedDescriptor(descriptor, descriptor.range, `latest`).catch(() => null),
]);
The catch(() => null) means that registry errors are converted to null.
Later, packages with no non-empty suggestions are removed:
if (suggestions.filter(suggestion => suggestion.label !== ``).length <= 1)
return null;
Therefore, an HTTP error becomes indistinguishable from a package for which no upgrade is available.
Source:
- Dominant language
- TypeScript
- Stars
- 8.1k
- Forks
- 1.4k
- Avg merge
- 2d 1h
- Merged PRs (30d)
- 4
Getting set up
- No Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from yarnpkg/berry
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
Maintainers usually reply within 1 day
-
[Bug?]: `yarn upgrade-interactive` drops the prerelease suffix from suggested versionsPossibly taken @lucas-gomes-santana claimed this 5 days ago. Openbug
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
Maintainers usually reply within 1 day
-
[Bug?]: Disabling global `npmMinimalAgeGate` does not disable scoped `npmMinimalAgeGate`Possibly taken @ychampion claimed this 137 days ago. Openbug
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
yarnpkg/berry#7192 · 1 comment · 1 reaction ·
Maintainers usually reply within 1 day
-
[Bug?]: [Docs] Duplication of yarn command in the CLI documentationPossibly taken @Hashim1999164 claimed this 119 days ago. Openbug
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
Maintainers usually reply within 1 day
Similar issues
-
External sources always come back in English: `lc` isn't passed to `/api/v3/external_sources`Possibly taken @Anurag1428 claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
openfoodfacts/openfoodfacts-explorer#2264 · 1 comment ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 80/100
cloudflare/workers-sdk#17139 ·
Maintainers usually reply within 1 day
-
area: editor P3 type: feature
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
halisonworks/mod-codeling#290 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
colinhacks/zod#6776 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
aws/aws-sdk-js-v3#8441 ·
Maintainers usually reply within 1 day