glanceapp/glance · error

no pages configured

Error message

no pages configured

What it means

Config validation (isConfigStateValid) rejects a configuration whose pages list is empty. Glance renders pages; with zero pages there is nothing to serve, so the config is considered logically invalid even though it parses.

Source

Thrown at internal/glance/config.go:453

	onChange(lastContents)

	return func() error {
		if debounceTimer != nil {
			debounceTimer.Stop()
		}

		return watcher.Close()
	}, nil
}

// TODO: Refactor, we currently validate in two different places, this being
// one of them, which doesn't modify the data and only checks for logical errors
// and then again when creating the application which does modify the data and do
// further validation. Would be better if validation was done in a single place.
func isConfigStateValid(config *config) error {
	if len(config.Pages) == 0 {
		return fmt.Errorf("no pages configured")
	}

	if len(config.Auth.Users) > 0 && config.Auth.SecretKey == "" {
		return fmt.Errorf("secret-key must be set when users are configured")
	}

	for username := range config.Auth.Users {
		if username == "" {
			return fmt.Errorf("user has no name")
		}

		if len(username) < 3 {
			return errors.New("usernames must be at least 3 characters")
		}

		user := config.Auth.Users[username]

		if user.Password == "" {

View on GitHub (pinned to 91324e8de7)

Solutions

  1. Add at least one page with a title and columns to glance.yml
  2. If using includes, verify the merged result still has a top-level pages: list (check indentation of the included content)
  3. Uncomment or restore a previously removed page block

Example fix

# before
server:
  port: 8080
# after
server:
  port: 8080
pages:
  - name: Home
    columns:
      - size: full
        widgets: []
Defensive patterns

Strategy: validation

Validate before calling

// After unmarshal, before starting the app:
if len(cfg.Pages) == 0 {
    return errors.New("refusing to start: no pages configured")
}

Prevention

When it happens

Trigger: A glance.yml that defines server/auth settings but contains no pages: block, or whose only page is commented out; also a config assembled entirely from !include files where the page include failed silently at the YAML level (e.g. included content merged under the wrong key).

Common situations: Starting from a template and deleting the example pages; includes that inject widgets but no top-level pages key; YAML indentation putting pages under another section.

Related errors


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