Skip to content
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

CallbackFunction refresh pollutes the state file with a temp folder path #3185

Closed
t0yv0 opened this issue Dec 26, 2023 · 1 comment
Closed
Labels
kind/bug Some behavior is incorrect or out of spec resolution/duplicate This issue is a duplicate of another issue

Comments

@t0yv0
Copy link
Member

t0yv0 commented Dec 26, 2023

What happened?

Investigating non-clean refresh on aws.lambda.CallbackFunction, noting that refresh wipes out asset information in favor of a pointer to a local temp dir which is broken.

Example

const f = new aws.lambda.CallbackFunction("f", {
    callback: (ev, ctx) => {
        console.log("OK");
    },
});

Output of pulumi about

CLI
Version 3.97.0
Go Version go1.21.4
Go Compiler gc

Plugins
NAME VERSION
aws 6.17.0
awsx 2.4.0
docker 4.5.0
docker 3.6.1
nodejs unknown

Host
OS darwin
Version 14.1.1
Arch x86_64

This project is written in nodejs: executable='/Users/t0yv0/bin/node' version='v18.18.2'

Current Stack: t0yv0/aws-2246/dev

TYPE URN
pulumi:pulumi:Stack urn:pulumi:dev::aws-2246::pulumi:pulumi:Stack::aws-2246-dev
pulumi:providers:aws urn:pulumi:dev::aws-2246::pulumi:providers:aws::default_6_17_0
aws:iam/role:Role urn:pulumi:dev::aws-2246::aws:iam/role:Role::f
aws:iam/rolePolicyAttachment:RolePolicyAttachment urn:pulumi:dev::aws-2246::aws:iam/rolePolicyAttachment:RolePolicyAttachment::f-1b4caae3
aws:iam/rolePolicyAttachment:RolePolicyAttachment urn:pulumi:dev::aws-2246::aws:iam/rolePolicyAttachment:RolePolicyAttachment::f-a1de8170
aws:iam/rolePolicyAttachment:RolePolicyAttachment urn:pulumi:dev::aws-2246::aws:iam/rolePolicyAttachment:RolePolicyAttachment::f-b5aeb6b6
aws:iam/rolePolicyAttachment:RolePolicyAttachment urn:pulumi:dev::aws-2246::aws:iam/rolePolicyAttachment:RolePolicyAttachment::f-4aaabb8e
aws:iam/rolePolicyAttachment:RolePolicyAttachment urn:pulumi:dev::aws-2246::aws:iam/rolePolicyAttachment:RolePolicyAttachment::f-019020e7
aws:iam/rolePolicyAttachment:RolePolicyAttachment urn:pulumi:dev::aws-2246::aws:iam/rolePolicyAttachment:RolePolicyAttachment::f-74d12784
aws:iam/rolePolicyAttachment:RolePolicyAttachment urn:pulumi:dev::aws-2246::aws:iam/rolePolicyAttachment:RolePolicyAttachment::f-7cd09230
aws:iam/rolePolicyAttachment:RolePolicyAttachment urn:pulumi:dev::aws-2246::aws:iam/rolePolicyAttachment:RolePolicyAttachment::f-d32a66fa
aws:iam/rolePolicyAttachment:RolePolicyAttachment urn:pulumi:dev::aws-2246::aws:iam/rolePolicyAttachment:RolePolicyAttachment::f-e1a3786d
aws:lambda/function:Function urn:pulumi:dev::aws-2246::aws:lambda/function:Function::f

Found no pending operations associated with dev

Backend
Name pulumi.com
URL https://app.pulumi.com/t0yv0
User t0yv0
Organizations t0yv0, pulumi
Token type personal

Dependencies:
NAME VERSION
@pulumi/aws 6.17.0
@pulumi/awsx 2.4.0
@pulumi/pulumi 3.99.0
@types/node 18.19.3

Pulumi locates its logs in /var/folders/gk/cchgxh512m72f_dmkcc3d09h0000gp/T/com.apple.shortcuts.mac-helper// by default

Additional context

The diff of Pulumi state before and after refresh seems to indicate that the refresh is dropping the asset information and replacing it with a string pointing to the local machine temp folder, which will break if multiple machines are involved with running Pulumi against the given stack.

>         "modified": "2023-12-26T20:34:15.167924Z",
384,394c394
<           "code": {
<             "4dabf18193072939515e22adb298388d": "0def7320c3a5731c473e5ecbe6d01bc7",
<             "assets": {
<               "__index.js": {
<                 "4dabf18193072939515e22adb298388d": "c44067f5952c0a294b673a41bacd8c17",
<                 "hash": "2786e307463cd99f57e588051d1f9a6bff2df3e58e71852500458e65256e3dab",
<                 "text": "exports.handler = __f0;\n\nfunction __f0(__0, __1) {\n  return (function() {\n    with({ this: undefined, arguments: undefined }) {\n\nreturn (ev, ctx) => {\n        console.log(\"OK\");\n    };\n\n    }\n  }).apply(undefined, undefined).apply(this, arguments);\n}\n"
<               }
<             },
<             "hash": "129a422e3156b23f42a9469c7c2e631149844e38184691812568b1f6962c2840"
<           },
---
>           "code": "/var/folders/gk/cchgxh512m72f_dmkcc3d09h0000gp/T/com.apple.shortcuts.mac-helper/pulumi-asset-129a422e3156b23f42a9469c7c2e631149844e38184691812568b1f6962c2840",
412,422c412
<           "code": {
<             "4dabf18193072939515e22adb298388d": "0def7320c3a5731c473e5ecbe6d01bc7",
<             "assets": {
<               "__index.js": {
<                 "4dabf18193072939515e22adb298388d": "c44067f5952c0a294b673a41bacd8c17",
<                 "hash": "2786e307463cd99f57e588051d1f9a6bff2df3e58e71852500458e65256e3dab",
<                 "text": "exports.handler = __f0;\n\nfunction __f0(__0, __1) {\n  return (function() {\n    with({ this: undefined, arguments: undefined }) {\n\nreturn (ev, ctx) => {\n        console.log(\"OK\");\n    };\n\n    }\n  }).apply(undefined, undefined).apply(this, arguments);\n}\n"
<               }
<             },
<             "hash": "129a422e3156b23f42a9469c7c2e631149844e38184691812568b1f6962c2840"
<           },
---
>           "code": "/var/folders/gk/cchgxh512m72f_dmkcc3d09h0000gp/T/com.apple.shortcuts.mac-helper/pulumi-asset-129a422e3156b23f42a9469c7c2e631149844e38184691812568b1f6962c2840",
444a435
>           "replacementSecurityGroupIds": [],
457c448
<             "ciphertext": "AAABACb4REA60+0aWw6p4lrHyuVX4TXjTr9yC7LN4VDHbA=="
---
>             "ciphertext": "AAABAMTnTHUioNAvFZI8GXn/+wdu5Kt+K9werDKu2VBJTg=="
484c475
<         "modified": "2023-12-26T20:33:51.910202Z",
---
>         "modified": "2023-12-26T20:34:15.184054Z",

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).

@t0yv0 t0yv0 added kind/bug Some behavior is incorrect or out of spec needs-triage Needs attention from the triage team labels Dec 26, 2023
@t0yv0
Copy link
Member Author

t0yv0 commented Dec 26, 2023

Duplicate of #3548

@t0yv0 t0yv0 closed this as completed Dec 26, 2023
@pulumi-bot pulumi-bot added the resolution/duplicate This issue is a duplicate of another issue label Dec 26, 2023
@t0yv0 t0yv0 removed the needs-triage Needs attention from the triage team label Dec 26, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Some behavior is incorrect or out of spec resolution/duplicate This issue is a duplicate of another issue
Projects
None yet
Development

No branches or pull requests

2 participants