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 Connection Error #1708

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Fix Connection Error #1708

wants to merge 1 commit into from

Conversation

ShivaniKumar1
Copy link

The error being returned is misleading. The error that should be returned should be something like
output::error <<-EOF Error: Python Connection timeout error EOF meta_set "failure_reason" "connection-timeout"
The error "python version not found" has nothing to do with the connection being timeout.

@ShivaniKumar1 ShivaniKumar1 requested a review from a team as a code owner December 2, 2024 21:58

For a list of the supported Python versions, see:
https://devcenter.heroku.com/articles/python-support#supported-runtimes
Error: Python Connection timeout
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi! Thank you for the PR.

I agree this error message needs improving (fixing this was in my longer term todo list), since it currently doesn't distinguish between the 404 case and other failure modes.

However, unfortunately this new error message will also not be correct most of the time either. For example:

  • Some Python versions are not available on some stacks (eg Python 3.8 is not available on Heroku-22 and newer)
  • The download could fail for other reasons that aren't a timeout (for example an HTTP 500 from S3 being down)

As such, this change would cause the Python 3.8 tests here to fail:

it 'aborts the build with a version not available message' do
app.deploy do |app|
expect(clean_output(app.output)).to include(<<~OUTPUT)
remote: -----> Python app detected
remote: -----> Using Python 3.8 specified in .python-version
remote:
remote: ! Error: Python #{LATEST_PYTHON_3_8} isn't available for this stack (#{app.stack}).
remote: !
remote: ! For a list of the supported Python versions, see:
remote: ! https://devcenter.heroku.com/articles/python-support#supported-runtimes
remote:
remote: ! Push rejected, failed to compile Python app.
OUTPUT

To fix all cases here, we'll need to inspect the HTTP status code from curl and vary the error message accordingly. Or we could wait until Python 3.8 support is dropped (which will be happening soon), since at that point all Python versions are available on all stacks.

@edmorley edmorley linked an issue Dec 18, 2024 that may be closed by this pull request
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.

Improve error handling for connection timeout
2 participants