Ubuntu: Creation of ringbuilder files fails because of Permission Error

Bug #1980613 reported by Takashi Kajinami
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
puppet-swift
Fix Released
Critical
Takashi Kajinami

Bug Description

Currently scenario 002 job in Ubuntu is consistently failing because the following permission error is preventing the swift-ring-builder command from creating a builder file.

~~~
Traceback (most recent call last):
  File "/usr/bin/swift-ring-builder", line 37, in <module>
    sys.exit(main())
  File "/usr/lib/python3/dist-packages/swift/cli/ringbuilder.py", line 1671, in main
    mkdir(backup_dir)
PermissionError: [Errno 13] Permission denied: '/etc/swift/backups'
~~~

According to the output of `ls -la /etc/swift`, the /etc/swift directory is owned by root and the swift user does not have write access to the directory.

~~~
total 44
drwxr-x--- 5 root swift 4096 Jul 4 00:14 .
drwxr-xr-x 120 root root 4096 Jul 4 00:12 ..
drwxr-xr-x 2 swift swift 4096 Jul 4 00:14 account-server
-rw-r--r-- 1 swift swift 656 Jul 4 00:14 account-server.conf
drwxr-xr-x 2 swift swift 4096 Jul 4 00:14 container-server
-rw-r--r-- 1 swift swift 792 Jul 4 00:14 container-server.conf
-rw-r----- 1 root swift 625 Jul 4 00:14 object-expirer.conf
drwxr-xr-x 2 swift swift 4096 Jul 4 00:14 object-server
-rw-r--r-- 1 swift swift 822 Jul 4 00:14 object-server.conf
-rw-r--r-- 1 root root 2559 Jul 4 00:14 proxy-server.conf
-rw-r--r-- 1 root root 86 Jul 4 00:14 swift.conf
~~~

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to puppet-swift (master)
Changed in puppet-swift:
status: New → In Progress
Changed in puppet-swift:
importance: Undecided → Critical
assignee: nobody → Takashi Kajinami (kajinamit)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to puppet-swift (master)

Reviewed: https://review.opendev.org/c/openstack/puppet-swift/+/848554
Committed: https://opendev.org/openstack/puppet-swift/commit/d443048fae953e03e4a9db53d5b5f518e6a17d2f
Submitter: "Zuul (22348)"
Branch: master

commit d443048fae953e03e4a9db53d5b5f518e6a17d2f
Author: Takashi Kajinami <email address hidden>
Date: Mon Jul 4 10:10:02 2022 +0900

    Use the root user to generate ring builder files

    In Ubuntu, the swift user does not have write access to the /etc/swift
    directory, so generating a ring builder file by the swift user fails
    with Permission Error.

    This change switches the execution user to root to avoid the error.

    Closes-Bug: #1980613
    Change-Id: Ibad7afb29007109a683e22a1119b5b5fbdb1c130

Changed in puppet-swift:
status: In Progress → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to puppet-swift (stable/yoga)

Fix proposed to branch: stable/yoga
Review: https://review.opendev.org/c/openstack/puppet-swift/+/851717

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to puppet-swift (stable/xena)

Fix proposed to branch: stable/xena
Review: https://review.opendev.org/c/openstack/puppet-swift/+/851754

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to puppet-swift (stable/wallaby)

Fix proposed to branch: stable/wallaby
Review: https://review.opendev.org/c/openstack/puppet-swift/+/851755

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Change abandoned on puppet-swift (stable/wallaby)

Change abandoned by "Takashi Kajinami <email address hidden>" on branch: stable/wallaby
Review: https://review.opendev.org/c/openstack/puppet-swift/+/851755
Reason: The issue is currently observed in >= stable/yoga only

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Change abandoned on puppet-swift (stable/xena)

Change abandoned by "Takashi Kajinami <email address hidden>" on branch: stable/xena
Review: https://review.opendev.org/c/openstack/puppet-swift/+/851754
Reason: The issue is currently observed in >= stable/yoga only

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to puppet-swift (stable/yoga)

Reviewed: https://review.opendev.org/c/openstack/puppet-swift/+/851717
Committed: https://opendev.org/openstack/puppet-swift/commit/0abf25d1bf3a91b1c69576e7a27a36e23a73b1bd
Submitter: "Zuul (22348)"
Branch: stable/yoga

commit 0abf25d1bf3a91b1c69576e7a27a36e23a73b1bd
Author: Takashi Kajinami <email address hidden>
Date: Mon Jul 4 10:10:02 2022 +0900

    Use the root user to generate ring builder files

    In Ubuntu, the swift user does not have write access to the /etc/swift
    directory, so generating a ring builder file by the swift user fails
    with Permission Error.

    This change switches the execution user to root to avoid the error.

    Closes-Bug: #1980613
    Change-Id: Ibad7afb29007109a683e22a1119b5b5fbdb1c130
    (cherry picked from commit d443048fae953e03e4a9db53d5b5f518e6a17d2f)

tags: added: in-stable-yoga
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/puppet-swift 20.4.0

This issue was fixed in the openstack/puppet-swift 20.4.0 release.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/puppet-swift 21.0.0

This issue was fixed in the openstack/puppet-swift 21.0.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.