Invalid gnocchi tmp dir ownership

Bug #1799522 reported by Martin Mágr
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
tripleo
Fix Released
Critical
Martin Mágr

Bug Description

The directory /var/lib/gnocchi/tmp is created by gnocchi-upgrade with root user as owner, which makes it impossible for gnocchi to work with measures.

Relevant traceback:

2018-10-17 07:15:13,796 [277055] ERROR gnocchi.chef: Error processing new measures
Traceback (most recent call last):
  File "/usr/lib/python2.7/site-packages/gnocchi/chef.py", line 165, in process_new_measures_for_sack
    for metric in metrics
  File "/usr/lib/python2.7/site-packages/gnocchi/storage/__init__.py", line 727, in add_measures_to_metrics
    self._update_metric_splits(splits_to_update)
  File "/usr/lib/python2.7/site-packages/gnocchi/storage/__init__.py", line 460, in _update_metric_splits
    return self._store_metric_splits(metrics_splits_to_store)
  File "/usr/lib/python2.7/site-packages/gnocchi/storage/__init__.py", line 236, in _store_metric_splits
    in six.iteritems(metrics_keys_aggregations_data_offset)
  File "/usr/lib/python2.7/site-packages/gnocchi/utils.py", line 316, in parallel_map
    return list(executor.map(lambda args: fn(*args), list_of_args))
  File "/usr/lib/python2.7/site-packages/concurrent/futures/_base.py", line 605, in result_iterator
    yield future.result()
  File "/usr/lib/python2.7/site-packages/concurrent/futures/_base.py", line 429, in result
    return self.__get_result()
  File "/usr/lib/python2.7/site-packages/concurrent/futures/thread.py", line 62, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/usr/lib/python2.7/site-packages/gnocchi/utils.py", line 316, in <lambda>
    return list(executor.map(lambda args: fn(*args), list_of_args))
  File "/usr/lib/python2.7/site-packages/gnocchi/storage/file.py", line 228, in _store_metric_splits_unbatched
    data)
  File "/usr/lib/python2.7/site-packages/gnocchi/storage/file.py", line 114, in _atomic_file_store
    delete=False)
  File "/usr/lib64/python2.7/tempfile.py", line 458, in NamedTemporaryFile
    (fd, name) = _mkstemp_inner(dir, prefix, suffix, flags)
  File "/usr/lib64/python2.7/tempfile.py", line 239, in _mkstemp_inner
    fd = _os.open(file, flags, 0600)
OSError: [Errno 13] Permission denied: '/var/lib/gnocchi/tmp/gnocchicxNwtv'

Martin Mágr (mmagr)
Changed in tripleo:
milestone: none → stein-1
assignee: nobody → Martin Mágr (mmagr)
importance: Undecided → Critical
tags: added: rocky-backport-potential
Changed in tripleo:
status: New → In Progress
Changed in tripleo:
milestone: stein-1 → stein-2
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to tripleo-heat-templates (master)

Reviewed: https://review.openstack.org/611827
Committed: https://git.openstack.org/cgit/openstack/tripleo-heat-templates/commit/?id=332dd89f47fdc223165f2564fa28f723769ad411
Submitter: Zuul
Branch: master

commit 332dd89f47fdc223165f2564fa28f723769ad411
Author: Martin Magr <email address hidden>
Date: Fri Oct 19 12:11:17 2018 +0200

    Ensure correct tmp ownership for Gnocchi

    Directory /var/lib/gnocchi/tmp is created by gnocchi-upgrade
    with root ownership. This patch ensures the directory is created
    first with proper ownership.

    Closes-Bug: #1799522
    Change-Id: Iaf8e13490adffaf4a606730f4758d064af69b2aa

Changed in tripleo:
status: In Progress → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to tripleo-heat-templates (stable/rocky)

Fix proposed to branch: stable/rocky
Review: https://review.openstack.org/618089

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

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

tags: added: queens-backport-potential
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to tripleo-heat-templates (stable/rocky)

Reviewed: https://review.openstack.org/618089
Committed: https://git.openstack.org/cgit/openstack/tripleo-heat-templates/commit/?id=788c90d4a0707b6a78ecd2ed11345cd32abe62a7
Submitter: Zuul
Branch: stable/rocky

commit 788c90d4a0707b6a78ecd2ed11345cd32abe62a7
Author: Martin Magr <email address hidden>
Date: Fri Oct 19 12:11:17 2018 +0200

    Ensure correct tmp ownership for Gnocchi

    Directory /var/lib/gnocchi/tmp is created by gnocchi-upgrade
    with root ownership. This patch ensures the directory is created
    first with proper ownership.

    Closes-Bug: #1799522
    Change-Id: Iaf8e13490adffaf4a606730f4758d064af69b2aa
    (cherry picked from commit 332dd89f47fdc223165f2564fa28f723769ad411)

tags: added: in-stable-rocky
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/tripleo-heat-templates 10.2.0

This issue was fixed in the openstack/tripleo-heat-templates 10.2.0 release.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to tripleo-heat-templates (master)

Reviewed: https://review.openstack.org/620833
Committed: https://git.openstack.org/cgit/openstack/tripleo-heat-templates/commit/?id=948ab3f0ccb9327b0f93ee938971a3e8f5f09ca6
Submitter: Zuul
Branch: master

commit 948ab3f0ccb9327b0f93ee938971a3e8f5f09ca6
Author: Martin Magr <email address hidden>
Date: Thu Nov 29 10:19:25 2018 +0100

    Use correct permission on Gnocchi tmp dir

    Patch Iaf8e13490adffaf4a606730f4758d064af69b2aa does not fix the problem
    with Gnocchi temporary directory completely. Gnocchi is still not able
    to create new subdirectories. This patch makes the directory permission
    more easy.

    Change-Id: I6b13b0c4aaaa96684b3c7b782a2a2f5ff79e7f39
    Closes-Bug: #1799522

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to tripleo-heat-templates (stable/rocky)

Fix proposed to branch: stable/rocky
Review: https://review.openstack.org/624073

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to tripleo-heat-templates (stable/rocky)

Reviewed: https://review.openstack.org/624073
Committed: https://git.openstack.org/cgit/openstack/tripleo-heat-templates/commit/?id=4070380da97d142869dc8af272015cfb4b3f5c2d
Submitter: Zuul
Branch: stable/rocky

commit 4070380da97d142869dc8af272015cfb4b3f5c2d
Author: Martin Magr <email address hidden>
Date: Thu Nov 29 10:19:25 2018 +0100

    Use correct permission on Gnocchi tmp dir

    Patch Iaf8e13490adffaf4a606730f4758d064af69b2aa does not fix the problem
    with Gnocchi temporary directory completely. Gnocchi is still not able
    to create new subdirectories. This patch makes the directory permission
    more easy.

    Change-Id: I6b13b0c4aaaa96684b3c7b782a2a2f5ff79e7f39
    Closes-Bug: #1799522
    (cherry picked from commit 948ab3f0ccb9327b0f93ee938971a3e8f5f09ca6)

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/tripleo-heat-templates 9.2.0

This issue was fixed in the openstack/tripleo-heat-templates 9.2.0 release.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/tripleo-heat-templates 10.3.0

This issue was fixed in the openstack/tripleo-heat-templates 10.3.0 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.