Open semik opened 9 months ago
I see there is unhandled return codes from the ssh, for example, when the keytool
is not found, the code is 127
(command not found). This should be considered as bug and fixed:
When the codes are properly handled, you should not be able to create the Location, because you should get an error response.
I was testing the same as you have described, however, I am not able to see duplicated commands, this is my log:
Feb 2 08:33:21 lab testssh: executing scp -t -- /tmp/LUlzPRHnIbw=
Feb 2 08:33:21 lab testssh: executing keytool -importcert -keystore /home/testssh/test.p12 -storetype PKCS12 -storepass 00000000 -alias czertainly -file /tmp/LUlzPRHnIbw= -trustcacerts -noprompt
Feb 2 08:33:22 lab testssh: executing keytool -list -rfc -keystore /home/testssh/test.p12 -storetype PKCS12 -storepass 00000000 -alias czertainly
Feb 2 08:33:22 lab testssh: executing rm /tmp/LUlzPRHnIbw=
I was trying to run command from CZERTAINLY front end and also directly through the Keystore Entity Provider interface, in both cases, I do not see duplicated commands. Looking into the code, I do not see reason for duplicated commands.
@semik what version of Keystore Entity Provider you are using? I was testing with the deployment using Helm chart version 2.10.0.
I'm sorry, I can't reproduce that double execution again. It took some more experiments until I learned how to record commands in first place. So maybe something was running twice? After target system reboot commands are lodged only once.
@semik what version of Keystore Entity Provider you are using? I was testing with the deployment using Helm chart version 2.10.0.
I'm running stable 2.10.0:
Image: docker.io/3keycompany/czertainly-keystore-entity-provider:1.4.1
Image ID: docker.io/3keycompany/czertainly-keystore-entity-provider@sha256:9d8bc2d76bbb4d448eacdc1c720fd8d1d21cd5fb719414493f4f5628b6d6f503
Describe the bug
When trying to access pkcs12 keystore on a Linux server which missing
keytool
command CZERTAINLY doesn't report problem correctly.In case I want just to synchronize keystore (ie. read it into CZERTAINLY) it doesn't report anything. I would expect info that there was problem to read key store.
In case I want to push some certificate into keystore it reports:
Failed to push Certificate (400): Failed to push Certificate 1c525054-6f0e-4752-a304-35aeaa06c0bd to Location test-p12. Reason: {"message":""}
I expect to get info that there is some problem likebash: keytool: command not found
.I'm testing on version 2.10.0.
To Reproduce Steps to reproduce the behavior:
Expected behavior I expect to receive some helpful error.
Additional context There is no useful error message inside
keystore-entity-provider
POD:Calling remote commands is not correctly handling errors. Here is transcription of executed commands:
Note that:
keytool
commands even after the first one is failing (keytool
cmd is not present on target server`), this means that it doesn't handle errors correctly.To record commands what are being executed place:
test
is username of used user, executed commands are logged into/var/log/user.log
file on default Debian Bookworm system.