badges/shields · warning · NotFound

no tags found

Error message

no tags found

What it means

DockerLastUpdated.transform throws NotFound with prettyMessage 'no tags found' when the Docker Hub tags response succeeds (HTTP 200) but data.count is 0 or data.results is empty. Per the source comment, a Hub 404 already maps to 'repository or tag not found'; this error covers the distinct case of a repo that exists but has no tags yet.

Source

Thrown at services/docker/docker-last-updated.service.js:88

  async fetch({ user, repo, tag }) {
    return await fetch(this, {
      schema: tag ? tagSchema : newestSchema,
      url: `https://registry.hub.docker.com/v2/repositories/${getDockerHubUser(
        user,
      )}/${repo}/tags${tag ? `/${tag}` : '?page_size=1&ordering=last_updated'}`,
      httpErrors: { 404: 'repository or tag not found' },
    })
  }

  transform({ tag, data }) {
    if (tag) {
      return { date: data.last_updated }
    }
    // 404 from the Hub API already maps to "repository or tag not found".
    // An empty results list is a 200 for a repo that exists but has no tags yet.
    if (data.count === 0 || data.results.length === 0) {
      throw new NotFound({ prettyMessage: 'no tags found' })
    }
    return { date: data.results[0].last_updated }
  }

  async handle({ user, repo, tag }) {
    const data = await this.fetch({ user, repo, tag })
    const { date } = this.transform({ tag, data })
    return this.constructor.render({ date })
  }
}

View on GitHub (pinned to 766fd8bc89)

Solutions

  1. Verify the repository has at least one tag on Docker Hub
  2. Push an image to the repository so tags exist
  3. Check the user/repo spelling - you may be hitting an empty repo instead of the intended one
  4. Use a different, populated repository for the badge

Example fix

// before
/badge/docker/last-update/myuser/empty-repo -> no tags found
// after
# push first
docker push myuser/empty-repo:latest
Defensive patterns

Strategy: try-catch

Validate before calling

async function dockerRepoHasAnyTag(user, repo) {
  const res = await fetch(`https://hub.docker.com/v2/repositories/${user}/${repo}/tags?page_size=1`)
  if (!res.ok) return false
  const data = await res.json()
  return (data.count ?? 0) > 0 && data.results?.length > 0
}

Type guard

function hasTags(data) {
  return data?.count > 0 && Array.isArray(data.results) && data.results.length > 0
}

Try / catch

try {
  const badge = await getDockerLastUpdatedBadge(user, repo)
} catch (err) {
  if (err.prettyMessage === 'no tags found') {
    badge = 'no tags'
  } else throw err
}

Prevention

When it happens

Trigger: Requesting a last-updated badge for a Docker Hub repository that returns a 200 with an empty tags list - a repo created but never pushed to, or all tags deleted.

Common situations: Freshly created Docker Hub repositories with no pushes; repos whose tags were pruned; requesting with a tag filter where no results match.

Related errors


AI-assisted analysis of badges/shields@766fd8bc89 (2026-08-30). Data as JSON: /api/errors/bb40b111da1cdb1b. Report an issue: GitHub.