Error: Your sops key is not yet added to the repository #1073

Open
opened 2024-04-02 06:25:29 +00:00 by DavHau · 0 comments
Owner

I get this error after importing some clanModules and trying to run a VM. This doesn't seem to make a whole lot of sense. As a user I don't know what sops is and I should not need to care.

The strange thing about it is that clan secrets key show executed on that flake displays a key:

clan --flake /tmp/clana secrets key show
age1...

original error log:

Exception in thread Thread-1 (start_vm_from_prompt):
Traceback (most recent call last):
  File "/nix/store/7wz6hm9i8wljz0hgwz1wqmn2zlbgavrq-python3-3.11.8/lib/python3.11/threading.py", line 1045, in _bootstrap_inner
    self.run()
  File "/nix/store/7wz6hm9i8wljz0hgwz1wqmn2zlbgavrq-python3-3.11.8/lib/python3.11/threading.py", line 982, in run
    self._target(*self._args, **self._kwargs)
  File "/home/grmpf/synced/projects/clan/clan-core/pkgs/clan-cli/clan_cli/clana/__init__.py", line 140, in start_vm_from_prompt
    run_command(
  File "/home/grmpf/synced/projects/clan/clan-core/pkgs/clan-cli/clan_cli/vms/run.py", line 202, in run_command
    run_vm(vm, nix_options=option)
  File "/home/grmpf/synced/projects/clan/clan-core/pkgs/clan-cli/clan_cli/vms/run.py", line 130, in run_vm
    nixos_config = build_vm(machine, cachedir, nix_options)
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/grmpf/synced/projects/clan/clan-core/pkgs/clan-cli/clan_cli/vms/run.py", line 44, in build_vm
    secrets_dir = get_secrets(machine, tmpdir)
                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/grmpf/synced/projects/clan/clan-core/pkgs/clan-cli/clan_cli/vms/run.py", line 71, in get_secrets
    secret_facts_store = secret_facts_module.SecretStore(machine=machine)
                         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/grmpf/synced/projects/clan/clan-core/pkgs/clan-cli/clan_cli/facts/secret_modules/sops.py", line 25, in __init__
    encrypt_secret(
  File "/home/grmpf/synced/projects/clan/clan-core/pkgs/clan-cli/clan_cli/secrets/secrets.py", line 83, in encrypt_secret
    key = ensure_sops_key(flake_dir)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/grmpf/synced/projects/clan/clan-core/pkgs/clan-cli/clan_cli/secrets/sops.py", line 103, in ensure_sops_key
    return ensure_user_or_machine(flake_dir, get_public_key(path.read_text()))
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/grmpf/synced/projects/clan/clan-core/pkgs/clan-cli/clan_cli/secrets/sops.py", line 84, in ensure_user_or_machine
    raise ClanError(
clan_cli.errors.ClanError: Your sops key is not yet added to the repository. Please add it with 'clan secrets users add youruser age1vphy2sr6uw4ptsua3gh9khrm2cqyt65t46tusmt44z98qa7q6ymq6prrdl' (replace youruser with your user name)
I get this error after importing some clanModules and trying to run a VM. This doesn't seem to make a whole lot of sense. As a user I don't know what sops is and I should not need to care. The strange thing about it is that `clan secrets key show` executed on that flake displays a key: ``` clan --flake /tmp/clana secrets key show age1... ``` original error log: ``` Exception in thread Thread-1 (start_vm_from_prompt): Traceback (most recent call last): File "/nix/store/7wz6hm9i8wljz0hgwz1wqmn2zlbgavrq-python3-3.11.8/lib/python3.11/threading.py", line 1045, in _bootstrap_inner self.run() File "/nix/store/7wz6hm9i8wljz0hgwz1wqmn2zlbgavrq-python3-3.11.8/lib/python3.11/threading.py", line 982, in run self._target(*self._args, **self._kwargs) File "/home/grmpf/synced/projects/clan/clan-core/pkgs/clan-cli/clan_cli/clana/__init__.py", line 140, in start_vm_from_prompt run_command( File "/home/grmpf/synced/projects/clan/clan-core/pkgs/clan-cli/clan_cli/vms/run.py", line 202, in run_command run_vm(vm, nix_options=option) File "/home/grmpf/synced/projects/clan/clan-core/pkgs/clan-cli/clan_cli/vms/run.py", line 130, in run_vm nixos_config = build_vm(machine, cachedir, nix_options) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/grmpf/synced/projects/clan/clan-core/pkgs/clan-cli/clan_cli/vms/run.py", line 44, in build_vm secrets_dir = get_secrets(machine, tmpdir) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/grmpf/synced/projects/clan/clan-core/pkgs/clan-cli/clan_cli/vms/run.py", line 71, in get_secrets secret_facts_store = secret_facts_module.SecretStore(machine=machine) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/grmpf/synced/projects/clan/clan-core/pkgs/clan-cli/clan_cli/facts/secret_modules/sops.py", line 25, in __init__ encrypt_secret( File "/home/grmpf/synced/projects/clan/clan-core/pkgs/clan-cli/clan_cli/secrets/secrets.py", line 83, in encrypt_secret key = ensure_sops_key(flake_dir) ^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/grmpf/synced/projects/clan/clan-core/pkgs/clan-cli/clan_cli/secrets/sops.py", line 103, in ensure_sops_key return ensure_user_or_machine(flake_dir, get_public_key(path.read_text())) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/grmpf/synced/projects/clan/clan-core/pkgs/clan-cli/clan_cli/secrets/sops.py", line 84, in ensure_user_or_machine raise ClanError( clan_cli.errors.ClanError: Your sops key is not yet added to the repository. Please add it with 'clan secrets users add youruser age1vphy2sr6uw4ptsua3gh9khrm2cqyt65t46tusmt44z98qa7q6ymq6prrdl' (replace youruser with your user name) ```
DavHau self-assigned this 2024-04-02 06:25:29 +00:00
lassulus was assigned by DavHau 2024-04-02 06:25:29 +00:00
Mic92 was assigned by DavHau 2024-04-02 06:25:29 +00:00
kenji added the
cli
documentation
secrets
labels 2024-04-12 09:02:05 +00:00
kenji added the
bootstrapping
label 2024-04-12 09:53:56 +00:00
Sign in to join this conversation.
No Milestone
No project
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: clan/clan-core#1073
No description provided.