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

Bug: No message from the Maven's stderr in the sam output logs #502

Open
usmanovbf opened this issue May 12, 2023 · 1 comment
Open

Bug: No message from the Maven's stderr in the sam output logs #502

usmanovbf opened this issue May 12, 2023 · 1 comment
Labels

Comments

@usmanovbf
Copy link

Description:

I am trying to execute
MAVEN_OPTS="-DskipTests=true" sam build --debug --cached and getting the error with no maven error message - it is empty but appears in the depths of the aws-lambda-builders library

Steps to reproduce:

Execute the $ MAVEN_OPTS="-DskipTests=true" sam build --debug --cached

Observed result:

2023-05-12 03:23:05,439 | Maven logs: 
Maven Failed: {message}
2023-05-12 03:23:05,440 | JavaMavenWorkflow:MavenBuild failed
Traceback (most recent call last):
  File "/usr/local/Cellar/aws-sam-cli/1.82.0/libexec/lib/python3.8/site-packages/aws_lambda_builders/workflows/java_maven/actions.py", line 39, in execute
    self.subprocess_maven.build(self.scratch_dir)
  File "/usr/local/Cellar/aws-sam-cli/1.82.0/libexec/lib/python3.8/site-packages/aws_lambda_builders/workflows/java_maven/maven.py", line 34, in build
    raise MavenExecutionError(message=stdout.decode("utf8").strip())
aws_lambda_builders.workflows.java_maven.maven.MavenExecutionError: Maven Failed: 

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/Cellar/aws-sam-cli/1.82.0/libexec/lib/python3.8/site-packages/aws_lambda_builders/workflow.py", line 369, in run
    action.execute()
  File "/usr/local/Cellar/aws-sam-cli/1.82.0/libexec/lib/python3.8/site-packages/aws_lambda_builders/workflows/java_maven/actions.py", line 42, in execute
    raise ActionFailedError(str(ex))
aws_lambda_builders.actions.ActionFailedError: Maven Failed: 

Build Failed
2023-05-12 03:23:05,509 | Telemetry endpoint configured to be https://aws-serverless-tools-telemetry.us-west-2.amazonaws.com/metrics
2023-05-12 03:23:05,513 | Telemetry endpoint configured to be https://aws-serverless-tools-telemetry.us-west-2.amazonaws.com/metrics
2023-05-12 03:23:05,513 | Unable to find Click Context for getting session_id.
Error: JavaMavenWorkflow:MavenBuild - Maven Failed: 

Expected result:

Get the non-empty error message from Maven which should be retrieved from the stderr variable on the aws_lambda_builders/workflows/java_maven/maven.py:49 line

Additional environment details (Ex: Windows, Mac, Amazon Linux etc)

  1. OS:
$ uname -a
Darwin my-laptop 22.4.0 Darwin Kernel Version 22.4.0: Mon Mar  6 21:00:17 PST 2023; root:xnu-8796.101.5~3/RELEASE_X86_64 x86_64
  1. sam --version: SAM CLI, version 1.82.0
  2. AWS region: eu-west-1
{
  "version": "1.82.0",
  "system": {
    "python": "3.8.16",
    "os": "macOS-13.3.1-x86_64-i386-64bit"
  },
  "additional_dependencies": {
    "docker_engine": "20.10.12",
    "aws_cdk": "Not available",
    "terraform": "1.4.6"
  }
}
image
@usmanovbf usmanovbf added the stage/needs-triage Automatically applied to new issues and PRs, indicating they haven't been looked at. label May 12, 2023
@usmanovbf usmanovbf changed the title Bug: No stderr info from maven in the sam output logs Bug: No message from the Maven's stderr in the sam output logs May 12, 2023
@mndeveci mndeveci transferred this issue from aws/aws-sam-cli May 13, 2023
@mndeveci
Copy link
Contributor

Thanks for raising this issue!

I think we need to log the stderr from Maven in here https://github.com/aws/aws-lambda-builders/blob/develop/aws_lambda_builders/workflows/java_maven/maven.py#LL31C67-L31C67

We are happy to review the change if you would like to raise a PR.

@mndeveci mndeveci added area/workflow/java_maven area/build and removed stage/needs-triage Automatically applied to new issues and PRs, indicating they haven't been looked at. labels May 13, 2023
@hawflau hawflau added the contributors/welcome Contributors are welcome to work on this label May 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants