Deploy did not succeed with HTTP Error 400:

my site has been failing to deploy, site name: e-homes.netlify.app, site id: 78400ddc-ceda-4077-ba81-6878a0a9e6a2

The app builds successfully and then fails to deploy due to the error above, I have research and could not fix the issue. The error I am encountering is Deploy did not succeed with HTTP Error 400

see full error log

8:52:26 PM: Deploy site
8:52:26 PM: ────────────────────────────────────────────────────────────────
8:52:26 PM: ​
8:52:26 PM: Starting to deploy site from ‘.next’
8:52:26 PM: Calculating files to upload
8:52:27 PM: 69 new file(s) to upload
8:52:27 PM: 1 new function(s) to upload
8:52:32 PM: Failed to create function: invalid parameter for function creation: Invalid AWS Lambda parameters used in this request.
8:52:32 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)
8:52:32 PM: Failed to upload file: ___netlify-server-handler
8:52:32 PM: Section completed: deploying
8:52:32 PM: ​
8:52:32 PM: Error deploying
8:52:32 PM: ────────────────────────────────────────────────────────────────
8:52:32 PM: ​
8:52:32 PM: Error message
8:52:32 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: Invalid AWS Lambda parameters used in this request.}
8:52:32 PM: ​
8:52:32 PM: Error location
8:52:32 PM: At deploy the stage with HTTP status code ‘400’
8:52:32 PM: ​
8:52:32 PM: Resolved config
8:52:32 PM: build:
8:52:32 PM: command: npm run build
8:52:32 PM: commandOrigin: config
8:52:32 PM: environment:
8:52:32 PM: - NEXT_PUBLIC_BASEAPI
8:52:32 PM: - NEXT_PUBLIC_SECRET_PERSIST_KEY
8:52:32 PM: publish: /opt/build/repo/.next
8:52:32 PM: publishOrigin: config
8:52:32 PM: plugins:
8:52:32 PM: - inputs: {}
8:52:32 PM: origin: config
8:52:32 PM: package: ‘@netlify/plugin-nextjs’
8:52:32 PM: redirects:
8:52:32 PM: - from: /_next/image
8:52:32 PM: query:
8:52:32 PM: q: ‘:quality’
8:52:32 PM: url: ‘:url’
8:52:32 PM: w: ‘:width’
8:52:32 PM: status: 200
8:52:32 PM: to: /.netlify/images?url=:url&w=:width&q=:quality
8:52:32 PM: - from: /_ipx/*
query:
q: ‘:quality’
url: ‘:url’
w: ‘:width’
status: 200
to: /.netlify/images?url=:url&w=:width&q=:quality
redirectsOrigin: inline
8:52:32 PM: Build failed due to a user error: Build script returned non-zero exit code: 2
8:52:32 PM: Failing build: Failed to build site

Could you try to re-deploy your site now?

Thanks, it works now, what can I do so that it does not happens again ?

Nothing. This was on our end.