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

Emulator socket fails on Windows with EACCES #1280

Closed
jkarst opened this issue May 13, 2019 · 15 comments
Closed

Emulator socket fails on Windows with EACCES #1280

jkarst opened this issue May 13, 2019 · 15 comments

Comments

@jkarst
Copy link

jkarst commented May 13, 2019

[REQUIRED] Environment info

**firebase-tools:**6.9.2

**Platform:**Windows

[REQUIRED] Test case

With 6.9.2 I try to emulate functions locally and get this whenever I call a function:

`! Your requested "node" version "8" doesn't match your global version "10"

events.js:174
throw er; // Unhandled 'error' event
^

Error: listen EACCES: permission denied C:\Users\Work\AppData\Local\Temp\firebase_emulator_invocation_10596.sock
at Server.setupListenHandle [as _listen2] (net.js:1253:19)
at listenInCluster (net.js:1318:12)
at Server.listen (net.js:1416:5)
at Function.listen (C:\Users\Work\AppData\Roaming\npm\node_modules\firebase-tools\node_modules\express\lib\application.js:618:24)
at Promise (C:\Users\Work\AppData\Roaming\npm\node_modules\firebase-tools\lib\emulator\functionsEmulatorRuntime.js:359:46)
at new Promise ()
at C:\Users\Work\AppData\Roaming\npm\node_modules\firebase-tools\lib\emulator\functionsEmulatorRuntime.js:332:15
at Generator.next ()
at C:\Users\Work\AppData\Roaming\npm\node_modules\firebase-tools\lib\emulator\functionsEmulatorRuntime.js:7:71
at new Promise ()
Emitted 'error' event at:
at emitErrorNT (net.js:1297:8)
at process._tickCallback (internal/process/next_tick.js:63:19)
at Function.Module.runMain (internal/modules/cjs/loader.js:757:11)
at startup (internal/bootstrap/node.js:283:19)
at bootstrapNodeJSCore (internal/bootstrap/node.js:622:3)`

This behaviour was not present in 6.8.0 and I just verified that 6.8.0 works.

I even reinstalled Windows to double check (don't worry, it was time to do it anyway).

Note that I'm running firebase tools as the administrator, so not sure where the permission denied error is coming from.

Also note that when I run a basic express server:

`const express = require('express')
const app = express()
const port = "c:\temp\f.sock"

app.get('/', (req, res) => res.send('Hello World!'))

app.listen(port, () => console.log(Example app listening on port ${port}!))`

I get the same error.

[REQUIRED] Steps to reproduce

  1. Install firebase [email protected]
  2. Init a new project with just functions
  3. Uncomment the helloWorld function example
  4. Emulate the function locally with firebase serve command
  5. Call the localhost function url
  6. Notice the crash

[REQUIRED] Expected behavior

The function should run.

[REQUIRED] Actual behavior

The function crashes.

@flelirzin
Copy link

flelirzin commented May 13, 2019

Same here. On my side, not working with 6.8.0 because I'm node 8 and it requires node 6

@abeisgoat
Copy link
Contributor

Thanks for the report @jkarst, looks like we've got a handful of Windows-exclusive issues. I'll dive into issues on there specifically today. Sorry for the inconvience, in the meantime feel free to npm install -g [email protected] to roll back to the old emulator.

@abeisgoat abeisgoat changed the title Local emulated functions do not work Emulator socket fails on Windows with EACCES May 13, 2019
@abeisgoat abeisgoat self-assigned this May 13, 2019
@JavierPAYTEF
Copy link

I can confirm this is happening for me as well. Reverting to the previous version resolved the issue.
My stack trace is the same and I also have Node 10 installed instead of Node 8.

@epomatti
Copy link

Same here with 6.9.2 on Windows and Node 10. Reverted back to 6.8.0.

@brendanosborne
Copy link

Seeing the same issue. @epomatti how do you revert?

@ryanpbrewster
Copy link
Contributor

You should be able to downgrade via npm install --global [email protected] (drop the --global flag if you're not installing it globally).

@epomatti
Copy link

epomatti commented May 15, 2019

Seeing the same issue. @epomatti how do you revert?

@brendanosborne run npm install -g [email protected]... all of 6.9.x releases are broken in some way until now, you have to go 6.8.0.

@brendanosborne
Copy link

Thanks @epomatti and @ryanmeier - I'm back in business until this is resolved.

@abeisgoat
Copy link
Contributor

Alright, I've found a fix for this and will hopefully get it in for the 6.9.3 release this week!

abeisgoat added a commit that referenced this issue May 16, 2019
@samtstern
Copy link
Contributor

Fix for this has been merged and will be included in the next release.

@GitNothing
Copy link

Seeing the same issue. @epomatti how do you revert?

@brendanosborne run npm install -g [email protected]... all of 6.9.x releases are broken in some way until now, you have to go 6.8.0.

Thanks. Spent many hours on this, thinking it was my fault.

@epomatti
Copy link

@vdGitAway I've upgraded to 6.10.0 and it is working for me until now. It fixed this bug and many others. Give it a try.

If you have any problems delete node_modules directory.

I also had to include the following dev dependency, otherwise the code would not run:

  "devDependencies": {
    "firebase-functions-test": "^0.1.6"
  }

Since you're on it, run npm outdated and npm update too to get the latest versions for your dependencies.

@dreadrocksean
Copy link

I'm having this issue and I'm on 8.2.0

@sadranyi
Copy link

sadranyi commented Aug 5, 2020

I am still seeing this issue as of today.
Windows 10
Node 10
latest firebase-tools

@amebrahimi
Copy link

amebrahimi commented Jul 28, 2021

I have this issue too I'm on windows 10
Node v16.5.0
firebase 9.16.0

node:events:371
      throw er; // Unhandled 'error' event
      ^

Error: listen EACCES: permission denied 127.0.0.1:4000
    at Server.setupListenHandle [as _listen2] (node:net:1298:21)
    at listenInCluster (node:net:1363:12)
    at GetAddrInfoReqWrap.doListen [as callback] (node:net:1501:7)
    at GetAddrInfoReqWrap.onlookup [as oncomplete] (node:dns:73:8)
Emitted 'error' event on Server instance at:
    at emitErrorNT (node:net:1342:8)
    at processTicksAndRejections (node:internal/process/task_queues:83:21) {
  code: 'EACCES',
  errno: -4092,
  syscall: 'listen',
  address: '127.0.0.1',
  port: 4000
}

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

No branches or pull requests