Manila-share with zfsonlinux not starting when LOCALE is not POSIX or en_US.UTF-8

Bug #1714691 reported by Dr. Clemens Hardewig
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Shared File Systems Service (Manila)
Fix Released
Medium
Dustin Schoenbrun

Bug Description

Hi,

Having installed Ocata manila-share on ubuntu 16.04 with zfs 0.6.5 and locale de_DE.UTF-8, manila share is not starting. Log File shows a problem with the share status information when executing zpool command to get the share parameters. Logfile with debug option shows a problem with the output string evaluation of the zpool command:

2017-08-30 21:01:54.178 2851 DEBUG manila.share.manager [req-a300bfec-ca40-4a3f-97bd-722bd6aa0654 - - - - -] Start initialization of driver: 'ZFSonLinuxShareDriver@storageserver@zfs' init_host /usr/lib/python2.7/dist-packages/manila/share/manager.py:274
2017-08-30 21:01:54.179 2851 DEBUG oslo_concurrency.processutils [req-a300bfec-ca40-4a3f-97bd-722bd6aa0654 - - - - -] Running cmd (subprocess): which exportfs execute /usr/lib/python2.7/dist-packages/oslo_concurrency/processutils.py:355
2017-08-30 21:01:54.205 2851 DEBUG oslo_concurrency.processutils [req-a300bfec-ca40-4a3f-97bd-722bd6aa0654 - - - - -] CMD "which exportfs" returned: 0 in 0.026s execute /usr/lib/python2.7/dist-packages/oslo_concurrency/processutils.py:385
2017-08-30 21:01:54.207 2851 DEBUG oslo_concurrency.processutils [req-a300bfec-ca40-4a3f-97bd-722bd6aa0654 - - - - -] Running cmd (subprocess): sudo manila-rootwrap /etc/manila/rootwrap.conf exportfs execute /usr/lib/python2.7/dist-packages/oslo_concurrency/processutils.py:355
2017-08-30 21:01:54.889 2851 DEBUG oslo_concurrency.processutils [req-a300bfec-ca40-4a3f-97bd-722bd6aa0654 - - - - -] CMD "sudo manila-rootwrap /etc/manila/rootwrap.conf exportfs" returned: 0 in 0.682s execute /usr/lib/python2.7/dist-packages/oslo_concurrency/processutils.py:385
2017-08-30 21:01:54.891 2851 DEBUG oslo_concurrency.processutils [req-a300bfec-ca40-4a3f-97bd-722bd6aa0654 - - - - -] Running cmd (subprocess): modinfo zfs execute /usr/lib/python2.7/dist-packages/oslo_concurrency/processutils.py:355
2017-08-30 21:01:54.918 2851 DEBUG oslo_concurrency.processutils [req-a300bfec-ca40-4a3f-97bd-722bd6aa0654 - - - - -] CMD "modinfo zfs" returned: 0 in 0.028s execute /usr/lib/python2.7/dist-packages/oslo_concurrency/processutils.py:385
2017-08-30 21:01:54.921 2851 DEBUG oslo_concurrency.processutils [req-a300bfec-ca40-4a3f-97bd-722bd6aa0654 - - - - -] Running cmd (subprocess): sudo manila-rootwrap /etc/manila/rootwrap.conf mount --make-rshared /crzfpool01 execute /usr/lib/python2.7/dist-packages/oslo_concurrency/processutils.py:355
2017-08-30 21:01:55.588 2851 DEBUG oslo_concurrency.processutils [req-a300bfec-ca40-4a3f-97bd-722bd6aa0654 - - - - -] CMD "sudo manila-rootwrap /etc/manila/rootwrap.conf mount --make-rshared /crzfpool01" returned: 0 in 0.668s execute /usr/lib/python2.7/dist-packages/oslo_concurrency/processutils.py:385
2017-08-30 21:01:55.605 2851 DEBUG manila.share.manager [req-a300bfec-ca40-4a3f-97bd-722bd6aa0654 - - - - -] Re-exporting 0 shares init_host /usr/lib/python2.7/dist-packages/manila/share/manager.py:295
2017-08-30 21:01:55.606 2851 INFO manila.share.manager [req-a300bfec-ca40-4a3f-97bd-722bd6aa0654 - - - - -] Updating share status
2017-08-30 21:01:55.608 2851 DEBUG oslo_concurrency.processutils [req-a300bfec-ca40-4a3f-97bd-722bd6aa0654 - - - - -] Running cmd (subprocess): sudo manila-rootwrap /etc/manila/rootwrap.conf zpool get free crzfpool01 execute /usr/lib/python2.7/dist-packages/oslo_concurrency/processutils.py:355
2017-08-30 21:01:56.174 2851 DEBUG oslo_concurrency.processutils [req-a300bfec-ca40-4a3f-97bd-722bd6aa0654 - - - - -] CMD "sudo manila-rootwrap /etc/manila/rootwrap.conf zpool get free crzfpool01" returned: 0 in 0.566s execute /usr/lib/python2.7/dist-packages/oslo_concurrency/processutils.py:385
2017-08-30 21:01:56.175 2851 DEBUG manila.share.drivers.zfsonlinux.driver [req-a300bfec-ca40-4a3f-97bd-722bd6aa0654 - - - - -] Value free size = '7,25T' _get_pools_info /usr/lib/python2.7/dist-packages/manila/share/drivers/zfsonlinux/driver.py:355
2017-08-30 21:01:56.177 2851 DEBUG manila.share.drivers.zfsonlinux.driver [req-a300bfec-ca40-4a3f-97bd-722bd6aa0654 - - - - -] Value free size after translate_string = 'None' _get_pools_info /usr/lib/python2.7/dist-packages/manila/share/drivers/zfsonlinux/driver.py:357
2017-08-30 21:01:56.178 2851 DEBUG oslo_concurrency.processutils [req-a300bfec-ca40-4a3f-97bd-722bd6aa0654 - - - - -] Running cmd (subprocess): sudo manila-rootwrap /etc/manila/rootwrap.conf zpool get size crzfpool01 execute /usr/lib/python2.7/dist-packages/oslo_concurrency/processutils.py:355
2017-08-30 21:01:56.843 2851 DEBUG oslo_concurrency.processutils [req-a300bfec-ca40-4a3f-97bd-722bd6aa0654 - - - - -] CMD "sudo manila-rootwrap /etc/manila/rootwrap.conf zpool get size crzfpool01" returned: 0 in 0.665s execute /usr/lib/python2.7/dist-packages/oslo_concurrency/processutils.py:385
2017-08-30 21:01:56.845 2851 DEBUG manila.share.drivers.zfsonlinux.driver [req-a300bfec-ca40-4a3f-97bd-722bd6aa0654 - - - - -] Value total size = 'None' _get_pools_info /usr/lib/python2.7/dist-packages/manila/share/drivers/zfsonlinux/driver.py:359
2017-08-30 21:01:56.845 2851 DEBUG manila.share.drivers.zfsonlinux.driver [req-a300bfec-ca40-4a3f-97bd-722bd6aa0654 - - - - -] Value total size after translate_string = 'None' _get_pools_info /usr/lib/python2.7/dist-packages/manila/share/drivers/zfsonlinux/driver.py:361
2017-08-30 21:01:56.846 2851 ERROR oslo_service.service [req-a300bfec-ca40-4a3f-97bd-722bd6aa0654 - - - - -] Error starting thread.
2017-08-30 21:01:56.846 2851 ERROR oslo_service.service Traceback (most recent call last):
2017-08-30 21:01:56.846 2851 ERROR oslo_service.service File "/usr/lib/python2.7/dist-packages/oslo_service/service.py", line 722, in run_service
2017-08-30 21:01:56.846 2851 ERROR oslo_service.service service.start()
2017-08-30 21:01:56.846 2851 ERROR oslo_service.service File "/usr/lib/python2.7/dist-packages/manila/service.py", line 124, in start
2017-08-30 21:01:56.846 2851 ERROR oslo_service.service self.manager.init_host()
2017-08-30 21:01:56.846 2851 ERROR oslo_service.service File "/usr/lib/python2.7/dist-packages/manila/share/manager.py", line 167, in wrapped
2017-08-30 21:01:56.846 2851 ERROR oslo_service.service return f(self, *args, **kwargs)
2017-08-30 21:01:56.846 2851 ERROR oslo_service.service File "/usr/lib/python2.7/dist-packages/manila/share/manager.py", line 377, in init_host
2017-08-30 21:01:56.846 2851 ERROR oslo_service.service self.publish_service_capabilities(ctxt)
2017-08-30 21:01:56.846 2851 ERROR oslo_service.service File "/usr/lib/python2.7/dist-packages/manila/share/manager.py", line 167, in wrapped
2017-08-30 21:01:56.846 2851 ERROR oslo_service.service return f(self, *args, **kwargs)
2017-08-30 21:01:56.846 2851 ERROR oslo_service.service File "/usr/lib/python2.7/dist-packages/manila/utils.py", line 519, in wrapper
2017-08-30 21:01:56.846 2851 ERROR oslo_service.service return func(self, *args, **kwargs)
2017-08-30 21:01:56.846 2851 ERROR oslo_service.service File "/usr/lib/python2.7/dist-packages/manila/share/manager.py", line 3126, in publish_service_capabilities
2017-08-30 21:01:56.846 2851 ERROR oslo_service.service self._report_driver_status(context)
2017-08-30 21:01:56.846 2851 ERROR oslo_service.service File "/usr/lib/python2.7/dist-packages/manila/utils.py", line 519, in wrapper
2017-08-30 21:01:56.846 2851 ERROR oslo_service.service return func(self, *args, **kwargs)
2017-08-30 21:01:56.846 2851 ERROR oslo_service.service File "/usr/lib/python2.7/dist-packages/manila/share/manager.py", line 3090, in _report_driver_status
2017-08-30 21:01:56.846 2851 ERROR oslo_service.service share_stats = self.driver.get_share_stats(refresh=True)
2017-08-30 21:01:56.846 2851 ERROR oslo_service.service File "/usr/lib/python2.7/dist-packages/manila/share/driver.py", line 793, in get_share_stats
2017-08-30 21:01:56.846 2851 ERROR oslo_service.service self._update_share_stats()
2017-08-30 21:01:56.846 2851 ERROR oslo_service.service File "/usr/lib/python2.7/dist-packages/manila/share/drivers/zfsonlinux/driver.py", line 385, in _update_share_stats
2017-08-30 21:01:56.846 2851 ERROR oslo_service.service 'pools': self._get_pools_info(),
2017-08-30 21:01:56.846 2851 ERROR oslo_service.service File "/usr/lib/python2.7/dist-packages/manila/share/drivers/zfsonlinux/driver.py", line 364, in _get_pools_info
2017-08-30 21:01:56.846 2851 ERROR oslo_service.service 'total_capacity_gb': float(total_size),
2017-08-30 21:01:56.846 2851 ERROR oslo_service.service TypeError: float() argument must be a string or a number
2017-08-30 21:01:56.846 2851 ERROR oslo_service.service
2017-08-30 21:01:56.852 2851 DEBUG oslo_concurrency.lockutils [req-7bafeba1-ed12-431c-9aa8-06f531ba8abd - - - - -] Acquired semaphore "singleton_lock" lock /usr/lib/python2.7/dist-packages/oslo_concurrency/lockutils.py:215
2017-08-30 21:01:56.852 2851 DEBUG oslo_concurrency.lockutils [req-7bafeba1-ed12-431c-9aa8-06f531ba8abd - - - - -] Releasing semaphore "singleton_lock" lock /usr/lib/python2.7/dist-packages/oslo_concurrency/lockutils.py:228
2017-08-30 21:01:56.871 2819 INFO oslo_service.service [req-7bafeba1-ed12-431c-9aa8-06f531ba8abd - - - - -] Child 2851 exited with status 1
2017-08-30 21:01:56.875 2819 DEBUG oslo_service.service [req-7bafeba1-ed12-431c-9aa8-06f531ba8abd - - - - -] Started child 2872 _start_child /usr/lib/python2.7/dist-packages/oslo_service/service.py:514
2017-08-30 21:01:56.883 2872 INFO manila.service [-] Starting manila-share node (version 4.0.0)
2017-08-30 21:01:56.905 2872 DEBUG manila.coordination [req-a6e72152-02d7-4b4b-b6c0-87048e5fa85d - - - - -] This tooz lock management back end does not support heart beats. start /usr/lib/python2.7/dist-packages/manila/coordination.py:95
2017-08-30 21:23:51.211 6090 INFO manila.coordination [req-8302c88f-c966-4138-bbde-c2e74bc5812d - - - - -] Coordination back end started successfully.
2017-08-30 21:23:51.211 6090 DEBUG oslo_db.api [req-8302c88f-c966-4138-bbde-c2e74bc5812d - - - - -] Loading backend 'sqlalchemy' from 'manila.db.sqlalchemy.api' _load_backend /usr/lib/python2.7/dist-packages/oslo_db/api.py:238
2017-08-30 21:23:51.610 6090 DEBUG oslo_db.sqlalchemy.engines [req-8302c88f-c966-4138-bbde-c2e74bc5812d - - - - -] MySQL server mode set to STRICT_TRANS_TABLES,STRICT_ALL_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,TRADITIONAL,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION _check_effective_sql_mode /usr/lib/python2.7/dist-packages/oslo_db/sqlalchemy/engines.py:261
2017-08-30 21:23:51.786 6090 DEBUG manila.service [req-8302c88f-c966-4138-bbde-c2e74bc5812d - - - - -] Creating RPC server for service manila-share. start /usr/lib/python2.7/dist-packages/manila/service.py:116
2017-08-30 21:23:51.814 6090 DEBUG manila.share.manager [req-8302c88f-c966-4138-bbde-c2e74bc5812d - - - - -] Start initialization of driver: 'ZFSonLinuxShareDriver@storageserver@zfs' init_host /usr/lib/python2.7/dist-packages/manila/share/manager.py:274
2017-08-30 21:23:51.815 6090 DEBUG oslo_concurrency.processutils [req-8302c88f-c966-4138-bbde-c2e74bc5812d - - - - -] Running cmd (subprocess): which exportfs execute /usr/lib/python2.7/dist-packages/oslo_concurrency/processutils.py:355
2017-08-30 21:23:51.841 6090 DEBUG oslo_concurrency.processutils [req-8302c88f-c966-4138-bbde-c2e74bc5812d - - - - -] CMD "which exportfs" returned: 0 in 0.026s execute /usr/lib/python2.7/dist-packages/oslo_concurrency/processutils.py:385
2017-08-30 21:23:51.842 6090 DEBUG oslo_concurrency.processutils [req-8302c88f-c966-4138-bbde-c2e74bc5812d - - - - -] Running cmd (subprocess): sudo manila-rootwrap /etc/manila/rootwrap.conf exportfs execute /usr/lib/python2.7/dist-packages/oslo_concurrency/processutils.py:355
2017-08-30 21:23:52.489 6090 DEBUG oslo_concurrency.processutils [req-8302c88f-c966-4138-bbde-c2e74bc5812d - - - - -] CMD "sudo manila-rootwrap /etc/manila/rootwrap.conf exportfs" returned: 0 in 0.647s execute /usr/lib/python2.7/dist-packages/oslo_concurrency/processutils.py:385
2017-08-30 21:23:52.491 6090 DEBUG oslo_concurrency.processutils [req-8302c88f-c966-4138-bbde-c2e74bc5812d - - - - -] Running cmd (subprocess): modinfo zfs execute /usr/lib/python2.7/dist-packages/oslo_concurrency/processutils.py:355
2017-08-30 21:23:52.517 6090 DEBUG oslo_concurrency.processutils [req-8302c88f-c966-4138-bbde-c2e74bc5812d - - - - -] CMD "modinfo zfs" returned: 0 in 0.027s execute /usr/lib/python2.7/dist-packages/oslo_concurrency/processutils.py:385
2017-08-30 21:23:52.520 6090 DEBUG oslo_concurrency.processutils [req-8302c88f-c966-4138-bbde-c2e74bc5812d - - - - -] Running cmd (subprocess): sudo manila-rootwrap /etc/manila/rootwrap.conf mount --make-rshared /crzfpool01 execute /usr/lib/python2.7/dist-packages/oslo_concurrency/processutils.py:355
2017-08-30 21:23:53.180 6090 DEBUG oslo_concurrency.processutils [req-8302c88f-c966-4138-bbde-c2e74bc5812d - - - - -] CMD "sudo manila-rootwrap /etc/manila/rootwrap.conf mount --make-rshared /crzfpool01" returned: 0 in 0.661s execute /usr/lib/python2.7/dist-packages/oslo_concurrency/processutils.py:385
2017-08-30 21:23:53.196 6090 DEBUG manila.share.manager [req-8302c88f-c966-4138-bbde-c2e74bc5812d - - - - -] Re-exporting 0 shares init_host /usr/lib/python2.7/dist-packages/manila/share/manager.py:295
2017-08-30 21:23:53.198 6090 INFO manila.share.manager [req-8302c88f-c966-4138-bbde-c2e74bc5812d - - - - -] Updating share status
2017-08-30 21:23:53.200 6090 DEBUG oslo_concurrency.processutils [req-8302c88f-c966-4138-bbde-c2e74bc5812d - - - - -] Running cmd (subprocess): sudo manila-rootwrap /etc/manila/rootwrap.conf zpool get free crzfpool01 execute /usr/lib/python2.7/dist-packages/oslo_concurrency/processutils.py:355
2017-08-30 21:23:53.751 6090 DEBUG oslo_concurrency.processutils [req-8302c88f-c966-4138-bbde-c2e74bc5812d - - - - -] CMD "sudo manila-rootwrap /etc/manila/rootwrap.conf zpool get free crzfpool01" returned: 0 in 0.552s execute /usr/lib/python2.7/dist-packages/oslo_concurrency/processutils.py:385
2017-08-30 21:23:53.753 6090 DEBUG manila.share.drivers.zfsonlinux.driver [req-8302c88f-c966-4138-bbde-c2e74bc5812d - - - - -] Value free size = '7,25T' _get_pools_info /usr/lib/python2.7/dist-packages/manila/share/drivers/zfsonlinux/driver.py:355
2017-08-30 21:23:53.754 6090 DEBUG manila.share.drivers.zfsonlinux.driver [req-8302c88f-c966-4138-bbde-c2e74bc5812d - - - - -] Value free size after translate_string = 'None' _get_pools_info /usr/lib/python2.7/dist-packages/manila/share/drivers/zfsonlinux/driver.py:357
2017-08-30 21:23:53.755 6090 DEBUG oslo_concurrency.processutils [req-8302c88f-c966-4138-bbde-c2e74bc5812d - - - - -] Running cmd (subprocess): sudo manila-rootwrap /etc/manila/rootwrap.conf zpool get size crzfpool01 execute /usr/lib/python2.7/dist-packages/oslo_concurrency/processutils.py:355
2017-08-30 21:23:53.809 6090 DEBUG oslo_concurrency.processutils [req-8302c88f-c966-4138-bbde-c2e74bc5812d - - - - -] CMD "sudo manila-rootwrap /etc/manila/rootwrap.conf zpool get size crzfpool01" returned: -15 in 0.054s execute /usr/lib/python2.7/dist-packages/oslo_concurrency/processutils.py:385
2017-08-30 21:23:53.810 6090 DEBUG oslo_concurrency.processutils [req-8302c88f-c966-4138-bbde-c2e74bc5812d - - - - -] u'sudo manila-rootwrap /etc/manila/rootwrap.conf zpool get size crzfpool01' failed. Not Retrying. execute /usr/lib/python2.7/dist-packages/oslo_concurrency/processutils.py:433
2017-08-30 21:23:53.810 6062 INFO oslo_service.service [req-4d246449-5326-42c6-af30-ae9307f2fd6b - - - - -] Caught SIGTERM, stopping children
2017-08-30 21:23:53.812 6062 DEBUG oslo_concurrency.lockutils [req-4d246449-5326-42c6-af30-ae9307f2fd6b - - - - -] Acquired semaphore "singleton_lock" lock /usr/lib/python2.7/dist-packages/oslo_concurrency/lockutils.py:215
2017-08-30 21:23:53.812 6062 DEBUG oslo_concurrency.lockutils [req-4d246449-5326-42c6-af30-ae9307f2fd6b - - - - -] Releasing semaphore "singleton_lock" lock /usr/lib/python2.7/dist-packages/oslo_concurrency/lockutils.py:228
2017-08-30 21:23:53.812 6062 DEBUG oslo_service.service [req-4d246449-5326-42c6-af30-ae9307f2fd6b - - - - -] Stop services. stop /usr/lib/python2.7/dist-packages/oslo_service/service.py:625
2017-08-30 21:23:53.813 6062 INFO manila.coordination [req-4d246449-5326-42c6-af30-ae9307f2fd6b - - - - -] Stopped Coordinator (Agent ID: ca81aa78-0a9e-42ba-8b39-8851cece3b09, prefix: manila-)
2017-08-30 21:23:53.813 6062 DEBUG oslo_service.service [req-4d246449-5326-42c6-af30-ae9307f2fd6b - - - - -] Killing children. stop /usr/lib/python2.7/dist-packages/oslo_service/service.py:630
2017-08-30 21:23:53.814 6062 INFO oslo_service.service [req-4d246449-5326-42c6-af30-ae9307f2fd6b - - - - -] Waiting on 1 children to exit
2017-08-30 21:23:53.823 6062 INFO oslo_service.service [req-4d246449-5326-42c6-af30-ae9307f2fd6b - - - - -] Child 6090 killed by signal 15

Having added two debug statements to the driver.py code in /usr/lib/python2.7/dist-packages/manila/share/drivers/zfsonlinux/driver.py, line 355,357,359:

 def _get_pools_info(self):
        """Returns info about all pools used by backend."""
        pools = []
        for zpool in self.zpool_list:
            free_size = self.get_zpool_option(zpool, 'free')
            LOG.debug( "Value free size = '%s' " % free_size)
            free_size = utils.translate_string_size_to_float(free_size)
            LOG.debug( "Value free size after translate_string = '%s' " % free_size)
            total_size = self.get_zpool_option(zpool, 'size')
            LOG.debug( "Value total size = '%s' " % total_size)
            total_size = utils.translate_string_size_to_float(total_size)
            LOG.debug( "Value total size after translate_string = '%s' " % total_size)
            pool = {
                'pool_name': zpool,
                'total_capacity_gb': float(total_size),
                'free_capacity_gb': float(free_size),
                'reserved_percentage':
                    self.configuration.reserved_share_percentage,
            }
            pool.update(self.common_capabilities)
            if self.configuration.replication_domain:
                pool['replication_type'] = 'readable'
            pools.append(pool)
        return pools

 it shows that the output of the zpool command cause a type error as the it seems that the output of the function utils.translate_string_size_to_float in line 356 of driver.py returns weird result (see above). Also abnormal as result from this is a return code of -15 when executing the command "sudo manila-rootwrap /etc/manila/rootwrap.conf zpool get size crzfpool01".

when executing "sudo manila-rootwrap /etc/manila/rootwrap.conf zpool get size crzfpool01" from shell, command result looks like:
NAME PROPERTY VALUE SOURCE
crzfpool01 size 7,25T -

Note the comma: it is due to the fact that my locale value LC_NUMERIC is set to de_DE.UTF-8.

When I set locale to POSIX resp. en_US.UTF-8, manila-share starts as designed.

This means in fact that manila-share with zfsonlinux can only be started when Locale is set to POSIX and not to any other value which changes the decimal separator from '.' to any other character like ','. This is from my perspective not desirable.

Code needs to be added to support other locale than POSIX

Thanx!

Br Clemens

description: updated
summary: Manila-share with zfsonlinux not starting when LOCALE is not POSIX or
- en-US.UTF-8
+ en_US.UTF-8
description: updated
Revision history for this message
Dr. Clemens Hardewig (bringha1) wrote :

[Update]

Could somebody check whether this would be a suitable candidate for a fix? (NOTE: I am NOT a python expert ;-))

In /usr/lib/python2.7/dist-packages/manila/utils.py, line 523

def translate_string_size_to_float(string, multiplier='G'):
    """Translates human-readable storage size to float value.

    Supported values for 'multiplier' are following:
        K - kilo | 1
        M - mega | 1024
        G - giga | 1024 * 1024
        T - tera | 1024 * 1024 * 1024
        P = peta | 1024 * 1024 * 1024 * 1024

    returns:
        - float if correct input data provided
        - None if incorrect
    """
    if not isinstance(string, six.string_types):
        return None
    multipliers = ('K', 'M', 'G', 'T', 'P')
    mapping = {
        k: 1024.0 ** v
        for k, v in zip(multipliers, range(len(multipliers)))
    }
    if multiplier not in multipliers:
        raise exception.ManilaException(
            "'multiplier' arg should be one of following: "
            "'%(multipliers)s'. But it is '%(multiplier)s'." % {
                'multiplier': multiplier,
                'multipliers': "', '".join(multipliers),
            }
        )
    try:
        value = float(string) / 1024.0
        value = value / mapping[multiplier]
        return value
    except (ValueError, TypeError):
        matched = re.match(
--> OLD r"^(\d+\.*\d*)([%s])$" % ','.join(multipliers), string)
--> NEW r"^(\d+[\.\,]*\d*)([%s])$" % ','.join(multipliers), string)
        if matched:
            value = float(matched.groups()[0])
            multiplier = mapping[matched.groups()[1]] / mapping[multiplier]
            return value * multiplier

Just a try ;-)

Revision history for this message
Dr. Clemens Hardewig (bringha1) wrote :

Correction for the new line:

--> NEW r"^(\d+[.,]*\d*)([%s])$" % ','.join(multipliers), string)

description: updated
description: updated
Changed in manila:
status: New → Triaged
importance: Undecided → Medium
Revision history for this message
Dustin Schoenbrun (dschoenb) wrote :

Thanks for the detailed description of the issue, Dr. Hardewig! It looks like this is indeed an issue in at least the ZFSonLinux Manila driver and might impact how other drivers behave in other locales. Your proposed fix to manila/utils.py looks like it will work to cover the different decimal delimiters in different locales. If it's alright with you I can push up a proposed fix to Manlia and list you as co-author. Thanks again for the report, Dr. Hardewig!

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to manila (master)

Fix proposed to branch: master
Review: https://review.openstack.org/515216

Changed in manila:
assignee: nobody → Dustin Schoenbrun (dschoenb)
status: Triaged → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to manila (master)

Reviewed: https://review.openstack.org/515216
Committed: https://git.openstack.org/cgit/openstack/manila/commit/?id=8800e54f770c4c4a6f813a5ea72bb12316482d87
Submitter: Zuul
Branch: master

commit 8800e54f770c4c4a6f813a5ea72bb12316482d87
Author: Dustin Schoenbrun <email address hidden>
Date: Wed Oct 25 18:00:50 2017 -0400

    Fix issue with different decimal separators

    An issue was discovered in the ZFSonLinux driver wherein on a system
    set to have a locale where the decimal separator is not a period but
    rather a comma the method translate_string_size_to_float() would fail
    because it's regex to find sizes in strings did not account for any
    other decimal separators other than periods.

    This fix updates the regular expression to accept either a period or
    a comma as a decimal separator in a size string.

    Many thanks to Dr. Clemens Hardewig for reporting the original bug
    and providing an updated regular expression.

    Change-Id: I15da4aaff90814eed03816db013d6acc89ba2ee8
    Closes-Bug: #1714691

Changed in manila:
status: In Progress → Fix Released
Revision history for this message
Dr. Clemens Hardewig (bringha1) wrote : Re: [Bug 1714691] Re: Manila-share with zfsonlinux not starting when LOCALE is not POSIX or en_US.UTF-8
Download full text (20.4 KiB)

Thanks Dustin, appreciate

I contrast to other patch descriptions I can not obtain for which release of openstack the patch shall be valid/introduced. Note that at least Ocata and Pike would require this patch to make work Manila-share properly ….

Thanks

Clemens

> Am 25.10.2017 um 22:36 schrieb Dustin Schoenbrun <email address hidden>:
>
> Thanks for the detailed description of the issue, Dr. Hardewig! It looks
> like this is indeed an issue in at least the ZFSonLinux Manila driver
> and might impact how other drivers behave in other locales. Your
> proposed fix to manila/utils.py looks like it will work to cover the
> different decimal delimiters in different locales. If it's alright with
> you I can push up a proposed fix to Manlia and list you as co-author.
> Thanks again for the report, Dr. Hardewig!
>
> --
> You received this bug notification because you are subscribed to the bug
> report.
> https://bugs.launchpad.net/bugs/1714691
>
> Title:
> Manila-share with zfsonlinux not starting when LOCALE is not POSIX or
> en_US.UTF-8
>
> Status in Manila:
> Triaged
>
> Bug description:
> Hi,
>
> Having installed Ocata manila-share on ubuntu 16.04 with zfs 0.6.5 and
> locale de_DE.UTF-8, manila share is not starting. Log File shows a
> problem with the share status information when executing zpool command
> to get the share parameters. Logfile with debug option shows a problem
> with the output string evaluation of the zpool command:
>
> 2017-08-30 21:01:54.178 2851 DEBUG manila.share.manager [req-a300bfec-ca40-4a3f-97bd-722bd6aa0654 - - - - -] Start initialization of driver: 'ZFSonLinuxShareDriver@storageserver@zfs' init_host /usr/lib/python2.7/dist-packages/manila/share/manager.py:274
> 2017-08-30 21:01:54.179 2851 DEBUG oslo_concurrency.processutils [req-a300bfec-ca40-4a3f-97bd-722bd6aa0654 - - - - -] Running cmd (subprocess): which exportfs execute /usr/lib/python2.7/dist-packages/oslo_concurrency/processutils.py:355
> 2017-08-30 21:01:54.205 2851 DEBUG oslo_concurrency.processutils [req-a300bfec-ca40-4a3f-97bd-722bd6aa0654 - - - - -] CMD "which exportfs" returned: 0 in 0.026s execute /usr/lib/python2.7/dist-packages/oslo_concurrency/processutils.py:385
> 2017-08-30 21:01:54.207 2851 DEBUG oslo_concurrency.processutils [req-a300bfec-ca40-4a3f-97bd-722bd6aa0654 - - - - -] Running cmd (subprocess): sudo manila-rootwrap /etc/manila/rootwrap.conf exportfs execute /usr/lib/python2.7/dist-packages/oslo_concurrency/processutils.py:355
> 2017-08-30 21:01:54.889 2851 DEBUG oslo_concurrency.processutils [req-a300bfec-ca40-4a3f-97bd-722bd6aa0654 - - - - -] CMD "sudo manila-rootwrap /etc/manila/rootwrap.conf exportfs" returned: 0 in 0.682s execute /usr/lib/python2.7/dist-packages/oslo_concurrency/processutils.py:385
> 2017-08-30 21:01:54.891 2851 DEBUG oslo_concurrency.processutils [req-a300bfec-ca40-4a3f-97bd-722bd6aa0654 - - - - -] Running cmd (subprocess): modinfo zfs execute /usr/lib/python2.7/dist-packages/oslo_concurrency/processutils.py:355
> 2017-08-30 21:01:54.918 2851 DEBUG oslo_concurrency.processutils [req-a300bfec-ca40-4a3f-97bd-722bd6aa0654 - - - - -] CMD "modinfo zfs" returned: 0 in 0.028s execute /usr/lib/python...

Tom Barron (tpb)
tags: added: ocata-backport-potential pike-backport-potential
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to manila (stable/pike)

Fix proposed to branch: stable/pike
Review: https://review.openstack.org/516380

Revision history for this message
Dustin Schoenbrun (dschoenb) wrote :

Hey Dr. Clemens,

Happy to help! Tom has marked this bug with backport potential to Ocata and Pike (the patch that I submitted will land in Queens) but we cherry-picked to the patch to Pike and when it merges into the stable branch there we will also backport it to Ocata. Let me know if you have any other questions!

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to manila (stable/pike)

Reviewed: https://review.openstack.org/516380
Committed: https://git.openstack.org/cgit/openstack/manila/commit/?id=776015af4000a48640bd0a91f7220b49c18238d9
Submitter: Zuul
Branch: stable/pike

commit 776015af4000a48640bd0a91f7220b49c18238d9
Author: Dustin Schoenbrun <email address hidden>
Date: Wed Oct 25 18:00:50 2017 -0400

    Fix issue with different decimal separators

    An issue was discovered in the ZFSonLinux driver wherein on a system
    set to have a locale where the decimal separator is not a period but
    rather a comma the method translate_string_size_to_float() would fail
    because it's regex to find sizes in strings did not account for any
    other decimal separators other than periods.

    This fix updates the regular expression to accept either a period or
    a comma as a decimal separator in a size string.

    Many thanks to Dr. Clemens Hardewig for reporting the original bug
    and providing an updated regular expression.

    Change-Id: I15da4aaff90814eed03816db013d6acc89ba2ee8
    Closes-Bug: #1714691
    (cherry picked from commit 8800e54f770c4c4a6f813a5ea72bb12316482d87)

tags: added: in-stable-pike
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to manila (stable/ocata)

Fix proposed to branch: stable/ocata
Review: https://review.openstack.org/516423

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to manila (stable/ocata)

Reviewed: https://review.openstack.org/516423
Committed: https://git.openstack.org/cgit/openstack/manila/commit/?id=d30aff5f480c4bf3b4cda82c94b3376793f35bfd
Submitter: Zuul
Branch: stable/ocata

commit d30aff5f480c4bf3b4cda82c94b3376793f35bfd
Author: Dustin Schoenbrun <email address hidden>
Date: Wed Oct 25 18:00:50 2017 -0400

    Fix issue with different decimal separators

    An issue was discovered in the ZFSonLinux driver wherein on a system
    set to have a locale where the decimal separator is not a period but
    rather a comma the method translate_string_size_to_float() would fail
    because it's regex to find sizes in strings did not account for any
    other decimal separators other than periods.

    This fix updates the regular expression to accept either a period or
    a comma as a decimal separator in a size string.

    Many thanks to Dr. Clemens Hardewig for reporting the original bug
    and providing an updated regular expression.

    Change-Id: I15da4aaff90814eed03816db013d6acc89ba2ee8
    Closes-Bug: #1714691
    (cherry picked from commit 8800e54f770c4c4a6f813a5ea72bb12316482d87)
    (cherry picked from commit 776015af4000a48640bd0a91f7220b49c18238d9)

tags: added: in-stable-ocata
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/manila 6.0.0.0b1

This issue was fixed in the openstack/manila 6.0.0.0b1 development milestone.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/manila 4.0.2

This issue was fixed in the openstack/manila 4.0.2 release.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/manila 5.0.2

This issue was fixed in the openstack/manila 5.0.2 release.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.