Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pnpm logs error only to stdout when fails due to strict peer dependencies #14904

Closed
anomiex opened this issue Apr 1, 2022 · 5 comments
Closed
Labels
status:requirements Full requirements are not yet known, so implementation should not be started type:bug Bug fix of existing functionality

Comments

@anomiex
Copy link
Contributor

anomiex commented Apr 1, 2022

How are you running Renovate?

WhiteSource Renovate hosted app on github.com

If you're self-hosting Renovate, tell us what version of Renovate you run.

No response

Please select which platform you are using if self-hosting.

No response

If you're self-hosting Renovate, tell us what version of the platform you run.

No response

Was this something which used to work for you, and then stopped?

I never saw this working

Describe the bug

If pnpm is configured with strict-peer-dependencies = true (which I hear is going to be the default in pnpm 7), and a package update adds a new peer dependency, renovate fails. That part is expected.

What's not expected is that the "artifact update problem" comment is completely unhelpful:

⚠ Artifact update problem

Renovate failed to update an artifact related to this branch. You probably do not want to merge this PR as-is.

♻ Renovate will retry this branch, including artifacts, only when one of the following happens:

  • any of the package files in this branch needs updating, or
  • the branch becomes conflicted, or
  • you click the rebase/retry checkbox if found above, or
  • you rename this PR's title to start with "rebase!" to trigger it manually

The artifact failure details are included below:

File name: pnpm-lock.yaml
npm notice 
npm notice New minor version of npm available! 8.5.0 -> 8.6.0
npm notice Changelog: <https://github.com/npm/cli/releases/tag/v8.6.0>
npm notice Run `npm install -g npm@8.6.0` to update!
npm notice 

There's no indication that pnpm is what failed, much less why. The message there makes it sounds like npm having a minor update is somehow the problem. I don't know what it would say if npm didn't whine about its update.

The reason can be found by digging into the logs, of course.

Minimal reproduction repo: https://github.com/anomiex/renovate-test-2
Failing update: anomiex/renovate-test-2#6

Relevant debug logs

Logs
DEBUG: Executing command(branch="renovate/major-wordpress-monorepo")
{
  "command": "docker run --rm --name=renovate_node --label=renovate_child -v \"/mnt/renovate/gh/anomiex/renovate-test-2\":\"/mnt/renovate/gh/anomiex/renovate-test-2\" -v \"/tmp/renovate-cache\":\"/tmp/renovate-cache\" -e NPM_CONFIG_CACHE -e npm_config_store -w \"/mnt/renovate/gh/anomiex/renovate-test-2\" docker.io/renovate/node bash -l -c \"install-tool pnpm 6.32.4 && pnpm install --recursive --lockfile-only --ignore-scripts --ignore-pnpmfile\""
}
DEBUG: rawExec err(branch="renovate/major-wordpress-monorepo")
{
  "err": {
    "killed": false,
    "code": 1,
    "signal": null,
    "cmd": "docker run --rm --name=renovate_node --label=renovate_child -v \"/mnt/renovate/gh/anomiex/renovate-test-2\":\"/mnt/renovate/gh/anomiex/renovate-test-2\" -v \"/tmp/renovate-cache\":\"/tmp/renovate-cache\" -e NPM_CONFIG_CACHE -e npm_config_store -w \"/mnt/renovate/gh/anomiex/renovate-test-2\" docker.io/renovate/node bash -l -c \"install-tool pnpm 6.32.4 && pnpm install --recursive --lockfile-only --ignore-scripts --ignore-pnpmfile\"",
    "stdout": "Installing legacy tool pnpm v6.32.4\n\nadded 1 package in 3s\n6.32.4\n WARN  The \"store\" setting has been renamed to \"store-dir\". Please use the new name.\nProgress: resolved 1, reused 0, downloaded 0, added 0\nProgress: resolved 2, reused 0, downloaded 2, added 0\nProgress: resolved 3, reused 0, downloaded 3, added 0\nProgress: resolved 4, reused 0, downloaded 3, added 0\nProgress: resolved 23, reused 0, downloaded 3, added 0\nProgress: resolved 44, reused 0, downloaded 17, added 0\nProgress: resolved 60, reused 0, downloaded 42, added 0\nProgress: resolved 68, reused 0, downloaded 53, added 0\nProgress: resolved 78, reused 0, downloaded 59, added 0\nProgress: resolved 93, reused 0, downloaded 67, added 0\nProgress: resolved 106, reused 0, downloaded 82, added 0\nProgress: resolved 116, reused 0, downloaded 93, added 0\nProgress: resolved 121, reused 0, downloaded 101, added 0\nProgress: resolved 127, reused 0, downloaded 103, added 0\nProgress: resolved 140, reused 0, downloaded 113, added 0\nProgress: resolved 159, reused 0, downloaded 133, added 0\nProgress: resolved 174, reused 0, downloaded 142, added 0\nProgress: resolved 187, reused 0, downloaded 155, added 0\nProgress: resolved 205, reused 0, downloaded 168, added 0\nProgress: resolved 225, reused 0, downloaded 183, added 0\nProgress: resolved 250, reused 0, downloaded 208, added 0\nProgress: resolved 268, reused 0, downloaded 229, added 0\nProgress: resolved 278, reused 0, downloaded 240, added 0\nProgress: resolved 291, reused 0, downloaded 253, added 0\nProgress: resolved 298, reused 0, downloaded 258, added 0\nProgress: resolved 315, reused 0, downloaded 273, added 0\nProgress: resolved 333, reused 0, downloaded 289, added 0\nProgress: resolved 349, reused 0, downloaded 311, added 0\nProgress: resolved 372, reused 0, downloaded 340, added 0\nProgress: resolved 385, reused 0, downloaded 357, added 0\nProgress: resolved 395, reused 0, downloaded 380, added 0\nProgress: resolved 396, reused 0, downloaded 393, added 0\nundefined\n ERR_PNPM_PEER_DEP_ISSUES  Unmet peer dependencies\n\n.\n└─┬ @wordpress/eslint-plugin\n  ├── ✕ missing peer prettier@>=2\n  └─┬ eslint-plugin-prettier\n    └── ✕ missing peer prettier@>=1.13.0\nPeer dependencies that should be installed:\n  prettier@>=2.0.0\n\n",
    "stderr": "npm notice \nnpm notice New minor version of npm available! 8.5.0 -> 8.6.0\nnpm notice Changelog: <https://**redacted**@8.6.0` to update!\nnpm notice \n",
    "message": "Command failed: docker run --rm --name=renovate_node --label=renovate_child -v \"/mnt/renovate/gh/anomiex/renovate-test-2\":\"/mnt/renovate/gh/anomiex/renovate-test-2\" -v \"/tmp/renovate-cache\":\"/tmp/renovate-cache\" -e NPM_CONFIG_CACHE -e npm_config_store -w \"/mnt/renovate/gh/anomiex/renovate-test-2\" docker.io/renovate/node bash -l -c \"install-tool pnpm 6.32.4 && pnpm install --recursive --lockfile-only --ignore-scripts --ignore-pnpmfile\"\nnpm notice \nnpm notice New minor version of npm available! 8.5.0 -> 8.6.0\nnpm notice Changelog: <https://**redacted**@8.6.0` to update!\nnpm notice \n",
    "stack": "Error: Command failed: docker run --rm --name=renovate_node --label=renovate_child -v \"/mnt/renovate/gh/anomiex/renovate-test-2\":\"/mnt/renovate/gh/anomiex/renovate-test-2\" -v \"/tmp/renovate-cache\":\"/tmp/renovate-cache\" -e NPM_CONFIG_CACHE -e npm_config_store -w \"/mnt/renovate/gh/anomiex/renovate-test-2\" docker.io/renovate/node bash -l -c \"install-tool pnpm 6.32.4 && pnpm install --recursive --lockfile-only --ignore-scripts --ignore-pnpmfile\"\nnpm notice \nnpm notice New minor version of npm available! 8.5.0 -> 8.6.0\nnpm notice Changelog: <https://**redacted**@8.6.0` to update!\nnpm notice \n\n    at ChildProcess.exithandler (child_process.js:383:12)\n    at ChildProcess.emit (events.js:400:28)\n    at ChildProcess.emit (domain.js:475:12)\n    at maybeClose (internal/child_process.js:1058:16)\n    at Process.ChildProcess._handle.onexit (internal/child_process.js:293:5)"
  }
}
DEBUG: lock file error(branch="renovate/major-wordpress-monorepo")
{
  "cmd": "pnpm",
  "err": {
    "killed": false,
    "code": 1,
    "signal": null,
    "cmd": "docker run --rm --name=renovate_node --label=renovate_child -v \"/mnt/renovate/gh/anomiex/renovate-test-2\":\"/mnt/renovate/gh/anomiex/renovate-test-2\" -v \"/tmp/renovate-cache\":\"/tmp/renovate-cache\" -e NPM_CONFIG_CACHE -e npm_config_store -w \"/mnt/renovate/gh/anomiex/renovate-test-2\" docker.io/renovate/node bash -l -c \"install-tool pnpm 6.32.4 && pnpm install --recursive --lockfile-only --ignore-scripts --ignore-pnpmfile\"",
    "stdout": "Installing legacy tool pnpm v6.32.4\n\nadded 1 package in 3s\n6.32.4\n WARN  The \"store\" setting has been renamed to \"store-dir\". Please use the new name.\nProgress: resolved 1, reused 0, downloaded 0, added 0\nProgress: resolved 2, reused 0, downloaded 2, added 0\nProgress: resolved 3, reused 0, downloaded 3, added 0\nProgress: resolved 4, reused 0, downloaded 3, added 0\nProgress: resolved 23, reused 0, downloaded 3, added 0\nProgress: resolved 44, reused 0, downloaded 17, added 0\nProgress: resolved 60, reused 0, downloaded 42, added 0\nProgress: resolved 68, reused 0, downloaded 53, added 0\nProgress: resolved 78, reused 0, downloaded 59, added 0\nProgress: resolved 93, reused 0, downloaded 67, added 0\nProgress: resolved 106, reused 0, downloaded 82, added 0\nProgress: resolved 116, reused 0, downloaded 93, added 0\nProgress: resolved 121, reused 0, downloaded 101, added 0\nProgress: resolved 127, reused 0, downloaded 103, added 0\nProgress: resolved 140, reused 0, downloaded 113, added 0\nProgress: resolved 159, reused 0, downloaded 133, added 0\nProgress: resolved 174, reused 0, downloaded 142, added 0\nProgress: resolved 187, reused 0, downloaded 155, added 0\nProgress: resolved 205, reused 0, downloaded 168, added 0\nProgress: resolved 225, reused 0, downloaded 183, added 0\nProgress: resolved 250, reused 0, downloaded 208, added 0\nProgress: resolved 268, reused 0, downloaded 229, added 0\nProgress: resolved 278, reused 0, downloaded 240, added 0\nProgress: resolved 291, reused 0, downloaded 253, added 0\nProgress: resolved 298, reused 0, downloaded 258, added 0\nProgress: resolved 315, reused 0, downloaded 273, added 0\nProgress: resolved 333, reused 0, downloaded 289, added 0\nProgress: resolved 349, reused 0, downloaded 311, added 0\nProgress: resolved 372, reused 0, downloaded 340, added 0\nProgress: resolved 385, reused 0, downloaded 357, added 0\nProgress: resolved 395, reused 0, downloaded 380, added 0\nProgress: resolved 396, reused 0, downloaded 393, added 0\nundefined\n ERR_PNPM_PEER_DEP_ISSUES  Unmet peer dependencies\n\n.\n└─┬ @wordpress/eslint-plugin\n  ├── ✕ missing peer prettier@>=2\n  └─┬ eslint-plugin-prettier\n    └── ✕ missing peer prettier@>=1.13.0\nPeer dependencies that should be installed:\n  prettier@>=2.0.0\n\n",
    "stderr": "npm notice \nnpm notice New minor version of npm available! 8.5.0 -> 8.6.0\nnpm notice Changelog: <https://**redacted**@8.6.0` to update!\nnpm notice \n",
    "message": "Command failed: docker run --rm --name=renovate_node --label=renovate_child -v \"/mnt/renovate/gh/anomiex/renovate-test-2\":\"/mnt/renovate/gh/anomiex/renovate-test-2\" -v \"/tmp/renovate-cache\":\"/tmp/renovate-cache\" -e NPM_CONFIG_CACHE -e npm_config_store -w \"/mnt/renovate/gh/anomiex/renovate-test-2\" docker.io/renovate/node bash -l -c \"install-tool pnpm 6.32.4 && pnpm install --recursive --lockfile-only --ignore-scripts --ignore-pnpmfile\"\nnpm notice \nnpm notice New minor version of npm available! 8.5.0 -> 8.6.0\nnpm notice Changelog: <https://**redacted**@8.6.0` to update!\nnpm notice \n",
    "stack": "Error: Command failed: docker run --rm --name=renovate_node --label=renovate_child -v \"/mnt/renovate/gh/anomiex/renovate-test-2\":\"/mnt/renovate/gh/anomiex/renovate-test-2\" -v \"/tmp/renovate-cache\":\"/tmp/renovate-cache\" -e NPM_CONFIG_CACHE -e npm_config_store -w \"/mnt/renovate/gh/anomiex/renovate-test-2\" docker.io/renovate/node bash -l -c \"install-tool pnpm 6.32.4 && pnpm install --recursive --lockfile-only --ignore-scripts --ignore-pnpmfile\"\nnpm notice \nnpm notice New minor version of npm available! 8.5.0 -> 8.6.0\nnpm notice Changelog: <https://**redacted**@8.6.0` to update!\nnpm notice \n\n    at ChildProcess.exithandler (child_process.js:383:12)\n    at ChildProcess.emit (events.js:400:28)\n    at ChildProcess.emit (domain.js:475:12)\n    at maybeClose (internal/child_process.js:1058:16)\n    at Process.ChildProcess._handle.onexit (internal/child_process.js:293:5)"
  },
  "type": "pnpm"
}

Have you created a minimal reproduction repository?

I have linked to a minimal reproduction repository in the bug description

@anomiex anomiex added priority-5-triage status:requirements Full requirements are not yet known, so implementation should not be started type:bug Bug fix of existing functionality labels Apr 1, 2022
@rarkins
Copy link
Collaborator

rarkins commented Apr 2, 2022

The problem seems to be that pnpm errors but prints it all to stdout. Meanwhile npm (which is used to install pnpm) prints a warnings to stderr.

I wonder if pnpm could change its behavior and log errors to stderr so that they're picked up.

@rarkins rarkins changed the title Unhelpful "artifact update problem" comment if pnpm fails due to strict peer dependencies pnpm logs error only to stdout when fails due to strict peer dependencies Apr 2, 2022
@anomiex
Copy link
Contributor Author

anomiex commented Apr 2, 2022

Pnpm has a --use-stderr option, although that makes it print everything to stderr (not just errors). That could still be an improvement.

@rarkins
Copy link
Collaborator

rarkins commented Apr 2, 2022

Maybe we can redirect the npm install stderr to stdout. Then, if stderr is empty then I think we include all of stdout instead.

@OliverDudgeon
Copy link

pnpm has released v7 now with strict-peer-dependencies = true as default.

@viceice
Copy link
Member

viceice commented May 4, 2022

this should be fixed by suppress the npm update check, so you should now see the pnpm error.

@viceice viceice closed this as completed May 4, 2022
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jun 4, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
status:requirements Full requirements are not yet known, so implementation should not be started type:bug Bug fix of existing functionality
Projects
None yet
Development

No branches or pull requests

4 participants