Skip to content

[Bug?]: 4.12.0 yarn installation error message regression #7019

@shinebayar-g

Description

@shinebayar-g

Self-service

  • I'd be willing to implement a fix

Describe the bug

Yarn 4.12.0 fixed git 2.52.0's invalid key: core.autocrlf error. However, it has introduced regression in the log error output.

Compare the two outputs below.

4.11.0 error message. It clearly indicates the error as

➤ YN0001: package@[email protected]:redacted/redacted.git#workspace=redacted&commit=0b78f8194a979956fccda000630f6d8364429444: Failed cloning the repository
Failed cloning the repository
➤ YN0001:   Repository URL: ssh://[email protected]/redacted/redacted.git
➤ YN0001:   Error: invalid key:  core.autocrlf
➤ YN0001:   Fatal Error: unable to write parameters to config file
➤ YN0001:   Exit Code: 128
Image

However, on 4.12.0, we see this:

  ➤ YN0000: │ /tmp/xfs-ad231f63 STDOUT Internal Error: redacted@[email protected]:redacted/redacted.git#commit=d69a48a832d647965a05205cf643751de2730f97: Failed cloning the repository
  ➤ YN0000: │ /tmp/xfs-ad231f63 STDOUT     at RH (/home/runner/.cache/node/corepack/v1/yarn/4.7.0/yarn.js:529:10062)
  ➤ YN0000: │ /tmp/xfs-ad231f63 STDOUT     at async /home/runner/.cache/node/corepack/v1/yarn/4.7.0/yarn.js:529:7533
Image

It seems there's an unhandled exception during the clone and it's affecting the error outputs.
Errors are out of order, and doesn't contain the actual error message which makes it impossible to find the error root cause.

To reproduce

In GitHub Actions:

  1. Update yarn version in the package.json to "packageManager": "[email protected]",
  2. Install yarn using corepack. npm i -g corepack, corepack enable, yarn -v
  3. Install some repositories using the git syntax.
    yarn add foo@git+ssh://[email protected]/owner/repo.git.
  4. If the target git repository contains packageManager field set and uses yarn < 4.12.0, then corepack automatically uses that version instead of the current yarn version. So users will see above error.

Environment

System:
    OS: macOS 26.1
    CPU: (10) arm64 Apple M1 Pro
  Binaries:
    Node: 22.21.1 - /private/var/folders/kb/zbm7kc491ng1mw5wqk8b97kw0000gn/T/xfs-9b4b2ff6/node
    Yarn: 4.12.0 - /private/var/folders/kb/zbm7kc491ng1mw5wqk8b97kw0000gn/T/xfs-9b4b2ff6/yarn

Additional context

git version must be 2.52.0 to reproduce the error.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions