Bug 1623775 - [abrt] dnf: read_config(): plugin.py:55:read_config:AttributeError: 'str' object has no attribute 'pluginconfpath'
Summary: [abrt] dnf: read_config(): plugin.py:55:read_config:AttributeError: 'str' obj...
Keywords:
Status: CLOSED EOL
Alias: None
Product: Fedora
Classification: Fedora
Component: imgbased
Version: 27
Hardware: x86_64
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Yuval Turgeman
QA Contact: Fedora Extras Quality Assurance
URL: https://retrace.fedoraproject.org/faf...
Whiteboard: abrt_hash:64733fd5d995d95811f024e154e...
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2018-08-30 07:48 UTC by Chetan Nagarkar
Modified: 2018-11-30 23:48 UTC (History)
11 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2018-11-30 23:48:24 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)
File: _var_log_dnf.log (77.38 KB, text/plain)
2018-08-30 07:48 UTC, Chetan Nagarkar
no flags Details
File: backtrace (1.52 KB, text/plain)
2018-08-30 07:48 UTC, Chetan Nagarkar
no flags Details
File: cgroup (289 bytes, text/plain)
2018-08-30 07:49 UTC, Chetan Nagarkar
no flags Details
File: cpuinfo (1.23 KB, text/plain)
2018-08-30 07:49 UTC, Chetan Nagarkar
no flags Details
File: dnf-makecache.log (714.68 KB, text/plain)
2018-08-30 07:49 UTC, Chetan Nagarkar
no flags Details
File: environ (3.24 KB, text/plain)
2018-08-30 07:49 UTC, Chetan Nagarkar
no flags Details
File: mountinfo (3.82 KB, text/plain)
2018-08-30 07:49 UTC, Chetan Nagarkar
no flags Details
File: namespaces (129 bytes, text/plain)
2018-08-30 07:49 UTC, Chetan Nagarkar
no flags Details
File: open_fds (430 bytes, text/plain)
2018-08-30 07:49 UTC, Chetan Nagarkar
no flags Details

Description Chetan Nagarkar 2018-08-30 07:48:48 UTC
Version-Release number of selected component:
dnf-2.7.5-2.fc27

Additional info:
reporter:       libreport-2.9.5
cmdline:        /usr/bin/python3 /usr/bin/dnf install nfs
crash_function: read_config
exception_type: AttributeError
executable:     /usr/bin/dnf
kernel:         4.14.3-300.fc27.x86_64
runlevel:       N 5
type:           Python3
uid:            0

Truncated backtrace:
plugin.py:55:read_config:AttributeError: 'str' object has no attribute 'pluginconfpath'

Traceback (most recent call last):
  File "/usr/bin/dnf", line 58, in <module>
    main.user_main(sys.argv[1:], exit_code=True)
  File "/usr/lib/python3.6/site-packages/dnf/cli/main.py", line 179, in user_main
    errcode = main(args)
  File "/usr/lib/python3.6/site-packages/dnf/cli/main.py", line 64, in main
    return _main(base, args, cli_class, option_parser_class)
  File "/usr/lib/python3.6/site-packages/dnf/cli/main.py", line 95, in _main
    cli.configure(list(map(ucd, args)), option_parser())
  File "/usr/lib/python3.6/site-packages/dnf/cli/cli.py", line 841, in configure
    self.base.init_plugins(opts.disableplugin, opts.enableplugin, self)
  File "/usr/lib/python3.6/site-packages/dnf/base.py", line 266, in init_plugins
    self._plugins._run_init(self, cli)
  File "/usr/lib/python3.6/site-packages/dnf/plugin.py", line 133, in _run_init
    plugin = p_cls(base, cli)
  File "/usr/lib/python3.6/site-packages/dnf-plugins/imgbased-persist.py", line 42, in __init__
    cp = self.read_config(self.PLUGIN_CONF)
  File "/usr/lib/python3.6/site-packages/dnf/plugin.py", line 55, in read_config
    files = ['%s/%s.conf' % (path, name) for path in conf.pluginconfpath]
AttributeError: 'str' object has no attribute 'pluginconfpath'

Local variables in innermost frame:
parser: <iniparse.compat.ConfigParser object at 0x7fcddd256208>
conf: 'imgbased-persist'
cls: <class 'dnf.plugin.dynamic.imgbased-persist.ImgbasedPersist'>
name: 'imagebased-persist'

Comment 1 Chetan Nagarkar 2018-08-30 07:48:57 UTC
Created attachment 1479701 [details]
File: _var_log_dnf.log

Comment 2 Chetan Nagarkar 2018-08-30 07:48:59 UTC
Created attachment 1479702 [details]
File: backtrace

Comment 3 Chetan Nagarkar 2018-08-30 07:49:01 UTC
Created attachment 1479703 [details]
File: cgroup

Comment 4 Chetan Nagarkar 2018-08-30 07:49:02 UTC
Created attachment 1479704 [details]
File: cpuinfo

Comment 5 Chetan Nagarkar 2018-08-30 07:49:12 UTC
Created attachment 1479705 [details]
File: dnf-makecache.log

Comment 6 Chetan Nagarkar 2018-08-30 07:49:14 UTC
Created attachment 1479706 [details]
File: environ

Comment 7 Chetan Nagarkar 2018-08-30 07:49:16 UTC
Created attachment 1479707 [details]
File: mountinfo

Comment 8 Chetan Nagarkar 2018-08-30 07:49:17 UTC
Created attachment 1479708 [details]
File: namespaces

Comment 9 Chetan Nagarkar 2018-08-30 07:49:19 UTC
Created attachment 1479709 [details]
File: open_fds

Comment 10 Jaroslav Mracek 2018-10-05 20:13:50 UTC
It looks like that the problem is in plugin imgbased where it called self.read_config(self.PLUGIN_CONF) with string argument but it requires dnf.conf.

Comment 11 Yuval Turgeman 2018-10-07 09:11:29 UTC
Which version are you using ? this was fixed a long time ago in [1]

[1] https://gerrit.ovirt.org/#/c/87626/6/src/plugin-dnf/imgbased-persist.py

Comment 12 Chetan Nagarkar 2018-11-26 12:45:18 UTC
(In reply to Yuval Turgeman from comment #11)
> Which version are you using ? this was fixed a long time ago in [1]
> 
> [1] https://gerrit.ovirt.org/#/c/87626/6/src/plugin-dnf/imgbased-persist.py

- imgbased Version:
imgbased-1.0.999-0.1.fc28.2.noarch

As per above patch, I have edited file `/usr/lib/python3.6/site-packages/dnf-plugins/imgbased-persist.py`

~~~
import logging
import os
import shutil

import dnf

logger = logging.getLogger('dnf.plugin')
logger.setLevel(logging.INFO)


class ImgbasedPersist(dnf.Plugin):

    name = 'imagebased-persist'
    config_name = 'imgbased-persist'
    persist_path = "/tmp/persisted-rpms/"

    excluded_pkgs = []

    def __init__(self, base, cli):
        super(ImgbasedPersist, self).__init__(base, cli)
        self.base = base

        cp = self.read_config(self.base.conf)
        self.excluded_pkgs = cp.get("main", "exclude_pkgs").split(',')

    def check_excludes(self, name):
        if name in self.excluded_pkgs:
            return True
        return False

    def transaction(self):
        if self.base.transaction.install_set:
            if not os.path.isdir(self.persist_path):
                os.makedirs(self.persist_path)

            for p in self.base.transaction.install_set:
                if self.check_excludes(p.name):
                    continue
                rpm = p.localPkg()
                logger.info("Persisting: %s" % os.path.basename(rpm))
                shutil.copy2(rpm, self.persist_path + os.path.basename(rpm))

        if self.base.transaction.remove_set:
            for p in self.base.transaction.remove_set:
                rpm = "{}-{}-{}.{}.rpm".format(p.name, p.v, p.r, p.a)
                try:
                    logger.info("Unpersisting: %s" % rpm)
                    os.remove(self.persist_path + rpm)
                except:
                    # Has probably never been persisted. Manual RPM install?
                    pass

~~~


Now `ERROR` has changed.
~~~
# dnf  update
Traceback (most recent call last):
  File "/usr/bin/dnf", line 58, in <module>
    main.user_main(sys.argv[1:], exit_code=True)
  File "/usr/lib/python3.6/site-packages/dnf/cli/main.py", line 179, in user_main
    errcode = main(args)
  File "/usr/lib/python3.6/site-packages/dnf/cli/main.py", line 64, in main
    return _main(base, args, cli_class, option_parser_class)
  File "/usr/lib/python3.6/site-packages/dnf/cli/main.py", line 95, in _main
    cli.configure(list(map(ucd, args)), option_parser())
  File "/usr/lib/python3.6/site-packages/dnf/cli/cli.py", line 843, in configure
    self.base.init_plugins(opts.disableplugin, opts.enableplugin, self)
  File "/usr/lib/python3.6/site-packages/dnf/base.py", line 388, in init_plugins
    self._plugins._run_init(self, cli)
  File "/usr/lib/python3.6/site-packages/dnf/plugin.py", line 133, in _run_init
    plugin = p_cls(base, cli)
  File "/usr/lib/python3.6/site-packages/dnf-plugins/imgbased-persist.py", line 43, in __init__
    self.excluded_pkgs = cp.get("main", "exclude_pkgs").split(',')
  File "/usr/lib/python3.6/site-packages/iniparse/compat.py", line 219, in get
    raise NoSectionError(section)
configparser.NoSectionError: No section: 'main'
~~~

Comment 13 Ben Cotton 2018-11-27 13:28:59 UTC
This message is a reminder that Fedora 27 is nearing its end of life.
On 2018-Nov-30  Fedora will stop maintaining and issuing updates for
Fedora 27. It is Fedora's policy to close all bug reports from releases
that are no longer maintained. At that time this bug will be closed as
EOL if it remains open with a Fedora  'version' of '27'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version' 
to a later Fedora version.

Thank you for reporting this issue and we are sorry that we were not 
able to fix it before Fedora 27 is end of life. If you would still like 
to see this bug fixed and are able to reproduce it against a later version 
of Fedora, you are encouraged  change the 'version' to a later Fedora 
version prior this bug is closed as described in the policy above.

Although we aim to fix as many bugs as possible during every release's 
lifetime, sometimes those efforts are overtaken by events. Often a 
more recent Fedora release includes newer upstream software that fixes 
bugs or makes them obsolete.

Comment 14 Ben Cotton 2018-11-30 23:48:24 UTC
Fedora 27 changed to end-of-life (EOL) status on 2018-11-30. Fedora 27 is
no longer maintained, which means that it will not receive any further
security or bug fix updates. As a result we are closing this bug.

If you can reproduce this bug against a currently maintained version of
Fedora please feel free to reopen this bug against that version. If you
are unable to reopen this bug, please file a new report against the
current release. If you experience problems, please add a comment to this
bug.

Thank you for reporting this bug and we are sorry it could not be fixed.


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