mitchmac / ServerlessWP

Host WordPress sites on Vercel, Netlify, or AWS Lambda
GNU General Public License v3.0
240 stars 85 forks source link

504: GATEWAY_TIMEOUT #40

Open DmitryAdam opened 6 months ago

DmitryAdam commented 6 months ago

After fresh install from clicking the vercel deploy button, this message appear: This Serverless Function has timed out.

Your connection is working correctly.

Vercel is working correctly.

504: GATEWAY_TIMEOUT Code: FUNCTION_INVOCATION_TIMEOUT ID: sin1::xvkft-1702434374787-3c525d8b2102

If you are a visitor, contact the website owner or try again later. If you are the owner, learn how to fix the error and check the logs.

peterkyle01 commented 6 months ago

Changed the serverless.yml file on line 13 on the timeout from 15 to 30 because I read that is the max for vercel and it worked ,also make the function calls near your location on vercel to reduce the timeouts.

DmitryAdam commented 6 months ago

I did it, this is my serverlesss.yml:

service: serverlesswp-wordpress-starter

provider:
  name: aws
  runtime: nodejs18.x
  httpApi:
    payload: '2.0'

functions:
  requestHandler:
    handler: api/index.handler
    memorySize: 1024
    timeout: 30
    events:
      - httpApi:
          method: any
          path: /{proxy+}
    environment:
IMPranshu commented 6 months ago

Well, I think we can run only 1 serverless function project in the hobby project. If you are running this your other projects will eventually timeout on the "Hobby Plan". I have tested it out. It would help if you upgraded to Pro or used multiple Vercel accounts.

DmitryAdam commented 6 months ago

I did, I just running 1 project on this vercel account

eucelso commented 5 months ago

I have the same problem: I changed the file serverlesss.yml, but the error persists.

Could someone give me a light?

IMPranshu commented 5 months ago

One thing I noticed is that I was changing the PlanetScale DB's location from the default and I was facing the timeout error.

When I kept it to default I didn't face this error, I tried it multiple times. Hope this helps.

eucelso commented 5 months ago

I ended up changing my config here to Europe because that's where I am, I'll try to keep the default location to see then

eucelso commented 5 months ago

tks @IMPranshu I kept it to default and works!