POST Create Machine fail because sideEffects with Git Commit #471

Closed
opened 2023-11-05 11:50:26 +00:00 by hsjobeki · 7 comments
Owner

Creating a commit is an advanced feature. We didn't fully discuss yet.

It fails with my git config because i have setup signed commits with gpg.

Somehow it cannot find my gpg public key.

I'd disable / removing advanced git hijacking features until we specify them properly.

I would even put that behind a seperate endpoint but thats a future feature. Right now i cannot create machines anymore, unless i remove the commit feature manually or modify my git config.

{
    "detail": [
        {
            "loc": [],
            "msg": "\ncommand: nix --extra-experimental-features 'nix-command flakes' shell --inputs-from /nix/store/56vzz2dl7951svp649qmi4b9s6k8dlnk-nixpkgs 'nixpkgs#git' -c git commit -m 'Added machine aliquaNostrud' /home/johannes/.local/state/clan/flake/example_clan/machines/aliquaNostrud\nworking directory: /home/johannes/.local/state/clan/flake/example_clan/machines/aliquaNostrud\nexit code: 128\nstderr:\nerror: gpg failed to sign the data:\ngpg: skipped \"clan-tool <clan@example.com>\": No secret key\n[GNUPG:] INV_SGNR 9 clan-tool <clan@example.com>\n[GNUPG:] FAILURE sign 17\ngpg: signing failed: No secret key\n\nfatal: failed to write commit object\n\nstdout:\n\n"
        }
    ]
}
Creating a commit is an advanced feature. We didn't fully discuss yet. It fails with my git config because i have setup signed commits with gpg. Somehow it cannot find my gpg public key. I'd disable / removing advanced git hijacking features until we specify them properly. I would even put that behind a seperate endpoint but thats a future feature. Right now i cannot create machines anymore, unless i remove the commit feature manually or modify my git config. ``` { "detail": [ { "loc": [], "msg": "\ncommand: nix --extra-experimental-features 'nix-command flakes' shell --inputs-from /nix/store/56vzz2dl7951svp649qmi4b9s6k8dlnk-nixpkgs 'nixpkgs#git' -c git commit -m 'Added machine aliquaNostrud' /home/johannes/.local/state/clan/flake/example_clan/machines/aliquaNostrud\nworking directory: /home/johannes/.local/state/clan/flake/example_clan/machines/aliquaNostrud\nexit code: 128\nstderr:\nerror: gpg failed to sign the data:\ngpg: skipped \"clan-tool <clan@example.com>\": No secret key\n[GNUPG:] INV_SGNR 9 clan-tool <clan@example.com>\n[GNUPG:] FAILURE sign 17\ngpg: signing failed: No secret key\n\nfatal: failed to write commit object\n\nstdout:\n\n" } ] } ```
Mic92 was assigned by hsjobeki 2023-11-05 11:50:26 +00:00
Qubasa was assigned by hsjobeki 2023-11-05 11:50:26 +00:00
Author
Owner

@DavHau same applies for PUT /api/{flake}/machines/{name}/config
I cannot change the config of a machine, due to the above reported error

@DavHau same applies for PUT /api/{flake}/machines/{name}/config I cannot change the config of a machine, due to the above reported error
DavHau was assigned by hsjobeki 2023-11-05 12:38:09 +00:00
Owner

I think the problem arises from having signed commits enabled, which then fails because it doesn't find the signature keys anymore. It would be good to reproduce the issue, but the simples way would be first to disable commits.

I think the problem arises from having signed commits enabled, which then fails because it doesn't find the signature keys anymore. It would be good to reproduce the issue, but the simples way would be first to disable commits.
Owner

We at least have to git add changes to the repo, otherwise newly created machines wouldn't appear in the flake outputs and therefore lead to crashes as well.

We at least have to `git add` changes to the repo, otherwise newly created machines wouldn't appear in the flake outputs and therefore lead to crashes as well.
Author
Owner

I'm in favor of disabling commits. We now also have git commits in the devShell, which fails as well.
This bug means, i have to disable signed commits to keep working on the project, which is absurd.

I'm in favor of disabling commits. We now also have git commits in the devShell, which fails as well. This bug means, i have to disable signed commits to keep working on the project, which is absurd.
Owner

We are basically building a CRUD app ontop of nix and json files. Using git gives us the power to work transactional.
We are not using that yet, but might so later.

If we just disable git for now and ignore it might make it harder to add it later.

Somehow it cannot find my gpg public key.

Maybe you can find out why and fix it?

We are basically building a CRUD app ontop of nix and json files. Using git gives us the power to work transactional. We are not using that yet, but might so later. If we just disable git for now and ignore it might make it harder to add it later. > Somehow it cannot find my gpg public key. Maybe you can find out why and fix it?
Owner

@hsjobeki Can this be closed?

@hsjobeki Can this be closed?
Owner

Api was dropped.

Api was dropped.
Mic92 closed this issue 2024-01-02 14:54:42 +00:00
Sign in to join this conversation.
No Milestone
No project
4 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#471
No description provided.