Bugzilla (bugzilla.redhat.com) will be under maintenance for infrastructure upgrades and will not be available on July 31st between 12:30 AM - 05:30 AM UTC. We appreciate your understanding and patience. You can follow status.redhat.com for details.
Bug 1657700 - Cannot change default basepath while working with file backend: permission denied
Summary: Cannot change default basepath while working with file backend: permission de...
Alias: None
Product: Red Hat OpenStack
Classification: Red Hat
Component: openstack-gnocchi
Version: 14.0 (Rocky)
Hardware: Unspecified
OS: Unspecified
Target Milestone: ---
: ---
Assignee: Mehdi ABAAKOUK
QA Contact: Sasha Smolyak
Depends On:
TreeView+ depends on / blocked
Reported: 2018-12-10 10:05 UTC by Sasha Smolyak
Modified: 2018-12-12 07:25 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Last Closed: 2018-12-12 07:25:05 UTC
Target Upstream Version:

Attachments (Terms of Use)

Description Sasha Smolyak 2018-12-10 10:05:57 UTC
Description of problem:
Deployed 1 controller, 1 compute, 1 ceph configuration with GnocchiBackend: file. Changed default backend dir from /var/lib/gnocchi to /var/lib/test, in gnocchi_metricd tried to create new dir /var/lib/test: permission denied.

Version-Release number of selected component (if applicable):

How reproducible:

Steps to Reproduce:
1. Deploy 1 controller, 1 compute, 1 ceph with an additional parameter GnocchiBackend: file.

2. Test that the measures are shown after deployment: create a new instance, watch cpu measures, observe that the directories are created on /var/lib/gnocchi in gnocchi_api container.

3. In /var/lib/config-data/puppet-generated/gnocchi/etc/gnocchi/gnocchi.conf change file_basepath=/var/lib/test. Restart gnocchi_metricd container. Verify that the config /etc/gnocchi/gnocchi.conf is changed in gnocchi_metricd container.

4. In gnocchi_metricd container try to add a folder test under /var/log. Get error "permission denied". Cannot create the folder.

Note: when trying to add "test" folder under /var/lib/ in gnocchi_api container, everything works ok - the folder is created, the permissions can be changed.

Actual results:
Permission is denied

Expected results:
New folder is created

Additional info:
[heat-admin@controller-0 ~]$ tail /var/log/containers/gnocchi/gnocchi-metricd.log
    self._build_metric_path(metric, aggregation),
  File "/usr/lib/python2.7/site-packages/gnocchi/storage/file.py", line 136, in _build_metric_path
    return os.path.join(self._build_metric_dir(metric),
  File "/usr/lib/python2.7/site-packages/gnocchi/storage/file.py", line 121, in _build_metric_dir
    if self.SUBDIR_LEN > 0:
  File "/usr/lib/python2.7/site-packages/gnocchi/storage/file.py", line 76, in SUBDIR_LEN
    elif self.is_old_directory_structure():
  File "/usr/lib/python2.7/site-packages/gnocchi/storage/file.py", line 98, in is_old_directory_structure
    for p in os.listdir(self.basepath):
OSError: [Errno 2] No such file or directory: '/var/lib/test'

Comment 1 Sasha Smolyak 2018-12-10 10:13:25 UTC
I think that in Release notes, in "Telemetry" section, Section of working with file backend, need to add that it's forbidden for client to change default file basepath for Gnocchi backend from /var/lib/gnocchi

Comment 2 Mehdi ABAAKOUK 2018-12-12 07:25:05 UTC
To change the file directory you must do it with tripleo with the parameter GnocchiFileBasePath instead of changing /var/lib/config-data/puppet-generated/gnocchi/etc/gnocchi/gnocchi.conf.

Tripleo will take care of creating all needed directory.

Note You need to log in before you can comment on or make changes to this bug.