firebase-tools icon indicating copy to clipboard operation
firebase-tools copied to clipboard

error with firebase deploy functions

Open devosos opened this issue 9 years ago • 21 comments

Hi, I got this error when I try to deploy functions to my firebase project and I can't solve this problem firebase version:3.9.0

[debug] TypeError: Cannot read property 'pipesCount' of undefined at module.exports.Readable.pipe (_stream_readable.js:545:16) at module.exports.ZipArchiveOutputStream._smartStream (/usr/local/lib/node_modules/firebase-tools/node_modules/compress-commons/lib/archivers/zip/zip-archive-output-stream.js:171:11) at module.exports.ZipArchiveOutputStream._appendStream (/usr/local/lib/node_modules/firebase-tools/node_modules/compress-commons/lib/archivers/zip/zip-archive-output-stream.js:94:20) at module.exports.ArchiveOutputStream.entry (/usr/local/lib/node_modules/firebase-tools/node_modules/compress-commons/lib/archivers/archive-output-stream.js:89:10) at module.exports.ZipStream.entry (/usr/local/lib/node_modules/firebase-tools/node_modules/zip-stream/lib/zip-stream.js:105:49) at module.exports.Zip.append (/usr/local/lib/node_modules/firebase-tools/node_modules/archiver/lib/plugins/zip.js:30:15) at module.exports.Archiver._moduleAppend (/usr/local/lib/node_modules/firebase-tools/node_modules/archiver/lib/core.js:123:16) at module.exports.Archiver._onQueueTask (/usr/local/lib/node_modules/firebase-tools/node_modules/archiver/lib/core.js:246:8) at /usr/local/lib/node_modules/firebase-tools/node_modules/archiver/node_modules/async/lib/async.js:945:13 at Immediate.process [as _onImmediate] (/usr/local/lib/node_modules/firebase-tools/node_modules/archiver/node_modules/async/lib/async.js:913:25) [error] [error] Error: An unexpected error has occurred.

devosos avatar May 31 '17 12:05 devosos

What version of Node.js are you using?

On Wed, May 31, 2017, 5:28 AM Laguses [email protected] wrote:

Hi, I got this error when I try to deploy functions to my firebase project and I can't solve this problem firebase version:3.9.0

[debug] TypeError: Cannot read property 'pipesCount' of undefined at module.exports.Readable.pipe (_stream_readable.js:545:16) at module.exports.ZipArchiveOutputStream._smartStream (/usr/local/lib/node_modules/firebase-tools/node_modules/compress-commons/lib/archivers/zip/zip-archive-output-stream.js:171:11) at module.exports.ZipArchiveOutputStream._appendStream (/usr/local/lib/node_modules/firebase-tools/node_modules/compress-commons/lib/archivers/zip/zip-archive-output-stream.js:94:20) at module.exports.ArchiveOutputStream.entry (/usr/local/lib/node_modules/firebase-tools/node_modules/compress-commons/lib/archivers/archive-output-stream.js:89:10) at module.exports.ZipStream.entry (/usr/local/lib/node_modules/firebase-tools/node_modules/zip-stream/lib/zip-stream.js:105:49) at module.exports.Zip.append (/usr/local/lib/node_modules/firebase-tools/node_modules/archiver/lib/plugins/zip.js:30:15) at module.exports.Archiver._moduleAppend (/usr/local/lib/node_modules/firebase-tools/node_modules/archiver/lib/core.js:123:16) at module.exports.Archiver._onQueueTask (/usr/local/lib/node_modules/firebase-tools/node_modules/archiver/lib/core.js:246:8) at /usr/local/lib/node_modules/firebase-tools/node_modules/archiver/node_modules/async/lib/async.js:945:13 at Immediate.process [as _onImmediate] (/usr/local/lib/node_modules/firebase-tools/node_modules/archiver/node_modules/async/lib/async.js:913:25) [error] [error] Error: An unexpected error has occurred.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/firebase/firebase-tools/issues/356, or mute the thread https://github.com/notifications/unsubscribe-auth/AAAD_voVD-nm4r_ZHoU5cToJFNMXgNuGks5r_V0HgaJpZM4Nrkm- .

mbleigh avatar May 31 '17 13:05 mbleigh

latest version of Node.js ver:8.0.0

devosos avatar May 31 '17 14:05 devosos

I've seen two more reports of this issue on NodeJS 8 in Slack.

abeisgoat avatar May 31 '17 18:05 abeisgoat

@laurenzlong let's make figuring this out a top priority.

mbleigh avatar May 31 '17 20:05 mbleigh

Seems to be a bug with one of our dependencies: https://github.com/archiverjs/node-archiver/issues/236

laurenzlong avatar May 31 '17 21:05 laurenzlong

+1 for hitting this error. also on node.js ver:8.0.0.

AlexChaseJones avatar Jun 01 '17 01:06 AlexChaseJones

+1 for hitting this error. also on node.js ver:8.0.0.

gunins avatar Jun 01 '17 11:06 gunins

I downgraded node.js to ver:6.10.3 and now it works without any error.

devosos avatar Jun 01 '17 11:06 devosos

Got the same error when trying to deploy on Node version 8.0.0 and firebase deployment terminates with an unexpected error.:

[debug] TypeError: Cannot read property 'pipesCount' of undefined at module.exports.Readable.pipe (_stream_readable.js:545:16) at module.exports.ZipArchiveOutputStream._smartStream (/usr/local/lib/node_modules/firebase-tools/node_modules/compress-commons/lib/archivers/zip/zip-archive-output-stream.js:171:11) at module.exports.ZipArchiveOutputStream._appendStream (/usr/local/lib/node_modules/firebase-tools/node_modules/compress-commons/lib/archivers/zip/zip-archive-output-stream.js:94:20) at module.exports.ArchiveOutputStream.entry (/usr/local/lib/node_modules/firebase-tools/node_modules/compress-commons/lib/archivers/archive-output-stream.js:89:10) at module.exports.ZipStream.entry (/usr/local/lib/node_modules/firebase-tools/node_modules/zip-stream/lib/zip-stream.js:105:49) at module.exports.Zip.append (/usr/local/lib/node_modules/firebase-tools/node_modules/archiver/lib/plugins/zip.js:30:15) at module.exports.Archiver._moduleAppend (/usr/local/lib/node_modules/firebase-tools/node_modules/archiver/lib/core.js:123:16) at module.exports.Archiver._onQueueTask (/usr/local/lib/node_modules/firebase-tools/node_modules/archiver/lib/core.js:246:8) at /usr/local/lib/node_modules/firebase-tools/node_modules/archiver/node_modules/async/lib/async.js:945:13 at Immediate.process [as _onImmediate] (/usr/local/lib/node_modules/firebase-tools/node_modules/archiver/node_modules/async/lib/async.js:913:25) [error] [error] Error: An unexpected error has occurred.

goelmk avatar Jun 01 '17 14:06 goelmk

I appreciate the apparent activity / response on this, I encountered this error.

Just to remind people who's functions aren't critical i.e. for a mostly firebase hosted website - you can remove them temporarily - and I have been able to deploy doing this.

airbr avatar Jun 02 '17 01:06 airbr

I've also run into this error earlier and AFAIK the only workaround right now is downgrading Node.js from 8.0 to 7.10.

From what I've gathered doing some debugging, the problem seems to arise in prepareFunctionsUpload.js when generating the zip file (here), so the culprit is either the archiver NPM package or one of its dependencies.

Let me know if I can provide some more info.

~~Edit: cc @laurenzlong @mbleigh~~ Edit 2: Oops, just noticed Lauren already figured this out. Don't mind me.

jsayol avatar Jun 02 '17 14:06 jsayol

We are waiting on the archiver package to make a fix (for now). They are discussing it in the issue linked above by Lauren. The only way to fix for the time being is to downgrade node.

On Fri, Jun 2, 2017, 7:03 AM Josep Sayol [email protected] wrote:

I've also run into this error earlier and AFAIK the only workaround right now is downgrading Node.js from 8.0 to 7.10.

From what I've gathered doing some debugging, the problem seems to arise in prepareFunctionsUpload.js when generating the zip file (here https://github.com/firebase/firebase-tools/blob/59b61d13c8c4a8478aef168dff2691c58ab234da/lib/prepareFunctionsUpload.js#L80), so the culprit is either the archiver NPM package or one of its dependencies.

Let me know if I can provide some more info.

— You are receiving this because you commented.

Reply to this email directly, view it on GitHub https://github.com/firebase/firebase-tools/issues/356#issuecomment-305797280, or mute the thread https://github.com/notifications/unsubscribe-auth/AAAD_pQ5NOKxHepQcyQH5WxVNNlO-lnLks5sABY6gaJpZM4Nrkm- .

mbleigh avatar Jun 02 '17 14:06 mbleigh

@mbleigh We're not defining the node version in our functions project, and haven't seen the samples projects do it either. Is it as simple as defining node as a dependency in the package.json or is it the "engines" parameter in package.json?

ahaverty avatar Jun 02 '17 15:06 ahaverty

@ahaverty I feel I can answer that for you. Node is installed globally so it's not going to be in your package.json. You can use nvm (node version manager) to switch your node version. http://michael-kuehnel.de/node.js/2015/09/08/using-vm-to-switch-node-versions.html

AlexChaseJones avatar Jun 02 '17 15:06 AlexChaseJones

I see! So it's only a local issue during deployment? (It looks like firebase functions runs Node 6.9.1 regardless of the deployer https://cloud.google.com/functions/docs/writing/ ) Thanks @AlexChaseJones

ahaverty avatar Jun 02 '17 15:06 ahaverty

Correct.

On Fri, Jun 2, 2017, 8:27 AM Alan Haverty [email protected] wrote:

I see! So it's only a local issue during deployment? (It looks like firebase functions runs Node 6.9.1 regardless of the deployer https://cloud.google.com/functions/docs/writing/ ) Thanks @AlexChaseJones https://github.com/alexchasejones

— You are receiving this because you were mentioned.

Reply to this email directly, view it on GitHub https://github.com/firebase/firebase-tools/issues/356#issuecomment-305820945, or mute the thread https://github.com/notifications/unsubscribe-auth/AAAD_la24E0U4QFWi9hjNOWm7SigOtPMks5sACnmgaJpZM4Nrkm- .

mbleigh avatar Jun 02 '17 16:06 mbleigh

Confirmed, downgrading works.

Instructions for n00bs like me who are doing the Firebase Codelab tutorials:

nvm install 7.10
nvm use 7.10.0
npm install -g firebase-tools
firebase deploy --only functions

benjaminpwarren avatar Jun 03 '17 20:06 benjaminpwarren

This is currently waiting for a node patch: https://github.com/nodejs/node/pull/13374

mbrevda avatar Jun 05 '17 14:06 mbrevda

Node v8.1.0 has just been released, and if you upgrade your node version, then deploy will work again. Unfortunately we cannot get firebase-tools to work with v8.0.0.

nvm install 8.1.0
nvm use 8.1.0
npm install -g firebase-tools
firebase deploy --only functions

laurenzlong avatar Jun 08 '17 16:06 laurenzlong

Helped just firebase deploy --only functions

dmitryrn avatar Mar 01 '18 14:03 dmitryrn