pulumi / pulumi

Pulumi - Infrastructure as Code in any programming language 🚀
https://www.pulumi.com
Apache License 2.0
21.48k stars 1.1k forks source link

Flaky test with DLL32 loading issue on Windows #14240

Open t0yv0 opened 11 months ago

t0yv0 commented 11 months ago

What happened?

=== NAME  TestAccProviderConfig
    command.go:83: Invoke 'C:\ProgramData\chocolatey\lib\pulumi\tools\Pulumi\bin\pulumi.exe stack export --file C:\Users\RUNNER~1\AppData\Local\Temp\p-it-fv-az417-3-provider-c-c0c95d023789257115\stack.json' failed: exit status 2
panic: Failed to load user32: A dynamic link library (DLL) initialization routine failed.

goroutine 1 [running]:
syscall.MustLoadDLL(...)
    /opt/hostedtoolcache/go/1.21.1/x64/src/syscall/dll_windows.go:94
github.com/atotto/clipboard.init()
    /home/runner/go/pkg/mod/github.com/atotto/clipboard@v0.1.4/clipboard_windows.go:22 +0x347

    command.go:103: Wrote output to C:\Users\RUNNER~1\AppData\Local\Temp\p-it-fv-az417-3-provider-c-c0c95d02-1541851738\command-output\pulumi-export.20231012-180950.a95cd.log
    program.go:1335: Destroying stack
    command.go:34: **** Invoke 'C:\ProgramData\chocolatey\lib\pulumi\tools\Pulumi\bin\pulumi.exe destroy --non-interactive --yes --skip-preview' in 'C:\Users\RUNNER~1\AppData\Local\Temp\p-it-fv-az417-3-provider-c-c0c95d02-1541851738'
    command.go:83: Invoke 'C:\ProgramData\chocolatey\lib\pulumi\tools\Pulumi\bin\pulumi.exe destroy --non-interactive --yes --skip-preview' failed: exit status 2
panic: Failed to load user32: A dynamic link library (DLL) initialization routine failed.

Might be a good idea to find out why Pulumi CLI is initializing clipboard.

Example

Found during CI runs.

Output of pulumi about

v3.86.0

Additional context

N/A

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

mikhailshilkov commented 11 months ago

Should the issue go to pulumi/pulumi?

t0yv0 commented 11 months ago

Yeah good point, let me move. I think I'm less worried about the flaky test and the fact that it might blow up on customer machines.

AaronFriel commented 11 months ago

I've seen this before, and mitigated by forking and then getting an upstream patch to xanzy/ssh-agent:

t0yv0 commented 11 months ago

Unfortunately still experience this issue https://github.com/pulumi/pulumi-terraform-bridge/actions/runs/6551251659/job/17792051156?pr=1446#step:9:5409 ; possibly not yet removed from Pulumi CLI fully.

AaronFriel commented 11 months ago

@t0yv0 ah, sorry - to be clear, I pattern matched and this is the same kind of error as fixed in #10486. It looks like we would want to patch the upstream github.com/atotto/clipboard in the same way.

guifran001 commented 10 months ago

The reference in pulumi on the clipboard is in this file: https://github.com/pulumi/pulumi/blob/1a72f09a64c8f806b8dd24c08404366e45fc07d8/sdk/go/common/util/cmdutil/console.go that is using github.com/charmbracelet/bubbles/textinput which depends on atotto/clipboard.

I guess atotto/clipboard should use NewLazySystemDLL instead of MustLoadDLL

VenelinMartinov commented 8 months ago

Just hit this again: https://github.com/pulumi/pulumi-terraform-bridge/actions/runs/7759249788/job/21162896094

VenelinMartinov commented 6 months ago

Another one: https://github.com/pulumi/pulumi-terraform-bridge/actions/runs/8484037216/job/23246252827?pr=1818

tgummerer commented 2 days ago

A recent occurrence:

=== FAIL: go/auto TestRemoveWithForce (34.37s)
 local_workspace_test.go:222: up failed, err: could not get outputs: exit status 2
        code: 2
        stdout:
        stderr: panic: Failed to load user32: A dynamic link library (DLL) initialization routine failed.

        goroutine 1 [running]:
        syscall.MustLoadDLL(...)
            /opt/hostedtoolcache/go/1.23.1/x64/src/syscall/dll_windows.go:94
        github.com/atotto/clipboard.init()
            /home/runner/go/pkg/mod/github.com/atotto/clipboard@v0.1.4/clipboard_windows.go:22 +0x347
VenelinMartinov commented 2 days ago

Hit this yesterday: https://github.com/pulumi/pulumi-terraform-bridge/actions/runs/11053647383/job/30708522112#step:9:11702