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

Pulumi is not started from backed jar file #1307

Open
golosegor opened this issue Jan 9, 2024 · 4 comments
Open

Pulumi is not started from backed jar file #1307

golosegor opened this issue Jan 9, 2024 · 4 comments
Labels
kind/bug Some behavior is incorrect or out of spec

Comments

@golosegor
Copy link

What happened?

I'm trying to run pulumi from precompiled jar file (following the guide here: https://github.com/pulumi/pulumi-java/ )

First I'm starting new project and could check that compilation is working and pulumi do the job.
Then I'm packaging exactly this project, and building farjar (repro guide is here: https://github.com/golosegor/pulumi-execute-from-jar-issue )

Then I'm trying to run pulumi with complid code from folder nearby: https://github.com/golosegor/pulumi-execute-from-jar-issue/blob/main/repro-folder/Pulumi.yaml and getting GRCP unavailable exception

Example

I've created a repro

https://github.com/golosegor/pulumi-execute-from-jar-issue

Output of pulumi about

CLI
Version 3.100.0
Go Version go1.21.5
Go Compiler gc

Plugins
NAME VERSION
java unknown

Host
OS ubuntu
Version 23.10
Arch x86_64

Additional context

Output looks like that:

I0109 14:52:54.785976 297662 log.go:81] GetRequiredPlugins: plugins=[]
I0109 14:52:54.796470 297662 log.go:81] Run: program=.
I0109 14:52:54.796485 297662 log.go:73] Language host launching process: /home/eg/.sdkman/candidates/java/current/bin/java-jar ../demo/target/demo-1.0-SNAPSHOT-jar-with-dependencies.jar
Jan 09, 2024 2:52:55 PM com.pulumi.deployment.internal.DeploymentImpl$DefaultEngineLogger errorAsync
SEVERE: Running program [PID: 297717](/home/eg/.sdkman/candidates/java/17.0.9-tem/bin/java -jar ../demo/target/demo-1.0-SNAPSHOT-jar-with-dependencies.jar) failed with an unhandled exception:
io.grpc.StatusRuntimeException: UNAVAILABLE: io exception

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

@golosegor golosegor added kind/bug Some behavior is incorrect or out of spec needs-triage Needs attention from the triage team labels Jan 9, 2024
@justinvp justinvp added awaiting-feedback Blocked on input from the author and removed needs-triage Needs attention from the triage team labels Jan 29, 2024
@justinvp
Copy link
Member

Thanks for opening the issue and providing a repro project @golosegor! I haven't had a chance to try the repro yet, but one quick question: Does it work if you place the .jar within repro-folder and update the path in Pulumi.yaml to not have ../?

@golosegor
Copy link
Author

golosegor commented Jan 29, 2024

Hello @justinvp . I tried different ways. Absolute path is also not working. So it's not a problem with the path 100%

@justinvp justinvp removed the awaiting-feedback Blocked on input from the author label Feb 16, 2024
@vooft
Copy link

vooft commented Mar 9, 2024

No idea why exactly is this happening, feels like some funny business inside grpc-netty-shaded and shadow jar plugin.

I debugged through the code, and basically when you run pulumi via gradle, it defaults to dns:// protocol, but when you run it via a far jar, it falls back to unix://, which is invalid.

This happens in io.grpc.internal.ManagedChannelImpl#getNameResolver(java.lang.String, io.grpc.NameResolver.Factory, io.grpc.NameResolver.Args) link, where it says it should fall back to dns://, but it doesn't.

This seems to be a fix for that: grpc/grpc-java#10425 but dumb upgrade of grpc didn't help much.

@vooft
Copy link

vooft commented Mar 10, 2024

Interesting, I've just replaced the shadow plugin with spring-boot plugin, which can also generate a fat jar, and it works now!
Perhaps it would be good to have an official example project where a fat jar is created and pulumi is executed from it.

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
Projects
None yet
Development

No branches or pull requests

3 participants