aws / aws/aws-toolkit-vscode

Error: DotnetCliPackageBuilder:RunPackageAction - [WinError 267] The directory name is invalid

Open
#1,332 6 comments 0 reactions 0 assignees View on GitHub
bug good first issue language:.NET platform:windows sam
Dominant language
TypeScript
Stars
2k
Forks
807
Avg merge
10h 12m
Merged PRs (30d)
7

Description

**Describe the bug**

CodeUri in Function has invalid directory name

**To Reproduce**

* Create a powershell package using the new-awsPowerShellLambdaPackage:

> New-AWSPowerShellLambdaPackage -ScriptPath checkdomainavailable.ps1 -OutputPackage checkdomainavailable.zip

* Add the function in template.yaml

> CheckDomainAvailableFunction:
Type: AWS::Serverless::Function
Properties:
CodeUri: lambda/check-domain-available/checkdomainavailable.zip
Handler: checkdomainavailable::checkdomainavailable.Bootstrap::ExecuteFunction
Runtime: dotnetcore3.1
Role: !GetAtt OnBoardingR53LambdaRole.Arn
Events:
APIEvent:
Type: Api
Properties:
Path: /checkdomainavailable
Method: post
RestApiId: !Ref OnBoardingAPI

* Use the AWS: Deploy SAM Application

Deployment will fail with the following output:
``
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.
Starting SAM Application deployment...
Building SAM Application...
Error with child process: Building function 'StartPaymentFunction'
,Running NodejsNpmBuilder:NpmPack
,Running NodejsNpmBuilder:CopyNpmrc
,Running NodejsNpmBuilder:CopySource
,Running NodejsNpmBuilder:NpmInstall
,Running NodejsNpmBuilder:CleanUpNpmrc
,Building function 'CheckDomainAvailableFunction'
,Running DotnetCliPackageBuilder:GlobalToolInstall
,
,Tool 'amazon.lambda.tools' was reinstalled with the latest stable version (version '4.1.0').
,Running DotnetCliPackageBuilder:RunPackageAction
,Error: DotnetCliPackageBuilder:RunPackageAction - [WinError 267] The directory name is invalid
``

**Expected behavior**

The function should be deployed to Lambda

**Desktop (please complete the following information):**

- OS: Windows_NT x64 10.0.18362
- Visual Studio Code Version: 1.49.2
- AWS Toolkit Version: 1.14.0

**Additional context**

In the template an additional nodejs function, as well as API and IAM roles are also deployed. This worked fine before I added the dotnetcore function.

**Testing performed**

I already tried moving the generated zip file to other directories anad different runtime dotnetcore2.1

Contributor guide

Open the contributing guide

Research direction

Reproduce the deployment from template.yaml using New-AWSPowerShellLambdaPackage and the AWS: Deploy SAM Application command on the reported Windows setup. Start with the AWS Toolkit logs at DotnetCliPackageBuilder:RunPackageAction and compare the failing CodeUri case with the working Node.js function. Done means the SAM application builds and deploys the PowerShell Lambda successfully.

Written by the indexing model from the issue text.

Assessment

Tech stack
aws, powershell, vscode
Domain
cloud, devops
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.