glanceapp/glance · error

failed to retrieve any content

Error message

failed to retrieve any content

What it means

errNoContent is a sentinel error in internal/glance/widget-utils.go meaning every attempted content fetch returned nothing usable. It is returned by the multi-source fetch helpers (e.g. fetchBytesAndString / concurrent request helpers) when all requests failed or all responses were empty, as opposed to errPartialContent when only some failed. Widgets surface it via withError and schedule an early retry.

Source

Thrown at internal/glance/widget-utils.go:20

import (
	"context"
	"crypto/tls"
	"encoding/json"
	"encoding/xml"
	"errors"
	"fmt"
	"io"
	"math/rand/v2"
	"net/http"
	"strconv"
	"sync"
	"sync/atomic"
	"time"
)

var (
	errNoContent      = errors.New("failed to retrieve any content")
	errPartialContent = errors.New("failed to retrieve some of the content")
)

const defaultClientTimeout = 5 * time.Second

var defaultHTTPClient = &http.Client{
	Transport: &http.Transport{
		MaxIdleConnsPerHost: 10,
		Proxy:               http.ProxyFromEnvironment,
	},
	Timeout: defaultClientTimeout,
}

var defaultInsecureHTTPClient = &http.Client{
	Timeout: defaultClientTimeout,
	Transport: &http.Transport{
		TLSClientConfig: &tls.Config{InsecureSkipVerify: true},
		Proxy:           http.ProxyFromEnvironment,

View on GitHub (pinned to 91324e8de7)

Solutions

  1. Verify outbound network/DNS from the Glance host (curl the failing widget's target URL).
  2. Check HTTP_PROXY/HTTPS_PROXY/NO_PROXY environment variables; defaultHTTPClient honors them, a bad proxy makes every request fail.
  3. Confirm the target service is up and the server IP is not blocked or rate-limited.
  4. Increase network throughput or move Glance closer to the target (the 5s default client timeout can be exceeded on slow links).
  5. Look at the widget's error badge in the UI; combined with logs it identifies which upstream returned nothing.
Defensive patterns

Strategy: retry

Prevention

When it happens

Trigger: A widget's update() calls one of the utils that fans out N requests (documented by its comments as 'fails when no content could be retrieved from any of the provided requests'); every request errors (network down, DNS failure, non-200 status) or every response body is empty, so the helper returns errNoContent.

Common situations: Container has no internet or DNS is broken; a site changed its API and every URL 404s; HTTP_PROXY/HTTPS_PROXY env vars (defaultHTTPClient uses http.ProxyFromEnvironment) point to a dead proxy; target site rate-limits or blocks the server IP; 5s defaultClientTimeout exceeded on slow links.

Related errors


AI-assisted analysis of glanceapp/glance@91324e8de7 (2026-08-15). Data as JSON: /api/errors/eedd922bccb6dcc2. Report an issue: GitHub.