Project

General

Profile

Bug #50519

"ceph dashboard set-ssl-certificate{,-key} -i" is trying to decode an already decoded string.

Added by Pascal Briehl almost 3 years ago. Updated almost 3 years ago.

Status:
Resolved
Priority:
Immediate
Category:
Security & Auth
Target version:
% Done:

0%

Source:
Community (user)
Tags:
Backport:
pacific
Regression:
No
Severity:
2 - major
Reviewed:
Affected Versions:
ceph-qa-suite:
Pull request ID:
Crash signature (v1):
Crash signature (v2):

Description

We are using 16.2.1 on Debian buster directly from https://download.ceph.com/debian-pacific/ .

We just enabled the dashboard on our test installation to validate.
When we tried to enable ssl the cli failed to store the file content after trying to decode an already decoded string.

  1. ceph dashboard set-ssl-certificate -i fullchain.crt
    Error EINVAL: Traceback (most recent call last):
    File "/usr/share/ceph/mgr/mgr_module.py", line 1337, in _handle_command
    return CLICommand.COMMANDS[cmd['prefix']].call(self, cmd, inbuf)
    File "/usr/share/ceph/mgr/mgr_module.py", line 389, in call
    return self.func(mgr, **kwargs)
    File "/usr/share/ceph/mgr/dashboard/module.py", line 372, in set_ssl_certificate
    self.set_store('crt', inbuf.decode())
    AttributeError: 'str' object has no attribute 'decode'
  1. ceph dashboard set-ssl-certificate-key -i privatekey.key
    Error EINVAL: Traceback (most recent call last):
    File "/usr/share/ceph/mgr/mgr_module.py", line 1337, in _handle_command
    return CLICommand.COMMANDS[cmd['prefix']].call(self, cmd, inbuf)
    File "/usr/share/ceph/mgr/mgr_module.py", line 389, in call
    return self.func(mgr, **kwargs)
    File "/usr/share/ceph/mgr/dashboard/module.py", line 385, in set_ssl_certificate_key
    self.set_store('key', inbuf.decode())
    AttributeError: 'str' object has no attribute 'decode'

Modifing "inbuf.decode()" to "inbuf" in the regarding lines allowed us then to load the certifikate & key and activate ssl.


Related issues

Copied to Dashboard - Backport #50649: pacific: "ceph dashboard set-ssl-certificate{,-key} -i" is trying to decode an already decoded string. Resolved

History

#1 Updated by Ernesto Puerta almost 3 years ago

  • Category set to Security & Auth
  • Status changed from New to Triaged
  • Assignee set to Alfonso Martínez
  • Source set to Community (user)
  • Severity changed from 3 - minor to 2 - major

While we're analyzing the issue, as a workaround you can add the dashboard keys directly in the key-value store with the following commands:

ceph config-key set mgr/dashboard/crt -i fullchain.crt
ceph config-key set mgr/dashboard/key -i privatekey.key

#2 Updated by Ernesto Puerta almost 3 years ago

  • Backport set to pacific

#3 Updated by Alfonso Martínez almost 3 years ago

  • Status changed from Triaged to In Progress
  • Target version changed from v16.2.2 to v17.0.0

#4 Updated by Alfonso Martínez almost 3 years ago

  • Status changed from In Progress to Fix Under Review
  • Pull request ID set to 41062

#5 Updated by Ernesto Puerta almost 3 years ago

  • Status changed from Fix Under Review to Pending Backport

#6 Updated by Backport Bot almost 3 years ago

  • Copied to Backport #50649: pacific: "ceph dashboard set-ssl-certificate{,-key} -i" is trying to decode an already decoded string. added

#7 Updated by Ernesto Puerta almost 3 years ago

  • Status changed from Pending Backport to Resolved

#8 Updated by Ernesto Puerta almost 3 years ago

  • Priority changed from Normal to Urgent

#9 Updated by Ernesto Puerta almost 3 years ago

  • Priority changed from Urgent to Immediate

#10 Updated by Ernesto Puerta almost 3 years ago

  • Tags set to regression

Also available in: Atom PDF