Js-ipfs: 0.29.2 Uncaught Error: BlockStream: write after end

Created on 1 Jun 2018  路  12Comments  路  Source: ipfs/js-ipfs

  • Version: 0.29.2
  • Platform: 64-bit (Windows) Chrome

Type: Bug

Severity: Critical

Description:

after upgrade to 0.29.2 got repeating error

Uncaught Error: BlockStream: write after end
    at BlockStream.write ([email protected]:208388)
    at [email protected]:74221
    at [email protected]:117724
    at [email protected]:75427
    at [email protected]:75427
    at callback ([email protected]:27597)
    at drain ([email protected]:27582)
    at Array.read ([email protected]:27542)
    at next ([email protected]:75420)
    at [email protected]:75429
    at sink ([email protected]:62070)
    at Connection.consume ([email protected]:82397)
    at pull ([email protected]:62467)
    at select ([email protected]:215803)
    at pullLP.decodeFromReader ([email protected]:115710)
    at readMessage ([email protected]:197839)
    at Object.reader.read [as cb] ([email protected]:197851)
    at drain ([email protected]:112582)
    at more ([email protected]:112594)
    at Object.reader.read ([email protected]:112638)
    at readMessage ([email protected]:197846)
    at Object.reader.read [as cb] ([email protected]:197832)
    at drain ([email protected]:112582)
    at more ([email protected]:112594)
    at [email protected]:112605
    at [email protected]:112563
    at [email protected]:117724
    at drain ([email protected]:74284)
    at BlockStream.<anonymous> ([email protected]:74293)
    at BlockStream.EventEmitter.emit ([email protected]:18848)
    at BlockStream._emitChunk ([email protected]:208539)
    at BlockStream.flush ([email protected]:208426)
    at BlockStream.end ([email protected]:208422)
    at Peer.onend ([email protected]:80616)
    at Peer.g ([email protected]:18917)
    at Peer.EventEmitter.emit ([email protected]:18848)
    at endReadableNT ([email protected]:81049)
    at afterTickTwo ([email protected]:50139)
    at Item.run ([email protected]:2423)
    at drainQueue ([email protected]:2393)

and

warning, stream-to-pull-stream: 
the wrapped node-stream does not implement `destroy`, 
this may cause resource leaks.

Steps to reproduce the error:

my configs

const config = {
        repo: 'osliki-classi-test',
        EXPERIMENTAL: {
          pubsub: true,
          relay: {
            enabled: true,
            hop: {
              enabled: true,
              //active: true
            }
          }
        },
        config: {
          Addresses: {
            Swarm: [
              '/dns4/wrtc-star.discovery.libp2p.io/tcp/443/wss/p2p-webrtc-star',
              '/dns4/ws-star.discovery.libp2p.io/tcp/443/wss/p2p-websocket-star',
            ]
          }
        }
      }
P1 dihard kinbug

Most helpful comment

@ya7ya good diagnosis skills. Are you working on a fix too :)?

All 12 comments

@ya7ya this error was introduced with https://github.com/libp2p/js-libp2p-webrtc-star/pull/145. Mind checking what's up?

@diasdavid I'll check it out 馃憤

quick update: This issue occurs when an older libp2p-webrtc-star connects to the latest version. you can test that out if you use a local signaling server and then connecting multiple peers to it

I'm gonna try to figure out a fix to make sure this is backward compatible with libp2p-webrtc older versions.

Turns out it's the lack of destroy implementation in block-stream . so pump kept on throwing an error everytime a peer disconnects.

@ya7ya good diagnosis skills. Are you working on a fix too :)?

@diasdavid Yeah. I'm looking into fixing block-stream or reimplementing it properly. last commit there was 7 years ago :D !!

The change was reverted in libp2p-webrtc-star to mitigate this error. @ya7ya let's make sure to do an integration test when https://github.com/libp2p/js-libp2p-webrtc-star/pull/146 gets back.

@Artod thank you for reporting. a fresh npm install should get you golden :)

@diasdavid thx!

@diasdavid I just upgraded to 0.29.3 and got the same errors

@Artod did you rm -rf node_modules && rm package-lock.json && npm install?

I load it using a

Related issues

mnts picture mnts  路  3Comments

daviddias picture daviddias  路  3Comments

lifeBCE picture lifeBCE  路  3Comments

daviddias picture daviddias  路  3Comments

gitGksgk picture gitGksgk  路  3Comments