← Back to team overview

yahoo-eng-team team mailing list archive

[Bug 1885357] [NEW] Horizon fails to create volume from snapshot of non-standard-type volume

 

Public bug reported:

Horizon offers the opportunity to create a volume from a snapshot. It
does not, however, properly determine the type of the originating volume
of the snapshot and tries to use the default. In environments with non-
default storage types (e.g. encrypted storages, like in our case), this
fails and leads to an error message:

2020-06-26 16:13:12,633 36 WARNING horizon.exceptions Recoverable error:
Invalid input received: Invalid volume_type provided: d4917a31-3332-4323
-9b1f-9ace3dda9d9a (requested type is not compatible; recommend omitting
the type argument). (HTTP 400) (Request-ID: req-
40ee2f61-6a16-44f2-96d7-46f5c42f1942)

Problematic code is in cinder/forms.py of Horizon:

https://github.com/openstack/horizon/blob/master/openstack_dashboard/dashboards/project/volumes/forms.py#L379

Under normal circumstances, the storage type should be set in that file
in "prepare_source_fields_if_snapshot_specified"
(https://github.com/openstack/horizon/blob/master/openstack_dashboard/dashboards/project/volumes/forms.py#L145)

That code would need to be triggered in the __init__ function of
CreateForm
(https://github.com/openstack/horizon/blob/master/openstack_dashboard/dashboards/project/volumes/forms.py#L297)
which tests the GET of the original request for certain strings.

Debugging however, unveils that GET simply does not contain any of the
strings checked for there anymore -- in our case, it always was
"<WSGIRequest: GET '/dashboard/project/volumes/create/'>". So in fact,
the whole code path starting at
https://github.com/openstack/horizon/blob/master/openstack_dashboard/dashboards/project/volumes/forms.py#L314
might be death and the default will always be used. The default doesn't
populate "type", however,

This of course also leads to creating volumes from volumes not working
due to the same issue.

** Affects: horizon
     Importance: Undecided
         Status: New

-- 
You received this bug notification because you are a member of Yahoo!
Engineering Team, which is subscribed to OpenStack Dashboard (Horizon).
https://bugs.launchpad.net/bugs/1885357

Title:
  Horizon fails to create volume from snapshot of non-standard-type
  volume

Status in OpenStack Dashboard (Horizon):
  New

Bug description:
  Horizon offers the opportunity to create a volume from a snapshot. It
  does not, however, properly determine the type of the originating
  volume of the snapshot and tries to use the default. In environments
  with non-default storage types (e.g. encrypted storages, like in our
  case), this fails and leads to an error message:

  2020-06-26 16:13:12,633 36 WARNING horizon.exceptions Recoverable
  error: Invalid input received: Invalid volume_type provided:
  d4917a31-3332-4323-9b1f-9ace3dda9d9a (requested type is not
  compatible; recommend omitting the type argument). (HTTP 400)
  (Request-ID: req-40ee2f61-6a16-44f2-96d7-46f5c42f1942)

  Problematic code is in cinder/forms.py of Horizon:

  https://github.com/openstack/horizon/blob/master/openstack_dashboard/dashboards/project/volumes/forms.py#L379

  Under normal circumstances, the storage type should be set in that
  file in "prepare_source_fields_if_snapshot_specified"
  (https://github.com/openstack/horizon/blob/master/openstack_dashboard/dashboards/project/volumes/forms.py#L145)

  That code would need to be triggered in the __init__ function of
  CreateForm
  (https://github.com/openstack/horizon/blob/master/openstack_dashboard/dashboards/project/volumes/forms.py#L297)
  which tests the GET of the original request for certain strings.

  Debugging however, unveils that GET simply does not contain any of the
  strings checked for there anymore -- in our case, it always was
  "<WSGIRequest: GET '/dashboard/project/volumes/create/'>". So in fact,
  the whole code path starting at
  https://github.com/openstack/horizon/blob/master/openstack_dashboard/dashboards/project/volumes/forms.py#L314
  might be death and the default will always be used. The default
  doesn't populate "type", however,

  This of course also leads to creating volumes from volumes not working
  due to the same issue.

To manage notifications about this bug go to:
https://bugs.launchpad.net/horizon/+bug/1885357/+subscriptions


Follow ups