-
Notifications
You must be signed in to change notification settings - Fork 158
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
InvalidParameterValueException: Uploaded file must be a non-empty zip #3622
Comments
From @komalali : okay I have some new information. I ran 2 separate deployments, pulumi refresh and pulumi update instead of 1 remediate-drift which does the pulumi update --refresh. When I run them as 2 separate deployments I don't get the error. |
using the automation API for go as well:
seems to work intermittently and can't really determine whats causing it
|
I opened this a couple weeks back and it appeared resolved but is rearing its ugly head again |
I am also struggling with this error happening intermittently. I have not been able to replicate it yet. I am using a zip file that's generated with https://www.serverless.com/. lambda_forward_logs:
type: aws:lambda:Function
properties:
code:
fn::fileArchive: ./backend/.serverless/forward-logs.zip # generated by serverless
|
We are also seeing this issue on creating and updating Lambda function code. As a test, I created an The issue seems to go away if I restart my machine. But does eventually come back. |
The zip files that get uploaded are stored in |
The AssetArchive to upload gets stored as zip file in
Those 22B files are empty zip files. If we run without
Note the fileize of 201B this time around. |
Yes! Can confirm Can also confirm running |
Local reproduction:
The last step will attempt to upload the empty zip file. |
I haven't been able to repro on the original program from @komalali as it does not create After some experimentation I was able to reproduce based on this program: import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";
import * as apigateway from "@pulumi/aws-apigateway";
const cfg = new pulumi.Config();
const archive = cfg.require("archive");
const assumeRole = aws.iam.getPolicyDocument({
statements: [{
effect: "Allow",
principals: [{
type: "Service",
identifiers: ["lambda.amazonaws.com"],
}],
actions: ["sts:AssumeRole"],
}],
});
const iamForLambda = new aws.iam.Role("iam_for_lambda", {
name: "iam_for_lambda",
assumeRolePolicy: assumeRole.then(assumeRole => assumeRole.json),
});
const fn = new aws.lambda.Function("fn", {
role: iamForLambda.arn,
code: new pulumi.asset.FileArchive(archive),
handler: "index.test",
runtime: "nodejs18.x",
})
export const lambdaARN = fn.arn; Calling refresh is not necessary for the repro. It looks like #!/usr/bin/env bash
set -euo pipefail
export AWS_PROFILE=devsandbox
# Clean slate.
pulumi destroy --yes
rm -rf $TMPDIR/*pulumi*asset*
# Provision a1.zip
pulumi config set archive ./a1/a1.zip
pulumi up --skip-preview --yes
pulumi stack export --file a1.json
md5 $TMPDIR/*pulumi*asset*
# Provision a2.zip
pulumi config set archive ./a2/a2.zip
pulumi up --skip-preview --yes
md5 $TMPDIR/*pulumi*asset*
# Create a discontinuity between cloud and local state.
pulumi stack import --file a1.json
# Lose the temp asset files.
rm $TMPDIR/*pulumi*asset*
# Refresh is not necessary.
# pulumi refresh --yes
# See if we can update again.
pulumi up --yes --skip-preview
# This clobbers the asset for a1.zip.
md5 $TMPDIR/*pulumi*asset*
pulumi config set archive ./a1/a1.zip
pulumi up --yes --skip-preview # FAILS HERE |
|
I have confirmed that pulumi/pulumi#14007 caused the change in behavior by interacting in an unexpected way with the asset-handling code in the bridge. Building 6.6.1 of the provider against v3.90.1 of pulumi/pkg with 14007 reverted yields a pulumi-resource-aws provider where the problem no longer reproduces. |
I have passed on pulumi/pulumi#15729 to the core team, the evidence is that it's likely once we have that fixed we can remediate the issue here. Thanks for your patience everyone. |
Still awaiting a pulumi release (v3.111.1 does not contain the fix yet). |
Looks like it was included in the latest release |
Adds a test to regress against the situation that caused the AWS P1 in pulumi/pulumi-aws#3622
Fixes #3622 This PR was generated via `$ upgrade-provider pulumi/pulumi-aws --kind=bridge --pr-reviewers=VenelinMartinov`. --- - Updating Java Gen version from 0.9.9 to 0.10.0. - Upgrading pulumi-terraform-bridge from v3.78.0 to v3.79.0. - Upgrading pulumi-terraform-bridge/pf from v0.31.0 to v0.32.0.
We're seeing a resurgence of this issue -- we upgraded from Pulumi 3.38.0 to 3.142.0 a few weeks ago to mitigate this same issue, and after a few weeks, we've now noticed that we're consistently running into the We're running: Please let me know if you'd like for me to create a new issue instead. |
Yes please create a new one ref'ing this one. |
@t0yv0 pulumi/pulumi#18461 has been created! |
What happened?
From @komalali
Hi! I have noticed a recurring error as I've worked on drift detection.
Context:
The following drift run/remediation succeeds.
Example
The source is very simple:
https://github.com/pulumi/deploy-demos/blob/main/pulumi-programs/drift-test/index.ts
Output of
pulumi about
Additional context
We tried a few times to reproduce locally but failed to do so, while it reproduces pretty consistently with deployments. This seems quite surprising. There's a bit going about drift detection but when all is said and done deployments is simply performing this operation over a state that tracks a lambda and a cloud that has the lambda removed:
Pulumi refreshes and drops the lambda from state, then decides to Create the lambda, which should succeed but does not.
Contributing
Vote on this issue by adding a 👍 reaction.
To contribute a fix for this issue, leave a comment (and link to your pull request, if you've opened one already).
The text was updated successfully, but these errors were encountered: