Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Epipe error after seeding the 2 torrent to webtorrent #985

Closed
Rakesh-webdeveloper opened this issue Nov 24, 2016 · 4 comments
Closed

Epipe error after seeding the 2 torrent to webtorrent #985

Rakesh-webdeveloper opened this issue Nov 24, 2016 · 4 comments

Comments

@Rakesh-webdeveloper
Copy link

@Rakesh-webdeveloper Rakesh-webdeveloper commented Nov 24, 2016

  • WebTorrent-hybrid version: 1.6.0 (0.97.2)
  • Node.js version: v4.6.0
  • npm o2.15.9
  • express js 4.14.0

I'm trying to add the magnet link to the client.add() to download and seed the torrent
my code

router.post('/magnet_uri', function(req, res, next) { 
    // magnet link
    var torrentId = req.body.magnet_url;
    client.on('error', function (err) {
        console.log("Client Error : ", err);  // Invalid torrent identifier
    });
    //  adding the magnet link to the client 
    client.add(torrentId,{ path: './seed_torrent/' }, function (torrent) { 
       console.log('torrent start seeding');
        // About torrent info
        var info_torrent = {
           // MagnetURI: torrent.magnetURI,
            TorrentHashInfo: torrent.infoHash,
            TorrentName: torrent.name,
            TorrentPeer: torrent.numPeers,
            TorrentPath: torrent.path
        }
        console.log(info_torrent);
        torrent.on('ready', function() {
            console.log("Torrent is ready to download"+'ready');
        });
        // display the warning details if warning occurs
        torrent.on('warning', function (err) {
            console.log("Torrent Warning : ", err);
        })
  	// on torrent error for display the error message
  	torrent.on('error', function (err) {
            console.log("Torrent Error : ", err);
  			// console.log("error occured, Torrent can't downloaded");
  	})
        // if peer is not found
        // announceType is either 'tracker' or 'dht'
        torrent.on('noPeers', function (announceType) {
            console.log("Torrent NoPeers : ", announceType);
        })
              // if torrent is finished download
  		torrent.on('done', function () {
     		console.log('torrent download finished');
    	})
   })

i run the app in command line
i used command

DEBUG=alpha-webtorrent:* npm start

Where alpha-webtorrent is a expressjs app folder

I'm sending the magnet link to the nodejs server, so that it add the torrent link and start downloading the file.
while i sent the multiple file to the magnet link simultaneously or one after the another
first torrent file downloaded successfully and start seeding
while the second torrent downloaded successfully after that
i always face an issue :"

events.js:141
      throw er; // Unhandled 'error' event
      ^

Error: write EPIPE
    at exports._errnoException (util.js:907:11)
    at WriteWrap.afterWrite (net.js:785:14)

npm ERR! Linux 3.16.0-4-amd64
npm ERR! argv "/usr/bin/nodejs" "/usr/bin/npm" "start"
npm ERR! node v4.6.0
npm ERR! npm  v2.15.9
npm ERR! code ELIFECYCLE
npm ERR! alpha-webtorrent@0.0.0 start: `node ./bin/www`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the alpha-webtorrent@0.0.0 start script 'node ./bin/www'.
npm ERR! This is most likely a problem with the alpha-webtorrent package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     node ./bin/www
npm ERR! You can get information on how to open an issue for this project with:
npm ERR!     npm bugs alpha-webtorrent
npm ERR! Or if that isn't available, you can get their info via:
npm ERR!
npm ERR!     npm owner ls alpha-webtorrent
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     /home/alpha-webtorrent/npm-debug.log

I coudn't find the solution for this.
Please help @feross

@Rakesh-webdeveloper Rakesh-webdeveloper changed the title Epipe error after adding the 2 torrent to webtorrent client.add() Epipe error after seeding the 2 torrent to webtorrent Nov 24, 2016
@Rakesh-webdeveloper

This comment has been minimized.

Copy link
Author

@Rakesh-webdeveloper Rakesh-webdeveloper commented Dec 1, 2016

Is this difficult to answer.................... @feross
i posted all the code i have used. If someone not understanding please let me know.

@feross

This comment has been minimized.

Copy link
Member

@feross feross commented Dec 2, 2016

Your webtorrent-hybrid version can't be 1.6.0. The latest version is 1.0.5. I would check to ensure that you're actually using the latest version.

@feross feross closed this Dec 2, 2016
@Rakesh-webdeveloper

This comment has been minimized.

Copy link
Author

@Rakesh-webdeveloper Rakesh-webdeveloper commented Dec 3, 2016

webtorrent-hybrid version can't be 1.6.0. I agree, I solved my issue. @feross

@lock

This comment has been minimized.

Copy link

@lock lock bot commented May 4, 2018

This thread has been automatically locked because it has not had recent activity. To discuss futher, please open a new issue.

@lock lock bot locked as resolved and limited conversation to collaborators May 4, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants
You can’t perform that action at this time.