2 years, 6 months ago.

How to address the error "[mbed] ERROR: Unknown Error: list index out of range"?


When I create a new mbed project in cli using "mbed new test-prj". I get the below logs.

$ mbed new test-prj [mbed] Working path "C:\test" (directory) [mbed] Creating new program "test-prj" (git) [mbed] ERROR: Unknown Error: list index out of range

Any reason why this error message pops up? I am using mbed version 1.9.2.

1 Answer

2 years, 5 months ago.

Hi Vivek,

We're sorry you are having problems with the CLI. That is a strange error and we don't recognize the failure. Could you please pipe the verbose output to a text file and send it to us?

mbed new test-prj -vv | tee mbed_new.txt

Also - please tell us:

  1. What host OS are you using and which version of Python?
  2. Do you recall how you installed Mbed ?
  3. Are you observing other failures, for instance when building projects?


Ralph, Team Mbed


Sorry for the delay. I had to restart my Mbed work and now still seeing the same issue. Initially, I had Mbed setup installed through mbed cli windows installer Mbed_installer_v0.4.10.exe (using Python 2.7.14) and faced this issue.

So now I tried alternate approach installing Python 3 and installing Mbed tools from Python itself and still seeing issue.

OS version: Windows 10 Enterprise version 1709 Python version: 3.7.4

Other commands like mbed import, compile work. But "mbed new" has this issue.

I am unable to attach the verbose text file. So posting the verbose output below.

Initialized empty Git repository in C:/Users/vvsk/Desktop/Mbed_GS_AN/Examples/test-prj/.git/ [mbed-16424] Working path "C:\Users\vvsk\Desktop\Mbed_GS_AN\Examples" (directory) [mbed-16424] Exec "git init C:\Users\vvsk\Desktop\Mbed_GS_AN\Examples\test-prj" in "C:\Users\vvsk\Desktop\Mbed_GS_AN\Examples" [mbed-16424] Creating new program "test-prj" (git) [mbed-16424] Exec "git remote -v" in "C:\Users\vvsk\Desktop\Mbed_GS_AN\Examples\test-prj" origin Traceback (most recent call last): File "c:\users\vvsk\appdata\local\programs\python\python37\lib\site-packages\mbed\mbed.py", line 3408, in main status = pargs.command(pargs) File "c:\users\vvsk\appdata\local\programs\python\python37\lib\site-packages\mbed\mbed.py", line 2032, in thunk return command(argv) File "c:\users\vvsk\appdata\local\programs\python\python37\lib\site-packages\mbed\mbed.py", line 2123, in new raise e File "c:\users\vvsk\appdata\local\programs\python\python37\lib\site-packages\mbed\mbed.py", line 2118, in new add(url, path=d, depth=depth, protocol=protocol, top=False) File "c:\users\vvsk\appdata\local\programs\python\python37\lib\site-packages\mbed\mbed.py", line 2232, in add repo = Repo.fromrepo() File "c:\users\vvsk\appdata\local\programs\python\python37\lib\site-packages\mbed\mbed.py", line 1091, in fromrepo repo.sync() File "c:\users\vvsk\appdata\local\programs\python\python37\lib\site-packages\mbed\mbed.py", line 1187, in sync self.url = self.geturl() File "c:\users\vvsk\appdata\local\programs\python\python37\lib\site-packages\mbed\mbed.py", line 1222, in scm_call return getattr(self.scm, method)(*args, kwargs) File "c:\users\vvsk\appdata\local\programs\python\python37\lib\site-packages\mbed\mbed.py", line 884, in geturl remotes = Git.getremotes() File "c:\users\vvsk\appdata\local\programs\python\python37\lib\site-packages\mbed\mbed.py", line 873, in getremotes t = re.sub('[()]', '', remote[2]) IndexError: list index out of range

posted by Vivek Kannan 23 Jul 2019