Skip to content

Add new entry for API keypair (instead of update)#224

Draft
sureshanaparti wants to merge 1 commit into
masterfrom
api-keypair-fix
Draft

Add new entry for API keypair (instead of update)#224
sureshanaparti wants to merge 1 commit into
masterfrom
api-keypair-fix

Conversation

@sureshanaparti

Copy link
Copy Markdown
Member

Add new entry for API keypair (instead of update). There is no record to update.

@vishesh92 vishesh92 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

clgtm. didn't test.

@sureshanaparti sureshanaparti marked this pull request as draft May 28, 2026 05:33
@weizhouapache

Copy link
Copy Markdown
Member

@sureshanaparti
is it ready for review ?

cmk sync is failing with 4.23 env now

@weizhouapache

Copy link
Copy Markdown
Member

@sureshanaparti

tested http://sl-jenkins-master.sofia.shapeblue.com:8080/job/Reference_Trillian/12000/consoleFull

09:45:30 TASK [cloudstack-manager : add admin keys for cloudmonkey] *********************
09:45:30 task path: /var/lib/jenkins/workspace/Reference_Trillian/Ansible/roles/cloudstack-manager/tasks/preconfig_globalsettings.yml:97
09:45:30 skipping: [ref-trl-12000-k-Mu24-wei-zhou-mgmt1] => {"changed": false, "skip_reason": "Conditional result was False", "skipped": true}
09:45:30 
09:45:30 TASK [cloudstack-manager : add admin keys for cloudmonkey in api_keypair table] ***
09:45:30 task path: /var/lib/jenkins/workspace/Reference_Trillian/Ansible/roles/cloudstack-manager/tasks/preconfig_globalsettings.yml:101
09:45:31 ok: [ref-trl-12000-k-Mu24-wei-zhou-mgmt1] => {"ansible_facts": {"reponse": "Attempted"}, "changed": false}

nothing changed ...

there is only 1 record in api_keypair

mysql> select * from api_keypair;
+----+--------------------------------------+------+-----------+------------+---------+------------+----------+-------------+----------------------------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------+---------------------+---------+
| id | uuid                                 | name | domain_id | account_id | user_id | start_date | end_date | description | api_key                                                                                | secret_key                                                                                                                                               | created             | removed |
+----+--------------------------------------+------+-----------+------------+---------+------------+----------+-------------+----------------------------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------+---------------------+---------+
|  1 | 768d6d31-f145-4347-b381-e31f9c221b0f | 3    |         1 |          3 |       3 | NULL       | NULL     |             | EuCiFMMetOgXB32qmpJ84lVviYudqqdFRDH97y6fw5Dl51t5ILxwKXX9key-UJMRkmGELuiKl7SITsmp8IioBA | Jv5s8A1r/maeUUlaVxFtGD+z5MMdCEgND1k3ngv6QFPFmVmbD4qwcHNK7psnW4Clo037sS4CxWa83IOPWE4vSMkrQMbjcr1t5wQIalcABQV4w1odo24xseybZuN6UYKbVAiO9BapKW3FTLKZNrD3qdzx | 2026-06-23 07:44:26 | NULL    |
+----+--------------------------------------+------+-----------+------------+---------+------------+----------+-------------+----------------------------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------+---------------------+---------+
1 row in set (0.00 sec)

cmk sync does not work

root@ref-trl-12000-k-Mu24-wei-zhou-mgmt1:~# cmk sync
Loaded in-built API cache. Failed to read API cache, please run 'sync'.
🙈 Error: (HTTP 530, error code 9999) Cannot invoke "org.apache.cloudstack.acl.apikeypair.ApiKeyPair.getAccountId()" because "apiKeyPair" is null
root@ref-trl-12000-k-Mu24-wei-zhou-mgmt1:~# 

@weizhouapache

Copy link
Copy Markdown
Member

manual sql execution works

mysql> INSERT INTO `cloud`.`api_keypair` (uuid, name, domain_id, account_id, user_id, api_key, secret_key, created) SELECT UUID(), 'admin-api-key', acc.domain_id, acc.id, usr.id, 'LIN6rqXuaJwMPfGYFh13qDwYz5VNNz1J2J6qIOWcd3oLQOq0WtD4CwRundBL6rzXToa3lQOC_vKjI3nkHtiD8Q', 'ngaGb94iv6PxNQRmZxQL1es9oNTLMGYt0nbIQPBPZd/hmR4NGCZmt/UlwcxkDNH52c7hNqT2k4jZoah59sys4PvHQdEqybYuxiNU9qyZn6uv+ZgMl3RZW97r126umNglBZu8kVBpic6Z9SGpFJGyUtav', NOW() FROM `cloud`.`user` usr JOIN `cloud`.`account` acc ON usr.account_id = acc.id WHERE usr.id = 2;
Query OK, 1 row affected (0.00 sec)
Records: 1  Duplicates: 0  Warnings: 0

strange

@weizhouapache weizhouapache self-requested a review June 23, 2026 09:26
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

Successfully merging this pull request may close these issues.

3 participants