Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ndn-hydra fails to start if ~/.ndn directory is deleted #22

Open
yoursunny opened this issue Jul 15, 2021 · 5 comments
Open

ndn-hydra fails to start if ~/.ndn directory is deleted #22

yoursunny opened this issue Jul 15, 2021 · 5 comments

Comments

@yoursunny
Copy link

Environment

  • Linux kernel 5.4.0
  • Docker python:3.9 image
  • NFD 0.7.1-30-ga103334b, Unix socket mounted into the container at /run/nfd.sock
  • NFD uses multicast strategy for all prefixes
  • ndn-hydra 0.2.1 installed via pip
  • applied workaround for NameError: name 'rgs' is not defined #21:
    sed -i 's/\brgs\b/args/' /usr/local/lib/python3.9/site-packages/ndn_hydra/repo/main/main.py

Steps to reproduce

root@4c4540439250:/# rm -rf ~/.ndn
root@4c4540439250:/# ndn-hydra-repo -rp /hydra -n $(hostname -s) -s $RANDOM
Exception in thread Thread-1:
Traceback (most recent call last):
  File "/usr/local/lib/python3.9/threading.py", line 973, in _bootstrap_inner
    self.run()
  File "/usr/local/lib/python3.9/site-packages/ndn_hydra/repo/main/main.py", line 117, in run
    app = NDNApp()
  File "/usr/local/lib/python3.9/site-packages/ndn/app.py", line 63, in __init__
    self.keychain = default_keychain(config['pib'], config['tpm'])
  File "/usr/local/lib/python3.9/site-packages/ndn/client_conf.py", line 101, in default_keychain
    pib = KeychainSqlite3(os.path.join(pib_loc, 'pib.db'), tpm)
  File "/usr/local/lib/python3.9/site-packages/ndn/security/keychain/keychain_sqlite3.py", line 277, in __init__
    cursor = self.conn.execute('SELECT tpm_locator FROM tpmInfo')
sqlite3.OperationalError: no such table: tpmInfo

It's same error as #14, which is not resolved.

@yoursunny
Copy link
Author

This issue persists in ndn-hydra 0.2.2.

@yoursunny
Copy link
Author

I see the following in documentation:

A NDN Hydra node will require a identity (along with a key) that is the same as the node_name. For now however, the default localhost/default key that NFD produces automatically is required in order to have a successful run. Deleting ~/.ndn or the default keys will result in the inability to run a hydra node.

It's still misleading:

  • If NFD was installed via systemd or in a Docker container, its keychain is in a different location, and it would not "produce automatically" a key in ~/.ndn.
  • If YaNFD or some other forwarder is used, it would not have the keychain either.

Thus, ndn-hydra guide should explicitly specify what keys should be created, instead of relying on some other program might "produce automatically" a key.

@aelhadee
Copy link

aelhadee commented Mar 2, 2022

What is the resolution for this issue? Is it a cause for this issue as well?

ndn-hydra/venv/lib/python3.8/site-packages/ndn/security/keychain/keychain_sqlite3.py", line 502, in default_identity
    raise KeyError('No default identity')
KeyError: 'No default identity'

Thank you

@justincpresley
Copy link
Owner

justincpresley commented Mar 2, 2022

Yes, you can resolve this issue by creating a certificate with an identity. Use ndnsec key-gen followed by a NAME.

@susmit85
Copy link
Contributor

Justin, was there any resolution to this? We are still seeing this problem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants