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

error with firebase deploy functions #356

Closed
devosos opened this issue May 31, 2017 · 21 comments
Closed

error with firebase deploy functions #356

devosos opened this issue May 31, 2017 · 21 comments
Assignees

Comments

@devosos
Copy link

devosos commented May 31, 2017

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.

@mbleigh
Copy link
Contributor

mbleigh commented May 31, 2017 via email

@devosos
Copy link
Author

devosos commented May 31, 2017

latest version of Node.js ver:8.0.0

@abeisgoat
Copy link
Contributor

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

@mbleigh
Copy link
Contributor

mbleigh commented May 31, 2017

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

@laurenzlong
Copy link
Contributor

Seems to be a bug with one of our dependencies: archiverjs/node-archiver#236

@AlexChaseJones
Copy link

AlexChaseJones commented Jun 1, 2017

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

1 similar comment
@gunins
Copy link

gunins commented Jun 1, 2017

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

@devosos
Copy link
Author

devosos commented Jun 1, 2017

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

@goelmk
Copy link

goelmk commented Jun 1, 2017

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.

@airbr
Copy link

airbr commented Jun 2, 2017

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.

@jsayol
Copy link
Contributor

jsayol commented Jun 2, 2017

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.

@mbleigh
Copy link
Contributor

mbleigh commented Jun 2, 2017 via email

@ahaverty
Copy link

ahaverty commented Jun 2, 2017

@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?

@AlexChaseJones
Copy link

@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

@ahaverty
Copy link

ahaverty commented Jun 2, 2017

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

@mbleigh
Copy link
Contributor

mbleigh commented Jun 2, 2017 via email

@benjaminpwarren
Copy link

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

@mbrevda
Copy link

mbrevda commented Jun 5, 2017

This is currently waiting for a node patch: nodejs/node#13374

@laurenzlong
Copy link
Contributor

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

@dmitryrn
Copy link

dmitryrn commented Mar 1, 2018

Helped just
firebase deploy --only functions

@AndrewRedican
Copy link

You can use babel and optionally webpack from transpile +ES8 to Node 6 which firebase currently uses.

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