Skip to content

js-v1.x WebSocket dial abort to jvm-v1.2 #15

@dhuseby

Description

@dhuseby

Repos:

Transport: ws, Secure: noise, Muxers: yamux, mplex

Summary

js-v1.x fails to dial jvm-v1.2 via WebSocket with both yamux and mplex muxers. The JVM listener starts successfully and publishes its multiaddr, but the JS dialer's connection attempt is aborted with "The operation was aborted" from the dial queue.

Failing tests (2)

  • js-v1.x x jvm-v1.2 (ws, noise, yamux)
  • js-v1.x x jvm-v1.2 (ws, noise, mplex)

Error output

  ping test (dialer)
    1) should dial and ping

  0 passing (5s)
  1 failing

  1) ping test (dialer)
       should dial and ping:
     CodeError: The operation was aborted
      at Job.queue.add.peerId.peerId [as fn] (file:///app/node_modules/libp2p/src/connection-manager/dial-queue.ts:266:21)
      at raceSignal (file:///app/node_modules/race-signal/src/index.ts:54:12)
      at Job.run (file:///app/node_modules/@libp2p/utils/src/queue/job.ts:77:22)

The JVM listener logs show successful startup and multiaddr publication:

Connection established to Redis (Jedis{Connection{DefaultJedisSocketFactory{proxy-11aa3c9b:6379}}})
Starting listener with advertisedAddress: /ip4/172.18.0.7/tcp/45984/ws/p2p/12D3KooWMPjmnpSkpRpnYjrG7z1BVpawL3EHEXYZYdZqkVss9nSz

Root cause analysis

The JS dialer retrieves the JVM listener's multiaddr from Redis and attempts to dial, but the connection is aborted during the dial queue processing. The abort occurs within the raceSignal timeout wrapper, suggesting the connection attempt times out before completing.

Possible causes:

  • WebSocket upgrade handshake incompatibility between js-libp2p and jvm-libp2p
  • Noise handshake failure or muxer negotiation timeout
  • jvm-libp2p's WebSocket listener may not correctly handle the JS client's connection sequence

Both muxers fail identically, indicating the failure occurs before muxer negotiation (likely during WebSocket upgrade or noise handshake).

Notes

  • The JVM listener is legacy and connects through the proxy. The JS dialer is modern and connects to global Redis. The proxy correctly translates the key names.
  • No proxy hostname issues — proxy-11aa3c9b uses correct RFC 1123 format.
  • js-v1.x successfully dials other implementations (go, rust, nim) via ws, so the issue is specific to jvm-v1.2 as listener.

Metadata

Metadata

Assignees

No one assigned

    Labels

    javascriptjs-libp2p relatedjvmjvm-libp2p related

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions