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

[Bug]: Connection issues with nba-api on AWS EC2 (Error 10054 / Timeout) #498

Closed
mvrebolo opened this issue Jan 14, 2025 · 1 comment
Closed
Labels
endpoint: third-party issue Issues, unrelated to the library, that exists within the 3rd-party's API service.

Comments

@mvrebolo
Copy link

NBA API Version

1.1.13

Issue

Hi,

I'm encountering a persistent issue when using the nba-api package on an AWS EC2 instance. The same script works perfectly on my local machine, but when running on EC2, it fails with the following errors:

  1. ConnectionResetError: [WinError 10054] An existing connection was forcibly closed by the remote host
  2. ReadTimeoutError: HTTPSConnectionPool(host='stats.nba.com', port=443): Read timed out

Steps to Reproduce

Here's a minimal script to reproduce the issue:

from nba_api.stats.endpoints import commonteamroster

try:
    # Query for Atlanta Hawks (TeamID: 1610612737)
    roster = commonteamroster.CommonTeamRoster(team_id=1610612737).get_data_frames()
    print("Request successful!")
    print(roster[0].head())  # Print sample data
except Exception as e:
    print(f"Error: {e}")

Environment Details

Operating System: Windows Server 2019 (AWS EC2 instance)
Python Version: 3.7.9 (same as the local machine)
nba-api Version: 1.1.13

Troubleshooting Steps Tried

Configured the instance with an Elastic IP.
Ensured the security group allows outbound traffic on port 443.
Updated the system packages and Python libraries.
Tried setting custom headers and timeouts using NBAStatsHTTP.

I appreciate any help, thank you!

Marcus

Code

No response

@mvrebolo mvrebolo added bug Something isn't working triage Researching into a possible bug labels Jan 14, 2025
@rsforbes
Copy link
Collaborator

See: #176

@rsforbes rsforbes added endpoint: third-party issue Issues, unrelated to the library, that exists within the 3rd-party's API service. and removed bug Something isn't working triage Researching into a possible bug labels Jan 14, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
endpoint: third-party issue Issues, unrelated to the library, that exists within the 3rd-party's API service.
Projects
None yet
Development

No branches or pull requests

2 participants