Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

EOFError when invalid credentials are provided for index #3088

Closed
Vayel opened this issue Oct 23, 2018 · 3 comments
Closed

EOFError when invalid credentials are provided for index #3088

Vayel opened this issue Oct 23, 2018 · 3 comments
Assignees
Labels
Type: Bug 🐛 This issue is a bug. Type: Vendored Dependencies This issue affects vendored dependencies within pipenv.

Comments

@Vayel
Copy link

Vayel commented Oct 23, 2018

Issue description

When invalid credentials are provided for an index, a EOFError is raised.

Expected result

I expect either the credentials to be prompted in the command line or an exception to be raised if I configured pipenv this way (by setting prompting=False here).

Actual result

Pipfile.lock not found, creating…
Locking [dev-packages] dependencies…
Locking [packages] dependencies…
using sources: [{'url': 'https://pypi.org/simple', 'verify_ssl': True, 'name': 'pypi'}, {'url': 'https://v:p@simudyne.jfrog.io/simudyne/api/pypi/simudyne-pypi/simple', 'verify_ssl': True, 'name': 'simudyne_pypi'}]
Using pip: -i https://pypi.org/simple --extra-index-url https://v:p@simudyne.jfrog.io/simudyne/api/pypi/simudyne-pypi/simple

                          ROUND 1                           
Current constraints:
  ipykernel
  simudyne

Finding the best candidates:
User for simudyne.jfrog.io: 
Traceback (most recent call last):
  File "/home/simudyne/.local/lib/python3.6/site-packages/pipenv/resolver.py", line 101, in <module>
    main()
  File "/home/simudyne/.local/lib/python3.6/site-packages/pipenv/resolver.py", line 90, in main
    system=system,
  File "/home/simudyne/.local/lib/python3.6/site-packages/pipenv/resolver.py", line 73, in resolve
    allow_global=system,
  File "/home/simudyne/.local/lib/python3.6/site-packages/pipenv/utils.py", line 422, in resolve_deps
    req_dir=req_dir,
  File "/home/simudyne/.local/lib/python3.6/site-packages/pipenv/utils.py", line 302, in actually_resolve_deps
    results = resolver.resolve(max_rounds=environments.PIPENV_MAX_ROUNDS)
  File "/home/simudyne/.local/lib/python3.6/site-packages/pipenv/patched/piptools/resolver.py", line 102, in resolve
    has_changed, best_matches = self._resolve_one_round()
  File "/home/simudyne/.local/lib/python3.6/site-packages/pipenv/patched/piptools/resolver.py", line 198, in _resolve_one_round
    best_matches = {self.get_best_match(ireq) for ireq in constraints}
  File "/home/simudyne/.local/lib/python3.6/site-packages/pipenv/patched/piptools/resolver.py", line 198, in <setcomp>
    best_matches = {self.get_best_match(ireq) for ireq in constraints}
  File "/home/simudyne/.local/lib/python3.6/site-packages/pipenv/patched/piptools/resolver.py", line 263, in get_best_match
    best_match = self.repository.find_best_match(ireq, prereleases=self.prereleases)
  File "/home/simudyne/.local/lib/python3.6/site-packages/pipenv/patched/piptools/repositories/pypi.py", line 165, in find_best_match
    all_candidates = clean_requires_python(self.find_all_candidates(ireq.name))
  File "/home/simudyne/.local/lib/python3.6/site-packages/pipenv/patched/piptools/repositories/pypi.py", line 153, in find_all_candidates
    candidates = self.finder.find_all_candidates(req_name)
  File "/home/simudyne/.local/lib/python3.6/site-packages/pipenv/patched/notpip/_internal/index.py", line 479, in find_all_candidates
    for page in self._get_pages(url_locations, project_name):
  File "/home/simudyne/.local/lib/python3.6/site-packages/pipenv/patched/notpip/_internal/index.py", line 628, in _get_pages
    page = self._get_page(location)
  File "/home/simudyne/.local/lib/python3.6/site-packages/pipenv/patched/notpip/_internal/index.py", line 746, in _get_page
    return HTMLPage.get_page(link, session=self.session)
  File "/home/simudyne/.local/lib/python3.6/site-packages/pipenv/patched/notpip/_internal/index.py", line 855, in get_page
    "Cache-Control": "max-age=600",
  File "/home/simudyne/.local/lib/python3.6/site-packages/pipenv/patched/notpip/_vendor/requests/sessions.py", line 525, in get
    return self.request('GET', url, **kwargs)
  File "/home/simudyne/.local/lib/python3.6/site-packages/pipenv/patched/notpip/_internal/download.py", line 397, in request
    return super(PipSession, self).request(method, url, *args, **kwargs)
  File "/home/simudyne/.local/lib/python3.6/site-packages/pipenv/patched/notpip/_vendor/requests/sessions.py", line 512, in request
    resp = self.send(prep, **send_kwargs)
  File "/home/simudyne/.local/lib/python3.6/site-packages/pipenv/patched/notpip/_vendor/requests/sessions.py", line 629, in send
    r = dispatch_hook('response', hooks, r, **kwargs)
  File "/home/simudyne/.local/lib/python3.6/site-packages/pipenv/patched/notpip/_vendor/requests/hooks.py", line 31, in dispatch_hook
    _hook_data = hook(hook_data, **kwargs)
  File "/home/simudyne/.local/lib/python3.6/site-packages/pipenv/patched/notpip/_internal/download.py", line 189, in handle_401
    username = six.moves.input("User for %s: " % parsed.netloc)
EOFError: EOF when reading a line

Steps to replicate

[[source]]
url = "https://pypi.org/simple"
verify_ssl = true
name = "pypi"

[[source]]
url = "https://${SIMUDYNE_USER}:${SIMUDYNE_PASSWORD}@simudyne.jfrog.io/simudyne/api/pypi/simudyne-pypi/simple"
verify_ssl = true
name = "simudyne_pypi"

[packages]
ipykernel = "*"
simudyne = {version = "*", index = "simudyne_pypi"}
export SIMUDYNE_USER="valid_or_invalid_user"
export SIMUDYNE_PASSWORD="invalid_password"
pipenv install

$ pipenv --support

Pipenv version: '2018.10.13'

Pipenv location: '/home/simudyne/.local/lib/python3.6/site-packages/pipenv'

Python location: '/home/simudyne/anaconda3/bin/python3'

Python installations found:

  • 3.6.6: /usr/bin/python3.6
  • 3.6.6: /usr/bin/python3.6m
  • 2.7.15rc1: /usr/bin/python2.7

PEP 508 Information:

{'implementation_name': 'cpython',
 'implementation_version': '3.6.4',
 'os_name': 'posix',
 'platform_machine': 'x86_64',
 'platform_python_implementation': 'CPython',
 'platform_release': '4.15.0-36-generic',
 'platform_system': 'Linux',
 'platform_version': '#39-Ubuntu SMP Mon Sep 24 16:19:09 UTC 2018',
 'python_full_version': '3.6.4',
 'python_version': '3.6',
 'sys_platform': 'linux'}

System environment variables:

  • CLUTTER_IM_MODULE
  • SIMUDYNE_PASSWORD
  • LS_COLORS
  • LESSCLOSE
  • XDG_MENU_PREFIX
  • LANG
  • GDM_LANG
  • DISPLAY
  • OLDPWD
  • GTK2_MODULES
  • COLORTERM
  • XDG_VTNR
  • SSH_AUTH_SOCK
  • MANDATORY_PATH
  • XDG_SESSION_ID
  • XDG_GREETER_DATA_DIR
  • USER
  • DESKTOP_SESSION
  • QT4_IM_MODULE
  • TEXTDOMAINDIR
  • GNOME_TERMINAL_SCREEN
  • DEFAULTS_PATH
  • QT_QPA_PLATFORMTHEME
  • PWD
  • HOME
  • TEXTDOMAIN
  • SSH_AGENT_PID
  • QT_ACCESSIBILITY
  • XDG_SESSION_TYPE
  • XDG_DATA_DIRS
  • XDG_SESSION_DESKTOP
  • GJS_DEBUG_OUTPUT
  • GTK_MODULES
  • TERM
  • SHELL
  • VTE_VERSION
  • XDG_SEAT_PATH
  • QT_IM_MODULE
  • XMODIFIERS
  • IM_CONFIG_PHASE
  • XDG_CURRENT_DESKTOP
  • GPG_AGENT_INFO
  • GNOME_TERMINAL_SERVICE
  • XDG_SEAT
  • SHLVL
  • LANGUAGE
  • GDMSESSION
  • GNOME_DESKTOP_SESSION_ID
  • LOGNAME
  • DBUS_SESSION_BUS_ADDRESS
  • XDG_RUNTIME_DIR
  • XAUTHORITY
  • XDG_SESSION_PATH
  • XDG_CONFIG_DIRS
  • PATH
  • GJS_DEBUG_TOPICS
  • SESSION_MANAGER
  • SIMUDYNE_USER
  • LESSOPEN
  • GTK_IM_MODULE
  • _
  • PYTHONDONTWRITEBYTECODE
  • PIP_SHIMS_BASE_MODULE
  • PIP_PYTHON_PATH

Pipenv–specific environment variables:

Debug–specific environment variables:

  • PATH: /home/simudyne/anaconda3/bin:/home/simudyne/bin:/home/simudyne/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin
  • SHELL: /bin/bash
  • LANG: en_GB.UTF-8
  • PWD: /tmp/python-client-app-example

Contents of Pipfile ('/tmp/python-client-app-example/Pipfile'):

[[source]]
url = "https://pypi.org/simple"
verify_ssl = true
name = "pypi"

[[source]]
url = "https://${SIMUDYNE_USER}:${SIMUDYNE_PASSWORD}@simudyne.jfrog.io/simudyne/api/pypi/simudyne-pypi/simple"
verify_ssl = true
name = "simudyne_pypi"

[packages]
ipykernel = "*"
simudyne = {version = "*", index = "simudyne_pypi"}
@uranusjr
Copy link
Member

This looks like a problem in pip.

@techalchemy
Copy link
Member

It's not, we need to pass PIP_NO_INPUT

@uranusjr
Copy link
Member

Ah OK, pip gives a prompt in this situation.

techalchemy added a commit that referenced this issue Oct 24, 2018
- Fix #3020
- Fix #3088
- Patch delegator
- Add weakref finalizer for tempfiles

Signed-off-by: Dan Ryan <dan@danryan.co>
@techalchemy techalchemy self-assigned this Oct 29, 2018
@techalchemy techalchemy added Type: Bug 🐛 This issue is a bug. Type: Vendored Dependencies This issue affects vendored dependencies within pipenv. labels Oct 29, 2018
techalchemy added a commit that referenced this issue Oct 30, 2018
Signed-off-by: Dan Ryan <dan@danryan.co>

Update vendored dependencies

Signed-off-by: Dan Ryan <dan@danryan.co>

Fix file handle leaks

- Fix #3020
- Fix #3088
- Patch delegator
- Add weakref finalizer for tempfiles

Signed-off-by: Dan Ryan <dan@danryan.co>

Fix spinner handlers on windows

Signed-off-by: Dan Ryan <dan@danryan.co>

Fix spinner output and encoding issue

Signed-off-by: Dan Ryan <dan@danryan.co>

fix encoding

Signed-off-by: Dan Ryan <dan@danryan.co>

Fix unicode output on windows, fix tomlkit imports

Signed-off-by: Dan Ryan <dan@danryan.co>

Unvendor boltons, fix compatibility, update merge functionalities

Signed-off-by: Dan Ryan <dan@danryan.co>

Update pythonfinder, vistir version, requirementslib version

Signed-off-by: Dan Ryan <dan@danryan.co>

Fix vendoring script

Signed-off-by: Dan Ryan <dan@danryan.co>

Silence pip version checks

Signed-off-by: Dan Ryan <dan@danryan.co>

Add debugging to locking

Signed-off-by: Dan Ryan <dan@danryan.co>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Bug 🐛 This issue is a bug. Type: Vendored Dependencies This issue affects vendored dependencies within pipenv.
Projects
None yet
Development

No branches or pull requests

3 participants