robbydyer/sports

Problem with games view

Closed this issue · 23 comments

Running v 57
It only appears to be showing the team's name in place of the logo and only one team for both home and away.
IMG_1637

Showing the same team name is definitely a bug.

The team names only appear when it fails to get a logo for that team- this can happen for some teams when ESPN's API doesn't have a logo available for it. Is this happening for every game, or just this one?

It was happening for every sport. I restarted the service and now everything is working again. Not exactly a fix but maybe throw in a self restart after 24 hours? I did see that you put in a placeholder for the last release.

I hesitate to add a self-restart, as that could cause weird issues if someone were running the app outside of the systemd service.

If you want to add in your own, it would be a very straightforward cron job. Not sure if you're familiar with cron, but something like this: 00 01 * * * /usr/bin/systemctl restart sportsmatrix.service. This would restart your service at 1:00am every day. You would add this line to root's cron by running sudo crontab -e, add the line and save the file. Verify it's there with sudo crontab -l

Yeah, im familiar. Ill go ahead and add that. It's a shame you cant use something like Chris Creamer's sportslogo.net. There's just no way to connect the team abbrevs with their images. ESPN's logos seem to be filled with artifacts that don't always display appropriately

Works!

I believe this issue still exists even after a cron restart.

08:39AM warn no logo config defined, defaults will be used {"logo key": "BYU_AWAY_800x400"}
08:39AM warn no logo config defined, defaults will be used {"logo key": "USF_HOME_800x400"}
08:40AM warn no logo config defined, defaults will be used {"logo key": "ARIZ_HOME_800x400"}
08:40AM warn no logo config defined, defaults will be used {"logo key": "ORE_AWAY_800x400"}
08:40AM warn skipping disabled board {"board": "NBA"}
08:40AM warn game has not started, not fetching live data yet {"game ID": 401326362, "min until start": 694.74463259015}
08:40AM error failed to render left logo {"error": "no logo DET_HOME_64x32"}
08:40AM error failed to render right logo {"error": "no logo GB_AWAY_64x32"}
08:40AM warn game has not started, not fetching live data yet {"game ID": 401326362, "min until start": 694.74462983755}
08:40AM error failed to render left logo {"error": "no logo CIN_HOME_64x32"}
08:40AM error failed to render right logo {"error": "no logo CHI_AWAY_64x32"}
08:40AM error failed to render right logo {"error": "no logo CLE_AWAY_64x32"}
08:40AM error failed to render left logo {"error": "no logo HOU_HOME_64x32"}
08:40AM error failed to render left logo {"error": "no logo LAR_HOME_64x32"}
08:40AM error failed to render right logo {"error": "no logo IND_AWAY_64x32"}
08:40AM error failed to render right logo {"error": "no logo MIA_AWAY_64x32"}
08:40AM error failed to render left logo {"error": "no logo BUF_HOME_64x32"}
08:41AM error failed to render left logo {"error": "no logo NE_HOME_64x32"}
08:41AM error failed to render right logo {"error": "no logo NYJ_AWAY_64x32"}
08:41AM error failed to render right logo {"error": "no logo PHI_AWAY_64x32"}
08:41AM error failed to render left logo {"error": "no logo SF_HOME_64x32"}

Interestingly, the web board version looks fine and is showing the logos.

Hm, maybe try clearing all your image cache- it's kept in /tmp/sportsmatrix_logos. You can just delete that entire directory. And then restart the service

So the most recent was

Screen Shot 2021-09-21 at 9 18 19 AM

I've added a crontab line to delete all the logos and then restart at the top of every hour. Really weird. I reviewed the logos in the tmp and they all seem to be legitimate files and arent corrupt according to my image viewer.

Are you having issues with all logos, or just the ones that produce an error like failed to render left logo? You definitely should not be having to clear the logo cache every hour- that's likely to cause more issues than it solves, as you'll be re-downloading the source logos over and over.

Also, make sure you're on the latest version (v0.0.59), just to be sure

Are you having issues with all logos, or just the ones that produce an error like failed to render left logo? You definitely should not be having to clear the logo cache every hour- that's likely to cause more issues than it solves, as you'll be re-downloading the source logos over and over.

It's pretty random. It seems like the longer the board's service is running, the more the images that were showing begin to not show. Even restarting the board and not emptying the folder, it will still present the error about not being able to render the logos.

The next time you see a logo not appear that was previously, trying calling the API to clear the cache for that sport. You can do so like: curl http://myhost/api/mlb/clearcache. That doesn't delete file cache, but should clear in-memory logo cache.

Well, so far so good. And yes, I did remove the crons so they arent doing anything atm. There are two college teams who's logo arent showing consistently and they are Nebraska and Arkansas. ¯\_(ツ)_/¯

Im guessing something weird with ESPN's logo that this doesn't like.

I close this down for now.

Overnight, the logos were all gone. Saw entries in the log like:
09:02AM error failed to render left logo {"error": "no logo MIN_HOME_64x32"}

Ran the clearcache API for the MLB and this was the log entry:
09:12AM warn no logo config defined, defaults will be used {"logo key": "MIN_HOME_64x32"}

I had to do this for each board that uses team logos

Did the logos come back after running the clearcache?

That warn no logo config defined, defaults will be used message is misleading- nothing is wrong when you see that, that's normal.

That's definitely weird- I might see if I can add some extra logic to verify the in-memory logo cache is valid.

Just for added details, I am running a Raspberry Pi 3 Model B Rev 1.2 with MemTotal: 946392 kB

Im going to go ahead and shut this one down and will report back if the issue comes back. I assume you're now checking for an invalid logo and removing it from in cache to get it again from the file system?