nrfcredstore list command returns error

Issue:

I would like to bring to your attention that I am getting an error when running the 'list command using the nrfcredstore cli utility, while trying to retrieve the flashed credentials on my nrf9151 DK. The following error appears:

(PR-22093) devin@devin-Latitude-5511:~/ncs/nrf$ nrfcredstore /dev/ttyACM0 list
Traceback (most recent call last):
  File "/home/devin/ncs/toolchains/1d2c5d0ab5/usr/local/bin/nrfcredstore", line 8, in <module>
    sys.exit(run())
             ^^^^^
  File "/home/devin/ncs/toolchains/1d2c5d0ab5/usr/local/lib/python3.12/site-packages/nrfcredstore/cli.py", line 111, in run
    main(sys.argv[1:], CredStore(ATClient(serial.Serial())))
  File "/home/devin/ncs/toolchains/1d2c5d0ab5/usr/local/lib/python3.12/site-packages/nrfcredstore/cli.py", line 100, in main
    exec_cmd(args, credstore)
  File "/home/devin/ncs/toolchains/1d2c5d0ab5/usr/local/lib/python3.12/site-packages/nrfcredstore/cli.py", line 68, in exec_cmd
    creds = credstore.list(args.tag, ct)
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/devin/ncs/toolchains/1d2c5d0ab5/usr/local/lib/python3.12/site-packages/nrfcredstore/credstore.py", line 70, in list
    return list(cred_map)
           ^^^^^^^^^^^^^^
  File "/home/devin/ncs/toolchains/1d2c5d0ab5/usr/local/lib/python3.12/site-packages/nrfcredstore/credstore.py", line 66, in <lambda>
    Credential(int(columns[0]), int(columns[1]), columns[2].strip()),
               ^^^^^^^^^^^^^^^
ValueError: invalid literal for int() with base 10: ''

What I've done:

As expected, I have flashed the device with the at_client sample application.

I have verified I can retrieve a list of the keys from the device when I manually enter the AT command : 

AT%CMNG=1

I have tried multiple version of the tool chain and I seem to get the same error. 

 /home/devin/ncs/toolchains/b77d8c1312/usr/local/bin/nrfcredstore /dev/ttyACM0 list
Traceback (most recent call last):
  File "/home/devin/ncs/toolchains/b77d8c1312/usr/local/bin/nrfcredstore", line 8, in <module>
    sys.exit(run())
             ^^^^^
  File "/home/devin/ncs/toolchains/b77d8c1312/usr/local/lib/python3.12/site-packages/nrfcredstore/cli.py", line 111, in run
    main(sys.argv[1:], CredStore(ATClient(serial.Serial())))
  File "/home/devin/ncs/toolchains/b77d8c1312/usr/local/lib/python3.12/site-packages/nrfcredstore/cli.py", line 100, in main
    exec_cmd(args, credstore)
  File "/home/devin/ncs/toolchains/b77d8c1312/usr/local/lib/python3.12/site-packages/nrfcredstore/cli.py", line 68, in exec_cmd
    creds = credstore.list(args.tag, ct)
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/devin/ncs/toolchains/b77d8c1312/usr/local/lib/python3.12/site-packages/nrfcredstore/credstore.py", line 70, in list
    return list(cred_map)
           ^^^^^^^^^^^^^^
  File "/home/devin/ncs/toolchains/b77d8c1312/usr/local/lib/python3.12/site-packages/nrfcredstore/credstore.py", line 66, in <lambda>
    Credential(int(columns[0]), int(columns[1]), columns[2].strip()),
               ^^^^^^^^^^^^^^^
ValueError: invalid literal for int() with base 10: ''

I have also tried to power cycle the device of course, with no luck. I have also tried a seperate nrf9151DK board, and face the same issue. 

I want to add that I have flashed multiple sets of credentials on this device, and thus I suspect this may be contribuing to the issue as I have more than the standard two sets of credentials and associated security tags, on this device. 

I would also like to mention that I am still learning the NCS toolchain and associated usage. Yesterday the nrfcredstore cli command worked, but today I have git fetched and git pull origin main in the 'nrf' repo inside the ncs parent directory. I proceeded to run 'west update' as instructed online. I have noticed I have the most recent commits (I can see this by viewing the logs), but I am not sure if I am supposed to have new toolchain 'hash' or whatnot. On this note I would greatly appreciate some clarification as to how the toolchains , located in the 'ncs/toolchains/ <hash_here> ' directory, are dependant on - or related to-  the current commit I am in on the main branch of the nrf repo. 

Dev setup:

OS: Linux Ubuntu 24.04.1

nrf9151DK HW v0.9.0

  • Hi,

    Yesterday the nrfcredstore cli command worked, but today I have git fetched and git pull origin main in the 'nrf' repo inside the ncs parent directory. I proceeded to run 'west update' as instructed online.

    Which instructions have you followed online?

    Does generate and provision certificates work?

    On this note I would greatly appreciate some clarification as to how the toolchains , located in the 'ncs/toolchains/ <hash_here> ' directory, are dependant on - or related to-  the current commit I am in on the main branch of the nrf repo.

    Can you elaborate on the dependency/relationship between current commit on the main branch of nrf repository and the toolchain? Is there anything specific in this potential dependency/relationship that you are interested in?

    Best regards,
    Dejan

  • This documentation online is what I referenced  https://docs.nordicsemi.com/bundle/ncs-3.0.1/page/nrf/installation/updating.html  Although I do not see why that is relevant. That being said I have noticed that when I run west update , it seems like the associated repos within the workspace (nrf , zephyr, mcuboot etc) , are all checked out automatically back to the version refered to in the workspace manifest. 

    This being said, I am still getting this issue with the nrfcredstore 'list' command, and I am not exactly sure how to resolve this moving forward. Since this post I have run 'west update' again and nothing has changed. 

    -- 

    Yes generate and provision certificates steps work - everything except the 'list' command appears fine. 

    --

    I also do not have any specific dependency that interests me. I am just looking for clarification on how to better understand what the nRF Connect SDK actually 'is', and what a workspace is, and the roles of each. This seems to be the 'sdk' repo, https://github.com/nrfconnect/sdk-nrf , but my 'workspace' appears differently and has both an nrf and nrfxlib directory. I am also only able to run west command while in the /ncs directory , even when I launch and am inside a toolchain shell....
     

    ~/ncs 
    ❯ ls -d */
    bootloader       downloads  nrf-802154  tmp         twister-out    v2.9.1
    build            modules    nrfxlib     toolchains  twister-out.1  zephyr
    dev_credentials  nrf        test        tools       twister-out.2  
    
    

    As well some clarification on what the toolchain 'shell' is doing , and the difference between the toolchains, and the SDK versions, would be greatly appreciated. 

    As a side note I have noticed that when I run the sdk-manager, it appears I do not any sdk installed... which makes no sense because I have been building and using my current SDK fine.

    /ncs$ nrfutil sdk-manager list
    No SDKs installed
    

  • Hi,

    dheadrick said:
    I have noticed that when I run the sdk-manager, it appears I do not any sdk installed... which makes no sense because I have been building and using my current SDK fine.

    Please find below links to some documentation resources that might be helpful in clarifying workspaces, nRF Connect SDK and Toolchain.
    workspaces, west workspace, how to create west workspace, workspace concepts
    nRF Connect SDK, setting up nRF Connect SDK, installing nRF Connect SDK, updating repositories and tools
    install nRF Connect SDK Toolchain, how to setup SDK and Toolchain

    dheadrick said:
    I have noticed that when I run the sdk-manager, it appears I do not any sdk installed... which makes no sense because I have been building and using my current SDK fine.

    Have you tried to install sdk-manager using command "nrfutil install sdk-manager" before trying to list installed SDKs?

    Best regards,
    Dejan

Related