-
Notifications
You must be signed in to change notification settings - Fork 152
Closed
Description
Description:
Because the log output from the Maven build is decoded with UTF-8 (see line), an "ü" in our unit-test logs causes the SAM local Lambda build to fail.
If I add -DskipTests with a Makefile it completes as expected.
Steps to reproduce the issue:
- Set up Lambda project that logs out an Umlaut (äÄöÖüÜß) during
maven package - run
sam buildwith default template configuration
Observed result:
| JavaMavenWorkflow:CopySource succeeded
| Running JavaMavenWorkflow:MavenBuild
| JavaMavenWorkflow:MavenBuild raised unhandled exception
Traceback (most recent call last):
File "C:\Program Files\Amazon\AWSSAMCLI\runtime\lib\site-packages\aws_lambda_builders\workflow.py", line 369, in run
action.execute()
File "C:\Program Files\Amazon\AWSSAMCLI\runtime\lib\site-packages\aws_lambda_builders\workflows\java_maven\actions.py", line 39, in execute
self.subprocess_maven.build(self.scratch_dir)
File "C:\Program Files\Amazon\AWSSAMCLI\runtime\lib\site-packages\aws_lambda_builders\workflows\java_maven\maven.py", line 31, in build
LOG.debug("Maven logs: %s", stdout.decode("utf8").strip())
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xfc in position 43840: invalid start byte
Expected result:
SAM build completes despite an encoding error in a debug-log or it logs out any Maven output correctly.
Additional environment details (Ex: Windows, Mac, Amazon Linux etc)
- OS: Windows 10
- SAM CLI version: 1.96.0
- AWS region: EU-CENTRAL-1