Bug 1412275

Summary: keep getting an error calling random.Random
Product: [Fedora] Fedora Reporter: Dusty Mabe <dustymabe>
Component: anacondaAssignee: Anaconda Maintenance Team <anaconda-maint-list>
Status: CLOSED RAWHIDE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: rawhideCC: anaconda-maint-list, awilliam, cstratak, dustymabe, g.kaviyarasu, jonathan, mkolman, vanmeeuwen+fedora, vponcova
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: python3-3.6.0-7.fc26 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2017-02-14 10:07:13 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:

Description Dusty Mabe 2017-01-11 16:29:32 UTC
Description of problem:

This is a possible entropy problem but I don't really know what to do other than report it:

In rawhide anaconda-26.18-1.fc26 I get this error from dracut when booting. It doesn't happen always.


    6.868682] dracut-cmdline[216]: Traceback (most recent call last):
[    6.870162] dracut-cmdline[216]:   File "<frozen importlib._bootstrap>", line 879, in _find_spec
[    6.871634] dracut-cmdline[216]: AttributeError: '_SixMetaPathImporter' object has no attribute 'find_spec'[    6.872632] random: fast init done

[    6.873399] dracut-cmdline[216]: During handling of the above exception, another exception occurred:
[    6.874688] dracut-cmdline[216]: BlockingIOError: [Errno 11] Resource temporarily unavailable
[    6.875911] dracut-cmdline[216]: The above exception was the direct cause of the following exception:
[    6.877363] dracut-cmdline[216]: Traceback (most recent call last):
[    6.878484] dracut-cmdline[216]:   File "/sbin/parse-kickstart", line 37, in <module>
[    6.882150] dracut-cmdline[216]:     from pykickstart.parser import KickstartParser, preprocessKickstart
[    6.884129] dracut-cmdline[216]:   File "/usr/lib/python3.6/site-packages/pykickstart/parser.py", line 47, in <module>
[    6.887554] dracut-cmdline[216]:     from pykickstart import constants, version
[    6.889100] dracut-cmdline[216]:   File "/usr/lib/python3.6/site-packages/pykickstart/version.py", line 61, in <module>
[    6.890747] dracut-cmdline[216]:     from pykickstart.load import load_to_str
[    6.891890] dracut-cmdline[216]:   File "/usr/lib/python3.6/site-packages/pykickstart/load.py", line 20, in <module>
[    6.893270] dracut-cmdline[216]:     import requests
[    6.895454] dracut-cmdline[216]:   File "/usr/lib/python3.6/site-packages/requests/__init__.py", line 52, in <module>
[  OK  ] Started dracut cmdline hook.
[    6.899193] audit: type=1130 audit(1484079464.263:9): pid=1 uid=0 auid=4294967295 ses=4294967295 subj=kernel msg='unit=dracut-cmdline comm="systemd" exe="/usr/lib/systemd/systemd" hostname=? addr=? terminal=? res=success'
[    6.899173]          Starting dracut pre-udev hook...
dracut-cmdline[216]:     from .packages.urllib3.contrib import pyopenssl
[    6.902303] dracut-cmdline[216]:   File "/usr/lib/python3.6/site-packages/requests/packages/__init__.py", line 27, in <module>         Starting Open-iSCSI...

[    6.905989] dracut-cmdline[216]:     from . import urllib3
[    6.906782] dracut-cmdline[216]:   File "/usr/lib/python3.6/site-packages/requests/packages/urllib3/__init__.py", line 8, in <module>
[    6.910581] dracut-cmdline[216]:     from .connectionpool import (
[    6.911468] dracut-cmdline[216]:   File "/usr/lib/python3.6/site-packages/requests/packages/urllib3/connectionpool.py", line 11, in <module>
[    6.912762] dracut-cmdline[216]:     from .exceptions import (
[    6.913603] dracut-cmdline[216]:   File "/usr/lib/python3.6/site-packages/requests/packages/urllib3/exceptions.py", line 2, in <module>
[    6.914921] dracut-cmdline[216]:     from .packages.six.moves.http_client import (
[    6.915876] dracut-cmdline[216]:   File "<frozen importlib._bootstrap>", line 961, in _find_and_load
[    6.916794] dracut-cmdline[216]:   File "<frozen importlib._bootstrap>", line 946, in _find_and_load_unlocked
[    6.919416] dracut-cmdline[216]:   File "<frozen importlib._bootstrap>", line 881, in _find_spec
[    6.920308] dracut-cmdline[216]:   File "<frozen importlib._bootstrap>", line 858, in _find_spec_legacy
[    6.923278] dracut-cmdline[216]:   File "<frozen importlib._bootstrap>", line 435, in spec_from_loader
[    6.924518] Loading iSCSI transport class v2.0-870.
[    6.927462] dracut-cmdline[216]:   File "/usr/lib/python3.6/site-packages/requests/packages/urllib3/packages/six.py", line 216, in is_package
[    6.929205] dracut-cmdline[216]:     return hasattr(self.__get_module(fullname), "__path__")
[    6.930335] dracut-cmdline[216]:   File "/usr/lib/python3.6/site-packages/requests/packages/urllib3/packages/six.py", line 118, in __getattr__
[    6.931822] dracut-cmdline[216]:     _module = self._resolve()
[    6.933958] dracut-cmdline[216]:   File "/usr/lib/python3.6/site-packages/requests/packages/urllib3/packages/six.py", line 115, in _resolve
[    6.936604] dracut-cmdline[216]:     return _import_module(self.mod)
[    6.937608] dracut-cmdline[216]:   File "/usr/lib/python3.6/site-packages/requests/packages/urllib3/packages/six.py", line 82, in _import_module
[    6.939064] dracut-cmdline[216]:     __import__(name)
[    6.939897] dracut-cmdline[216]:   File "/usr/lib64/python3.6/http/client.py", line 71, in <module>
[    6.941132] dracut-cmdline[216]:     import email.parser
[    6.941966] dracut-cmdline[216]:   File "/usr/lib64/python3.6/email/parser.py", line 12, in <module>
[    6.943172] dracut-cmdline[216]:     from email.feedparser import FeedParser, BytesFeedParser
[    6.944262] dracut-cmdline[216]:   File "/usr/lib64/python3.6/email/feedparser.py", line 27, in <module>
[    6.945491] dracut-cmdline[216]:     from email._policybase import compat32
[    6.946447] dracut-cmdline[216]:   File "/usr/lib64/python3.6/email/_policybase.py", line 9, in <module>
[    6.947603] dracut-cmdline[216]:     from email.utils import _has_surrogates
[    6.948608] dracut-cmdline[216]:   File "/usr/lib64/python3.6/email/utils.py", line 28, in <module>
[    6.949714] dracut-cmdline[216]:     import random
[    6.950500] squashfs: version 4.0 (2009/01/31) Phillip Lougher
[    6.950482] dracut-cmdline[216]:   File "/usr/lib64/python3.6/random.py", line 742, in <module>
[    6.952483] [  OK  ] Started Open-iSCSI.
[    6.953194] audit: type=1130 audit(1484079464.316:10): pid=1 uid=0 auid=4294967295 ses=4294967295 subj=kernel msg='unit=iscsid comm="systemd" exe="/usr/lib/systemd/systemd" hostname=? addr=? terminal=? res=success'
dracut-cmdline[216]:     _inst = Random()
[    6.956727] dracut-cmdline[216]: SystemError: <class 'random.Random'> returned a result with an error set

Comment 1 Martin Kolman 2017-01-13 10:47:46 UTC
At least:

[    6.956727] dracut-cmdline[216]: SystemError: <class 'random.Random'> returned a result with an error set

Seems to correspond to:

https://bugs.python.org/issue29208

Looks like the issue even has a patch (for Python) attached that fixes the issue.

Comment 2 Martin Kolman 2017-01-13 10:49:10 UTC
Adding the Fedora Python package maintainer to CC.

Comment 3 Charalampos Stratakis 2017-01-13 16:03:13 UTC
I created a scratch build with the patch applied.

https://koji.fedoraproject.org/koji/taskinfo?taskID=17268702

Would you be able to try to reproduce the issue with these builds?

Comment 4 Dusty Mabe 2017-01-14 04:35:58 UTC
hey Charalampos - I'll try to test this but I don't know if I'll be very effective because the environment I'm seeing this in is anaconda/dracut and I'll have to research how to build that env with this new python in it. Others from that team might be able to help me. 

Thanks for sharing the build.

Comment 5 Adam Williamson 2017-01-19 17:07:15 UTC
Charalampos: could you perhaps just go ahead and backport the fix to Rawhide? It's a clear bug upstream, and the fix has landed on 3.6 branch already AIUI, so it should be safe, right? It's a bit tricky for Dusty to wedge a scratch build into the reproduction scenario for this bug.

Comment 6 Charalampos Stratakis 2017-01-19 17:12:40 UTC
(In reply to Adam Williamson from comment #5)
> Charalampos: could you perhaps just go ahead and backport the fix to
> Rawhide? It's a clear bug upstream, and the fix has landed on 3.6 branch
> already AIUI, so it should be safe, right? It's a bit tricky for Dusty to
> wedge a scratch build into the reproduction scenario for this bug.

Already commited the patch for it some days ago but python3 is FTBFS due to http://bugs.python.org/issue29324 so for the time being I am testing a patch to skip the test.

Comment 7 Charalampos Stratakis 2017-01-19 20:10:27 UTC
Building: https://koji.fedoraproject.org/koji/taskinfo?taskID=17332629

Comment 8 Dusty Mabe 2017-01-19 20:29:36 UTC
thanks. i'll test it once it is in and let you know if the problem goes away

Comment 9 Dusty Mabe 2017-01-20 03:42:35 UTC
(In reply to Charalampos Stratakis from comment #7)
> Building: https://koji.fedoraproject.org/koji/taskinfo?taskID=17332629

that build failed. can you resubmit it?

Comment 10 Charalampos Stratakis 2017-01-20 13:50:21 UTC
(In reply to Dusty Mabe from comment #9)
> (In reply to Charalampos Stratakis from comment #7)
> > Building: https://koji.fedoraproject.org/koji/taskinfo?taskID=17332629
> 
> that build failed. can you resubmit it?

Yep, random build failure. Resubmitted.

https://koji.fedoraproject.org/koji/taskinfo?taskID=17341284

Comment 11 Charalampos Stratakis 2017-01-25 14:56:09 UTC
Is the issue still appearing?

Comment 12 Dusty Mabe 2017-02-01 05:11:29 UTC
sorry, been on the road. I'll try to test this tomorrow.

Comment 13 Dusty Mabe 2017-02-14 02:42:24 UTC
Seems to be working fine for me now. Thank you! And sorry for the late reply.