Skip to content

eoc --latest crashes with a raw stack trace when Maven Central is unreachable #1168

Open

Description

@morphqdd

What happens

src/parser-version.js's get() (lines 16-29) does a synchronous request to Maven Central and neither catches transport errors nor handles a non-200 response gracefully - it just throws. It is called from src/eoc.js:115 at module load time, which is before program.parseAsync() runs and therefore outside the top-level try/catch at src/eoc.js:439-446. So nothing in the process can catch whatever it throws.

Its sibling function exists() was explicitly hardened for exactly this scenario in #998 and #1085 (warn and proceed instead of crashing), but get() never received the same treatment.

Reproduced in a network namespace with only external network removed (loopback still up):

$ unshare -r -n sh -c 'ip link set lo up; node src/eoc.js --latest lint'
node_modules/sync-rpc/lib/index.js:167
    throw error;
    ^
Error
    at extractValue (.../sync-rpc/lib/index.js:165:19)
    at Object.get (src/parser-version.js:20:17)
    at Object.<anonymous> (src/eoc.js:115:40)
    ...
  code: 'ENETUNREACH'

Note the thrown error has an empty message, so even moving the call inside a try/catch would only print a blank line - the fix needs to be inside get() itself, catching the transport error and falling back the same way exists() does.

What should happen

eoc --latest should behave gracefully when Maven Central is unreachable - warn and fall back to the bundled parser version (mirroring what exists() already does), not print a raw Node internal stack trace with an empty error message.

Activity

  1. morphqdd commented on Aug 13, 2026

    @morphqdd
    ContributorAuthor

    @yegor256, please take a look when you have a moment.

  2. 0crat commented on Sep 1, 2026

    @0crat

    @morphqdd Thanks for reporting a new bug! You've earned +12 points. By reporting bugs, you help our project improve its quality. If you find anything else in the repository that doesn't look as good as you might expect, do not hesitate to report it. Your running score is +6507; don't forget to check your Zerocracy account too).

  3. added 2 commits that reference this issue on Sep 5, 2026
  4. added a commit that references this issue on Sep 26, 2026
  5. added a commit that references this issue on Oct 6, 2026
  6. yegor256 commented on Nov 6, 2026

    @yegor256
    Member

    Merged #1375 moved latest lookup into preAction, but get() still throws on transport failure without the requested fallback. Verify a useful warning and the bundled parser when Maven Central is unavailable. Next step: review #1229. Current code: src/parser-version.js:22.

  7. added a commit that references this issue on Nov 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions