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

TypeError: May not write null values to stream #1

Open
franck34 opened this issue Jan 21, 2017 · 6 comments
Open

TypeError: May not write null values to stream #1

franck34 opened this issue Jan 21, 2017 · 6 comments

Comments

@franck34
Copy link

Running node 6.9.4 on Debian.

Trying to delete S3 item return an error:

TypeError: May not write null values to stream
at validChunk (_stream_writable.js:211:10)
at S3Deleter.Writable.write (_stream_writable.js:245:12)
at S3Deleter.module.exports.S3Deleter.end (/var/www/xxxxx.com/dev/node_modules/s3-deleter/lib/index.js:66:19)
at S3Lister.onend (/var/www/xxxxx.com/dev/node_modules/s3-lister/node_modules/readable-stream/lib/_stream_readable.js:523:10)
at S3Lister.g (events.js:291:16)
at emitNone (events.js:86:13)
at S3Lister.emit (events.js:185:7)
at /var/www/xxxxx.com/dev/node_modules/s3-lister/node_modules/readable-stream/lib/_stream_readable.js:965:16
at _combinedTickCallback (internal/process/next_tick.js:67:7)
at process._tickDomainCallback (internal/process/next_tick.js:122:9)

Any idea ?

thank you !

@drob
Copy link
Owner

drob commented Jan 21, 2017

Thanks for the issue report!

Do you have a code excerpt that reproduces this issue? I tried reproducing it myself without success.

@drob
Copy link
Owner

drob commented Jan 21, 2017

Ah, found a repro. Are you calling deleter.end(null) by chance?

@franck34
Copy link
Author

Hi ! thanks for your reactivity !

Below my code

var s3Options = {
    key: 'xxxx',
    secret: 'xxxxxxxx',
    bucket: 'xxxxxx-s3'
};

var knoxClient = knox.createClient(s3Options);

var listerDev = new S3Lister(knoxClient,{prefix:'dev/12345'});
var deleterDev = new S3Deleter(knoxClient);

deleterDev.on('error',function (err) {
    console.log('on error','deleterDev', err);
});

listerDev.on('error',function(err) {
    console.log('on error','listerDev', err);
});

try {
    listerDev.pipe(deleterDev);
} catch(e) {
    console.log('try catch error',e.message);
}

@drob
Copy link
Owner

drob commented Jan 23, 2017

Would you mind adding an .on('data', ...) listener to listerDev? I am curious what is being passed to deleterDev. I believe it's something null at some point.

Alternately, if this is test data and you're comfortable doing so, you could send me the credentials to that bucket and I can reproduce and investigate on my own.

@franck34
Copy link
Author

Yep, it's for test. Let me send you an email.

@franck34
Copy link
Author

franck34 commented Apr 9, 2017

Hi

I tried to debug myself, but no time/enought knowledge.

Switching back to old school extension for knox client.

https://gist.github.com/franck34/b1ab4c7ecf27023a2f68320ba6a3fd0a

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

2 participants