Skip to content

[BUG] CLI hangs indefinitely when --registry-url points to an unreachable host (no timeout handling) #2027

@sahillllllllll-bit

Description

@sahillllllllll-bit

Describe the bug.

When the CLI is executed with a --registry-url that is unreachable (e.g., a blackholed IP), the command hangs indefinitely instead of failing fast.

Root cause is in:

cli/src/utils/generate/registry.ts

Function:

registryValidation()

Problematic code:

await fetch(registryUrl as string);

Issues:

  • No timeout
  • No AbortController
  • Uses default GET instead of lightweight HEAD
  • Swallows original network error
  • Blocks CLI execution indefinitely

This causes:

  • CLI freeze
  • CI pipeline stalls
  • Poor UX
  • No actionable error feedback

Expected behavior

CLI should:

  • Fail fast (e.g., 3–5s timeout)
  • Display meaningful error message
  • Exit cleanly

Screenshots

Image

How to Reproduce

Run:

asyncapi generate fromTemplate asyncapi.yaml @asyncapi/html-template \
  --registry-url http://10.255.255.1

CLI will hang instead of exiting with an error.

🖥️ Device Information [optional]

  • Operating System (OS):Windows(WSL)
  • Browser:
  • Browser Version:

👀 Have you checked for similar open issues?

  • I checked and didn't find similar issue

🏢 Have you read the Contributing Guidelines?

Are you willing to work on this issue ?

Yes I am willing to submit a PR!

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    Status

    To Triage

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions