question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

.NET Core HelloWorld does not work with non-ASCII Windows user names

See original GitHub issue

Describe the bug

When I follow the documentation to create and deploy a .NET Core SAM sample application, deploying the application fails with the error message

Error: DotnetCliPackageBuilder:RunPackageAction - 'utf-8' codec can't decode byte 0x94 in position 1322: invalid start byte

This is presumable due to my Windows user name (Stefan.Götz) or user home directory containing a non-ASCII character and it not being properly UTF-8 encoded.

To Reproduce

Steps to reproduce the behavior:

  1. Install VSCode, AWS Toolkit, .NET Core as per documentation
  2. In VSCode, run “AWS: Create new SAM Application”
  3. In VSCode, run “AWS: Deploy SAM Application”
  4. See error

Expected behavior

Would expect the sample SAM application to be deployed successfully (this works for me with a Python sample application).

Screenshots

Logs:

2020-06-10 15:47:47 [INFO]: Retrieving AWS endpoint data
2020-06-10 15:47:47 [INFO]: OS:  Windows_NT x64 10.0.18363
Visual Studio Code Version:  1.45.1
AWS Toolkit Version:  1.10.0

2020-06-10 15:48:14 [INFO]: Running command: C:\Program Files\Amazon\AWSSAMCLI\bin\sam.cmd --info
2020-06-10 15:48:28 [INFO]: Starting SAM Application deployment...
2020-06-10 15:48:28 [INFO]: Building SAM Application...
2020-06-10 15:48:28 [INFO]: Running command: C:\Program Files\Amazon\AWSSAMCLI\bin\sam.cmd build --build-dir C:\Users\STEFAN~1.GTZ\AppData\Local\Temp\aws-toolkit-vscode\samDeploynTnqGI\build --template c:\cygwin64\tmp\dev-sgotz-sam-cs-hello-world\dev-sgotz-sam-cs-hello-world\template.yaml
2020-06-10 15:48:36 [ERROR]: Unexpected exitcode (1), expecting (0)
2020-06-10 15:48:36 [ERROR]: Error: undefined
2020-06-10 15:48:36 [ERROR]: stderr: Building function 'HelloWorldFunction'
,Running DotnetCliPackageBuilder:GlobalToolInstall
,
,Tool 'amazon.lambda.tools' was reinstalled with the latest stable version (version '4.0.0').
,Running DotnetCliPackageBuilder:RunPackageAction
,Error: DotnetCliPackageBuilder:RunPackageAction - 'utf-8' codec can't decode byte 0x94 in position 1322: invalid start byte
2020-06-10 15:48:36 [ERROR]: stdout: Build Failed
2020-06-10 15:48:36 [ERROR]: [Error: Error with child process: Building function 'HelloWorldFunction'
,Running DotnetCliPackageBuilder:GlobalToolInstall
,
,Tool 'amazon.lambda.tools' was reinstalled with the latest stable version (version '4.0.0').
,Running DotnetCliPackageBuilder:RunPackageAction
,Error: DotnetCliPackageBuilder:RunPackageAction - 'utf-8' codec can't decode byte 0x94 in position 1322: invalid start byte
	at Object.t.logAndThrowIfUnexpectedExitCode (c:\Users\Stefan.Götz\.vscode\extensions\amazonwebservices.aws-toolkit-vscode-1.10.0\dist\extension.js:2:492849)
	at t.SamCliBuildInvocation.<anonymous> (c:\Users\Stefan.Götz\.vscode\extensions\amazonwebservices.aws-toolkit-vscode-1.10.0\dist\extension.js:2:1239517)
	at Generator.next (<anonymous>)
	at o (c:\Users\Stefan.Götz\.vscode\extensions\amazonwebservices.aws-toolkit-vscode-1.10.0\dist\extension.js:2:1237747)
	at processTicksAndRejections (internal/process/task_queues.js:85:5)]
2020-06-10 15:48:36 [ERROR]: An error occurred while deploying a SAM Application. Check the logs for more information by running the "View AWS Toolkit Logs" command from the Command Palette.
2020-06-10 15:52:49 [INFO]: Successfully sent a telemetry batch of 14
2020-06-10 15:57:50 [INFO]: Successfully sent a telemetry batch of 2

Desktop (please complete the following information):

OS: Windows_NT x64 10.0.18363 Visual Studio Code Version: 1.45.1 AWS Toolkit Version: 1.10.0

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
mndevecicommented, Sep 4, 2020

SAM CLI v1.2.0 released yesterday including this fix

1reaction
CoshUScommented, Sep 3, 2020
Read more comments on GitHub >

github_iconTop Results From Across the Web

Using non-ASCII characters in Microsoft.AspNetCore.Identity ...
This is the default behaviour of ASP.NET Core Identity. You could do the following to disable validation: services.
Read more >
Compatibility issues with apps using some non-ASCII ...
I am currently experiencing that issue with an application and my PC User name contains non-ASCII character. So I was wondering - if...
Read more >
UTF-8 Everywhere
Once tested on ASCII strings for file name arguments, it would work correctly for file names in any language, as arguments are treated...
Read more >
Unicode & Character Encodings in Python: A Painless Guide
As you saw, the problem with ASCII is that it's not nearly a big enough set of characters to accommodate the world's set...
Read more >
Non ascii characters are padding without reason — oracle-tech
Hi all, here is my issue : I have description field in my jsp page, when user enters some non ASCII characters as...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found