Arm Mbed and Pelion Device Management support forum

Git operation fails while downloading mbed library

When creating a new project or updating a library in an existing project, the download of the mbed library fails. A portion of my mbed-studio.log:

[2019-12-31T12:22:51.036] [WARN] root/mbs-library-mgmt - Library operation failed [ ‘file:///c%3A/src/mbed/test/mbed-os-example-blinky’,
{ type: ‘hydrate’ },
{ name: ‘GitError’,
result:
{ stdout: ‘’,
stderr:
‘Cloning into ‘c:\src\mbed\test\mbed-os-example-blinky\mbed-os’…\nremote: Enumerating objects: 239205 \rremote: fatal: filename in tree entry contains backslash: ‘frameworks\utest’ \nerror: git upload-pack: git-pack-objects died with error.\nfatal: git upload-pack: aborting due to possible repository corruption on the remote side.\nremote: aborting due to possible repository corruption on the remote side.\u0000\nfatal: early EOF\nfatal: index-pack failed\n’,
exitCode: 128 },
args:
[ ‘clone’,
‘–recursive’,
‘–progress’,
‘–progress’,
‘–’,
‘file:///c%3A/Users/jonathan.pickett/AppData/Local/Mbed%20Studio/library-cache/github.com/ARMmbed/mbed-os.git’,
‘c:\src\mbed\test\mbed-os-example-blinky\mbed-os’ ] } ]
[2019-12-31T12:22:51.044] [ERROR] root/mbs-target-mgmt - Failed to get targets from Mbed OS: Request getTargets failed unexpectedly without providing any details.
file:///c%3A/src/mbed/test/mbed-os-example-blinky might not have Mbed OS loaded. []
[2019-12-31T12:22:51.049] [INFO] root/mbs-device - Asking device manager for list of devices []
[2019-12-31T12:22:51.058] [INFO] root/mbs-core - Updating CoreMbedApplicationState with updateType: TARGET_SELECTED, update: false []
[2019-12-31T12:22:51.058] [INFO] root/mbs-core - Determining program buttons status: {“BUILD”:{“type”:“BUILD”,“typeString”:“BUILD”,“isDisabled”:true,“tooltip”:“Select or connect a platform”},“DEBUG”:{“type”:“DEBUG”,“typeString”:“DEBUG”,“isDisabled”:true,“tooltip”:“Select or connect a platform”},“RUN”:{“type”:“RUN”,“typeString”:“RUN”,“isDisabled”:true,“tooltip”:“Select or connect a platform”}} []
[2019-12-31T12:22:51.058] [INFO] root/mbs-core - Updating CoreMbedApplicationState with updateType: TARGET_BUILDABLE, update: false []
[2019-12-31T12:22:51.059] [INFO] root/mbs-core - Determining program buttons status: {“BUILD”:{“type”:“BUILD”,“typeString”:“BUILD”,“isDisabled”:true,“tooltip”:“Select or connect a platform”},“DEBUG”:{“type”:“DEBUG”,“typeString”:“DEBUG”,“isDisabled”:true,“tooltip”:“Select or connect a platform”},“RUN”:{“type”:“RUN”,“typeString”:“RUN”,“isDisabled”:true,“tooltip”:“Select or connect a platform”}} []
[2019-12-31T12:22:52.598] [DEBUG] root/mbs-cpp-config - IntelliSense will not update until a target is selected []
[2019-12-31T12:22:58.816] [INFO] root/mbs-about - reporting an issue from Mbed Studio browser []
[2019-12-31T12:22:58.834] [INFO] root/mbs-about - Mbed Studio platform:: Windows []
[2019-12-31T12:22:58.835] [INFO] root/mbs-about - Mbed Studio version: 0.8.0 []
[2019-12-31T12:24:00.186] [INFO] root/mbs-about - reporting an issue from Mbed Studio browser []
[2019-12-31T12:24:00.208] [INFO] root/mbs-about - Mbed Studio platform:: Windows []
[2019-12-31T12:24:00.209] [INFO] root/mbs-about - Mbed Studio version: 0.8.0 []

I am able to workaround this with mbed-cli.

Hi Jonathan,

Thank you for reporting this issue. I’m glad that a temporary mbed-cli workaround works for you. We believe that it may happen because of the version of git installed on your system. Can you check and let us know the version of git you have got installed? Please feel free to also send us logs to studio@mbed.com. It will help us in investigating this issue.

Mbed Studio is shipped with Git but is using it only when Git is not present on the system or the version of it is too old.
In upcoming minor release of Mbed Studio we improved Source Control and Library Management. We switched also to always use bundled version of Git. You can expect that release soon.

Thanks,
Arek - Mbed Studio team

I am using version 2.24.1.2 available from https://chocolatey.org/packages/git

My Git setup has not changed recently. Git operations with Mbed Studio were working a few weeks ago.

Hi Jonathan,

Version 2.24.1.2 of Git for Windows has a bug where its handling of invalid file paths is unnecessarily strict. The mbed-os repository history has an invalid file path that was added and removed a long time ago, so this version of Git cannot clone mbed-os.

The issue is reported in Git-for-Windows here: https://github.com/git-for-windows/git/issues/2435.

Work-arounds:

  • Disable the NTFS protections in Git (see the GitHub issue)
  • Downgrade Git to 2.24.0

Or continue using mbed-cli for now and wait for the next Mbed Studio version as suggested by Arek.

Hope that helps,
Matthew - Mbed Studio team

2 Likes

Thanks for the info! As a note, I just hit this installing mbed studio on a clean machine (where I had also just installed Git for Windows from their download page). So, anyone spinning up new machines or setups on Windows is probably going to hit this. Good to know that there are workarounds.

Downgrading Git worked for me. Thanks.

In case anyone else comes across this, Git for Windows 2.25.0 has just been released and includes a fix for this issue.

1 Like