Skip to content
This repository has been archived by the owner on Feb 12, 2024. It is now read-only.

0.29.2 Uncaught Error: BlockStream: write after end #1379

Closed
Artod opened this issue Jun 1, 2018 · 12 comments
Closed

0.29.2 Uncaught Error: BlockStream: write after end #1379

Artod opened this issue Jun 1, 2018 · 12 comments
Labels
exp/expert Having worked on the specific codebase is important kind/bug A bug in existing code (including security flaws) P1 High: Likely tackled by core team if no one steps up

Comments

@Artod
Copy link

Artod commented Jun 1, 2018

  • 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',
            ]
          }
        }
      }
@daviddias daviddias added status/ready Ready to be worked kind/bug A bug in existing code (including security flaws) exp/expert Having worked on the specific codebase is important P1 High: Likely tackled by core team if no one steps up labels Jun 4, 2018
@daviddias
Copy link
Member

@ya7ya this error was introduced with libp2p/js-libp2p-webrtc-star#145. Mind checking what's up?

@ya7ya
Copy link
Contributor

ya7ya commented Jun 4, 2018

@diasdavid I'll check it out 👍

@ya7ya
Copy link
Contributor

ya7ya commented Jun 4, 2018

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.

@daviddias
Copy link
Member

daviddias commented Jun 4, 2018

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

@ya7ya
Copy link
Contributor

ya7ya commented Jun 4, 2018

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

@daviddias
Copy link
Member

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

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

@ghost ghost removed the status/ready Ready to be worked label Jun 20, 2018
@Artod
Copy link
Author

Artod commented Jun 20, 2018

@diasdavid thx!

@Artod
Copy link
Author

Artod commented Jun 22, 2018

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

@daviddias daviddias reopened this Jun 22, 2018
@daviddias
Copy link
Member

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

@Artod
Copy link
Author

Artod commented Jun 22, 2018

I load it using a <script> with src from here https://unpkg.com/[email protected]/dist/index.min.js

My app is built with the create-react-app. As far as I remember there is an issue with building an app importing ipfs.

@alanshaw
Copy link
Member

alanshaw commented Aug 2, 2018

@Artod can you point me at some code I can run that exhibits this error? Also, we're now on 0.31.x so this might have been resolved!

@daviddias
Copy link
Member

@Artod try with latest 0.31.2, it should be allll goood . Closing this one now, reopen this issue if needed

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
exp/expert Having worked on the specific codebase is important kind/bug A bug in existing code (including security flaws) P1 High: Likely tackled by core team if no one steps up
Projects
None yet
Development

No branches or pull requests

4 participants