Strange installation problem with nRF Connect SDK - git not found

I am facing yet another strange installation problem, after  nRF Connect SDK always fails with error "not found" has been solved.

The installation worked so far and I was able to use the nRF Connect SDK without any issues.

When I yesterday tried to use the setup again, I suddenly got errors like "No boards found" etc. I read up on this forum about potential issues and reinstalled the SDKs and so on. Nothing helped. I noticed that everything worked fine if I tried to build on the commandline using "west builld" in VS Code, but the UI functions did not work.

Then I tried uninstalling everything, reinstall the VS Code extensions and all of a sudden I was no longer able to install the SDK anymore given me errors like "git not found" while GIT is DEFINITELY PRESENT on the system, also in the default search path. Running git from a cmdline works fine.

So I even reinstalled GIT with the Windows installer, rebooted etc, but nothing seemed to make this problem go away.

Then I tried installing the stuff using VS Code again, but where presented the same problem

If I open a new nRF Connect terminal and issue the very same command "west init" manually there, it works:

But after the installation the extension still complains nothing is installed.

[19:08:47] nRF Command Line Tools 10.23.2 are up to date
[19:08:58] nrfutil-toolchain-manager install v2.5.0: Download toolchain
[19:09:00] nrfutil-toolchain-manager install v2.5.0: Finished, using previously downloaded file: success
[19:09:00] nrfutil-toolchain-manager install v2.5.0: Unpack toolchain
[19:09:28] nrfutil-toolchain-manager install v2.5.0: Toolchain unpacked to C:\ncs\tmp\.tmpjhd3yt: success
[19:09:28] nrfutil-toolchain-manager install v2.5.0: Install toolchain
[19:09:28] nrfutil-toolchain-manager install v2.5.0: Toolchain installed at C:\ncs\toolchains\c57af46cb7: success
[19:09:29] =========== Toolchain validation report for nRF Connect SDK Toolchain v2.5.0 ===========
No issues were detected with the toolchain.
[19:09:53] Command failed: west init -m https://github.com/nrfconnect/sdk-nrf --mr v2.5.1
FATAL ERROR: can't find git; install it or ensure it's on your PATH

IMPORTANT: The data below could contain sensitive or confidential information about your environment.
If you do not wish this to be seen by others, please make sure to remove it before sharing.

For help and support, visit the Nordic DevZone at https://devzone.nordicsemi.com/.

{
  "platform": {
    "os": "win32",
    "osVersion": "Windows 10 Pro",
    "osKernel": "10.0.19045",
    "vscode": "1.85.1",
    "electron": "25.9.7",
    "node": "v18.15.0"
  },
  "system": {
    "date": "2023-12-26T18:11:31.932Z",
    "vscodeRoot": "c:\\Users\\daubsi\\AppData\\Local\\Programs\\Microsoft VS Code\\resources\\app",
    "nrfConnectForDesktopInstalled": true,
    "vscodeUptime": "00:02:53",
    "osUptime": "04:51:20",
    "cpu": "Intel(R) Core(TM) i7-7500U CPU @ 2.70GHz"
  },
  "workspace": {
    "name": "hv23last",
    "workspaceFile": null,
    "folders": [
      "c:\\Users\\daubsi\\Nextcloud\\hv23last"
    ]
  },
  "sdks": [],
  "apps": [],
  "workspaceState": "freestanding-unconfigured",
  "toolchains": [
    {
      "version": "2.5.0",
      "path": "c:\\ncs\\toolchains\\c57af46cb7"
    }
  ],
  "connectedDevices": [],
  "deviceProvider": "nrfutil",
  "tools": {
    "C:\\ncs\\toolchains\\c57af46cb7\\opt\\zephyr-sdk\\arm-zephyr-eabi\\bin\\arm-zephyr-eabi-gcc.exe": "0.16.1",
    "C:\\Program Files\\SEGGER\\JLink\\JLink.exe": "7.88j",
    "C:\\Program Files\\Nordic Semiconductor\\nrf-command-line-tools\\bin\\nrfjprog.exe": "10.23.2",
    "nrfutil": "Not found",
    "C:\\ncs\\toolchains\\c57af46cb7\\opt\\bin\\cmake.exe": "3.20.5",
    "C:\\ncs\\toolchains\\c57af46cb7\\opt\\bin\\Scripts\\west.exe": "1.1.0",
    "C:\\ncs\\toolchains\\c57af46cb7\\opt\\bin\\python.exe": "3.8.2",
    "C:\\ncs\\toolchains\\c57af46cb7\\opt\\bin\\ninja.exe": "1.9.0",
    "C:\\ncs\\toolchains\\c57af46cb7\\opt\\bin\\gperf.exe": "3.1",
    "C:\\ncs\\toolchains\\c57af46cb7\\opt\\bin\\dtc.exe": "1.4.7",
    "C:\\ncs\\toolchains\\c57af46cb7\\opt\\bin\\gn.exe": "2122",
    "C:\\ncs\\toolchains\\c57af46cb7\\mingw64\\bin\\git.exe": "2.37.3.windows.1",
    "gdbPath": "c:\\ncs\\toolchains\\c57af46cb7\\opt\\zephyr-sdk\\arm-zephyr-eabi\\bin\\arm-zephyr-eabi-gdb.exe"
  },
  "nrfutil": {
    "nrfutil-device": {
      "version": "2.0.0",
      "binPath": "c:\\Users\\daubsi\\.vscode\\extensions\\nordic-semiconductor.nrf-connect-2023.11.301-win32-x64\\platform\\nrfutil\\bin\\nrfutil-device"
    },
    "nrfutil-toolchain-manager": {
      "version": "0.14.1",
      "binPath": "c:\\Users\\daubsi\\.vscode\\extensions\\nordic-semiconductor.nrf-connect-2023.11.301-win32-x64\\platform\\nrfutil\\bin\\nrfutil-toolchain-manager"
    }
  },
  "environment": {
    "westEnv": {
      "ELECTRON_RUN_AS_NODE": "1",
      "HOME": "C:\\Users\\daubsi",
      "HOMEDRIVE": "C:",
      "HOMEPATH": "\\Users\\daubsi",
      "PATH": "C:\\ncs\\toolchains\\c57af46cb7;C:\\ncs\\toolchains\\c57af46cb7\\mingw64\\bin;C:\\ncs\\toolchains\\c57af46cb7\\bin;C:\\ncs\\toolchains\\c57af46cb7\\opt\\bin;C:\\ncs\\toolchains\\c57af46cb7\\opt\\bin\\Scripts;C:\\ncs\\toolchains\\c57af46cb7\\opt\\nanopb\\generator-bin;C:\\ncs\\toolchains\\c57af46cb7\\opt\\zephyr-sdk\\aarch64-zephyr-elf\\bin;C:\\ncs\\toolchains\\c57af46cb7\\opt\\zephyr-sdk\\x86_64-zephyr-elf\\bin;C:\\ncs\\toolchains\\c57af46cb7\\opt\\zephyr-sdk\\arm-zephyr-eabi\\bin;c:\\Users\\daubsi\\.vscode\\extensions\\nordic-semiconductor.nrf-connect-2023.11.301-win32-x64\\platform\\nrfutil\\lib\\nrfutil-toolchain-manager;C:\\Program Files (x86)\\VMware\\VMware Workstation\\bin\\;C:\\Python310\\Scripts\\;C:\\Python310\\;C:\\WINDOWS\\system32;C:\\WINDOWS;C:\\WINDOWS\\System32\\Wbem;C:\\WINDOWS\\System32\\WindowsPowerShell\\v1.0\\;C:\\WINDOWS\\System32\\OpenSSH\\;C:\\Program Files\\PuTTY\\;C:\\Program Files (x86)\\Pico Technology\\PicoScope6\\;C:\\Program Files\\010 Editor;C:\\Program Files (x86)\\GitExtensions\\;C:\\Program Files\\dotnet\\;C:\\Program Files\\Nordic Semiconductor\\nrf-command-line-tools\\bin\\;C:\\Program Files\\Git\\cmd;C:\\Users\\daubsi\\.cargo\\bin;C:\\Python310\\Scripts\\;C:\\Python310\\;C:\\Users\\daubsi\\AppData\\Local\\Microsoft\\WindowsApps;C:\\Users\\daubsi\\AppData\\Local\\Programs\\Microsoft VS Code\\bin;C:\\Program Files (x86)\\Nmap;C:\\Users\\daubsi\\vod_download_tools;",
      "ZEPHYR_TOOLCHAIN_VARIANT": "zephyr",
      "ZEPHYR_SDK_INSTALL_DIR": "C:\\ncs\\toolchains\\c57af46cb7\\opt\\zephyr-sdk",
      "PYTHONPATH": "C:\\ncs\\toolchains\\c57af46cb7\\opt\\bin;C:\\ncs\\toolchains\\c57af46cb7\\opt\\bin\\Lib;C:\\ncs\\toolchains\\c57af46cb7\\opt\\bin\\Lib\\site-packages"
    },
    "inherited": {
      "ELECTRON_RUN_AS_NODE": "1",
      "HOME": "C:\\Users\\daubsi",
      "HOMEDRIVE": "C:",
      "HOMEPATH": "\\Users\\daubsi",
      "Path": "C:\\Program Files (x86)\\VMware\\VMware Workstation\\bin\\;C:\\Python310\\Scripts\\;C:\\Python310\\;C:\\WINDOWS\\system32;C:\\WINDOWS;C:\\WINDOWS\\System32\\Wbem;C:\\WINDOWS\\System32\\WindowsPowerShell\\v1.0\\;C:\\WINDOWS\\System32\\OpenSSH\\;C:\\Program Files\\PuTTY\\;C:\\Program Files (x86)\\Pico Technology\\PicoScope6\\;C:\\Program Files\\010 Editor;C:\\Program Files (x86)\\GitExtensions\\;C:\\Program Files\\dotnet\\;C:\\Program Files\\Nordic Semiconductor\\nrf-command-line-tools\\bin\\;C:\\Program Files\\Git\\cmd;C:\\Users\\daubsi\\.cargo\\bin;C:\\Python310\\Scripts\\;C:\\Python310\\;C:\\Users\\daubsi\\AppData\\Local\\Microsoft\\WindowsApps;C:\\Users\\daubsi\\AppData\\Local\\Programs\\Microsoft VS Code\\bin;C:\\Program Files (x86)\\Nmap;C:\\Users\\daubsi\\vod_download_tools;",
      "PATH": "C:\\Program Files (x86)\\VMware\\VMware Workstation\\bin\\;C:\\Python310\\Scripts\\;C:\\Python310\\;C:\\WINDOWS\\system32;C:\\WINDOWS;C:\\WINDOWS\\System32\\Wbem;C:\\WINDOWS\\System32\\WindowsPowerShell\\v1.0\\;C:\\WINDOWS\\System32\\OpenSSH\\;C:\\Program Files\\PuTTY\\;C:\\Program Files (x86)\\Pico Technology\\PicoScope6\\;C:\\Program Files\\010 Editor;C:\\Program Files (x86)\\GitExtensions\\;C:\\Program Files\\dotnet\\;C:\\Program Files\\Nordic Semiconductor\\nrf-command-line-tools\\bin\\;C:\\Program Files\\Git\\cmd;C:\\Users\\daubsi\\.cargo\\bin;C:\\Python310\\Scripts\\;C:\\Python310\\;C:\\Users\\daubsi\\AppData\\Local\\Microsoft\\WindowsApps;C:\\Users\\daubsi\\AppData\\Local\\Programs\\Microsoft VS Code\\bin;C:\\Program Files (x86)\\Nmap;C:\\Users\\daubsi\\vod_download_tools;"
    },
    "toolchainPath": "c:\\ncs\\toolchains\\c57af46cb7",
    "toolchainBinPath": "c:\\ncs\\toolchains\\c57af46cb7\\opt\\zephyr-sdk\\arm-zephyr-eabi\\bin",
    "toolchainVersion": "2.5.0"
  },
  "terminal": {
    "defaultProfile": null
  },
  "config": {
    "nordic-semiconductor.nrf-connect": {
      "topdir": "",
      "toolchain": {
        "path": "${nrf-connect.toolchain:2.5.0}"
      },
      "ozonePath": "",
      "applications": [],
      "applicationOptions": {},
      "kconfig": {
        "interface": "kconfig"
      },
      "west": {
        "env": {
          "$base": "terminal"
        }
      },
      "boardRoots": [],
      "taskBindings": {},
      "debugging": {
        "flash": true,
        "bindings": {},
        "justMyCode": true
      },
      "activeAppFollowActiveEditor": true,
      "deviceProvider": "",
      "flash": {
        "softreset": false,
        "erase": false,
        "recover": false
      },
      "enableTelemetry": false,
      "thirdpartyIntegration": {},
      "toolchainManager": {
        "indexURL": null,
        "installDirectory": null
      },
      "nrfutil": {
        "home": null
      },
      "defaultOpenAction": "ask"
    },
    "nordic-semiconductor.nrf-terminal": {
      "terminalMode": "character"
    }
  },
  "extensions": {
    "internal": {
      "nordic-semiconductor.nrf-connect": {
        "version": "2023.11.301",
        "path": "c:\\Users\\daubsi\\.vscode\\extensions\\nordic-semiconductor.nrf-connect-2023.11.301-win32-x64",
        "isActive": true
      },
      "nordic-semiconductor.nrf-terminal": {
        "version": "2023.10.17",
        "path": "c:\\Users\\daubsi\\.vscode\\extensions\\nordic-semiconductor.nrf-terminal-2023.10.17",
        "isActive": true
      },
      "nordic-semiconductor.nrf-devicetree": {
        "version": "2023.11.120",
        "path": "c:\\Users\\daubsi\\.vscode\\extensions\\nordic-semiconductor.nrf-devicetree-2023.11.120",
        "isActive": true
      },
      "nordic-semiconductor.nrf-kconfig": {
        "version": "2023.11.64",
        "path": "c:\\Users\\daubsi\\.vscode\\extensions\\nordic-semiconductor.nrf-kconfig-2023.11.64",
        "isActive": true
      }
    },
    "external": {
      "marus25.cortex-debug": null,
      "ms-vscode.cpptools": "1.18.5",
      "ms-vscode.js-debug": "1.85.0",
      "ms-vscode.js-debug-companion": "1.1.2",
      "ms-vscode.vscode-js-profile-table": "1.0.8",
      "ms-python.python": "2023.22.1",
      "ms-python.vscode-pylance": "2023.12.1",
      "ms-vscode-remote.remote-wsl": "0.81.8",
      "trond-snekvik.gnu-mapfiles": "1.1.0",
      "twxs.cmake": "0.0.17"
    }
  }
}

What could be the reason for this?

Refering to my other post mentioned at the top: I made sure that tools like "reg.exe", "git.exe" etc. fully resolve without issued. 

  • Definitely not the first reboot... but yes, it seems it's working now as it should. The fact that also the nRF Connect for Desktop -> Toolchain Manager app showed the same problem is strange though. So was apparently not something related to the VS Code extension. I also tried opening an cmd prompt, making sure all %PATH%, etc. are properly set, git.exe can be found/resolved and then started the Desktop app from that shell and still it complained not to find git.exe... 
    That's why I was interested in understanding how git.exe is called from within the app. Maybe the problem emerges from somewhere in that area. 

  • daubsi said:
    The fact that also the nRF Connect for Desktop -> Toolchain Manager app showed the same problem is strange though.

    I'm checking with the team responsible, but I believe it is doing the same thing as VSC; simply running these commands. Did you try manually installing in the terminals in which you did find git btw? Maybe that would have worked.

    My understanding is that the nRF Terminal and the terminal in the Toolchain Manager NCS drop-down menu is setting a few path variables. That might of course play a role.

    Either way, I am glad it now works for you.

    Regards,

    Elfving

  • The commands being run in the toolchain manager are:

    mkdir <path to sdk installtion>

    nrfutil toolchain-manager launch --chdir <path to sdk installation> --ncs-version <sdk version> -- west -v init -m github.com/.../sdk-nrf --mr <sdk version>

    nrfutil toolchain-manager launch --chdir <path to sdk installation> --ncs-version <sdk version> -- west -v update

    nrfutil toolchain-manager launch --chdir <path to sdk installation> --ncs-version <sdk version> -- west -v zephyr-export

    Regards,

    Elfving

  • Thank you for those details Elfving, this is surely helpful. I'll try to reproduce the issue and see where it is me taking. 

    "Did you try installing in the terminals where...": Well, yes, because git was found in every terminal! Because it was in the normal system/user path env. I had no issue running or finding git at all. That's what's so confusing me.

    DId I understand this correctly that the commands above (nrfutil toolchain-manager launch ....) are "hidden" internally and I could not actually see them anywhere? Wonder if "procmon"  could have helped. But then again, I would not see the correlation to git anyhow.

    Regarding nrfutil - this is a python script where I would need to setup my env first, before this would properly run, right?

    On my Linux box I remember I need to set the following so that I can directly run nrfutil. I understood that's what's happening in VS Code internally?

    cat setup_env.sh 
    export PATH=/home/daubsi/ncs/toolchains/7795df4459/usr/bin:/home/daubsi/ncs/toolchains/7795df4459/usr/bin:/home/daubsi/ncs/toolchains/7795df4459/usr/local/bin:/home/daubsi/ncs/toolchains/7795df4459/opt/bin:/home/daubsi/ncs/toolchains/7795df4459/opt/nanopb/generator-bin:/home/daubsi/ncs/toolchains/7795df4459/opt/zephyr-sdk/aarch64-zephyr-elf/bin:/home/daubsi/ncs/toolchains/7795df4459/opt/zephyr-sdk/x86_64-zephyr-elf/bin:/home/daubsi/ncs/toolchains/7795df4459/opt/zephyr-sdk/arm-zephyr-eabi/bin:$PATH
    export LD_LIBRARY_PATH=/home/daubsi/ncs/toolchains/7795df4459/usr/lib:/home/daubsi/ncs/toolchains/7795df4459/usr/lib/x86_64-linux-gnu:/home/daubsi/ncs/toolchains/7795df4459/usr/local/lib:$LD_LIBRARY_PATH
    export GIT_EXEC_PATH=/home/daubsi/ncs/toolchains/7795df4459/usr/local/libexec/git-core
    export GIT_TEMPLATE_DIR=/home/daubsi/ncs/toolchains/7795df4459/usr/local/share/git-core/templates
    export PYTHONHOME=/home/daubsi/ncs/toolchains/7795df4459/usr/local
    export PYTHONPATH=/home/daubsi/ncs/toolchains/7795df4459/usr/local/lib/python3.8:/home/daubsi/ncs/toolchains/7795df4459/usr/local/lib/python3.8/site-packages
    export ZEPHYR_TOOLCHAIN_VARIANT=zephyr
    export ZEPHYR_SDK_INSTALL_DIR=/home/daubsi/ncs/toolchains/7795df4459/opt/zephyr-sdk
    export ZEPHYR_BASE=/home/daubsi/ncs/v2.5.0/zephyr

  • daubsi said:
    Thank you for those details Elfving, this is surely helpful. I'll try to reproduce the issue and see where it is me taking. 

    No problem, but I've now had a talk with a developer who believes this might be a bug with the nrfutil toolchain manager, and looking into fixing it. We are not sure yet though, but it might be that this is not just a problem on your side. 

    daubsi said:
    On my Linux box I remember I need to set the following so that I can directly run nrfutil.

    Hmm that is a bit surprising to me. Did you need that in order to use nrfutil for anything, even "nrfutil device"? What distribution and version of linux was this?

    daubsi said:
    DId I understand this correctly that the commands above (nrfutil toolchain-manager launch ....) are "hidden" internally

    Not exactly sure what you mean by this, but it is open source and javascript, so you are free to have a look at what is running. Though we not log/display them to the user during normal App usage. However when the VS Code extension calls west, it does not wrap it in nrfutil toolchain-manager launch etc. That only applies to the Toolchain manager app though.

    Regards,

    Elfving

Related