{"record":{"id":"8e5020b46cbdcfe2","repo":"Crosstalk-Solutions/project-nomad","slug":"failed-to-fetch-available-versions-for-this-servic","errorCode":null,"errorMessage":"Failed to fetch available versions for this service.","messagePattern":"Failed to fetch available versions for this service\\.","errorType":"http","errorClass":null,"httpStatus":500,"severity":"error","filePath":"admin/app/controllers/system_controller.ts","lineNumber":252,"sourceCode":"            .where('service_name', serviceName)\n            .where('installed', true)\n            .first()\n\n        if (!service) {\n            return response.status(404).send({ error: `Service ${serviceName} not found or not installed` })\n        }\n\n        try {\n            const hostArch = await this.getHostArch()\n            const updates = await this.containerRegistryService.getAvailableUpdates(\n                service.container_image,\n                hostArch,\n                service.source_repo\n            )\n            response.send({ versions: updates })\n        } catch (error) {\n            logger.error({ err: error }, `[SystemController] Failed to fetch versions for ${serviceName}`)\n            response.status(500).send({ error: 'Failed to fetch available versions for this service.' })\n        }\n    }\n\n    async updateService({ request, response }: HttpContext) {\n        const payload = await request.validateUsing(updateServiceValidator)\n        const result = await this.dockerService.updateContainer(\n            payload.service_name,\n            payload.target_version\n        )\n\n        if (result.success) {\n            response.send({ success: true, message: result.message })\n        } else {\n            response.status(400).send({ error: result.message })\n        }\n    }\n\n    private async getHostArch(): Promise<string> {","sourceCodeStart":234,"sourceCodeEnd":270,"githubUrl":"https://github.com/Crosstalk-Solutions/project-nomad/blob/0bd1c6f4f9888d577fe232de06ac144bb8337131/admin/app/controllers/system_controller.ts#L234-L270","documentation":"This 500 error is returned by the getAvailableVersions endpoint when the underlying call to fetch available update versions for a service (via DockerService/update source repo) throws. It is a catch-all wrapper: any network failure, registry error, or unexpected exception while listing versions is masked as this generic message, with the real cause logged server-side.","triggerScenarios":"GET request to the available-versions route (e.g. /api/system/versions) when the service's source_repo is unreachable, the registry API rate-limits or times out, hostArch detection fails, or the service record has a malformed source_repo.","commonSituations":"Offline or firewalled homelab host, Docker Hub / GitHub API rate limiting, a service entry with a bad or empty source_repo, or a transient DNS failure during version lookup.","solutions":["Check the server logs for the line '[SystemController] Failed to fetch versions for <name>' — the err field holds the real cause","Verify the host has outbound network access to the service's source_repo (curl the registry/manifest URL)","Confirm the Service row's source_repo and hostArch are set correctly","Retry after resolving connectivity; if the registry is rate-limiting, wait or authenticate"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"const reachable = await fetch(serviceRepoHealthUrl, { method: 'HEAD' }).then(() => true).catch(() => false);\nif (!reachable) throw new Error('Version source unreachable');","typeGuard":null,"tryCatchPattern":"try {\n  const { versions } = await api.getAvailableVersions(serviceName);\n} catch (e: any) {\n  if (e?.response?.status === 500) showOfflineFallback(); // real cause is in server logs\n}","preventionTips":["Monitor host outbound connectivity to registries","Cache last-known version list client-side to degrade gracefully"],"tags":["docker","versions","network","adonis"],"backgroundTag":"docker-registry-network-error","analyzedSha":"0bd1c6f4f9888d577fe232de06ac144bb8337131","analyzedAt":"2026-08-27T05:34:15.424Z","schemaVersion":2},"datasetVersion":"2026-08-27T08:17:20.692Z"}