i’ve added a new serverless function and an extra env var and when trying to deploy i get this?
any idea why? sorry if this was mentioned before. thanks
update: i’ve realised that the issue is the dropbox token which is very long.
how can i solve this issue?
5:44:53 PM: Failed to create function: invalid parameter for function creation: Your environment variables exceed the 4KB limit imposed by AWS Lambda. Please consider reducing them.
5:44:53 PM: Failed to create function: invalid parameter for function creation: Your environment variables exceed the 4KB limit imposed by AWS Lambda. Please consider reducing them.
5:44:54 PM: Failed during stage ‘building site’: Build script returned non-zero exit code: 2 (Search results for '"non-zero exit code: 2"' - Netlify Support Forums)
5:44:52 PM: Deploy site
5:44:52 PM: ────────────────────────────────────────────────────────────────
5:44:52 PM:
5:44:52 PM: Starting to deploy site from ‘’
5:44:52 PM: Calculating files to upload
5:44:52 PM: 0 new file(s) to upload
5:44:52 PM: 4 new function(s) to upload
5:44:53 PM: Failed to upload file: hello-world
5:44:53 PM: Failed to upload file: dropboxIntegration
5:44:53 PM: Failed to upload file: firebase
5:44:53 PM: Failed to upload file: firebaseAddData
5:44:53 PM: Section completed: deploying
5:44:53 PM:
5:44:53 PM: Error deploying
5:44:53 PM: ────────────────────────────────────────────────────────────────
5:44:53 PM:
5:44:53 PM: Error message
5:44:53 PM: Deploy did not succeed with HTTP Error 400: [PUT /deploys/{deploy_id}/functions/{name}][400] uploadDeployFunction default &{Code:400 Message:Failed to create function: invalid parameter for function creation: Your environment variables exceed the 4KB limit imposed by AWS Lambda. Please consider reducing them.}
5:44:53 PM: Failed to create function: invalid parameter for function creation: Your environment variables exceed the 4KB limit imposed by AWS Lambda. Please consider reducing them.
5:44:53 PM: Failed to create function: invalid parameter for function creation: Your environment variables exceed the 4KB limit imposed by AWS Lambda. Please consider reducing them.
5:44:53 PM:
5:44:53 PM: Error location
5:44:53 PM: At deploy the stage with HTTP status code ‘400’
5:44:53 PM:
5:44:53 PM: Resolved config
5:44:53 PM: build:
5:44:53 PM: environment:
5:44:53 PM: - DROPBOX_ACCESS_TOKEN
5:44:53 PM: - EVENTIX_CLIENT_ID
5:44:53 PM: - EVENTIX_CLIENT_SECRET
5:44:53 PM: - EVENTIX_CODE_KEY
5:44:53 PM: - EVENTIX_COMPANY_ID
5:44:53 PM: - FIREBASE_SERVICE_ACCOUNT
5:44:53 PM: publish: /opt/build/repo
5:44:53 PM: publishOrigin: default
5:44:53 PM: functionsDirectory: /opt/build/repo/netlify/functions
5:44:53 PM: headers:
5:44:54 PM: - for: /*
values:
access-control-allow-origin: ‘*’
headersOrigin: config
5:44:54 PM: Build failed due to a user error: Build script returned non-zero exit code: 2
5:44:54 PM: Failing build: Failed to build site