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

Handle V2, fix logging error when S3 permissions are not granted #2426

Merged
merged 1 commit into from Apr 20, 2022

Conversation

Edweis
Copy link
Contributor

@Edweis Edweis commented Apr 12, 2022

To reproduce:

  • set useV2Handle: true in serverless.yml
  • make sure the permission of the default lambda miss the s3:GetObject permission
  • run the default lambda using getStaticProps
    Error is
{
   "errorType": "TypeError",
   "errorMessage": "Converting circular structure to JSON\n    --> starting at object with constructor 'IncomingMessage'\n    |     property 'req' -> object with constructor 'ClientRequest'\n    --- property 'res' closes the circle",
   "stack": [
       "TypeError: Converting circular structure to JSON",
       "    --> starting at object with constructor 'IncomingMessage'",
       "    |     property 'req' -> object with constructor 'ClientRequest'",
       "    --- property 'res' closes the circle",
       "    at JSON.stringify (<anonymous>)",
       "    at AwsPlatformClient.getObject (/var/task/default-handler-v2-fe969e74.js:102744:22)",
       "    at processTicksAndRejections (internal/process/task_queues.js:95:5)",
       "    at async staticRequest (/var/task/default-handler-v2-fe969e74.js:83675:26)",
       "    at async defaultHandler (/var/task/default-handler-v2-fe969e74.js:83851:16)",
       "    at async Runtime.handler (/var/task/default-handler-v2-fe969e74.js:102901:5)"
   ]
}

This PR prevent the API from returning 503 response.

@slsnextbot
Copy link
Collaborator

Handler Size Report

No changes to handler sizes.

Base Handler Sizes (kB) (commit e7af519)

{
    "Lambda": {
        "Default Lambda": {
            "Standard": 1578,
            "Minified": 692
        },
        "Image Lambda": {
            "Standard": 1542,
            "Minified": 830
        }
    },
    "Lambda@Edge": {
        "Default Lambda": {
            "Standard": 1588,
            "Minified": 698
        },
        "Default Lambda V2": {
            "Standard": 1580,
            "Minified": 694
        },
        "API Lambda": {
            "Standard": 634,
            "Minified": 318
        },
        "Image Lambda": {
            "Standard": 1550,
            "Minified": 835
        },
        "Regeneration Lambda": {
            "Standard": 1233,
            "Minified": 566
        },
        "Regeneration Lambda V2": {
            "Standard": 1307,
            "Minified": 596
        }
    }
}

New Handler Sizes (kB) (commit 4073e85)

{
    "Lambda": {
        "Default Lambda": {
            "Standard": 1578,
            "Minified": 692
        },
        "Image Lambda": {
            "Standard": 1542,
            "Minified": 830
        }
    },
    "Lambda@Edge": {
        "Default Lambda": {
            "Standard": 1588,
            "Minified": 698
        },
        "Default Lambda V2": {
            "Standard": 1580,
            "Minified": 694
        },
        "API Lambda": {
            "Standard": 634,
            "Minified": 318
        },
        "Image Lambda": {
            "Standard": 1550,
            "Minified": 835
        },
        "Regeneration Lambda": {
            "Standard": 1233,
            "Minified": 566
        },
        "Regeneration Lambda V2": {
            "Standard": 1307,
            "Minified": 596
        }
    }
}

@dphang dphang merged commit acfe76e into serverless-nextjs:master Apr 20, 2022
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

Successfully merging this pull request may close these issues.

None yet

3 participants