{"record":{"id":"8f74dbef6d709043","repo":"jackwener/OpenCLI","slug":"dockerhub-search-no-docker-hub-repositories-match","errorCode":null,"errorMessage":"dockerhub search: No Docker Hub repositories matched \"${query}\".","messagePattern":"dockerhub search: No Docker Hub repositories matched \"(.+?)\"\\.","errorType":"exception","errorClass":"EmptyResultError","httpStatus":null,"severity":"warning","filePath":"clis/dockerhub/search.js","lineNumber":30,"sourceCode":"    name: 'search',\n    access: 'read',\n    description: 'Search Docker Hub repositories by keyword',\n    domain: 'hub.docker.com',\n    strategy: Strategy.PUBLIC,\n    browser: false,\n    args: [\n        { name: 'query', positional: true, required: true, help: 'Search keyword (e.g. \"nginx\", \"bitnami redis\")' },\n        { name: 'limit', type: 'int', default: 25, help: 'Max repositories (1-100, single Docker Hub page)' },\n    ],\n    columns: ['rank', 'image', 'official', 'stars', 'pulls', 'description', 'url'],\n    func: async (args) => {\n        const query = requireString(args.query, 'query');\n        const limit = requireBoundedInt(args.limit, 25, 100);\n        const url = `${HUB_BASE}/search/repositories/?query=${encodeURIComponent(query)}&page_size=${limit}`;\n        const body = await hubFetch(url, 'dockerhub search');\n        const list = Array.isArray(body?.results) ? body.results : [];\n        if (!list.length) {\n            throw new EmptyResultError('dockerhub search', `No Docker Hub repositories matched \"${query}\".`);\n        }\n        return list.slice(0, limit).map((r, i) => {\n            const owner = String(r.repo_owner ?? '').trim();\n            const name = String(r.repo_name ?? '').trim();\n            const image = owner ? `${owner}/${name}` : (r.is_official ? `library/${name}` : name);\n            return {\n                rank: i + 1,\n                image,\n                official: Boolean(r.is_official),\n                stars: r.star_count != null ? Number(r.star_count) : null,\n                pulls: r.pull_count != null ? Number(r.pull_count) : null,\n                description: String(r.short_description ?? '').trim(),\n                url: image ? `https://hub.docker.com/r/${image}` : '',\n            };\n        });\n    },\n});\n","sourceCodeStart":12,"sourceCodeEnd":48,"githubUrl":"https://github.com/jackwener/OpenCLI/blob/49907e53dc3ade5c223ff0c4c2c2785687cec4e6/clis/dockerhub/search.js#L12-L48","documentation":"dockerhub search found zero repositories in the Docker Hub API response for the query. The library throws EmptyResultError to signal the command succeeded but matched nothing, distinguishing it from network or argument failures.","triggerScenarios":"Running dockerhub search with a query string that has no matching repositories on Docker Hub (e.g. a very specific or misspelled image name) while the API returns an empty results array.","commonSituations":"Typo in image name; searching an org's private repos that are not visible via search; query uses characters Docker Hub search does not match; image retired or never published to Docker Hub (hosted on GHCR/Quay instead).","solutions":["Shorten or generalize the query (e.g. 'redis' instead of 'redis-json-7-alpine')","Check the spelling of the image/repo name","Verify the repository actually exists and is public on hub.docker.com","If the image is hosted elsewhere (ghcr.io, quay.io), search that registry instead"],"exampleFix":"// before\ndockerhub search --query 'bitnami/redis-exporter-7-alpine'\n// after\ndockerhub search --query 'redis-exporter'","handlingStrategy":"fallback","validationCode":null,"typeGuard":null,"tryCatchPattern":"try { results = await dockerhubSearch(query); } catch (e) { if (e instanceof EmptyResultError) { console.warn(`No results for \"${query}\"; try a broader term`); results = []; } else throw e; }","preventionTips":["Prefer broad search terms","Verify the repo exists publicly on hub.docker.com first","Handle empty results gracefully in scripts (it is not a failure)"],"tags":["empty-result","search","dockerhub"],"backgroundTag":"empty-result-set","analyzedSha":"49907e53dc3ade5c223ff0c4c2c2785687cec4e6","analyzedAt":"2026-08-29T08:14:47.543Z","schemaVersion":2},"datasetVersion":"2026-08-29T17:17:51.833Z"}