Project

General

Profile

Bug #44502

mgr/dashboard: 'dashboard ac-user-create' is not idempotent

Added by Sage Weil 11 months ago. Updated 10 months ago.

Status:
Resolved
Priority:
Urgent
Category:
dashboard/configurations
Target version:
% Done:

0%

Source:
Tags:
Backport:
octopus
Regression:
No
Severity:
3 - minor
Reviewed:
Affected Versions:
ceph-qa-suite:
Pull request ID:
Crash signature:

Description

2020-03-07T15:12:41.196 INFO:teuthology.orchestra.run.smithi137.stderr:INFO:cephadm:Non-zero exit code 17 from /bin/podman run --rm --net=host -e CONTAINER_IMAGE=quay.io/ceph-ci/ceph:f7e57709a70012f57105c919d9d28c9c454d3ba5 -e NODE_NAME=smithi137 -v /var/log/ceph/dc231be0-6085-11ea-9a34-001a4aab830c:/var/log/ceph:z
 -v /tmp/ceph-tmpktpe2zce:/etc/ceph/ceph.client.admin.keyring:z -v /tmp/ceph-tmp6xjdjrab:/etc/ceph/ceph.conf:z --entrypoint /usr/bin/ceph quay.io/ceph-ci/ceph:f7e57709a70012f57105c919d9d28c9c454d3ba5 dashboard ac-user-create admin 3pjswr2wq1 administrator --force-password
2020-03-07T15:12:41.196 INFO:teuthology.orchestra.run.smithi137.stderr:INFO:cephadm:/usr/bin/ceph:stderr Error EEXIST: User 'admin' already exists
2020-03-07T15:12:41.202 INFO:teuthology.orchestra.run.smithi137.stderr:Traceback (most recent call last):
2020-03-07T15:12:41.202 INFO:teuthology.orchestra.run.smithi137.stderr:  File "/home/ubuntu/cephtest/cephadm", line 3700, in <module>
2020-03-07T15:12:41.202 INFO:teuthology.orchestra.run.smithi137.stderr:    r = args.func()
2020-03-07T15:12:41.202 INFO:teuthology.orchestra.run.smithi137.stderr:  File "/home/ubuntu/cephtest/cephadm", line 2072, in command_bootstrap
2020-03-07T15:12:41.202 INFO:teuthology.orchestra.run.smithi137.stderr:    '--force-password'])
2020-03-07T15:12:41.203 INFO:teuthology.orchestra.run.smithi137.stderr:  File "/home/ubuntu/cephtest/cephadm", line 1922, in cli
2020-03-07T15:12:41.203 INFO:teuthology.orchestra.run.smithi137.stderr:    ).run(timeout=timeout)
2020-03-07T15:12:41.203 INFO:teuthology.orchestra.run.smithi137.stderr:  File "/home/ubuntu/cephtest/cephadm", line 1679, in run
2020-03-07T15:12:41.203 INFO:teuthology.orchestra.run.smithi137.stderr:    self.run_cmd(), desc=self.entrypoint, timeout=timeout)
2020-03-07T15:12:41.203 INFO:teuthology.orchestra.run.smithi137.stderr:  File "/home/ubuntu/cephtest/cephadm", line 516, in call_throws
2020-03-07T15:12:41.203 INFO:teuthology.orchestra.run.smithi137.stderr:    raise RuntimeError('Failed command: %s' % ' '.join(command))
2020-03-07T15:12:41.203 INFO:teuthology.orchestra.run.smithi137.stderr:RuntimeError: Failed command: /bin/podman run --rm --net=host -e CONTAINER_IMAGE=quay.io/ceph-ci/ceph:f7e57709a70012f57105c919d9d28c9c454d3ba5 -e NODE_NAME=smithi137 -v /var/log/ceph/dc231be0-6085-11ea-9a34-001a4aab830c:/var/log/ceph:z -v /tmp/ceph-tmpktpe2zce:/etc/ceph/ceph.client.admin.keyring:z -v /tmp/ceph-tmp6xjdjrab:/etc/ceph/ceph.conf:z --entrypoint /usr/bin/ceph quay.io/ceph-ci/ceph:f7e57709a70012f57105c919d9d28c9c454d3ba5 dashboard ac-user-create admin 3pjswr2wq1 administrator --force-password

/a/sage-2020-03-07_14:00:00-rados-master-distro-basic-smithi/4834652

all of these CLI commands need to be idempotent, so that if the CLI experiences a connection interruption and resends the command to the mon/mgr it will still succeed.


Related issues

Related to mgr - Bug #44806: mgr/dashboard: check if all CLI commands are idempotent New
Copied to mgr - Backport #44796: octopus: mgr/dashboard: 'dashboard ac-user-create' is not idempotent Resolved

History

#1 Updated by Sage Weil 11 months ago

/a/sage-2020-03-10_00:56:37-rados:thrash-old-clients-wip-sage-testing-2020-03-09-1832-distro-basic-smithi/4842895
/a/sage-2020-03-10_00:56:37-rados:thrash-old-clients-wip-sage-testing-2020-03-09-1832-distro-basic-smithi/4842904

#2 Updated by Tiago Melo 11 months ago

For example the rbd just returns a message without the Error

╰─# bin/ceph osd pool create rbd 8                                               
*** DEVELOPER MODE: setting PATH, PYTHONPATH and LD_LIBRARY_PATH ***
2020-03-10T09:47:04.703+0000 7fc008a9d700 -1 WARNING: all dangerous and experimental features are enabled.
2020-03-10T09:47:04.731+0000 7fc008a9d700 -1 WARNING: all dangerous and experimental features are enabled.
pool 'rbd' already exists
╭─root@ceph-1 /ceph/build ‹wip-update-npm› 
╰─# ceph dashboard ac-user-create admin 3pjswr2wq1 administrator --force-password
*** DEVELOPER MODE: setting PATH, PYTHONPATH and LD_LIBRARY_PATH ***
2020-03-10T09:47:08.542+0000 7f6b830d3700 -1 WARNING: all dangerous and experimental features are enabled.
2020-03-10T09:47:08.574+0000 7f6b830d3700 -1 WARNING: all dangerous and experimental features are enabled.
Error EEXIST: User 'admin' already exists

#3 Updated by Volker Theile 11 months ago

IMO such a command should never be idempotent.

╭─root@ceph-octopus-docker / 
╰─# getent passwd | grep sshd
sshd:x:480:480:SSH daemon:/var/lib/sshd:/bin/false
╭─root@ceph-octopus-docker / 
╰─# useradd sshd
useradd: user 'sshd' already exists
╭─root@ceph-octopus-docker / 
╰─# echo $?                                                                                                                                          9 ↵
9

#4 Updated by Neha Ojha 10 months ago

  • Category set to dashboard/configurations

#5 Updated by Lenz Grimmer 10 months ago

  • Assignee set to Tatjana Dehler

We concluded to not return with a non-zero exit code, but print a clear error message.

#6 Updated by Tatjana Dehler 10 months ago

  • Status changed from New to In Progress
  • Pull request ID set to 34247

#7 Updated by Tatjana Dehler 10 months ago

  • Subject changed from 'dashboard ac-user-create' is not idempotent to mgr/dashboard: 'dashboard ac-user-create' is not idempotent

#8 Updated by Sage Weil 10 months ago

  • Status changed from In Progress to Pending Backport
  • Backport set to octopus

#9 Updated by Konstantin Shalygin 10 months ago

  • Copied to Backport #44796: octopus: mgr/dashboard: 'dashboard ac-user-create' is not idempotent added

#10 Updated by Tatjana Dehler 10 months ago

  • Related to Bug #44806: mgr/dashboard: check if all CLI commands are idempotent added

#11 Updated by Lenz Grimmer 10 months ago

  • Target version set to v16.0.0

#12 Updated by Nathan Cutler 10 months ago

  • Status changed from Pending Backport to Resolved

While running with --resolve-parent, the script "backport-create-issue" noticed that all backports of this issue are in status "Resolved" or "Rejected".

Also available in: Atom PDF