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

Fix typo in command to log pip-diff failure #832

Merged
merged 1 commit into from
Sep 30, 2019

Conversation

cjolowicz
Copy link
Contributor

@cjolowicz cjolowicz commented Aug 23, 2019

Due to a typo, mount(8) is invoked instead of mcount from heroku/buildpack-stdlib.

The pip-diff tool from vendor/pip-pop is used to determine stale requirements. When pip-diff encounters an unexpected failure, a count should be logged using mcount.

@cjolowicz
Copy link
Contributor Author

cjolowicz commented Aug 23, 2019

It appears that Travis CI is broken for external pull requests because the environment variables HEROKU_API_USER and HEROKU_API_KEY are secret and thus not available to pull requests from another repository.

/home/travis/build/heroku/heroku-buildpack-python/vendor/bundle/ruby/2.4.0/gems/heroku_hatchet-4.0.6/etc/ci_setup.rb:10:
in `fetch': key not found: "HEROKU_API_USER" (KeyError)

See https://github.com/heroku/hatchet/blob/master/README.md#install


You can see the same changes actually passing CI in this PR in my fork:

This PR is based against my fork, with HEROKU_API_USER and HEROKU_API_KEY linked to my own account, so the Heroku credentials are available to the CI jobs.

I would like to contribute some other changes (see cjolowicz/heroku-buildpack-python#13 and cjolowicz/heroku-buildpack-python#14), so I'm wondering how to best make PRs for this repository.

This was referenced Aug 24, 2019
@cjolowicz cjolowicz closed this Aug 24, 2019
@cjolowicz cjolowicz deleted the fix-mcount-typo branch August 24, 2019 17:26
@cjolowicz cjolowicz restored the fix-mcount-typo branch August 24, 2019 17:27
@cjolowicz cjolowicz reopened this Aug 24, 2019
@cjolowicz cjolowicz mentioned this pull request Aug 28, 2019
@cjolowicz
Copy link
Contributor Author

cjolowicz commented Aug 30, 2019

Here is an example for when this bug is hit. pip-diff failed because the cached requirements.txt referenced a file that had been removed. After the traceback, mount is invoked, resulting in an error message (see last line).

Traceback (most recent call last):
  File "/app/.heroku/python/lib/python3.7/site-packages/pip/_internal/download.py", line 665, in get_file_content
    with open(url, 'rb') as f:
FileNotFoundError: [Errno 2] No such file or directory: 'requirements/base.txt'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
  File "/app/tmp/buildpacks/33e977e2b813adb8f433f2a7adcfb3ddb2a56e566732d9bbea567c8a3d9f23de56cc92a95c5eceecf6c023272911ba623f1932889b0b52ecd7f577446edfa659/vendor/pip-pop/pip-diff", line 132, in <module>
    main()
  File "/app/tmp/buildpacks/33e977e2b813adb8f433f2a7adcfb3ddb2a56e566732d9bbea567c8a3d9f23de56cc92a95c5eceecf6c023272911ba623f1932889b0b52ecd7f577446edfa659/vendor/pip-pop/pip-diff", line 128, in main
    diff(**kwargs)
  File "/app/tmp/buildpacks/33e977e2b813adb8f433f2a7adcfb3ddb2a56e566732d9bbea567c8a3d9f23de56cc92a95c5eceecf6c023272911ba623f1932889b0b52ecd7f577446edfa659/vendor/pip-pop/pip-diff", line 100, in diff
    r1 = Requirements(r1)
  File "/app/tmp/buildpacks/33e977e2b813adb8f433f2a7adcfb3ddb2a56e566732d9bbea567c8a3d9f23de56cc92a95c5eceecf6c023272911ba623f1932889b0b52ecd7f577446edfa659/vendor/pip-pop/pip-diff", line 44, in __init__
    self.load(reqfile)
  File "/app/tmp/buildpacks/33e977e2b813adb8f433f2a7adcfb3ddb2a56e566732d9bbea567c8a3d9f23de56cc92a95c5eceecf6c023272911ba623f1932889b0b52ecd7f577446edfa659/vendor/pip-pop/pip-diff", line 54, in load
    for requirement in parse_requirements(reqfile, finder=finder, session=requests):
  File "/app/.heroku/python/lib/python3.7/site-packages/pip/_internal/req/req_file.py", line 113, in parse_requirements
    for req in req_iter:
  File "/app/.heroku/python/lib/python3.7/site-packages/pip/_internal/req/req_file.py", line 233, in process_line
    for req in parsed_reqs:
  File "/app/.heroku/python/lib/python3.7/site-packages/pip/_internal/req/req_file.py", line 104, in parse_requirements
    filename, comes_from=comes_from, session=session
  File "/app/.heroku/python/lib/python3.7/site-packages/pip/_internal/download.py", line 669, in get_file_content
    'Could not open requirements file: %s' % str(exc)
pip._internal.exceptions.InstallationError: Could not open requirements file: [Errno 2] No such file or directory: 'requirements/base.txt'
mount: failure.bad-requirements: No such file or directory

The pip-diff tool from vendor/pip-pop is used to determine stale
requirements. When pip-diff encounters an unexpected failure, a count is
logged using mcount from heroku/buildpack-stdlib.

Due to a typo, mount(8) was invoked instead of mcount, with an invalid
argument.
@cjolowicz
Copy link
Contributor Author

Rebased onto master (v157).

@CaseyFaist CaseyFaist mentioned this pull request Sep 27, 2019
@CaseyFaist CaseyFaist merged commit 0c701de into heroku:master Sep 30, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants