GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — nodejs download some of file fine but some empty with errno: 'ETIMEDOUT' · Issue #4556 · nodejs/node

nodejs download some of file fine but some empty with errno: 'ETIMEDOUT'  #4556

New issue
Copy link
New issue
Copy link
Closed
Closed
nodejs download some of file fine but some empty with errno: 'ETIMEDOUT' #4556
Copy link
Labels
invalidIssues and PRs that are invalid.

Description

@pooyamoha
pooyamoha
opened on Jan 6, 2016
Issue body actions

I have tried to download 1187 image url (stored in log text file) and download them in my local machine , most of the file are downloaded but i get TimeOut Error for some of them. (the total image file might be around 866 file, because some of the url are duplicate. i would appreciate if someone with modifying my script source code show me , how can i find a fix or workaround for the timeout issue and get download all the files fine. i uploaded the stored text file and the script here, so you can test it.

click here to download stored url log.txt

if you want to test my situation , you need to download above attached file and put it in the same folder of script file and run the script.

here is the source code :

 var fs = require('fs'),
        request = require('request');
    var path = require('path');

var lineReader = require('readline').createInterface({
  input: require('fs').createReadStream('log.txt')
});

lineReader.on('line', function (line) {
  console.log('Line from file:', line);
var img_fileName = path.basename(line);

 var file = fs.createWriteStream(img_fileName,{ flags: 'w'});


var options = {
    url: line,
    port: 80,
    setTimeout: 0,
    setNoDelay: true,
    setSocketKeepAlive: true    
};

request(options, function(err,response,body) {

 if (err)
 console.log(err);

 }).pipe(file);;


});

i get this error in console log on some of the files but most of them download fine and those file that get timeout when download them , store as a empty file.

{ [Error: connect ETIMEDOUT 192.82.104.198:80]
  code: 'ETIMEDOUT',
  errno: 'ETIMEDOUT',
  syscall: 'connect',
  address: '192.82.104.198',
  port: 80 }

P.S :

npm -v : 3.5.3 #########
node -v : 5.3.0

Activity

  1. bnoordhuis commented on Jan 6, 2016

    @bnoordhuis
    bnoordhuis
    on Jan 6, 2016
    Member
    More actions

    Can you post this here or on SO? This repo is for reporting bugs against node.js core, not general support. Thanks.

  2. bnoordhuis
    closed this as completedon Jan 6, 2016
  3. bnoordhuis
    added
    invalidIssues and PRs that are invalid.
    on Jan 6, 2016
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

    invalidIssues and PRs that are invalid.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      You are visitor 01402775 — GeezerVison does not store the pages you look up.
      Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.