Bug 1499099 - [abrt] glances: connect(): glances_docker.py:98:connect:AttributeError: module 'docker' has no attribute 'Client'
Summary: [abrt] glances: connect(): glances_docker.py:98:connect:AttributeError: modul...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: glances
Version: 27
Hardware: x86_64
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Edouard Bourguignon
QA Contact: Fedora Extras Quality Assurance
URL: https://retrace.fedoraproject.org/faf...
Whiteboard: abrt_hash:f6b05f5c21985e489d5f13d94e9...
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2017-10-06 03:03 UTC by Anass Ahmed
Modified: 2017-12-12 11:17 UTC (History)
8 users (show)

Fixed In Version: glances-2.11.1-1.fc27
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2017-12-12 11:17:20 UTC
Type: ---


Attachments (Terms of Use)
File: backtrace (1.07 KB, text/plain)
2017-10-06 03:03 UTC, Anass Ahmed
no flags Details
File: cgroup (321 bytes, text/plain)
2017-10-06 03:03 UTC, Anass Ahmed
no flags Details
File: cpuinfo (1.25 KB, text/plain)
2017-10-06 03:03 UTC, Anass Ahmed
no flags Details
File: environ (5.69 KB, text/plain)
2017-10-06 03:03 UTC, Anass Ahmed
no flags Details
File: mountinfo (3.56 KB, text/plain)
2017-10-06 03:03 UTC, Anass Ahmed
no flags Details
File: namespaces (102 bytes, text/plain)
2017-10-06 03:03 UTC, Anass Ahmed
no flags Details
File: open_fds (514 bytes, text/plain)
2017-10-06 03:04 UTC, Anass Ahmed
no flags Details

Description Anass Ahmed 2017-10-06 03:03:40 UTC
Description of problem:
Tried to execute glances in the terminal.

Version-Release number of selected component:
glances-2.7.1-3.fc27

Additional info:
reporter:       libreport-2.9.2
cmdline:        /usr/bin/python3 /usr/bin/glances
crash_function: connect
exception_type: AttributeError
executable:     /usr/bin/glances
kernel:         4.13.4-300.fc27.x86_64
runlevel:       N 5
type:           Python3
uid:            1000

Truncated backtrace:
glances_docker.py:98:connect:AttributeError: module 'docker' has no attribute 'Client'

Traceback (most recent call last):
  File "/usr/bin/glances", line 11, in <module>
    load_entry_point('Glances==2.7.1', 'console_scripts', 'glances')()
  File "/usr/lib/python3.6/site-packages/glances/__init__.py", line 127, in main
    args=core.get_args())
  File "/usr/lib/python3.6/site-packages/glances/standalone.py", line 68, in __init__
    self.stats.update()
  File "/usr/lib/python3.6/site-packages/glances/stats.py", line 154, in update
    self._plugins[p].update()
  File "/usr/lib/python3.6/site-packages/glances/plugins/glances_plugin.py", line 734, in wrapper
    ret = fct(*args, **kw)
  File "/usr/lib/python3.6/site-packages/glances/plugins/glances_docker.py", line 153, in update
    self.docker_client = self.connect()
  File "/usr/lib/python3.6/site-packages/glances/plugins/glances_docker.py", line 98, in connect
    ret = docker.Client(base_url='unix://var/run/docker.sock')
AttributeError: module 'docker' has no attribute 'Client'

Local variables in innermost frame:
version: None

Comment 1 Anass Ahmed 2017-10-06 03:03:49 UTC
Created attachment 1335038 [details]
File: backtrace

Comment 2 Anass Ahmed 2017-10-06 03:03:51 UTC
Created attachment 1335039 [details]
File: cgroup

Comment 3 Anass Ahmed 2017-10-06 03:03:52 UTC
Created attachment 1335040 [details]
File: cpuinfo

Comment 4 Anass Ahmed 2017-10-06 03:03:54 UTC
Created attachment 1335041 [details]
File: environ

Comment 5 Anass Ahmed 2017-10-06 03:03:56 UTC
Created attachment 1335042 [details]
File: mountinfo

Comment 6 Anass Ahmed 2017-10-06 03:03:58 UTC
Created attachment 1335043 [details]
File: namespaces

Comment 7 Anass Ahmed 2017-10-06 03:04:00 UTC
Created attachment 1335044 [details]
File: open_fds

Comment 8 Anass Ahmed 2017-10-23 18:45:49 UTC
Similar problem has been detected:

Tried to run glances command in the terminal where docker-py module is installed.

reporter:       libreport-2.9.2
cmdline:        /usr/bin/python3 /usr/bin/glances
crash_function: connect
exception_type: AttributeError
executable:     /usr/bin/glances
kernel:         4.13.8-300.fc27.x86_64
package:        glances-2.7.1-3.fc27
reason:         glances_docker.py:98:connect:AttributeError: module 'docker' has no attribute 'Client'
runlevel:       N 5
type:           Python3
uid:            1000

Comment 9 Kamil Páral 2017-11-01 11:05:58 UTC
Similar problem has been detected:

Just run 'glances'.

reporter:       libreport-2.9.2
cmdline:        /usr/bin/python3 /usr/bin/glances -b
crash_function: connect
exception_type: AttributeError
executable:     /usr/bin/glances
kernel:         4.13.9-300.fc27.x86_64
package:        glances-2.7.1-3.fc27
reason:         glances_docker.py:98:connect:AttributeError: module 'docker' has no attribute 'Client'
runlevel:       N 5
type:           Python3
uid:            1000

Comment 10 Didier Fabert (tartare) 2017-11-22 14:14:22 UTC
There is a workaround for this problem: use an updated version
sudo dnf copr enable tartare/glances
sudo dnf update glances

And it's working

Comment 11 Anass Ahmed 2017-11-22 23:26:47 UTC
(In reply to Didier from comment #10)
> There is a workaround for this problem: use an updated version
> sudo dnf copr enable tartare/glances
> sudo dnf update glances
> 
> And it's working

Then the fix is to update the official repo version :)

Comment 12 Anass Ahmed 2017-11-23 02:06:11 UTC
Whoa! The last fedora glances version is 2.5 and it's already 2 years old.

If you visited glances releases, you'll find that last release was on Aug 27 and it's 2.11: https://github.com/nicolargo/glances/releases

We need to update this package, ASAP.

Comment 13 Anass Ahmed 2017-11-23 02:08:34 UTC
Sorry, the last update is 2.7 on Fedora 27 but it doesn't show up in the Bodhi list: https://bodhi.fedoraproject.org/updates/?packages=glances

Comment 14 Anass Ahmed 2017-11-23 02:43:25 UTC
I made a PR on src.fedoraproject.org for new glances version to update to 2.11.1, I hope it gets merged soon and released: https://src.fedoraproject.org/rpms/glances/pull-request/1

Comment 15 Fedora Update System 2017-11-26 20:55:27 UTC
glances-2.11.1-1.fc27 has been submitted as an update to Fedora 27. https://bodhi.fedoraproject.org/updates/FEDORA-2017-ce1b9a88bb

Comment 16 Fedora Update System 2017-11-26 20:55:56 UTC
glances-2.11.1-1.fc26 has been submitted as an update to Fedora 26. https://bodhi.fedoraproject.org/updates/FEDORA-2017-4ec108000a

Comment 17 Fedora Update System 2017-11-28 06:45:14 UTC
glances-2.11.1-1.fc27 has been pushed to the Fedora 27 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2017-ce1b9a88bb

Comment 18 Fedora Update System 2017-11-28 07:24:03 UTC
glances-2.11.1-1.fc26 has been pushed to the Fedora 26 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2017-4ec108000a

Comment 19 Fedora Update System 2017-12-12 11:17:20 UTC
glances-2.11.1-1.fc27 has been pushed to the Fedora 27 stable repository. If problems still persist, please make note of it in this bug report.


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