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,

    You're right about the version and I think we don't need to check it further.
    I was just looking at your screenshot  and I think mosh:~$ prompt means you have Modem Shell flashed, and MoSh prints everything through a 1024 byte buffer (CONFIG_MOSH_PRINT_BUFFER_SIZE). That's the red "Cutting too long string" message. Your credential list is around 1100 bytes, so the tail gets cut. I think that's an issue, and it's why it worked before the AWS certs and still works per-tag.

    Can you try rebuilding with increasing this config to 4096 in your prj.conf.

  • Hi Syed,

    Thank you. This doesn't address the bug that is the "nrfcredstore".  

    I'm running the AWS IOT sample targeted for nrf9151dk, and invoking nrfcredstore from a "nRF Connect" session from within nRF Connect SDK for VS Code.

    So, we still need to address the nrfcredstore bug that is in the current NCS 3.4.x. 

    Separately, I re-built the "Modem Shell" and increased CONFIG_MOSH_PRINT_BUFFER_SIZE as per your suggestion. This does now correctly display the credentials. Thank you.



    Could you please investigate further the "nrfcredstore" bug? It is in the current NCS 3.4.x.

    Also, previously you suggested to update nrfcredstore via  "pip show nrfcredstore" to determine the version, How do I start a Python virtual environment session for NCS and execute the command above?

    Kind Regards,
    Ravi

Reply
  • Hi Syed,

    Thank you. This doesn't address the bug that is the "nrfcredstore".  

    I'm running the AWS IOT sample targeted for nrf9151dk, and invoking nrfcredstore from a "nRF Connect" session from within nRF Connect SDK for VS Code.

    So, we still need to address the nrfcredstore bug that is in the current NCS 3.4.x. 

    Separately, I re-built the "Modem Shell" and increased CONFIG_MOSH_PRINT_BUFFER_SIZE as per your suggestion. This does now correctly display the credentials. Thank you.



    Could you please investigate further the "nrfcredstore" bug? It is in the current NCS 3.4.x.

    Also, previously you suggested to update nrfcredstore via  "pip show nrfcredstore" to determine the version, How do I start a Python virtual environment session for NCS and execute the command above?

    Kind Regards,
    Ravi

Children
No Data
Related