Issues building `FileArchive` object. Somehow an ...
# dotnet
g
Issues building
FileArchive
object. Somehow an errant "\" char is being introduced in my string:
Copy code
var fullPathToLambdaCode = Path.GetFullPath(lambdaFunctionCodePath);
Log.Info($"Full path, being passed to FileArchive: [{fullPathToLambdaCode}].");
var codeArchive = new FileArchive(fullPathToLambdaCode);
Here's the output from that code:
Copy code
Full path, being passed to FileArchive: [/Users/tonyb/Work/DevOps.Lambda.Source/CSharp/Template-Lambda-Code/Template-Publish].
error: couldn't read archive path '/Users/tonyb/Work/DevOps.Lambda.Source/CSharp\Template-Lambda-Code/Template-Publish': stat /Users/tonyb/Work/DevOps.Lambda.Source/CSharp\Template-Lambda-Code/Template-Publish: no such file or directory
Whereis that "*\*" coming from? NOTE: The path
/Users/tonyb/Work/DevOps.Lambda.Source/CSharp\Template-Lambda-Code\Template-Publish
DOES EXIST, and there's files there, AND permissions are ok (I can read the file - I created them, after all).
e
odd, can you raise a issue at https://github.com/pulumi/pulumi-dotnet? Make sure we don't lose track of this, should be looked at.
g
Thank you @echoing-dinner-19531. Literally a few minutes ago, I got to the bottom of this. The issue was I had previously deployed the object, and it had a "\" char in the path. I then modified my code, and was more consistent in my path encoding (I am using
dotnet8
, in a Linux environment). So, when I re-deployed, the object's URN was different. So, perhaps still a bug, in that the error message did not mention URN. Once I did a
pulumi refresh ...
, followed by
pulumi up ...
, the error "went away".
I would argue that the path of the
FileArchive
object that is set in the
Function
object, should not be relevant to state, since the the "bits" are just ZIPped and pushed to AWS. The
FileArchive
is a local object, in many respects.
e
oh ok, glad you sorted it if you changed the URN that could trip things up for the old state
g
But, that's my point (and maybe I am not explaining myself well) - I didn't actually change the URN of the function - I only updated the code locally. So, the URN of the ZIP file, didn't REALLY change. Plus the ZIP is a local resource.
e
hmm maybe worth an issue then, give some more details on how that archive is used