{"record":{"id":"df7ddf5e020ecacb","repo":"affaan-m/ECC","slug":"catalog-show-requires-an-install-component-id","errorCode":null,"errorMessage":"Catalog show requires an install component ID","messagePattern":"Catalog show requires an install component ID","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"scripts/catalog.js","lineNumber":168,"sourceCode":"      return;\n    }\n\n    if (options.command === 'components') {\n      const components = listInstallComponents({\n        family: options.family,\n        target: options.target,\n      });\n      if (options.json) {\n        console.log(JSON.stringify({ components }, null, 2));\n      } else {\n        printComponents(components);\n      }\n      return;\n    }\n\n    if (options.command === 'show') {\n      if (!options.componentId) {\n        throw new Error('Catalog show requires an install component ID');\n      }\n      const component = getInstallComponent(options.componentId);\n      if (options.json) {\n        console.log(JSON.stringify(component, null, 2));\n      } else {\n        printComponent(component);\n      }\n      return;\n    }\n\n    throw new Error(`Unknown catalog command: ${options.command}`);\n  } catch (error) {\n    console.error(`Error: ${error.message}`);\n    process.exit(1);\n  }\n}\n\nmain();","sourceCodeStart":150,"sourceCodeEnd":186,"githubUrl":"https://github.com/affaan-m/ECC/blob/01e15490f04e29cfefe3896951f43db46994d8ee/scripts/catalog.js#L150-L186","documentation":"_validate_import_url() performs a forward DNS resolution (socket.getaddrinfo) on the hostname before opening any connection. If DNS resolution fails with socket.gaierror, the import is rejected immediately with the unresolvable hostname, rather than letting urllib.request.urlopen produce a less actionable error later. This is a fail-fast validation step.","triggerScenarios":"Typo in the domain name; the host does not exist in DNS; running in an air-gapped/offline environment; an internal hostname that only resolves behind a VPN that is not connected; an expired/delegated domain.","commonSituations":"CI runner without network/DNS; corporate environment where the host is only resolvable via internal DNS; mistyped domain; DNS server outage.","solutions":["Correct the hostname and confirm it resolves: run `nslookup <host>` or `getaddrinfo` from the same environment.","Connect to the required VPN or internal network if the host is internal-only.","For offline environments, download the instinct file on a connected machine and import it via its local path instead."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"# Pre-resolve the host to give a clearer error before importing.\nimport socket\ntry:\n    socket.getaddrinfo(host, 443, type=socket.SOCK_STREAM)\nexcept socket.gaierror:\n    raise SystemExit(f'host {host} does not resolve — check DNS/network/VPN')","typeGuard":"import socket\n\ndef host_resolves(host) -> bool:\n    try:\n        socket.getaddrinfo(host, 443, type=socket.SOCK_STREAM)\n        return True\n    except socket.gaierror:\n        return False","tryCatchPattern":"try:\n    content = _fetch_import_url(source)\nexcept ValueError as e:\n    if 'could not be resolved' in str(e):\n        log.error('DNS resolution failed — are you offline or on the wrong VPN?')\n    raise","preventionTips":["In CI, confirm network/DNS availability before running imports.","Connect to required VPNs for internal-only hosts before invoking the import.","For air-gapped environments, pre-download instinct files and import them locally."],"tags":["network","dns","validation","connectivity"],"backgroundTag":null,"analyzedSha":"01e15490f04e29cfefe3896951f43db46994d8ee","analyzedAt":"2026-08-13T00:31:08.655Z","schemaVersion":2},"datasetVersion":"2026-08-13T04:17:16.726Z"}