Kconfig server crash in VS Code

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": "linux",
    "osVersion": "#138-Ubuntu SMP Wed Jun 22 15:00:31 UTC 2022",
    "osKernel": "5.4.0-122-generic",
    "vscode": "1.69.2",
    "electron": "18.3.5",
    "node": "v16.13.2"
  },
  "system": {
    "date": "2022-07-22T10:58:41.073Z",
    "vscodeRoot": "/usr/share/code/resources/app",
    "nrfConnectForDesktopInstalled": "unknown",
    "vscodeUptime": "02:58:36",
    "osUptime": "03:04:20",
    "cpu": {
      "model": "Intel(R) Core(TM) i5-7300HQ CPU @ 2.50GHz",
      "speed": "1996 MHz",
      "count": 2
    },
    "memory": {
      "total": "7.66 GB",
      "free": "0.17 GB"
    }
  },
  "workspace": {
    "name": "peripheral (Workspace)",
    "workspaceFile": "/home/airat/promwad/dashcam/test3/peripheral.code-workspace",
    "folders": [
      "/home/airat/promwad/dashcam/test3/peripheral",
      "/home/airat/promwad/dashcam/test3/hci_uart",
      "/home/airat/ncs/v2.0.0/zephyr/boards/arm/nrf52dk_nrf52832"
    ]
  },
  "extensions": {
    "internal": {
      "nordic-semiconductor.nrf-connect": {
        "version": "2022.7.242",
        "path": "/home/airat/.vscode/extensions/nordic-semiconductor.nrf-connect-2022.7.242-linux-x64",
        "isActive": true
      },
      "nordic-semiconductor.nrf-terminal": {
        "version": "2022.7.21",
        "path": "/home/airat/.vscode/extensions/nordic-semiconductor.nrf-terminal-2022.7.21",
        "isActive": true
      },
      "nordic-semiconductor.nrf-devicetree": {
        "version": "2022.7.36",
        "path": "/home/airat/.vscode/extensions/nordic-semiconductor.nrf-devicetree-2022.7.36",
        "isActive": true
      },
      "nordic-semiconductor.nrf-kconfig": {
        "version": "2022.7.24",
        "path": "/home/airat/.vscode/extensions/nordic-semiconductor.nrf-kconfig-2022.7.24",
        "isActive": true
      }
    },
    "external": {
      "marus25.cortex-debug": "1.4.4",
      "ms-vscode.cpptools": "1.11.4",
      "ms-vscode.js-debug": "1.69.0",
      "ms-vscode.js-debug-companion": "1.0.18",
      "ms-vscode.vscode-js-profile-table": "1.0.2",
      "cschlosser.doxdocgen": "1.4.0",
      "jeff-hykin.better-cpp-syntax": "1.15.19",
      "ms-python.python": "2022.10.1",
      "ms-python.vscode-pylance": "2022.7.40",
      "ms-toolsai.jupyter": "2022.6.1201981810",
      "ms-toolsai.jupyter-keymap": "1.0.0",
      "ms-toolsai.jupyter-renderers": "1.0.9",
      "ms-vscode.cmake-tools": "1.11.26",
      "ms-vscode.cpptools-extension-pack": "1.2.0",
      "ms-vscode.cpptools-themes": "1.0.0",
      "trond-snekvik.gnu-mapfiles": "1.1.0",
      "trond-snekvik.simple-rst": "1.5.2",
      "twxs.cmake": "0.0.17"
    }
  },
  "tools": {
    "/home/airat/ncs/toolchains/v2.0.0/opt/zephyr-sdk/arm-zephyr-eabi/bin/arm-zephyr-eabi-gcc": "0.14.1",
    "/opt/SEGGER/JLink/JLinkExe": "7.68",
    "/usr/local/bin/nrfjprog": "10.16.0",
    "nrfutil": "Not found",
    "/home/airat/ncs/toolchains/v2.0.0/usr/local/bin/cmake": "3.20.5",
    "/home/airat/ncs/toolchains/v2.0.0/usr/local/bin/west": "0.13.1",
    "/home/airat/ncs/toolchains/v2.0.0/usr/local/bin/python3": "3.8.2",
    "/home/airat/ncs/toolchains/v2.0.0/usr/local/bin/ninja": "1.9.0",
    "/home/airat/ncs/toolchains/v2.0.0/usr/bin/gperf": "3.1",
    "/home/airat/ncs/toolchains/v2.0.0/usr/bin/dtc": "1.4.7",
    "/home/airat/ncs/toolchains/v2.0.0/opt/bin/gn": "1871",
    "/home/airat/ncs/toolchains/v2.0.0/usr/bin/git": "2.25.1"
  },
  "sdks": [
    {
      "version": "2.0.0",
      "path": "/home/airat/ncs/v2.0.0"
    }
  ],
  "toolchains": [
    {
      "version": "2.0.0",
      "path": {
        "$mid": 1,
        "fsPath": "/home/airat/ncs/toolchains/v2.0.0",
        "path": "/home/airat/ncs/toolchains/v2.0.0",
        "scheme": "file"
      }
    }
  ],
  "connectedDevices": [],
  "deviceProviders": [
    "nrfjprog"
  ],
  "config": {
    "nordic-semiconductor.nrf-connect": {
      "topdir": "${nrf-connect.sdk:2.0.0}",
      "toolchain": {
        "path": "${nrf-connect.toolchain:2.0.0}"
      },
      "ozonePath": "",
      "applications": [
        "${workspaceFolder}",
        "/home/airat/promwad/dashcam/test3/hci_uart"
      ],
      "applicationOptions": {},
      "kconfig": {
        "interface": "kconfig"
      },
      "welcome": {
        "showOnStartup": true
      },
      "west": {
        "env": {
          "$base": "terminal"
        }
      },
      "boardRoots": [],
      "enableTelemetry": false,
      "taskBindings": {},
      "debugging": {
        "backend": "Cortex-Debug"
      },
      "activeAppFollowActiveEditor": true
    },
    "nordic-semiconductor.nrf-terminal": {
      "terminalMode": "character"
    },
    "marus25.cortex-debug": {
      "armToolchainPath": null,
      "armToolchainPrefix": "arm-none-eabi",
      "gdbPath": null,
      "objdumpPath": null,
      "JLinkGDBServerPath": null,
      "openocdPath": null,
      "pyocdPath": null,
      "PEGDBServerPath": null,
      "stutilPath": null,
      "stlinkPath": null,
      "stm32cubeprogrammer": null,
      "enableTelemetry": true,
      "flattenAnonymous": false,
      "registerUseNaturalFormat": true,
      "variableUseNaturalFormat": true,
      "dbgServerLogfile": null,
      "showRTOS": false,
      "showDevDebugOutput": "none"
    }
  },
  "environment": {
    "westExe": "west",
    "westEnv": {
      "ELECTRON_RUN_AS_NODE": "1",
      "GIT_EXEC_PATH": "/home/airat/ncs/toolchains/v2.0.0/usr/lib/git-core",
      "HOME": "/home/airat",
      "PATH": "/home/airat/ncs/toolchains/v2.0.0/usr/bin:/home/airat/ncs/toolchains/v2.0.0/usr/local/bin:/home/airat/ncs/toolchains/v2.0.0/opt/bin:/home/airat/ncs/toolchains/v2.0.0/opt/nanopb/generator-bin:/home/airat/ncs/toolchains/v2.0.0/opt/zephyr-sdk/arm-zephyr-eabi/bin:/home/airat/ncs/toolchains/v2.0.0/arm-zephyr-eabi/bin:/tmp/.mount_nrfcon68g5ay:/tmp/.mount_nrfcon68g5ay/usr/sbin:/home/airat/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin",
      "ZEPHYR_BASE": "/home/airat/ncs/v2.0.0/zephyr",
      "ZEPHYR_TOOLCHAIN_VARIANT": "zephyr",
      "ZEPHYR_SDK_INSTALL_DIR": "/home/airat/ncs/toolchains/v2.0.0/opt/zephyr-sdk",
      "PYTHONPATH": "/home/airat/ncs/toolchains/v2.0.0/usr/local/lib/python3.8/site-packages",
      "USER": "airat"
    },
    "inherited": {
      "ELECTRON_RUN_AS_NODE": "1",
      "HOME": "/home/airat",
      "PATH": "/tmp/.mount_nrfcon68g5ay:/tmp/.mount_nrfcon68g5ay/usr/sbin:/home/airat/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin",
      "USER": "airat"
    },
    "toolchainPath": "/home/airat/ncs/toolchains/v2.0.0",
    "toolchainBinPath": "/home/airat/ncs/toolchains/v2.0.0/opt/zephyr-sdk/arm-zephyr-eabi/bin",
    "toolchainVersion": "2.0.0"
  },
  "terminal": {
    "shell": null,
    "defaultProfile": null
  }
}




I am using nRF Connect SDK with VS Code on Ubuntu 20.04. I have installed SDK using the nRF Connect for Desktop and Toolchain Manager.

When I start VS Code I get the following error:

The Kconfig server crashed 5 times in the last 3 minutes. The server will not be restarted.

Source: nRF Kconfig (Extension)

And following output:

Fatal Python error: Py_Initialize: Unable to get the locale encoding
ModuleNotFoundError: No module named 'encodings'

Current thread 0x00007f568a804740 (most recent call first):
[Info - 12:00:06 PM] Connection to server got closed. Server will restart.
Fatal Python error: Py_Initialize: Unable to get the locale encoding
ModuleNotFoundError: No module named 'encodings'

Current thread 0x00007efdee6e4740 (most recent call first):
[Info - 12:00:07 PM] Connection to server got closed. Server will restart.
Fatal Python error: Py_Initialize: Unable to get the locale encoding
ModuleNotFoundError: No module named 'encodings'

Current thread 0x00007f75c2b13740 (most recent call first):
[Info - 12:00:07 PM] Connection to server got closed. Server will restart.
Fatal Python error: Py_Initialize: Unable to get the locale encoding
ModuleNotFoundError: No module named 'encodings'

Current thread 0x00007f41b45f3740 (most recent call first):
[Info - 12:00:07 PM] Connection to server got closed. Server will restart.
Fatal Python error: Py_Initialize: Unable to get the locale encoding
ModuleNotFoundError: No module named 'encodings'

Current thread 0x00007f4fc0c78740 (most recent call first):
[Error - 12:00:08 PM] Connection to server got closed. Server will not be restarted.
How can I fix that?
Parents
  • Hi,

    Can "nRF Connect: Generate Support Information" (Ctrl+Shift+p) and attach the text document to this case?

    Regards,
    Sigurd Hellesvik

  • 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": "linux",
        "osVersion": "#138-Ubuntu SMP Wed Jun 22 15:00:31 UTC 2022",
        "osKernel": "5.4.0-122-generic",
        "vscode": "1.69.2",
        "electron": "18.3.5",
        "node": "v16.13.2"
      },
      "system": {
        "date": "2022-07-22T10:58:41.073Z",
        "vscodeRoot": "/usr/share/code/resources/app",
        "nrfConnectForDesktopInstalled": "unknown",
        "vscodeUptime": "02:58:36",
        "osUptime": "03:04:20",
        "cpu": {
          "model": "Intel(R) Core(TM) i5-7300HQ CPU @ 2.50GHz",
          "speed": "1996 MHz",
          "count": 2
        },
        "memory": {
          "total": "7.66 GB",
          "free": "0.17 GB"
        }
      },
      "workspace": {
        "name": "peripheral (Workspace)",
        "workspaceFile": "/home/airat/promwad/dashcam/test3/peripheral.code-workspace",
        "folders": [
          "/home/airat/promwad/dashcam/test3/peripheral",
          "/home/airat/promwad/dashcam/test3/hci_uart",
          "/home/airat/ncs/v2.0.0/zephyr/boards/arm/nrf52dk_nrf52832"
        ]
      },
      "extensions": {
        "internal": {
          "nordic-semiconductor.nrf-connect": {
            "version": "2022.7.242",
            "path": "/home/airat/.vscode/extensions/nordic-semiconductor.nrf-connect-2022.7.242-linux-x64",
            "isActive": true
          },
          "nordic-semiconductor.nrf-terminal": {
            "version": "2022.7.21",
            "path": "/home/airat/.vscode/extensions/nordic-semiconductor.nrf-terminal-2022.7.21",
            "isActive": true
          },
          "nordic-semiconductor.nrf-devicetree": {
            "version": "2022.7.36",
            "path": "/home/airat/.vscode/extensions/nordic-semiconductor.nrf-devicetree-2022.7.36",
            "isActive": true
          },
          "nordic-semiconductor.nrf-kconfig": {
            "version": "2022.7.24",
            "path": "/home/airat/.vscode/extensions/nordic-semiconductor.nrf-kconfig-2022.7.24",
            "isActive": true
          }
        },
        "external": {
          "marus25.cortex-debug": "1.4.4",
          "ms-vscode.cpptools": "1.11.4",
          "ms-vscode.js-debug": "1.69.0",
          "ms-vscode.js-debug-companion": "1.0.18",
          "ms-vscode.vscode-js-profile-table": "1.0.2",
          "cschlosser.doxdocgen": "1.4.0",
          "jeff-hykin.better-cpp-syntax": "1.15.19",
          "ms-python.python": "2022.10.1",
          "ms-python.vscode-pylance": "2022.7.40",
          "ms-toolsai.jupyter": "2022.6.1201981810",
          "ms-toolsai.jupyter-keymap": "1.0.0",
          "ms-toolsai.jupyter-renderers": "1.0.9",
          "ms-vscode.cmake-tools": "1.11.26",
          "ms-vscode.cpptools-extension-pack": "1.2.0",
          "ms-vscode.cpptools-themes": "1.0.0",
          "trond-snekvik.gnu-mapfiles": "1.1.0",
          "trond-snekvik.simple-rst": "1.5.2",
          "twxs.cmake": "0.0.17"
        }
      },
      "tools": {
        "/home/airat/ncs/toolchains/v2.0.0/opt/zephyr-sdk/arm-zephyr-eabi/bin/arm-zephyr-eabi-gcc": "0.14.1",
        "/opt/SEGGER/JLink/JLinkExe": "7.68",
        "/usr/local/bin/nrfjprog": "10.16.0",
        "nrfutil": "Not found",
        "/home/airat/ncs/toolchains/v2.0.0/usr/local/bin/cmake": "3.20.5",
        "/home/airat/ncs/toolchains/v2.0.0/usr/local/bin/west": "0.13.1",
        "/home/airat/ncs/toolchains/v2.0.0/usr/local/bin/python3": "3.8.2",
        "/home/airat/ncs/toolchains/v2.0.0/usr/local/bin/ninja": "1.9.0",
        "/home/airat/ncs/toolchains/v2.0.0/usr/bin/gperf": "3.1",
        "/home/airat/ncs/toolchains/v2.0.0/usr/bin/dtc": "1.4.7",
        "/home/airat/ncs/toolchains/v2.0.0/opt/bin/gn": "1871",
        "/home/airat/ncs/toolchains/v2.0.0/usr/bin/git": "2.25.1"
      },
      "sdks": [
        {
          "version": "2.0.0",
          "path": "/home/airat/ncs/v2.0.0"
        }
      ],
      "toolchains": [
        {
          "version": "2.0.0",
          "path": {
            "$mid": 1,
            "fsPath": "/home/airat/ncs/toolchains/v2.0.0",
            "path": "/home/airat/ncs/toolchains/v2.0.0",
            "scheme": "file"
          }
        }
      ],
      "connectedDevices": [],
      "deviceProviders": [
        "nrfjprog"
      ],
      "config": {
        "nordic-semiconductor.nrf-connect": {
          "topdir": "${nrf-connect.sdk:2.0.0}",
          "toolchain": {
            "path": "${nrf-connect.toolchain:2.0.0}"
          },
          "ozonePath": "",
          "applications": [
            "${workspaceFolder}",
            "/home/airat/promwad/dashcam/test3/hci_uart"
          ],
          "applicationOptions": {},
          "kconfig": {
            "interface": "kconfig"
          },
          "welcome": {
            "showOnStartup": true
          },
          "west": {
            "env": {
              "$base": "terminal"
            }
          },
          "boardRoots": [],
          "enableTelemetry": false,
          "taskBindings": {},
          "debugging": {
            "backend": "Cortex-Debug"
          },
          "activeAppFollowActiveEditor": true
        },
        "nordic-semiconductor.nrf-terminal": {
          "terminalMode": "character"
        },
        "marus25.cortex-debug": {
          "armToolchainPath": null,
          "armToolchainPrefix": "arm-none-eabi",
          "gdbPath": null,
          "objdumpPath": null,
          "JLinkGDBServerPath": null,
          "openocdPath": null,
          "pyocdPath": null,
          "PEGDBServerPath": null,
          "stutilPath": null,
          "stlinkPath": null,
          "stm32cubeprogrammer": null,
          "enableTelemetry": true,
          "flattenAnonymous": false,
          "registerUseNaturalFormat": true,
          "variableUseNaturalFormat": true,
          "dbgServerLogfile": null,
          "showRTOS": false,
          "showDevDebugOutput": "none"
        }
      },
      "environment": {
        "westExe": "west",
        "westEnv": {
          "ELECTRON_RUN_AS_NODE": "1",
          "GIT_EXEC_PATH": "/home/airat/ncs/toolchains/v2.0.0/usr/lib/git-core",
          "HOME": "/home/airat",
          "PATH": "/home/airat/ncs/toolchains/v2.0.0/usr/bin:/home/airat/ncs/toolchains/v2.0.0/usr/local/bin:/home/airat/ncs/toolchains/v2.0.0/opt/bin:/home/airat/ncs/toolchains/v2.0.0/opt/nanopb/generator-bin:/home/airat/ncs/toolchains/v2.0.0/opt/zephyr-sdk/arm-zephyr-eabi/bin:/home/airat/ncs/toolchains/v2.0.0/arm-zephyr-eabi/bin:/tmp/.mount_nrfcon68g5ay:/tmp/.mount_nrfcon68g5ay/usr/sbin:/home/airat/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin",
          "ZEPHYR_BASE": "/home/airat/ncs/v2.0.0/zephyr",
          "ZEPHYR_TOOLCHAIN_VARIANT": "zephyr",
          "ZEPHYR_SDK_INSTALL_DIR": "/home/airat/ncs/toolchains/v2.0.0/opt/zephyr-sdk",
          "PYTHONPATH": "/home/airat/ncs/toolchains/v2.0.0/usr/local/lib/python3.8/site-packages",
          "USER": "airat"
        },
        "inherited": {
          "ELECTRON_RUN_AS_NODE": "1",
          "HOME": "/home/airat",
          "PATH": "/tmp/.mount_nrfcon68g5ay:/tmp/.mount_nrfcon68g5ay/usr/sbin:/home/airat/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin",
          "USER": "airat"
        },
        "toolchainPath": "/home/airat/ncs/toolchains/v2.0.0",
        "toolchainBinPath": "/home/airat/ncs/toolchains/v2.0.0/opt/zephyr-sdk/arm-zephyr-eabi/bin",
        "toolchainVersion": "2.0.0"
      },
      "terminal": {
        "shell": null,
        "defaultProfile": null
      }
    }
    
    
    

    Hi, I've attached the file with support information output.

  • Hi,

    Try to downgrade the nRF Connect Extension to 2022.7.207.

    Regards,
    Sigurd Hellesvik

  • Hi,

    I tried downgrading the Extension. The problem still remains.

  • Hi,

    Do you have the folder toolchains/v2.0.0/usr/local/lib/python3.8/encoding?

    Regards,
    Sigurd Hellesvik

Reply Children
  • I have folder encodings. Here its contents:

    airat@mars-Aspire-A715-71G:~/ncs/toolchains/v2.0.0/usr/local/lib/python3.8/encodings$ ls
    aliases.py cp856.py iso2022_jp_3.py mac_iceland.py
    ascii.py cp857.py iso2022_jp_ext.py mac_latin2.py
    base64_codec.py cp858.py iso2022_jp.py mac_romanian.py
    big5hkscs.py cp860.py iso2022_kr.py mac_roman.py
    big5.py cp861.py iso8859_10.py mac_turkish.py
    bz2_codec.py cp862.py iso8859_11.py mbcs.py
    charmap.py cp863.py iso8859_13.py oem.py
    cp037.py cp864.py iso8859_14.py palmos.py
    cp1006.py cp865.py iso8859_15.py ptcp154.py
    cp1026.py cp866.py iso8859_16.py punycode.py
    cp1125.py cp869.py iso8859_1.py __pycache__
    cp1140.py cp874.py iso8859_2.py quopri_codec.py
    cp1250.py cp875.py iso8859_3.py raw_unicode_escape.py
    cp1251.py cp932.py iso8859_4.py rot_13.py
    cp1252.py cp949.py iso8859_5.py shift_jis_2004.py
    cp1253.py cp950.py iso8859_6.py shift_jis.py
    cp1254.py euc_jis_2004.py iso8859_7.py shift_jisx0213.py
    cp1255.py euc_jisx0213.py iso8859_8.py tis_620.py
    cp1256.py euc_jp.py iso8859_9.py undefined.py
    cp1257.py euc_kr.py johab.py unicode_escape.py
    cp1258.py gb18030.py koi8_r.py utf_16_be.py
    cp273.py gb2312.py koi8_t.py utf_16_le.py
    cp424.py gbk.py koi8_u.py utf_16.py
    cp437.py hex_codec.py kz1048.py utf_32_be.py
    cp500.py hp_roman8.py latin_1.py utf_32_le.py
    cp720.py hz.py mac_arabic.py utf_32.py
    cp737.py idna.py mac_centeuro.py utf_7.py
    cp775.py __init__.py mac_croatian.py utf_8.py
    cp850.py iso2022_jp_1.py mac_cyrillic.py utf_8_sig.py
    cp852.py iso2022_jp_2004.py mac_farsi.py uu_codec.py

  • Hi,

    My guess is that the Kconfig extension somehow uses the wrong version of python.
    But I am not sure how yet.

    I have asked our developers if they have ideas, and hope to get back to you on monday.

    If you grow impatient, you could always try to uninstall nRF Connect SDK from the Toolchain Manager and reinstall the nRF Connect SDK using the manual installation method.

    Regards,
    Sigurd Hellesvik

  • I have been having this problem for a while.  Sigurd's idea about Kconfig using the wrong version of Python seems to be correct - at least in my case.  I do not have python in my $PATH, and when I went to the Kconfig Extension and looked at the settings, there was no path to python provided.

    Setting the path to /usr/bin/python3 in the Kconfig Extension seems to have solved this problem for me.

    Thanks, folks!

    -Glenn

  • Hi Glenn,

    Thanks for the solution!

    Just thought I should point out that our toolchain includes its own version of python (inside toolchains/v2.0.0/).
    As long as it works, using your own python version is perfectly fine.
    But in case your own version does not work, for example because it does not have all required pip packages, trying to point the Kconfig Extension to the toolchain python version instead could fix things.

    Regards,
    Sigurd Hellesvik

Related