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

stream is null during docker pull and not handled #93

Open
KBPratap opened this issue Jun 14, 2018 · 2 comments
Open

stream is null during docker pull and not handled #93

KBPratap opened this issue Jun 14, 2018 · 2 comments

Comments

@KBPratap
Copy link

I have this issue, on some user machines this works fine but for some it throws the following errors:

TypeError: Cannot read property 'pipe' of null
    at Modem.followProgress (/data/app/node_modules/docker-modem/lib/modem.js:316:10)

Following is the implementation

docker.pull(repoTag, function(err, stream) {
    docker.modem.followProgress(stream, onFinished, onProgress);
    function onFinished(err, output) {
        ....
    }
    function onProgress(event) {
        ....
    }
}

Docker Version 18.03.1-ce-mac65 (24312)

@apocas
Copy link
Owner

apocas commented Sep 23, 2019

Could you give more details?
Can't replicate this.

@coco-super
Copy link

coco-super commented Dec 12, 2019

@nuxlli @rmg @knownasilya @Stuk @ekristen
I have this issue, on some user machines this works fine but for some it throws the following errors.
I don't know where the problem is,Can you give me some advice

dockerode version 3.0.2

docker.modem.followProgress(stream, onFinished, onProgress);

function buildImage(dockerBuildDir, dockerfilePath, imageTag) {
  return new Promise((resolve, reject) => {
    var tarStream = tar.pack(dockerBuildDir);
    docker.buildImage(tarStream, {
      dockerfile: path.relative(dockerBuildDir, dockerfilePath),
      t: imageTag
    }, (error, stream) => {
      containers.add(stream);

      if (error) { reject(error); }
      else {
        stream.on('error', (e) => {
          containers.delete(stream);
          reject(e);
        });
        stream.on('end', function () {
          containers.delete(stream);
          resolve(imageTag);
        });
      }
      followProgress(stream, (err, res) => err ? reject(err) : resolve(res));
    });
  });
}
stream.pipe(parser);
         ^

TypeError: Cannot read property 'pipe' of null
    at Modem.followProgress (/Users/ellison/fun/node_modules/docker-modem/lib/modem.js:379:10)
    at followProgress (/Users/ellison/fun/lib/docker.js:295:16)
    at docker.buildImage (/Users/ellison/fun/lib/docker.js:999:7)
    at /Users/ellison/fun/node_modules/dockerode/lib/docker.js:295:9
    at /Users/ellison/fun/node_modules/docker-modem/lib/modem.js:302:7
    at IncomingMessage.<anonymous> (/Users/ellison/fun/node_modules/docker-modem/lib/modem.js:321:9)
    at IncomingMessage.emit (events.js:187:15)
    at IncomingMessage.EventEmitter.emit (domain.js:442:20)
    at endReadableNT (_stream_readable.js:1092:12)
    at process._tickCallback (internal/process/next_tick.js:63:19)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants