question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

adopt-cephadm.yml - error configparser.DuplicateSectionError:

See original GitHub issue

What happened: Running adopt-cephadm.yml against my testbed which is currently pacfic on ceph-ansible stable-6.0

I then get the following ceph-ansible task issue:

PLAY [adopt ceph mon daemons] **************************************************************************************************************************

TASK [adopt mon daemon] ********************************************************************************************************************************
Friday 05 August 2022  11:03:28 +0200 (0:00:00.446)       0:01:28.437 *********
fatal: [A-08-02-storage.maas]: FAILED! => changed=false
  msg: |-
    Traceback (most recent call last):
      File "/usr/sbin/cephadm", line 8971, in <module>
        main()
      File "/usr/sbin/cephadm", line 8959, in main
        r = ctx.func(ctx)
      File "/usr/sbin/cephadm", line 5320, in command_ls
        ls = list_daemons(ctx, detail=not ctx.no_detail,
      File "/usr/sbin/cephadm", line 5380, in list_daemons
        fsid = get_legacy_daemon_fsid(ctx,
      File "/usr/sbin/cephadm", line 2311, in get_legacy_daemon_fsid
        fsid = get_legacy_config_fsid(cluster, legacy_dir=legacy_dir)
      File "/usr/sbin/cephadm", line 2288, in get_legacy_config_fsid
        config = read_config(config_file)
      File "/usr/sbin/cephadm", line 1686, in read_config
        cp.read(fn)
      File "/usr/lib/python3.8/configparser.py", line 697, in read
        self._read(fp, filename)
      File "/usr/lib/python3.8/configparser.py", line 1067, in _read
        raise DuplicateSectionError(sectname, fpname,
    configparser.DuplicateSectionError: While reading from '//etc/ceph/ceph.conf' [line 20]: section 'client.rgw.A-08-02-storage.rgw0' already exists
  rc: 1

From inspecting /etc/ceph/ceph.conf the following value [client.rgw.A-08-02-storage.rgw0] appears twice as per the error

[client.rgw.A-08-02-storage.rgw0]
host = A-08-02-storage
keyring = /var/lib/ceph/radosgw/ceph-rgw.A-08-02-storage.rgw0/keyring
log file = /var/log/ceph/ceph-rgw-A-08-02-storage.rgw0.log
rgw frontends = beast endpoint=10.102.51.11:7480
rgw thread pool size = 512

[client.rgw.A-08-02-storage.rgw0]
rgw content length compat = true
rgw enable apis = s3, swift, swift_auth, admin
rgw enable usage log = true
rgw enforce swift acls = true
rgw keystone accepted admin roles = admin, ResellerAdmin
rgw keystone accepted roles = Member, _member_, admin, ResellerAdmin
etc

How does one work around this duplication that ceph-ansible created in the first place?

What you expected to happen: To run the playbook as intended.

How to reproduce it (minimal and precise):

  • Have a working pacific cluster based on stable-6.0
  • Ceph RGW values in ceph_conf_overrides:

Inventory Group_vars

Environment:

  • OS (e.g. from /etc/os-release): Ubuntu 20.04.4 LTS
  • Kernel (e.g. uname -a): Linux B-03-11-cephctl 5.4.0-122-generic
  • Docker version if applicable (e.g. docker version): 20.10.12
  • Ansible version (e.g. ansible-playbook --version): 2.10.17
  • ceph-ansible version (e.g. git head or tag or stable branch): stable-6.0
  • Ceph version (e.g. ceph -v): 16.2.10

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:11

github_iconTop GitHub Comments

1reaction
guitscommented, Sep 22, 2022

I suspect any keys redefined in later sections override the earlier sections.

yes, that’s correct.

I’m sorry I don’t have a lot of time for this at the moment, but I’ll try to take a look at this as soon as possible…

0reactions
github-actions[bot]commented, Oct 14, 2022

This issue has been automatically closed due to inactivity. Please re-open if this still requires investigation.

Read more comments on GitHub >

github_iconTop Results From Across the Web

configparser — Configuration file parser — Python 3.11.1 ...
If a section by the given name already exists, DuplicateSectionError is raised. If the default section name is passed, ValueError is raised. The...
Read more >
How to use the configparser.DuplicateSectionError function in ...
To help you get started, we've selected a few configparser. ... DuplicateSectionError as error: log_error(error) sys.exit(1) except configparser.
Read more >
Error: configparser.DuplicateSectionError: While reading from ...
So this has been working since I downloaded it... then suddenly today, for no reason that I can find, it is dropping this...
Read more >
Parsing configure file with same section name in python
ConfigParser stores the sections it reads in a dictionary, so it can't handle multiple sections with the same name. Fortunately the constructor accepts...
Read more >
ConfigParser – Work with configuration files - PyMOTW
Use the ConfigParser module to manage user-editable configuration files for an application. The configuration files are organized into sections, ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found