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

java.lang.IllegalArgumentException: '@Import com.pulumi.aws.eks.ClusterArgs.roleArn' is required but was not given a value #1402

Closed
t0yv0 opened this issue Sep 27, 2024 · 4 comments
Assignees
Labels
kind/bug Some behavior is incorrect or out of spec resolution/fixed This issue was fixed
Milestone

Comments

@t0yv0
Copy link
Member

t0yv0 commented Sep 27, 2024

What happened?

Getting this problem on pulumi up on the 3.x testing:

java.lang.IllegalArgumentException: '@Import com.pulumi.aws.eks.ClusterArgs.roleArn' is required but was not given a value 

With the latest alpha:

    <dependencies>
        <dependency>
            <groupId>com.pulumi</groupId>
            <artifactId>pulumi</artifactId>
            <version>(,1.0]</version>
        </dependency>
        <dependency>
            <groupId>com.pulumi</groupId>
            <artifactId>aws</artifactId>
            <version>(6.0.2,6.99]</version>
        </dependency>
        <dependency>
            <groupId>com.pulumi</groupId>
            <artifactId>eks</artifactId>
            <version>3.0.0-alpha.7</version>
        </dependency>
    </dependencies>

This is unexpected, ClusterArgs does not even have roleArn. Wondering if something in Java SDK generation is going awry here.

Example

package myproject;

import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.aws.s3.Bucket;
import com.pulumi.aws.eks.Cluster;

public class App {
    public static void main(String[] args) {
        Pulumi.run(ctx -> {
            var c = new Cluster("my-cluster");
            ctx.export("cid", c.id());
        });
    }
}

Output of pulumi about

N/A

Additional context

No response

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 Sep 27, 2024
@t0yv0
Copy link
Member Author

t0yv0 commented Sep 27, 2024

javagen version is behind, v0.9.8 vs 0.16.1, we need to automate having this up-to-date, likely fixing the issue here.

@flostadler
Copy link
Contributor

flostadler commented Sep 27, 2024

rolearn is required for aws.eks.Cluster (that's the CR, not the component). The error is about that. See: https://www.pulumi.com/registry/packages/aws/api-docs/eks/cluster/#rolearn_java

@t0yv0
Copy link
Member Author

t0yv0 commented Sep 27, 2024

You are right! Trying this:

package myproject;

import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.aws.s3.Bucket;
import com.pulumi.eks.Cluster;

public class App {
    public static void main(String[] args) {
        Pulumi.run(ctx -> {
            new Cluster("my-cluster");
        });
    }
}

This looks better.

Panics though.

Please choose a stack, or create a new one: dev
Previewing update (dev)

View in Browser (Ctrl+O): https://app.pulumi.com/anton-pulumi-corp/java-test/dev/previews/7d89ba14-585a-4384-b0f6-139ef0fdefe7

     Type                                   Name                                          Plan       Info
 +   pulumi:pulumi:Stack                    java-test-dev                                 create     2 errors; 21 messages
 +   └─ eks:index:Cluster                   my-cluster                                    create     
 +      ├─ eks:index:ServiceRole            my-cluster-instanceRole                       create     
 +      │  ├─ aws:iam:Role                  my-cluster-instanceRole-role                  create     
 +      │  ├─ aws:iam:RolePolicyAttachment  my-cluster-instanceRole-3eb088f2              create     
 +      │  ├─ aws:iam:RolePolicyAttachment  my-cluster-instanceRole-03516f97              create     
 +      │  └─ aws:iam:RolePolicyAttachment  my-cluster-instanceRole-e1b295bd              create     
 +      ├─ eks:index:ServiceRole            my-cluster-eksRole                            create     
 +      │  ├─ aws:iam:Role                  my-cluster-eksRole-role                       create     
 +      │  └─ aws:iam:RolePolicyAttachment  my-cluster-eksRole-4b490823                   create     
 +      ├─ aws:iam:InstanceProfile          my-cluster-instanceProfile                    create     
 +      ├─ aws:ec2:SecurityGroup            my-cluster-eksClusterSecurityGroup            create     
 +      ├─ aws:ec2:SecurityGroupRule        my-cluster-eksClusterInternetEgressRule       create     
 +      ├─ aws:eks:Cluster                  my-cluster-eksCluster                         create     
 +      ├─ aws:ec2:SecurityGroup            my-cluster-nodeSecurityGroup                  create     
 +      ├─ aws:eks:Addon                    my-cluster-coredns                            create     
 +      ├─ aws:eks:Addon                    my-cluster-kube-proxy                         create     
 +      ├─ aws:ec2:SecurityGroupRule        my-cluster-eksExtApiServerClusterIngressRule  create     
 +      ├─ aws:ec2:SecurityGroupRule        my-cluster-eksNodeInternetEgressRule          create     
 +      ├─ pulumi:providers:kubernetes      my-cluster-eks-k8s                            create     
 +      ├─ aws:ec2:SecurityGroupRule        my-cluster-eksNodeIngressRule                 create     
 +      ├─ eks:index:VpcCniAddon            my-cluster-vpc-cni                            create     
 +      │  └─ aws:eks:Addon                 my-cluster-vpc-cni                            create     
 +      ├─ aws:ec2:SecurityGroupRule        my-cluster-eksNodeClusterIngressRule          create     
 +      ├─ aws:autoscaling:Group            my-cluster                                    create     
 +      ├─ aws:ec2:SecurityGroupRule        my-cluster-eksClusterIngressRule              create     
 +      ├─ kubernetes:core/v1:ConfigMap     my-cluster-nodeAccess                         create     
 +      └─ aws:ec2:LaunchTemplate           my-cluster-launchTemplate                     create     

Diagnostics:
  pulumi:pulumi:Stack (java-test-dev):
    error: Running program [PID: 11864](/nix/store/y033py0gyjxdvxxhplhyl29s15asp7xc-zulu19.32.13-ca-jdk-19.0.2/bin/java -classpath /nix/store/fg7sva8pccx1zqy63djh4md5qawfqj5l-apache-maven-3.9.5/maven/boot/plexus-classworlds-2.7.0.jar -Dclassworlds.conf=/nix/store/fg7sva8pccx1zqy63djh4md5qawfqj5l-apache-maven-3.9.5/maven/bin/m2.conf -Dmaven.home=/nix/store/fg7sva8pccx1zqy63djh4md5qawfqj5l-apache-maven-3.9.5/maven -Dlibrary.jansi.path=/nix/store/fg7sva8pccx1zqy63djh4md5qawfqj5l-apache-maven-3.9.5/maven/lib/jansi-native -Dmaven.multiModuleProjectDirectory=/Users/anton/Library/Mobile Documents/com~apple~CloudDocs/pulumi-bugs/test-eks-alpha/java-test org.codehaus.plexus.classworlds.launcher.Launcher -Dorg.slf4j.simpleLogger.defaultLogLevel=warn --no-transfer-progress compile exec:java) failed with an unhandled exception:
    java.lang.UnsupportedOperationException: Convert [com.pulumi.eks.Cluster.defaultNodeGroup]: Error converting 'com.google.common.collect.RegularImmutableMap' to 'TypeShape{type=class com.pulumi.eks.outputs.NodeGroupData, parameters=[]}'. Expected type 'com.pulumi.eks.outputs.NodeGroupData' (annotated with 'com.pulumi.core.annotations.CustomType') to have a setter annotated with @com.pulumi.core.annotations.CustomType$Setter("autoScalingGroup"), got: autoScalingGroupName,nodeSecurityGroup,extraNodeSecurityGroups
        at com.pulumi.serialization.internal.Converter.convertObjectUntyped(Converter.java:119)
        at com.pulumi.serialization.internal.Converter.convertValue(Converter.java:86)
        at com.pulumi.core.internal.OutputCompletionSource.setValue(OutputCompletionSource.java:95)
        at com.pulumi.deployment.internal.DeploymentImpl$ReadOrRegisterResourceInternal.lambda$completeResourceAsync$1(DeploymentImpl.java:1258)
        at java.base/java.util.concurrent.CompletableFuture$UniApply.tryFire(CompletableFuture.java:646)
        at java.base/java.util.concurrent.CompletableFuture$Completion.exec(CompletableFuture.java:483)
        at java.base/java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:387)
        at java.base/java.util.concurrent.ForkJoinPool$WorkQueue.topLevelExec(ForkJoinPool.java:1311)
        at java.base/java.util.concurrent.ForkJoinPool.scan(ForkJoinPool.java:1841)
        at java.base/java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1806)
        at java.base/java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:177)
    Caused by: java.lang.IllegalArgumentException: Expected type 'com.pulumi.eks.outputs.NodeGroupData' (annotated with 'com.pulumi.core.annotations.CustomType') to have a setter annotated with @com.pulumi.core.annotations.CustomType$Setter("autoScalingGroup"), got: autoScalingGroupName,nodeSecurityGroup,extraNodeSecurityGroups
        at com.pulumi.serialization.internal.Converter.lambda$tryConvertObjectInner$7(Converter.java:401)
        at java.base/java.util.HashMap.forEach(HashMap.java:1429)
        at com.pulumi.serialization.internal.Converter.tryConvertObjectInner(Converter.java:399)
        at com.pulumi.serialization.internal.Converter.convertObjectUntyped(Converter.java:115)
        ... 10 more
    error: an unhandled error occurred: '/Users/anton/bin/mvn /Users/anton/bin/mvn -Dorg.slf4j.simpleLogger.defaultLogLevel=warn --no-transfer-progress compile exec:java' exited with non-zero exit code: 32

    Sep 27, 2024 3:29:35 PM com.pulumi.deployment.internal.DeploymentImpl$DefaultEngineLogger errorAsync
    SEVERE: Running program [PID: 11864](/nix/store/y033py0gyjxdvxxhplhyl29s15asp7xc-zulu19.32.13-ca-jdk-19.0.2/bin/java -classpath /nix/store/fg7sva8pccx1zqy63djh4md5qawfqj5l-apache-maven-3.9.5/maven/boot/plexus-classworlds-2.7.0.jar -Dclassworlds.conf=/nix/store/fg7sva8pccx1zqy63djh4md5qawfqj5l-apache-maven-3.9.5/maven/bin/m2.conf -Dmaven.home=/nix/store/fg7sva8pccx1zqy63djh4md5qawfqj5l-apache-maven-3.9.5/maven -Dlibrary.jansi.path=/nix/store/fg7sva8pccx1zqy63djh4md5qawfqj5l-apache-maven-3.9.5/maven/lib/jansi-native -Dmaven.multiModuleProjectDirectory=/Users/anton/Library/Mobile Documents/com~apple~CloudDocs/pulumi-bugs/test-eks-alpha/java-test org.codehaus.plexus.classworlds.launcher.Launcher -Dorg.slf4j.simpleLogger.defaultLogLevel=warn --no-transfer-progress compile exec:java) failed with an unhandled exception:
    java.lang.UnsupportedOperationException: Convert [com.pulumi.eks.Cluster.defaultNodeGroup]: Error converting 'com.google.common.collect.RegularImmutableMap' to 'TypeShape{type=class com.pulumi.eks.outputs.NodeGroupData, parameters=[]}'. Expected type 'com.pulumi.eks.outputs.NodeGroupData' (annotated with 'com.pulumi.core.annotations.CustomType') to have a setter annotated with @com.pulumi.core.annotations.CustomType$Setter("autoScalingGroup"), got: autoScalingGroupName,nodeSecurityGroup,extraNodeSecurityGroups
        at com.pulumi.serialization.internal.Converter.convertObjectUntyped(Converter.java:119)
        at com.pulumi.serialization.internal.Converter.convertValue(Converter.java:86)
        at com.pulumi.core.internal.OutputCompletionSource.setValue(OutputCompletionSource.java:95)
        at com.pulumi.deployment.internal.DeploymentImpl$ReadOrRegisterResourceInternal.lambda$completeResourceAsync$1(DeploymentImpl.java:1258)
        at java.base/java.util.concurrent.CompletableFuture$UniApply.tryFire(CompletableFuture.java:646)
        at java.base/java.util.concurrent.CompletableFuture$Completion.exec(CompletableFuture.java:483)
        at java.base/java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:387)
        at java.base/java.util.concurrent.ForkJoinPool$WorkQueue.topLevelExec(ForkJoinPool.java:1311)
        at java.base/java.util.concurrent.ForkJoinPool.scan(ForkJoinPool.java:1841)
        at java.base/java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1806)
        at java.base/java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:177)
    Caused by: java.lang.IllegalArgumentException: Expected type 'com.pulumi.eks.outputs.NodeGroupData' (annotated with 'com.pulumi.core.annotations.CustomType') to have a setter annotated with @com.pulumi.core.annotations.CustomType$Setter("autoScalingGroup"), got: autoScalingGroupName,nodeSecurityGroup,extraNodeSecurityGroups
        at com.pulumi.serialization.internal.Converter.lambda$tryConvertObjectInner$7(Converter.java:401)
        at java.base/java.util.HashMap.forEach(HashMap.java:1429)
        at com.pulumi.serialization.internal.Converter.tryConvertObjectInner(Converter.java:399)
        at com.pulumi.serialization.internal.Converter.convertObjectUntyped(Converter.java:115)
        ... 10 more

    [WARNING] Using platform encoding (UTF-8 actually) to copy filtered resources, i.e. build is platform dependent!

I'd update Java before we investigate further.

@flostadler flostadler self-assigned this Sep 30, 2024
@flostadler flostadler removed the needs-triage Needs attention from the triage team label Sep 30, 2024
flostadler added a commit that referenced this issue Sep 30, 2024
Upgrades javagen to v0.16.1. This might solve the problems in #1402
flostadler added a commit that referenced this issue Oct 1, 2024
…1410)

In #1373 the default node group
was updated to use the `NodeGroupV2` component. We missed changing the
`NodeGroupData` type to reflect this. It was still referring to a
property called `autoScalingGroupName`, but it should've been changed to
expose an `autoScalingGroup`.

Fixes #1402
@flostadler flostadler added the resolution/fixed This issue was fixed label Oct 1, 2024
@flostadler
Copy link
Contributor

Fixed it with Fix output of default node group referring to autoscalingGroupName #1410. Release is currently running

@mjeffryes mjeffryes added this to the 0.111 milestone Oct 2, 2024
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/fixed This issue was fixed
Projects
None yet
Development

No branches or pull requests

3 participants