JanDeDobbeleer/oh-my-posh · warning

unable to get data for team %s

Error message

unable to get data for team %s

What it means

The NBA segment fetches available game data for a team from the NHL/NBA stats API. If the HTTP request fails, 'unable to get data for team <team>' is logged (joined with the underlying error) and the raw error is returned, disabling the segment.

Source

Thrown at src/segments/nba.go:289

	// If the score endpoint doesn't have anything get data from the schedule endpoint
	data, err = nba.retrieveScheduleData(teamName, httpTimeout)
	if err == nil {
		return data, nil
	}

	return nil, err
}

func (nba *Nba) getResult() (*NBAData, error) {
	teamName := nba.options.String(TeamName, "")

	httpTimeout := nba.options.Int(options.HTTPTimeout, options.DefaultHTTPTimeout)

	log.Debug("fetching available data for " + teamName)

	data, err := nba.getAvailableGameData(teamName, httpTimeout)
	if err != nil {
		log.Error(errors.Join(err, fmt.Errorf("unable to get data for team %s", teamName)))
		return nil, err
	}

	if !data.GameStatus.Valid() {
		err := fmt.Errorf("%d is not a valid game status", data.GameStatus)
		log.Error(err)
		return nil, err
	}

	return data, nil
}

View on GitHub (pinned to 0976794618)

Solutions

  1. Verify network access to the stats API endpoint and any proxy settings
  2. Check the team name/abbreviation in the segment config is valid
  3. Increase the segment's HTTP timeout option if the API is slow
  4. Hide the segment when offline or accept it disappearing; consider a template/enable fallback

Example fix

// before
"nba": { "team": "LAL", "http_timeout": 500 }
// after: give the API more time
"nba": { "team": "Lakers", "http_timeout": 2000 }
Defensive patterns

Strategy: retry

Validate before calling

// preflight the API before rendering
resp, err := http.Get("https://statsapi.web.nhl.com/api/v1/teams/LAL")
if err != nil || resp.StatusCode != 200 { /* hide segment */ }

Try / catch

// segment returns (nil, err); treat as 'no data this prompt'
result, err := getResult(team)
if err != nil {
    // fall back to last-known data or hide the segment
}

Prevention

When it happens

Trigger: Rendering an NBA/NHL segment when getAvailableGameData fails: no network connectivity, the stats API being down or rate-limiting, an invalid/unsupported team name in the config, or the configured HTTP timeout expiring.

Common situations: Corporate proxy or firewall blocking the stats API; API endpoint changed/retired upstream; typo'd team name/abbreviation in the theme config; offline laptop triggering the segment on every prompt.

Understand the failure class

Background: 'Something went wrong' / 'Request failed (500)' / 'HTTP error! status: 404' — what failed HTTP requests actually mean and how to find the real cause — this error's family across 28 libraries.

Related errors


AI-assisted analysis of JanDeDobbeleer/oh-my-posh@0976794618 (2026-08-31). Data as JSON: /api/errors/f29b6b6dcf8dc6a5. Report an issue: GitHub.