You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Throws this error and the key will not be removed:
TASK [try to remove ssh key] *************************************************************************************************************************
An exception occurred during task execution. To see the full traceback, use -vvv. The error was: urllib.error.HTTPError: HTTP Error 400: Bad Request
fatal: [localhost]: FAILED! => changed=false
module_stderr: |-
Traceback (most recent call last):
File "<stdin>", line 107, in <module>
File "<stdin>", line 99, in _ansiballz_main
File "<stdin>", line 47, in invoke_module
File "<frozen runpy>", line 226, in run_module
File "<frozen runpy>", line 98, in _run_module_code
File "<frozen runpy>", line 88, in _run_code
File "/tmp/ansible_adhawkins.borgbase.borgbase_ssh_payload_41mupboi/ansible_adhawkins.borgbase.borgbase_ssh_payload.zip/ansible_collections/adhawkins/borgbase/plugins/modules/borgbase_ssh.py", line 299, in <module>
File "/tmp/ansible_adhawkins.borgbase.borgbase_ssh_payload_41mupboi/ansible_adhawkins.borgbase.borgbase_ssh_payload.zip/ansible_collections/adhawkins/borgbase/plugins/modules/borgbase_ssh.py", line 295, in main
File "/tmp/ansible_adhawkins.borgbase.borgbase_ssh_payload_41mupboi/ansible_adhawkins.borgbase.borgbase_ssh_payload.zip/ansible_collections/adhawkins/borgbase/plugins/modules/borgbase_ssh.py", line 256, in runModule
File "/tmp/ansible_adhawkins.borgbase.borgbase_ssh_payload_41mupboi/ansible_adhawkins.borgbase.borgbase_ssh_payload.zip/ansible_collections/adhawkins/borgbase/plugins/modules/borgbase_ssh.py", line 158, in deleteKey
File "/tmp/ansible_adhawkins.borgbase.borgbase_ssh_payload_41mupboi/ansible_adhawkins.borgbase.borgbase_ssh_payload.zip/ansible_collections/adhawkins/borgbase/plugins/module_utils/borgbase_client.py", line 162, in execute
File "/tmp/ansible_adhawkins.borgbase.borgbase_ssh_payload_41mupboi/ansible_adhawkins.borgbase.borgbase_ssh_payload.zip/ansible_collections/adhawkins/borgbase/plugins/module_utils/borgbase_client.py", line 176, in _send
File "/tmp/ansible_adhawkins.borgbase.borgbase_ssh_payload_41mupboi/ansible_adhawkins.borgbase.borgbase_ssh_payload.zip/ansible/module_utils/urls.py", line 1561, in open
File "/usr/lib/python3.11/urllib/request.py", line 216, in urlopen
return opener.open(url, data, timeout)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3.11/urllib/request.py", line 525, in open
response = meth(req, response)
^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3.11/urllib/request.py", line 634, in http_response
response = self.parent.error(
^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3.11/urllib/request.py", line 563, in error
return self._call_chain(*args)
^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3.11/urllib/request.py", line 496, in _call_chain
result = func(*args)
^^^^^^^^^^^
File "/usr/lib/python3.11/urllib/request.py", line 643, in http_error_default
raise HTTPError(req.full_url, code, msg, hdrs, fp)
urllib.error.HTTPError: HTTP Error 400: Bad Request
module_stdout: ''
msg: |-
MODULE FAILURE
See stdout/stderr for the exact error
rc: 1
However, the BorgBase API explorer describes the parameter type as string:
Mutation sshDelete
Type SSHDelete
Arguments
id: String!
I tried to change the type to String, there is also instance of calling the deleteKey that by default turns the parameter to int around line 256 in borgbase/plugins/modules/borgbase_ssh.py: deleteResult = deleteKey(int(foundKey['id']), apiKey=module.params['apikey'])
After removing the integer conversion, it seems to work; deleteResult = deleteKey(foundKey['id'], apiKey=module.params['apikey'])
Deleting an SSH key seems to always fail with HTTP error 400. Even when the key is not used by any repo.
Example:
Throws this error and the key will not be removed:
It works fine when using GraphQL directly:
returns:
Find the key again:
returns:
And then:
returns:
The text was updated successfully, but these errors were encountered: