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

Non-GET HTTP requests hanging #1151

Closed
s16h opened this issue Dec 26, 2020 · 22 comments
Closed

Non-GET HTTP requests hanging #1151

s16h opened this issue Dec 26, 2020 · 22 comments

Comments

@s16h
Copy link

s16h commented Dec 26, 2020

Bug Report

Current Behavior

When sending a non-GET (e.g. POST) request to an httpApi endpoint, the request hangs. This doesn't happen with GET requests.

Sample Code

/~https://github.com/s16h/sls-offline-hanging-repro

Expected behavior/code
The expectation is that a POST request should return a response.

Environment

  • serverless version: 2.16.1
  • serverless-offline version: 6.8.0
  • node.js version: v15.5.0
  • OS: macOS 11.1
  • python version: 2.7.16 and 3.9.1 (Haven't tested with other versions)
@Olcina
Copy link

Olcina commented Dec 26, 2020

Same behavior on my system from this morning too. I'm using typescript in an Ubuntu 20 machine. So, I think it could be related to a change either in the serverless-offline plugin or in the serverless framework itself. Maybe an analytics request on their side is hanging. The use of export SLS_DEBUG=true is not giving any clues either.

@johnathanmiller
Copy link

I just started experiencing this exact issue today as well.

serverless: 2.16.1
serverless-offline: 6.8.0
node.js: v15.5.0
OS: macOS 10.15.4

@dashmug
Copy link

dashmug commented Dec 29, 2020

I'm experiencing this problem as well.

@Stereobit
Copy link

Same here. Temporary downgrading node from v15.5.0 helped.

@mrflip
Copy link

mrflip commented Jan 11, 2021

To fix this, it's important that your yarn does not install node 15 as a dependency, which will happen if you use homebrew to install it. Here's how we brute-forced it:

brew deps -n node # uninstall all of these
brew uninstall node
brew uninstall yarn
node --version # should not work
yarn --version # should not work
brew install node@14
brew link node@14
node --version # should work, be 14.x
npm install -g yarn
hash -r
yarn --version
# re-install other things you uninstalled

It's possible that removing all the dependencies is unnecessary, so you could try just uninstalling yarn, unlinking node@15, and then re-installing yarn with npm and not homebrew. Haven't run the following but the commands would be something like:

brew uninstall yarn
brew unlink node
node --version # should not work
brew install node@14
brew link node@14
npm install -g yarn
hash -r
yarn --version

It's nearly certain someone who knows more command line flags of brew would be able to finesse this with less carnage, but I assume this will be resolved quickly.

@fabienjuif
Copy link

@mrflip did you know about "n"? I use this for a quite long time now and this is great!

/~https://github.com/tj/n

@robertfmurdock
Copy link

Same issue here. This is a pretty nasty blocker for using the new node js. I'm curious to learn which node js feature changed that this depended on. 🤔

@pduchesne
Copy link

Same here, had to downgrade node to v14.

@akikinyan
Copy link

I also downgraded node to v14 and it worked.

@the1adi
Copy link

the1adi commented Feb 3, 2021

Is there a fix coming for node 15?

@kenberkeley
Copy link

kenberkeley commented Mar 23, 2021

Culprit found!!! Thanks to #1150 (comment)

After my several tests, only Node v15.5.0 and v15.5.1 are not working.

@Guneetgstar
Copy link

I was using node v12.16.1, upgraded to v14.16.1 still the same issue.

@mskg
Copy link

mskg commented Apr 8, 2021

Can confirm with 15*, 14.16.1 works.

@Guneetgstar
Copy link

Maybe it isn't coz of the node version? Coz I confirm that I am using the current LTS node v14.16.1 with the same problem. (Also all my API works just fine when deployed on AWS or invoked locally using sls invoke local)

@Guneetgstar
Copy link

To fix this, it's important that your yarn does not install node 15 as a dependency, which will happen if you use homebrew to install it.

Does that mean I might have multiple versions of node in my system? Can you please add some more info that why it fixes the issue or the issue appears at all? BDW I use npm and I don't have yarn.

@iamrutvik
Copy link

Works well on Node 15.14.0. Tested

@tnortman
Copy link

I just ran into this as well - was on node v12.16.1 and had to upgrade to node 14.16.1

@bensquire
Copy link

Was on node 16 something (didn't note it down) ended up downgrading to v14.17.0 to get it to work (also installed via brew on macOS 11.4)

@cluedtke
Copy link

This issue forced me into learning how to use .nvmrc files in projects. Any progress towards a fix though?

@shiva-rockers
Copy link

Solution is simple
Ensure the version of the node environment is the same in the system(nvm) and serverless.yml runtime.
check version support for your provider and install the same version in the local machine via nvm or any.

@laxmanvijay
Copy link

laxmanvijay commented Jul 9, 2021

I ran into this as well, the plugin hangs on v16.3.0 and v15.8.0.
After switching to v14.15.5 it works

@brunocalderon
Copy link

Related to #1150

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