nrfcredstore - Failed to list credentials

Environment: nRF Connect SDK v3.4.0 on macOS Golden Gate 27.0 and Sequoia 15.8

Device: nRF9151-DK

Problem occurred during build and testing of AWS connectivity to AWS IoT Core using the sample AWS IOT (/opt/nordic/ncs/v3.4.0/nrf/samples/net/aws_iot).

I was able to successfully setup & configure AWS IoT Core and build the aws_iot sample. This runs successfully and I'm able to successfully subscribe & publish between AWS IoT Shadow Service and the nRF9151-DK.

However, nrfcredstore fails to list credentials, with the following error.

nebula@nebula nrf9151dk_ns % nrfcredstore /dev/tty.usbmodem0010512176251 list             
Traceback (most recent call last):
  File "/opt/nordic/ncs/toolchains/ccc010f809/bin/nrfcredstore", line 6, in <module>
    sys.exit(run())
             ^^^^^
  File "/opt/nordic/ncs/toolchains/ccc010f809/lib/python3.12/site-packages/nrfcredstore/cli.py", line 171, in run
    main(args, CredStore(cred_if))
  File "/opt/nordic/ncs/toolchains/ccc010f809/lib/python3.12/site-packages/nrfcredstore/cli.py", line 146, in main
    exec_cmd(args, credstore)
  File "/opt/nordic/ncs/toolchains/ccc010f809/lib/python3.12/site-packages/nrfcredstore/cli.py", line 95, in exec_cmd
    creds = credstore.list(args.tag, ct)
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/nordic/ncs/toolchains/ccc010f809/lib/python3.12/site-packages/nrfcredstore/credstore.py", line 63, in list
    raise RuntimeError("Failed to list credentials")
RuntimeError: Failed to list credentials


Prior to adding the AWS certificates & client key, nrfcredstore was successfully able to list the credentials.

I'm able to successfully list credentials using the "--tag" option in the nrfcredstore command. So, the credentials are correctly stored. 

I've also verified that all the other certificates & keys are stored correctly.

For example,

nebula@nebula nrf9151dk_ns % nrfcredstore /dev/tty.usbmodem0010512176251 list --tag 4294967292

Secure tag   Key type           SHA                                                             
4294967292   NORDIC_PUB_KEY     672E2F05962B4EFBFA8801255D87E0E0418F2DDF4DDAEFC59E9B4162F512CB63

In addition, if the credentials are listed using the AT%CMNG=1, only some of the credentials get displayed properly, the rest get truncated.


This appears to be bug in nrfcredstore. Please review. Thank you.

KInd Regards

Parents
  • Hi,

    Thanks for reaching out.

    Actually there was a similar bug reported before and it got fixed in nrfcredstore v2.0.5. You may check which version is bundled with your NCS (pip show nrfcredstore inside the toolchain env). If it's older than v2.0.5, please try updating it.

    Secondly when running AT%CMNG=1 without specifying a tag, the modem lists all credentials at once. But there are buffer limits that cause truncation so I would recommend querying with a specific tag which should keep the response short enough to fit within allocated response buffers.

    Best Regards,
    Syed Maysum

  • Hi Syed,

    I'm using the latest nrfcredstore that comes with nRF Connect SDK v3.4.0.

    On macOS, for NCS 3.4.0, nrfcredstore is "/opt/nordic/ncs/toolchains/ccc010f809/bin"  and is part of the Python 3.12 of NCS 3.4.0.

    I'm not able to run "pip show nrfcredstore" to determine the version, as command doesn't work from within a "nRF Connect" terminal session. How does one start a virtual environment session for NCS?

    As I'm using a pretty recent version of NCS, I think the bug still exists. Please investigate further. Thank you.


    Kind Regards,
    Ravi

Reply
  • Hi Syed,

    I'm using the latest nrfcredstore that comes with nRF Connect SDK v3.4.0.

    On macOS, for NCS 3.4.0, nrfcredstore is "/opt/nordic/ncs/toolchains/ccc010f809/bin"  and is part of the Python 3.12 of NCS 3.4.0.

    I'm not able to run "pip show nrfcredstore" to determine the version, as command doesn't work from within a "nRF Connect" terminal session. How does one start a virtual environment session for NCS?

    As I'm using a pretty recent version of NCS, I think the bug still exists. Please investigate further. Thank you.


    Kind Regards,
    Ravi

Children
No Data
Related