Project

General

Profile

Actions

Bug #50519

closed

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

Added by Pascal Briehl about 3 years ago. Updated about 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 1 (0 open1 closed)

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

Updated by Ernesto Puerta about 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
Actions #2

Updated by Ernesto Puerta about 3 years ago

  • Backport set to pacific
Actions #3

Updated by Alfonso Martínez about 3 years ago

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

Updated by Alfonso Martínez about 3 years ago

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

Updated by Ernesto Puerta about 3 years ago

  • Status changed from Fix Under Review to Pending Backport
Actions #6

Updated by Backport Bot about 3 years ago

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

Updated by Ernesto Puerta about 3 years ago

  • Status changed from Pending Backport to Resolved
Actions #8

Updated by Ernesto Puerta about 3 years ago

  • Priority changed from Normal to Urgent
Actions #9

Updated by Ernesto Puerta about 3 years ago

  • Priority changed from Urgent to Immediate
Actions #10

Updated by Ernesto Puerta about 3 years ago

  • Translation missing: en.field_tag_list set to regression
Actions

Also available in: Atom PDF