Bug 1459100

Summary: [abrt] virt-manager: module(): utils.py:28:<module>:ImportError: cannot import name proxy_bypass_environment
Product: [Fedora] Fedora Reporter: Miguel Perez Colino <miguel>
Component: virt-managerAssignee: Cole Robinson <crobinso>
Status: CLOSED NOTABUG QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 26CC: berrange, crobinso, miguel, virt-maint
Target Milestone: ---   
Target Release: ---   
Hardware: x86_64   
OS: Unspecified   
URL: https://retrace.fedoraproject.org/faf/reports/bthash/95cf3c3c082b5f9ebcd2a952055e2ed55e0cb434
Whiteboard: abrt_hash:a3fadef835c11aacebe099fc55c587544a051985;VARIANT_ID=workstation;
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2017-06-08 13:02:50 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
File: backtrace
none
File: cgroup
none
File: cpuinfo
none
File: environ
none
File: mountinfo
none
File: namespaces
none
File: open_fds none

Description Miguel Perez Colino 2017-06-06 09:47:22 UTC
Version-Release number of selected component:
virt-manager-1.4.1-2.fc26

Additional info:
reporter:       libreport-2.9.1
cmdline:        /usr/bin/python2 /usr/share/virt-manager/virt-manager
crash_function: module
exception_type: ImportError
executable:     /usr/share/virt-manager/virt-manager
kernel:         4.11.3-300.fc26.x86_64
runlevel:       N 5
type:           Python
uid:            1000

Truncated backtrace:
#1 <module> in /usr/lib/python2.7/site-packages/requests/utils.py:28
#2 <module> in /usr/lib/python2.7/site-packages/requests/__init__.py:63
#3 <module> in /usr/share/virt-manager/virtinst/urlfetcher.py:34
#4 <module> in /usr/share/virt-manager/virtinst/distroinstaller.py:23
#5 <module> in /usr/share/virt-manager/virtinst/__init__.py:89
#6 <module> in /usr/share/virt-manager/virt-manager:33

Comment 1 Miguel Perez Colino 2017-06-06 09:47:31 UTC
Created attachment 1285313 [details]
File: backtrace

Comment 2 Miguel Perez Colino 2017-06-06 09:47:32 UTC
Created attachment 1285314 [details]
File: cgroup

Comment 3 Miguel Perez Colino 2017-06-06 09:47:34 UTC
Created attachment 1285315 [details]
File: cpuinfo

Comment 4 Miguel Perez Colino 2017-06-06 09:47:36 UTC
Created attachment 1285316 [details]
File: environ

Comment 5 Miguel Perez Colino 2017-06-06 09:47:38 UTC
Created attachment 1285317 [details]
File: mountinfo

Comment 6 Miguel Perez Colino 2017-06-06 09:47:39 UTC
Created attachment 1285318 [details]
File: namespaces

Comment 7 Miguel Perez Colino 2017-06-06 09:47:41 UTC
Created attachment 1285319 [details]
File: open_fds

Comment 8 Cole Robinson 2017-06-06 17:19:42 UTC
Probably some python-requests breakage, or a conflict between versions on your machine, like a system installed version vs a pip installed version. Does this fail too?

python -c 'import requests; print requests'

Comment 9 Miguel Perez Colino 2017-06-08 07:50:20 UTC
I'm afraid that it fails too ...

[mperezco@hal:~]$ python -c 'import requests; print requests'
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/usr/lib/python2.7/site-packages/requests/__init__.py", line 63, in <module>
    from . import utils
  File "/usr/lib/python2.7/site-packages/requests/utils.py", line 28, in <module>
    from .compat import (
ImportError: cannot import name proxy_bypass_environment

(BTW, thanks for checking it Cole, please let me know if I can help debugging it: miguel at redhat dot com)

Comment 11 Miguel Perez Colino 2017-06-08 07:51:34 UTC
I'm afraid that it fails too ...

[mperezco@hal:~]$ python -c 'import requests; print requests'
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/usr/lib/python2.7/site-packages/requests/__init__.py", line 63, in <module>
    from . import utils
  File "/usr/lib/python2.7/site-packages/requests/utils.py", line 28, in <module>
    from .compat import (
ImportError: cannot import name proxy_bypass_environment

Comment 12 Cole Robinson 2017-06-08 13:02:50 UTC
You'll need to check to see if multiple versions or requests are installed, probably via pip. Check this:

https://stackoverflow.com/questions/23378970/python-requests-importerror-no-module-named-util

But there's some similar discussions here:

https://bugzilla.redhat.com/show_bug.cgi?id=1297219
https://bugzilla.redhat.com/show_bug.cgi?id=1236312

If you can't figure it out hit me on IRC or email and I'll help. In the meantime closing this since it's likely not a virt-manager issue

Comment 13 Miguel Perez Colino 2017-06-08 15:07:56 UTC
This worked ...
[root@hal:~]# mv /usr/lib/python2.7/site-packages/requests /usr/lib/python2.7/site-packages/requests_old

[mperezco@hal:~# dnf install python-requests --best --allowerasing
Last metadata expiration check: 1:13:05 ago on Thu Jun 08 15:52:18 2017 CEST.
Package python2-requests-2.10.0-4.fc25.noarch is already installed, skipping.
Dependencies resolved.
================================================================================
 Package                 Arch          Version              Repository     Size
================================================================================
Upgrading:
 python2-requests        noarch        2.13.0-1.fc26        fedora        116 k

Transaction Summary
================================================================================
Upgrade  1 Package

Total download size: 116 k
Is this ok [y/N]: y
Downloading Packages:
python2-requests-2.13.0-1.fc26.noarch.rpm       491 kB/s | 116 kB     00:00    
--------------------------------------------------------------------------------
Total                                            99 kB/s | 116 kB     00:01     
Running transaction check
Transaction check succeeded.
Running transaction test
Transaction test succeeded.
Running transaction
  Preparing        :                                                        1/1 
  Upgrading        : python2-requests-2.13.0-1.fc26.noarch                  1/2 
  Cleanup          : python2-requests-2.10.0-4.fc25.noarch                  2/2 
warning: file /usr/lib/python2.7/site-packages/requests-2.10.0-py2.7.egg-info/top_level.txt: remove failed: No such file or directory
warning: file /usr/lib/python2.7/site-packages/requests-2.10.0-py2.7.egg-info/requires.txt: remove failed: No such file or directory
warning: file /usr/lib/python2.7/site-packages/requests-2.10.0-py2.7.egg-info/not-zip-safe: remove failed: No such file or directory
warning: file /usr/lib/python2.7/site-packages/requests-2.10.0-py2.7.egg-info/dependency_links.txt: remove failed: No such file or directory
warning: file /usr/lib/python2.7/site-packages/requests-2.10.0-py2.7.egg-info/SOURCES.txt: remove failed: No such file or directory
warning: file /usr/lib/python2.7/site-packages/requests-2.10.0-py2.7.egg-info/PKG-INFO: remove failed: No such file or directory
warning: file /usr/lib/python2.7/site-packages/requests-2.10.0-py2.7.egg-info: remove failed: No such file or directory
  Verifying        : python2-requests-2.13.0-1.fc26.noarch                  1/2 
  Verifying        : python2-requests-2.10.0-4.fc25.noarch                  2/2 

Upgraded:
  python2-requests.noarch 2.13.0-1.fc26

Comment 14 Miguel Perez Colino 2017-06-08 15:15:34 UTC
It seems that the upgrade missed the python2-requests package.
Shall we open a new bug?

Comment 15 Miguel Perez Colino 2017-06-08 15:15:44 UTC
It seems that the upgrade missed the python2-requests package.
Shall we open a new bug?

Comment 16 Cole Robinson 2017-06-08 15:19:47 UTC
(In reply to Miguel Perez Colino from comment #15)
> It seems that the upgrade missed the python2-requests package.
> Shall we open a new bug?

Maybe, but it could be that a newer python2-requests wasn't available at the time you upgraded from f25->f26

Comment 17 Miguel Perez Colino 2017-06-08 15:33:13 UTC
It's possible, but I opened it anyway:
https://bugzilla.redhat.com/show_bug.cgi?id=1459934