Unhandled Rejection (Error): GraphQL error: 502: Bad Gateway


#1

Hi, I got this error while I am on admin site and click install security button. I can see the api graphql page so would assume it’s working. Any ideas or answers would be much appreciated.

[UPDATE] Thanks @pavel. It’s working now when I upgraded node.js to 13.6.0


#2

Hi @hadisonick, another member of the community reported this same bug and we were able to reproduce it. We’ll release a fix ASAP and I’ll let you know when it’s ready so you can redeploy :slight_smile:

Thanks and cheers!


#3

Hi,

I’m facing the same issue on redeployed api for local environment. I was able to observe the malicious Lambda behavior responsible for “serverless-apollo-service: Security”. In CloudWatch I found:

2020-01-18T12:44:52.208Z	ae4a4daf-778b-4911-b8e5-7d9405da124f	ERROR	Unhandled Promise Rejection	
{
    "errorType": "Runtime.UnhandledPromiseRejection",
    "errorMessage": "Error: Cannot delete before saving to storage.",
    "reason": {
        "errorType": "Error",
        "errorMessage": "Cannot delete before saving to storage.",
        "code": "CANNOT_DELETE_NO_ID",
        "message": "Cannot delete before saving to storage.",
        "data": null,
        "stack": [
            "Error: Cannot delete before saving to storage.",
            "    at baseFn.delete (/var/task/handler.js:179913:17)",
            "    at baseFn.hook (/var/task/handler.js:180387:34)",
            "    at Object.init (/var/task/handler.js:181942:23)",
            "    at new <anonymous> (/var/task/handler.js:57514:45)",
            "    at instance (/var/task/handler.js:180769:54)",
            "    at /var/task/handler.js:180282:77",
            "    at Array.forEach (<anonymous>)",
            "    at baseFn.construct (/var/task/handler.js:180280:38)",
            "    at new baseFn (/var/task/handler.js:180270:14)",
            "    at Function.findOne (/var/task/handler.js:180217:27)",
            "    at process._tickCallback (internal/process/next_tick.js:68:7)"
        ]
    },
    "promise": {},
    "stack": [
        "Runtime.UnhandledPromiseRejection: Error: Cannot delete before saving to storage.",
        "    at process.on (/var/runtime/index.js:37:15)",
        "    at process.emit (events.js:198:13)",
        "    at process.EventEmitter.emit (domain.js:448:20)",
        "    at emitPromiseRejectionWarnings (internal/process/promises.js:140:18)",
        "    at process._tickCallback (internal/process/next_tick.js:69:34)"
    ]
}

I’m stuck at this point as I don’t know what component is responsible for this message. Glad you’re on it @pavel :slightly_smiling_face:


#4

Yep that’s exactly the problem and we know the cause; hang on, fix is on the way :slight_smile: