dev to prod
Lambda is getting deployed and developer checked it is fine but the job is failing with below error.
14:20:16 Starting lambda deployment procedure 14:20:16 ERROR: Build step failed with exception 14:20:16 java.lang.NullPointerException: file 14:20:16 at java.base/java.util.Objects.requireNonNull(Objects.java:246) 14:20:16 at org.apache.commons.io.FileUtils.openInputStream(FileUtils.java:2387) 14:20:16 at org.apache.commons.io.FileUtils.readFileToByteArray(FileUtils.java:2467) 14:20:16 at com.xti.jenkins.plugin.awslambda.service.LambdaDeployService.getByteBufferAndDeleteFile(LambdaDeployService.java:387) 14:20:16 at com.xti.jenkins.plugin.awslambda.service.LambdaDeployService.getFunctionCode(LambdaDeployService.java:372) 14:20:16 at com.xti.jenkins.plugin.awslambda.upload.LambdaUploader.upload(LambdaUploader.java:50) 14:20:16 at com.xti.jenkins.plugin.awslambda.callable.DeployCallable.call(DeployCallable.java:46) 14:20:16 at com.xti.jenkins.plugin.awslambda.callable.DeployCallable.call(DeployCallable.java:23) 14:20:16 at hudson.remoting.LocalChannel.call(LocalChannel.java:47) 14:20:16 at com.xti.jenkins.plugin.awslambda.upload.LambdaUploadBuildStep.perform(LambdaUploadBuildStep.java:81) 14:20:16 Caused: java.lang.RuntimeException 14:20:16 at com.xti.jenkins.plugin.awslambda.upload.LambdaUploadBuildStep.perform(LambdaUploadBuildStep.java:88) 14:20:16 at com.xti.jenkins.plugin.awslambda.upload.LambdaUploadBuildStep.perform(LambdaUploadBuildStep.java:69) 14:20:16 at jenkins.tasks.SimpleBuildStep.perform(SimpleBuildStep.java:123) 14:20:16 at hudson.tasks.BuildStepCompatibilityLayer.perform(BuildStepCompatibilityLayer.java:80) 14:20:16 at hudson.tasks.BuildStepMonitor$3.perform(BuildStepMonitor.java:47) 14:20:16 at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:818) 14:20:16 at hudson.model.Build$BuildExecution.build(Build.java:199) 14:20:16 at hudson.model.Build$BuildExecution.doRun(Build.java:164) 14:20:16 at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:526) 14:20:16 at hudson.model.Run.execute(Run.java:1900) 14:20:16 at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:44) 14:20:16 at hudson.model.ResourceController.execute(ResourceController.java:101) 14:20:16 at hudson.model.Executor.run(Executor.java:442) 14:20:16 Build step 'AWS Lambda deployment' marked build as failure 14:20:16 Finished: FAILURE
when checked in ChatGPT i got this
It looks like there is a NullPointerException in the Java code that is being executed during the deployment process. The stack trace shows that the exception is being caused by a call to FileUtils.openInputStream() in the LambdaDeployService class. The error message says "NullPointerException: file", which suggests that the file argument passed to that method is null.
To determine which file is causing the issue, you may need to look at the source code for LambdaDeployService and see where the file argument is coming from. It could be that the file is being deleted or moved before the method is called, or there could be an issue with the file path or name.
If you are not familiar with the codebase, you may need to consult with the developer or development team responsible for the code to get more information about the issue. They may be able to provide additional context or suggest a fix for the problem.