MLB-LED-Scoreboard / mlb-led-scoreboard

An LED scoreboard for Major League Baseball :baseball:
GNU General Public License v3.0
590 stars 105 forks source link

IndexError: list index out of range (crash) #410

Closed kennedye closed 11 months ago

kennedye commented 1 year ago

This issue is a

Hardware Configuration

Software Configuration

Expected behavior

runs as expected

Actual behavior

occasionally (not always, usually only seems to happen if I leave it running for like 2-3 hours) crashes with the error listed below, same place every time too.

Additional Information

ERROR (13:15:19): Untrapped error in main!
Traceback (most recent call last):
  File "/home/pi/mlb-led-scoreboard/main.py", line 141, in <module>
    main(matrix, config)
  File "/home/pi/mlb-led-scoreboard/main.py", line 75, in main
    __refresh_games(render, data)
  File "/home/pi/mlb-led-scoreboard/main.py", line 125, in __refresh_games
    data.advance_to_next_game()
  File "/home/pi/mlb-led-scoreboard/data/__init__.py", line 75, in advance_to_next_game
    game = self.schedule.next_game()
  File "/home/pi/mlb-led-scoreboard/data/schedule.py", line 106, in next_game
    preferred_game = Game.from_ID(self._games[game_index]["game_id"], self.date)
IndexError: list index out of range
WardBrian commented 1 year ago

Can you post the config.json you are using?

kennedye commented 1 year ago

here 'tis:

{
    "preferred": {
        "teams": ["Mariners","Nationals","Orioles"],
        "divisions": ["AL West", "NL East", "AL Wild Card"]
    },
    "news_ticker": {
        "team_offday": true,
        "always_display": false,
        "preferred_teams": true,
        "traderumors": false,
        "mlb_news": false,
        "countdowns": true,
        "date": true,
        "date_format": "%A, %B %-d"
    },
    "standings": {
        "team_offday": false,
        "mlb_offday": false,
        "always_display": false,
        "display_no_games_live": false
    },
    "rotation": {
        "enabled": true,
        "scroll_until_finished": true,
        "only_preferred": false,
        "only_live": true,
        "rates": {
            "live": 15.0,
            "final": 15.0,
            "pregame": 15.0
        },
        "while_preferred_team_live": {
            "enabled": false,
            "during_inning_breaks": true
        }
    },
    "weather": {
        "apikey": "<redacted>",
        "location": "Seattle,wa,us",
        "metric_units": false
    },
    "time_format": "12h",
    "end_of_day": "00:00",
    "full_team_names": true,
    "short_team_names_for_runs_hits": true,
    "pregame_weather": true,
    "scrolling_speed": 2,
    "debug": false,
    "demo_date": false
}
ty-porter commented 11 months ago

Closing, looks like #455 cleared this up.