Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 502288 - Invalid PORTAGE_BINHOST setting produces a python traceback
Summary: Invalid PORTAGE_BINHOST setting produces a python traceback
Status: RESOLVED FIXED
Alias: None
Product: Portage Development
Classification: Unclassified
Component: Unclassified (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Portage team
URL:
Whiteboard:
Keywords: InVCS
Depends on:
Blocks: 484436
  Show dependency tree
 
Reported: 2014-02-23 23:43 UTC by Jack Morgan (RETIRED)
Modified: 2017-08-11 21:20 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jack Morgan (RETIRED) gentoo-dev 2014-02-23 23:43:57 UTC
When setting PORTAGE_BINHOST to the local filesystem in make.conf, portage produces a traceback. Recommend adding a better error as well as a comment in make.conf.example.

Reproducible: Always

Steps to Reproduce:
1. set PORTAGE_BINHOST=/usr/portage/packages
2. emerge package
3. see traceback 
Actual Results:  
traceback produced

Expected Results:  
better error message about setting PORTAGE_BINHOST to the local filesystem
Comment 1 Jack Morgan (RETIRED) gentoo-dev 2014-02-23 23:45:34 UTC
marking IN_PROGRESS per bernalex request in #gentoo-portage
Comment 2 Jeroen Roovers gentoo-dev 2014-02-24 01:16:50 UTC
Please attach all relevant information to this bug report and don't use sites not under Gentoo's control to relay such information.

Also, post actual error messages on the bug report, and preferably mention them in the Summary so that everyone else can find the bug report too.
Comment 3 Alexander Berntsen (RETIRED) gentoo-dev 2014-02-24 01:24:04 UTC
(In reply to Jeroen Roovers from comment #2)
> Please attach all relevant information to this bug report and don't use
> sites not under Gentoo's control to relay such information.
The report has all the necessary information as-is.

> Also, post actual error messages on the bug report, and preferably mention
> them in the Summary so that everyone else can find the bug report too.
The error message is irrelevant, the point is that Portage produces a Python traceback instead of a more user friendly error message.

In any case this is fixed in git now.
Comment 4 Arfrever Frehtes Taifersar Arahesis 2014-02-24 08:39:35 UTC
http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commitdiff;h=099941cc4788f469b30b9ba7222f92fba28e6b28 is wrong for multiple reasons:

- Needless assignment of exception to _.

- No code should rely on existence of 'exit'.
  Example:
    $ python -Sc 'exit'
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
    NameError: name 'exit' is not defined

- 'sys.exit' should not be used in library code.
  In 'except ValueError:' block raise a new exception of Portage-specific type (from portage.exception module) and let the caller handle it.
Comment 5 Alexander Berntsen (RETIRED) gentoo-dev 2014-02-24 09:24:54 UTC
(In reply to Arfrever Frehtes Taifersar Arahesis from comment #4)
> http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commitdiff;
> h=099941cc4788f469b30b9ba7222f92fba28e6b28 is wrong for multiple reasons
Fixed. In the future, please contact me directly on IRC. This is more efficient for me.
Comment 6 Alec Warner archtester Gentoo Infrastructure gentoo-dev Security 2014-02-24 17:08:33 UTC
(In reply to Alexander Berntsen from comment #3)
> (In reply to Jeroen Roovers from comment #2)
> > Please attach all relevant information to this bug report and don't use
> > sites not under Gentoo's control to relay such information.
> The report has all the necessary information as-is.
> 
> > Also, post actual error messages on the bug report, and preferably mention
> > them in the Summary so that everyone else can find the bug report too.
> The error message is irrelevant, the point is that Portage produces a Python
> traceback instead of a more user friendly error message.
> 
> In any case this is fixed in git now.

Alex,
I am going to tell you the same thing we told arfrever. If you commit patches without sending them to the list for review, we will remove your commit access. Please only commit reviewed patches that have seen review.

-A
Comment 7 Alexander Berntsen (RETIRED) gentoo-dev 2014-02-24 17:10:06 UTC
(In reply to Alec Warner from comment #6)
> Alex,
> I am going to tell you the same thing we told arfrever. If you commit
> patches without sending them to the list for review, we will remove your
> commit access. Please only commit reviewed patches that have seen review.
The patch was reviewed by dol-sen. I forgot to add Reviewed-By to the commit message.
Comment 8 Sven B. 2016-02-12 22:33:46 UTC
Not sure if it is related to the invalid Binhost setting. 

PORTAGE_SSH_OPTS also produces a python traceback:

Should probably exit gracefully.

Example: 
1. PORTAGE_BINHOST="https://www.google.com" emerge -g portage
2. ================================================================================================
======== Traceback for invalid call to portage.package.ebuild.config.config.__getitem__ ========
  File "/usr/lib/python-exec/python3.4/emerge", line 50, in <module>
    retval = emerge_main()
  File "/usr/lib64/python3.4/site-packages/_emerge/main.py", line 1185, in emerge_main
    return run_action(emerge_config)
  File "/usr/lib64/python3.4/site-packages/_emerge/actions.py", line 2866, in run_action
    getbinpkgs="--getbinpkg" in emerge_config.opts)
  File "/usr/lib64/python3.4/site-packages/portage/dbapi/bintree.py", line 525, in populate
    self._populate(getbinpkgs)
  File "/usr/lib64/python3.4/site-packages/portage/dbapi/bintree.py", line 909, in _populate
    fcmd_vars[k] = self.settings[k]
  File "/usr/lib64/python3.4/site-packages/portage/package/ebuild/config.py", line 2570, in __getitem__
    return self._getitem(key)
  File "/usr/lib64/python3.4/site-packages/portage/package/ebuild/config.py", line 2623, in _getitem
    raise KeyError(mykey)
KeyError: 'PORTAGE_SSH_OPTS'
================================================================================================

Portage 2.2.27 (python 3.4.3-final-0, default/linux/amd64/13.0/desktop, gcc-5.3.0, glibc-2.22-r1, 4.4.1-gentoo x86_64)
Comment 9 Zac Medico gentoo-dev 2016-02-13 02:05:15 UTC
(In reply to Sven B. from comment #8)
> Not sure if it is related to the invalid Binhost setting. 
> 
> PORTAGE_SSH_OPTS also produces a python traceback:

That's bug 572494