Opened at 2015-05-27T21:14:16Z
Closed at 2015-07-29T00:41:33Z
#2436 closed defect (fixed)
"tahoe --version" shouldn't show scary diagnostic warnings
Reported by: | warner | Owned by: | daira |
---|---|---|---|
Priority: | normal | Milestone: | 1.10.2 |
Component: | packaging | Version: | 1.10.0 |
Keywords: | error packaging setuptools | Cc: | |
Launchpad Bug: |
Description
It is very common for tahoe --version to report diagnostics warnings about the difference between what pkg_resources claims to provide, and what the actual imported modules (and their __version__) reports. These warnings have convinced several users that their tahoe installation has failed, when in fact everything will would work normally apart from those warnings.
Zooko and I agreed on IRC to change tahoe --version to report the versions of Tahoe itself and its dependencies (foolscap, pycryptopp, etc), but to remove the import-vs-pkg_resources warnings. We'll add a separate tahoe debug versions command that emits complete diagnostics.
For reference, this is what the problematic output looks like:
% bin/tahoe -V allmydata-tahoe: 1.10.0 foolscap: 0.8.0 pycryptopp: 0.6.0.1206569328141510525648634803928199668821045408958 zfec: 1.4.24 Twisted: 13.0.0 Nevow: 0.11.1 zope.interface: unknown python: 2.7.9 platform: Linux-fedora_22-x86_64-64bit_ELF pyOpenSSL: 0.14 simplejson: 3.7.2 pycrypto: 2.6.1 pyasn1: 0.1.7 mock: 1.0.1 setuptools: 0.6c16dev4 Warning: dependency 'pycparser' (version '2.10') found by pkg_resources not found by import. Warning: dependency 'six' (version '1.9.0') found by pkg_resources not found by import. Warning: dependency 'cryptography' (version '0.8.2') found by pkg_resources not found by import. Warning: dependency 'cffi' (version '0.8.6') found by pkg_resources not found by import. Warning: dependency 'pyasn1-modules' (version '0.0.5') found by pkg_resources not found by import. Warning: dependency 'enum34' (version '1.0') found by pkg_resources not found by import. Warning: dependency 'characteristic' (version '14.3.0') found by pkg_resources not found by import. Warning: dependency 'service-identity' (version '14.0.0') found by pkg_resources not found by import. For debugging purposes, the PYTHONPATH was '/home/olabini/workspace/SPEAR/tahoe/allmydata-tahoe-1.10.0/support/lib/python2.7/site-packages' install_requires was ['setuptools >= 0.6c6', 'zfec >= 1.1.0', 'simplejson >= 1.4', 'zope.interface == 3.6.0, == 3.6.1, == 3.6.2, >= 3.6.5', 'Twisted >= 11.0.0', 'foolscap >= 0.6.3', 'pyOpenSSL', 'Nevow >= 0.6.0', 'pycrypto == 2.1.0, == 2.3, >= 2.4.1', 'pyasn1 >= 0.0.8a', 'mock >= 0.8.0', 'pycryptopp >= 0.6.0'] sys.path after importing pkg_resources was /home/olabini/workspace/SPEAR/tahoe/allmydata-tahoe-1.10.0/support/bin: /home/olabini/workspace/SPEAR/tahoe/allmydata-tahoe-1.10.0/support/lib/python2.7/site-packages/setuptools-0.6c16dev4.egg: /home/olabini/workspace/SPEAR/tahoe/allmydata-tahoe-1.10.0/src: /home/olabini/workspace/SPEAR/tahoe/allmydata-tahoe-1.10.0/support/lib/python2.7/site-packages/pycryptopp-0.6.0.1206569328141510525648634803928199668821045408958-py2.7-linux-x86_64.egg: /home/olabini/workspace/SPEAR/tahoe/allmydata-tahoe-1.10.0/support/lib/python2.7/site-packages/mock-1.0.1-py2.7.egg: /home/olabini/workspace/SPEAR/tahoe/allmydata-tahoe-1.10.0/support/lib/python2.7/site-packages/Nevow-0.11.1-py2.7.egg: /home/olabini/workspace/SPEAR/tahoe/allmydata-tahoe-1.10.0/support/lib/python2.7/site-packages/foolscap-0.8.0-py2.7.egg: /home/olabini/workspace/SPEAR/tahoe/allmydata-tahoe-1.10.0/support/lib/python2.7/site-packages/zfec-1.4.24-py2.7-linux-x86_64.egg: /home/olabini/workspace/SPEAR/tahoe/allmydata-tahoe-1.10.0/support/lib/python2.7/site-packages/service_identity-14.0.0-py2.7.egg: /home/olabini/workspace/SPEAR/tahoe/allmydata-tahoe-1.10.0/support/lib/python2.7/site-packages/pyutil-2.0.0-py2.7.egg: /home/olabini/workspace/SPEAR/tahoe/allmydata-tahoe-1.10.0/support/lib/python2.7/site-packages/pyasn1_modules-0.0.5-py2.7.egg: /home/olabini/workspace/SPEAR/tahoe/allmydata-tahoe-1.10.0/support/lib/python2.7/site-packages/characteristic-14.3.0-py2.7.egg: /home/olabini/workspace/SPEAR/tahoe/allmydata-tahoe-1.10.0/support/lib/python2.7/site-packages/zbase32-1.1.5-py2.7.egg: /home/olabini/workspace/SPEAR/tahoe/allmydata-tahoe-1.10.0/support/lib/python2.7/site-packages/Twisted-13.0.0-py2.7-linux-x86_64.egg: /home/olabini/workspace/SPEAR/tahoe/allmydata-tahoe-1.10.0/support/lib/python2.7/site-packages/zope.interface-4.1.2-py2.7-linux-x86_64.egg: /home/olabini/workspace/SPEAR/tahoe/allmydata-tahoe-1.10.0/support/lib/python2.7/site-packages: /usr/lib64/python27.zip: /usr/lib64/python2.7: /usr/lib64/python2.7/plat-linux2: /usr/lib64/python2.7/lib-tk: /usr/lib64/python2.7/lib-old: /usr/lib64/python2.7/lib-dynload: /usr/lib64/python2.7/site-packages: /usr/lib64/python2.7/site-packages/gst-0.10: /usr/lib64/python2.7/site-packages/gtk-2.0: /usr/lib/python2.7/site-packages
The output is large enough that, depending upon the size of your screen, you may wind up with the scary "Warning:... not found by import" lines at the top of the screen, which sounds an awful lot like an ImportError.
Change History (18)
comment:1 Changed at 2015-05-29T14:53:59Z by zooko
comment:2 Changed at 2015-05-29T15:05:50Z by zooko
https://twitter.com/olabini/status/604300869832597504
"the printing of sys.path REALLY looks like a stack trace btw."
I think a lesson here is never to show output to a user that looks like a stack trace, i.e. has a list of lines where the beginning of each line is a filename/pathname. I've seen this before: if a user sees something that looks like a stack trace, they immediately avert their gaze and assume that the software is malfunctioning.
comment:3 Changed at 2015-05-29T19:11:15Z by warner
What if tahoe --version emitted just the versions and a single line that said "warning: not all dependency versions matched expectations. Run 'tahoe debug versions' for more info." ? And then we move all that other (scary) stuff to the other command?
comment:4 Changed at 2015-06-01T05:34:22Z by warner
- Milestone changed from 1.10.1 to 1.11.0
Moving this out of 1.10.1, insufficient consensus to make a last-minute change.
comment:5 Changed at 2015-07-17T21:41:02Z by daira
- Milestone changed from 1.11.0 to 1.10.2
comment:6 Changed at 2015-07-17T21:43:06Z by daira
The issue I have with not displaying a warning is that the printed versions may not be correct. However, I'm okay with printing a short warning on the line that displays each offending version (in the "comment" field), and suppressing the long debugging information in cases where that is the only problem.
comment:7 Changed at 2015-07-17T21:49:10Z by daira
So in the example in the description, for instance, the output would be:
allmydata-tahoe: 1.10.0 foolscap: 0.8.0 pycryptopp: 0.6.0.1206569328141510525648634803928199668821045408958 zfec: 1.4.24 Twisted: 13.0.0 Nevow: 0.11.1 zope.interface: unknown python: 2.7.9 platform: Linux-fedora_22-x86_64-64bit_ELF pyOpenSSL: 0.14 simplejson: 3.7.2 pycrypto: 2.6.1 pyasn1: 0.1.7 mock: 1.0.1 setuptools: 0.6c16dev4 pycparser: 2.10 [according to pkg_resources] six: 1.9.0 [according to pkg_resources] cryptography: 0.8.2 [according to pkg_resources] cffi: 0.8.6 [according to pkg_resources] pyasn1-modules: 0.0.5 [according to pkg_resources] enum34: 1.0 [according to pkg_resources] characteristic: 14.3.0 [according to pkg_resources] service-identity: 14.0.0 [according to pkg_resources]
comment:8 Changed at 2015-07-17T21:51:23Z by daira
- Component changed from code to packaging
- Keywords error packaging setuptools zookos-opinion-needed warners-opinion-needed added
- Owner set to warner
comment:9 Changed at 2015-07-17T23:32:32Z by warner
That sounds like a good compromise to me. I think I'll use () instead of [].
comment:10 Changed at 2015-07-18T01:23:32Z by daira
[] is already used for comments; () is used for paths when --version-and-path is given. I want the output to remain consistently parsable.
comment:11 Changed at 2015-07-21T17:57:00Z by daira
- Keywords review-needed added; zookos-opinion-needed warners-opinion-needed removed
Review needed for https://github.com/tahoe-lafs/tahoe-lafs/pull/176.
comment:12 Changed at 2015-07-21T17:57:55Z by zooko
- Owner changed from warner to zooko
- Status changed from new to assigned
comment:13 Changed at 2015-07-21T17:59:34Z by Daira Hopwood <daira@…>
- Resolution set to fixed
- Status changed from assigned to closed
comment:14 Changed at 2015-07-21T19:46:56Z by daira
- Resolution fixed deleted
- Status changed from closed to reopened
Oops, I just spotted a bug. get_package_versions_string extends _vers_and_locs_list each time it is called (assuming not hasattr(sys, 'frozen')), but it may be called more than once.
I will fix it.
comment:15 Changed at 2015-07-21T19:47:06Z by daira
- Owner changed from zooko to daira
- Status changed from reopened to new
comment:16 Changed at 2015-07-21T19:47:19Z by daira
- Keywords review-needed removed
- Status changed from new to assigned
comment:17 Changed at 2015-07-29T00:40:35Z by Daira Hopwood <daira@…>
comment:18 Changed at 2015-07-29T00:41:33Z by warner
- Resolution set to fixed
- Status changed from assigned to closed
Landed in 28399b6.
On IRC Daira said that she thinks all of the warnings shown in the user-supplied output above have been fixed in trunk. I'll ask the user to try the 10.1a1post9 tarball.