Re: ceph rgw zone create fails EINVAL

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



I think this is at least partially a code bug in the rgw module. Where it's
actually failing in the traceback is generating the return message for the
user at the end, because it assumes `created_zones` will always be a list
of strings and that seems to not be the case in any error scenario. That
caused that error to be the one printed instead of the actual underlying
failure. From what I can see looking at the code, 1 of 3 error conditions
happened. 1) It may have actually failed parsing the spec. You may be able
to test this by using `orch apply` instead with the --dry-run flag so it
doesn't actually make daemons but should still have to parse the spec. 2)
If either the inbuf (-i <filepath>) or zone_name and realm_token aren't
provided it errors out. That one shouldn't be the case since you used -i in
your command. 3) It actually failed creating the zone. Unfortunately, there
seems to be a whole bunch of reasons it could fail doing so, as it does
much more than just creating the zone. From what I can see, this can fail
if there is no realm token provided, there is no zone provided, the zone
already exists, the token contains no endpoint, secreate, access key or
realm name, it fails to pull the realm (radosgw-admin realm pull --url
<realm_token enpoint> --access-key <access key> --secret <realm token
secret>), it fail to find the master zonegroup (using a `radosgw-admin
zonegroup get...` command with the realm from the spec passed in), it fails
actually creating the zone (using a `radosgw-admin zone create` command
with the --master, --access-key, --secret and --endpoints params all filled
in), or it fails updating the period after creating the zone. I wish I knew
this module a bit better so I could provide something more useful than a
massive list of potential failure causes, but unfortunately I do not. I am
at least going to create a patch to fix the error handling issue here
though.

On Wed, Jun 19, 2024 at 2:16 PM Matthew Vernon <mvernon@xxxxxxxxxxxxx>
wrote:

> Hi,
>
> I'm running cephadm/reef 18.2.2. I'm trying to set up multisite.
>
> I created realm/zonegroup/master zone OK (I think!), edited the
> zonegroup json to include hostnames. I have this spec file for the
> secondary zone:
>
> rgw_zone: codfw
> rgw_realm_token: "SECRET"
> placement:
>    label: "rgw"
>
> [I get "SECRET" by doing ceph rgw realm tokens on the master, and C&Ping
> the field labelled "token"]
>
> If I then try and apply this with:
> ceph rgw zone create -i /root/rgw_secondary.yaml
>
> It doesn't work, and I get an unhelpful backtrace:
> Error EINVAL: Traceback (most recent call last):
>    File "/usr/share/ceph/mgr/mgr_module.py", line 1811, in _handle_command
>      return CLICommand.COMMANDS[cmd['prefix']].call(self, cmd, inbuf)
>             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
>    File "/usr/share/ceph/mgr/mgr_module.py", line 474, in call
>      return self.func(mgr, **kwargs)
>             ^^^^^^^^^^^^^^^^^^^^^^^^
>    File "/usr/share/ceph/mgr/rgw/module.py", line 96, in wrapper
>      return func(self, *args, **kwargs)
>             ^^^^^^^^^^^^^^^^^^^^^^^^^^^
>    File "/usr/share/ceph/mgr/rgw/module.py", line 304, in
> _cmd_rgw_zone_create
>      return HandleCommandResult(retval=0, stdout=f"Zones {',
> '.join(created_zones)} created successfully")
>
> ^^^^^^^^^^^^^^^^^^^^^^^^
> TypeError: sequence item 0: expected str instance, int found
>
> I assume I've messed up the spec file, but it looks like the one in the
> docs[0]. Can anyone point me in the right direction, please?
>
> [if the underlying command emits anything useful, I can't find it in the
> logs]
>
> Thanks,
>
> Matthew
>
> [0] https://docs.ceph.com/en/reef/mgr/rgw/#realm-credentials-token
> _______________________________________________
> ceph-users mailing list -- ceph-users@xxxxxxx
> To unsubscribe send an email to ceph-users-leave@xxxxxxx
>
>
_______________________________________________
ceph-users mailing list -- ceph-users@xxxxxxx
To unsubscribe send an email to ceph-users-leave@xxxxxxx




[Index of Archives]     [Information on CEPH]     [Linux Filesystem Development]     [Ceph Development]     [Ceph Large]     [Ceph Dev]     [Linux USB Development]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [xfs]


  Powered by Linux