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

Attribute must be a whole number Issue #1940

Closed
alayshia opened this issue May 7, 2024 · 8 comments · Fixed by #1945
Closed

Attribute must be a whole number Issue #1940

alayshia opened this issue May 7, 2024 · 8 comments · Fixed by #1945
Assignees
Labels
impact/regression Something that used to work, but is now broken kind/bug Some behavior is incorrect or out of spec p1 Bugs severe enough to be the next item assigned to an engineer resolution/fixed This issue was fixed
Milestone

Comments

@alayshia
Copy link

alayshia commented May 7, 2024

Customer is receiving an Attribute must be a whole number, got 80. Examine values at XXXX despite the value being a whole number and the code not changing.

It has been recommended that a ticket should be open ticket as multiple users are seeing this.

@alayshia alayshia added the kind/bug Some behavior is incorrect or out of spec label May 7, 2024
@MitchellGerdisch
Copy link

I believe the code related to the creation of this issue is Python and the error is firing for a port property on a targetgroup resource.

There is another instance of this issue that is being seen by a different customer.
Here is some related information in case it helps shed light on the matter.

  • Code is in Typescript and is occurring with New Relic NrqlAlertCondition resource for the policyId property.
  • The error fires on different NrqlAlertCondition resources each time.
  • Only happens in pipeline. Running same command on workstation does not see the error.
    • Pipeline runner is Ubuntu 22.04 x86.
    • Pulumi 3.115.2
    • New Relic 5.23.1
  • Same pipeline has worked fine until today.

I have tried to reproduce unsuccessfully.

@mikhailshilkov mikhailshilkov added the needs-triage Needs attention from the triage team label May 8, 2024
@dennispan
Copy link

We ran into the same. After reverting from

pulumi==3.115.2
pulumi-aws==6.33.1

back to

pulumi==3.114.0
pulumi-aws==6.32.0

then it went through

@lukehoban
Copy link
Member

@dennispan or others hitting this issue, can you provide any other details. For example:

  1. The full text of a pulumi up output that hits this.
  2. Whether you trigger this with only the pulumi-aws version change
  3. What resource and resource property this error is reported against
  4. Whether you are seeing it consistently, or differently based on some environmental condition

@lukehoban lukehoban added the p1 Bugs severe enough to be the next item assigned to an engineer label May 8, 2024
@lukehoban
Copy link
Member

Seems most likely triggered by pulumi-aws upgrade from 6.32.0 to 6.33.1.

That brought in this diff of dependencies: pulumi/pulumi-aws@v6.32.0...v6.33.1#diff-0301265a2d4321ca487bbd7ba523f69633171cef680c0114e7ca8d2c34176b73. And most importantly:

  • pulumi-terraform-bridge/v3: 3.80.0 -> 3.81.0
  • pulumi-terraform-bridge/pf: 0.33.0 -> 0.34.0
  • terraform-plugin-framework: 1.7.0 -> 1.8.0
  • terraform-plugin-go: 0.22.1 -> 0.22.2

@lukehoban
Copy link
Member

Quite possibly caused by #1896, which was part of pulumi-terraform-bridge/v3@v3.81.0.

@lukehoban lukehoban transferred this issue from pulumi/pulumi May 8, 2024
@lukehoban
Copy link
Member

We believe we've heard reports against these providers - though it may also impact others:

  • aws
  • newrelic
  • gcp

@dennispan
Copy link

@lukehoban we ran into this in 2 consecutive pulumi up runs. Reverted pulumi and pulumi-aws then it went away. Haven't ran more after that. Hard to conclude whether it is consistent or transient.

Here's the logs from Diagnostic:

Diagnostics:
  pulumi:pulumi:Stack (company/compute/dev)
    Creating virtual environment...
    Finished creating virtual environment
    Updating pip, setuptools, and wheel in virtual environment...
    Requirement already satisfied: pip in ./venv/lib/python3.11/site-packages (24.0)
    Requirement already satisfied: setuptools in ./venv/lib/python3.11/site-packages (65.5.0)
    Collecting setuptools
      Downloading setuptools-69.5.1-py3-none-any.whl.metadata (6.2 kB)
    Collecting wheel
      Downloading wheel-0.43.0-py3-none-any.whl.metadata (2.2 kB)
    Downloading setuptools-69.5.1-py3-none-any.whl (894 kB)
       ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 894.6/894.6 kB 31.6 MB/s eta 0:00:00
    
    Downloading wheel-0.43.0-py3-none-any.whl (65 kB)
       ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 65.8/65.8 kB 18.2 MB/s eta 0:00:00
    
    Installing collected packages: wheel, setuptools
      Attempting uninstall: setuptools
        Found existing installation: setuptools 65.5.0
        Uninstalling setuptools-65.5.0:
          Successfully uninstalled setuptools-65.5.0
    Successfully installed setuptools-69.5.1 wheel-0.43.0
    Finished updating
    Installing dependencies in virtual environment...
    Collecting pulumi==3.115.2 (from -r ../requirements.txt (line 1))
      Downloading pulumi-3.115.2-py3-none-any.whl.metadata (11 kB)
    Collecting pulumi-aws==6.33.1 (from -r ../requirements.txt (line 2))
      Downloading pulumi_aws-6.33.1-py3-none-any.whl.metadata (9.4 kB)
    Collecting pre-commit~=3.7.0 (from -r ../requirements.txt (line 4))
      Downloading pre_commit-3.7.0-py2.py3-none-any.whl.metadata (1.3 kB)
    Collecting ruff~=0.4.3 (from -r ../requirements.txt (line 5))
      Downloading ruff-0.4.3-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.metadata (23 kB)
    Collecting yamllint~=1.35.1 (from -r ../requirements.txt (line 6))
      Downloading yamllint-1.35.1-py3-none-any.whl.metadata (4.2 kB)
    Collecting protobuf~=4.21 (from pulumi==3.115.2->-r ../requirements.txt (line 1))
      Downloading protobuf-4.25.3-cp37-abi3-manylinux2014_x86_64.whl.metadata (541 bytes)
    Collecting grpcio~=1.60.1 (from pulumi==3.115.2->-r ../requirements.txt (line 1))
      Downloading grpcio-1.60.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.metadata (4.0 kB)
    Collecting dill~=0.3 (from pulumi==3.115.2->-r ../requirements.txt (line 1))
      Downloading dill-0.3.8-py3-none-any.whl.metadata (10 kB)
    Collecting six~=1.12 (from pulumi==3.115.2->-r ../requirements.txt (line 1))
      Downloading six-1.16.0-py2.py3-none-any.whl.metadata (1.8 kB)
    Collecting semver~=2.13 (from pulumi==3.115.2->-r ../requirements.txt (line 1))
      Downloading semver-2.13.0-py2.py3-none-any.whl.metadata (5.0 kB)
    Collecting pyyaml~=6.0 (from pulumi==3.115.2->-r ../requirements.txt (line 1))
      Downloading PyYAML-6.0.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.metadata (2.1 kB)
    Collecting parver>=0.2.1 (from pulumi-aws==6.33.1->-r ../requirements.txt (line 2))
      Downloading parver-0.5-py3-none-any.whl.metadata (2.7 kB)
    Collecting cfgv>=2.0.0 (from pre-commit~=3.7.0->-r ../requirements.txt (line 4))
      Downloading cfgv-3.4.0-py2.py3-none-any.whl.metadata (8.5 kB)
    Collecting identify>=1.0.0 (from pre-commit~=3.7.0->-r ../requirements.txt (line 4))
      Downloading identify-2.5.36-py2.py3-none-any.whl.metadata (4.4 kB)
    Collecting nodeenv>=0.11.1 (from pre-commit~=3.7.0->-r ../requirements.txt (line 4))
      Downloading nodeenv-1.8.0-py2.py3-none-any.whl.metadata (21 kB)
    Collecting virtualenv>=20.10.0 (from pre-commit~=3.7.0->-r ../requirements.txt (line 4))
      Downloading virtualenv-20.26.1-py3-none-any.whl.metadata (4.4 kB)
    Collecting pathspec>=0.5.3 (from yamllint~=1.35.1->-r ../requirements.txt (line 6))
      Downloading pathspec-0.12.1-py3-none-any.whl.metadata (21 kB)
    Requirement already satisfied: setuptools in ./venv/lib/python3.11/site-packages (from nodeenv>=0.11.1->pre-commit~=3.7.0->-r ../requirements.txt (line 4)) (69.5.1)
    Collecting arpeggio>=1.7 (from parver>=0.2.1->pulumi-aws==6.33.1->-r ../requirements.txt (line 2))
      Downloading Arpeggio-2.0.2-py2.py3-none-any.whl.metadata (2.4 kB)
    Collecting attrs>=19.2 (from parver>=0.2.1->pulumi-aws==6.33.1->-r ../requirements.txt (line 2))
      Downloading attrs-23.2.0-py3-none-any.whl.metadata (9.5 kB)
    Collecting distlib<1,>=0.3.7 (from virtualenv>=20.10.0->pre-commit~=3.7.0->-r ../requirements.txt (line 4))
      Downloading distlib-0.3.8-py2.py3-none-any.whl.metadata (5.1 kB)
    Collecting filelock<4,>=3.12.2 (from virtualenv>=20.10.0->pre-commit~=3.7.0->-r ../requirements.txt (line 4))
      Downloading filelock-3.14.0-py3-none-any.whl.metadata (2.8 kB)
    Collecting platformdirs<5,>=3.9.1 (from virtualenv>=20.10.0->pre-commit~=3.7.0->-r ../requirements.txt (line 4))
      Downloading platformdirs-4.2.1-py3-none-any.whl.metadata (11 kB)
    Downloading pulumi-3.115.2-py3-none-any.whl (258 kB)
       ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 258.2/258.2 kB 38.3 MB/s eta 0:00:00
    
    Downloading pulumi_aws-6.33.1-py3-none-any.whl (8.7 MB)
       ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 8.7/8.7 MB 117.4 MB/s eta 0:00:00
    
    Downloading pre_commit-3.7.0-py2.py3-none-any.whl (204 kB)
       ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 204.2/204.2 kB 51.0 MB/s eta 0:00:00
    
    Downloading ruff-0.4.3-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (8.7 MB)
       ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 8.7/8.7 MB 107.2 MB/s eta 0:00:00
    
    Downloading yamllint-1.35.1-py3-none-any.whl (66 kB)
       ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 66.7/66.7 kB 18.8 MB/s eta 0:00:00
    
    Downloading cfgv-3.4.0-py2.py3-none-any.whl (7.2 kB)
    Downloading dill-0.3.8-py3-none-any.whl (116 kB)
       ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 116.3/116.3 kB 29.3 MB/s eta 0:00:00
    
    Downloading grpcio-1.60.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (5.4 MB)
       ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 5.4/5.4 MB 108.0 MB/s eta 0:00:00
    
    Downloading identify-2.5.36-py2.py3-none-any.whl (98 kB)
       ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 99.0/99.0 kB 26.8 MB/s eta 0:00:00
    
    Downloading nodeenv-1.8.0-py2.py3-none-any.whl (22 kB)
    Downloading parver-0.5-py3-none-any.whl (15 kB)
    Downloading pathspec-0.12.1-py3-none-any.whl (31 kB)
    Downloading protobuf-4.25.3-cp37-abi3-manylinux2014_x86_64.whl (294 kB)
       ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 294.6/294.6 kB 56.1 MB/s eta 0:00:00
    
    Downloading PyYAML-6.0.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (757 kB)
       ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 757.7/757.7 kB 98.1 MB/s eta 0:00:00
    
    Downloading semver-2.13.0-py2.py3-none-any.whl (12 kB)
    Downloading six-1.16.0-py2.py3-none-any.whl (11 kB)
    Downloading virtualenv-20.26.1-py3-none-any.whl (3.9 MB)
       ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 3.9/3.9 MB 113.9 MB/s eta 0:00:00
    
    Downloading Arpeggio-2.0.2-py2.py3-none-any.whl (55 kB)
       ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 55.3/55.3 kB 17.6 MB/s eta 0:00:00
    
    Downloading attrs-23.2.0-py3-none-any.whl (60 kB)
       ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 60.8/60.8 kB 15.1 MB/s eta 0:00:00
    
    Downloading distlib-0.3.8-py2.py3-none-any.whl (468 kB)
       ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 468.9/468.9 kB 68.0 MB/s eta 0:00:00
    
    Downloading filelock-3.14.0-py3-none-any.whl (12 kB)
    Downloading platformdirs-4.2.1-py3-none-any.whl (17 kB)
    Installing collected packages: distlib, arpeggio, six, semver, ruff, pyyaml, protobuf, platformdirs, pathspec, nodeenv, identify, grpcio, filelock, dill, cfgv, attrs, yamllint, virtualenv, pulumi, parver, pulumi-aws, pre-commit
    Successfully installed arpeggio-2.0.2 attrs-23.2.0 cfgv-3.4.0 dill-0.3.8 distlib-0.3.8 filelock-3.14.0 grpcio-1.60.1 identify-2.5.36 nodeenv-1.8.0 parver-0.5 pathspec-0.12.1 platformdirs-4.2.1 pre-commit-3.7.0 protobuf-4.25.3 pulumi-3.115.2 pulumi-aws-6.33.1 pyyaml-6.0.1 ruff-0.4.3 semver-2.13.0 six-1.16.0 virtualenv-20.26.1 yamllint-1.35.1
    Finished installing dependencies
 
  aws:efs:AccessPoint (job-cluster-efs-access-point)
    error: aws:efs/accessPoint:AccessPoint resource 'job-cluster-efs-access-point' has a problem: Attribute must be a whole number, got 1000. Examine values at 'job-cluster-efs-access-point.posixUser.gid'.
    error: aws:efs/accessPoint:AccessPoint resource 'job-cluster-efs-access-point' has a problem: Attribute must be a whole number, got 1000. Examine values at 'job-cluster-efs-access-point.posixUser.uid'.
    error: aws:efs/accessPoint:AccessPoint resource 'job-cluster-efs-access-point' has a problem: Attribute must be a whole number, got 1000. Examine values at 'job-cluster-efs-access-point.rootDirectory.creationInfo.ownerGid'.
    error: aws:efs/accessPoint:AccessPoint resource 'job-cluster-efs-access-point' has a problem: Attribute must be a whole number, got 1000. Examine values at 'job-cluster-efs-access-point.rootDirectory.creationInfo.ownerUid'.

@VenelinMartinov
Copy link
Contributor

VenelinMartinov commented May 8, 2024

repro:

import * as aws from "@pulumi/aws";

const vpc = new aws.ec2.Vpc("main", { cidrBlock: "10.0.0.0/16" });

const subnet = new aws.ec2.Subnet("main", {
    vpcId: vpc.id,
    cidrBlock: "10.0.12.0/24",
    availabilityZone: "us-east-1a"
});


const subnet2 = new aws.ec2.Subnet("subnet2", {
    vpcId: vpc.id,
    cidrBlock: "10.0.5.0/24",
    availabilityZone: "us-east-1b"
});

const secGroup = new aws.ec2.SecurityGroup("allowTls", {
    description: "Allow TLS inbound traffic and all outbound traffic",
    vpcId: vpc.id,
    tags: {
        Name: "allow_tls",
    },
});

const loadbalancer = new aws.lb.LoadBalancer("payload-lb", {
    loadBalancerType: "application",
    securityGroups: [secGroup.id],
    subnets: [subnet.id, subnet2.id],
    internal: true,
});

const targetGroup = new aws.lb.TargetGroup("payload-tg", {
    port: 80,
    protocol: "HTTP",
    targetType: "ip",
    vpcId: vpc.id,
});

const ubuntu = aws.ec2.getAmi({
    mostRecent: true,
    filters: [
        {
            name: "name",
            values: ["ubuntu/images/hvm-ssd/ubuntu-jammy-22.04-amd64-server-*"],
        },
        {
            name: "virtualization-type",
            values: ["hvm"],
        },
    ],
    owners: ["099720109477"],
});
const web = new aws.ec2.Instance("web", {
    ami: ubuntu.then(ubuntu => ubuntu.id),
    instanceType: aws.ec2.InstanceType.T3_Micro,
    tags: {
        Name: "HelloWorld",
    },
});


const attachment = new aws.lb.TargetGroupAttachment("payload-tga", {
    targetGroupArn: targetGroup.arn,
    // @ts-ignore
    port: "80",
    targetId: web.id,
});

export const vpcId = vpc.id;
export const subnet1Id = subnet.id
export const subnet2Id = subnet2.id

export const loadBalancerARN = loadbalancer.arn
export const targetGroupARN = targetGroup.arn

This suggests that affected users should be able to work around the issue with some explicit type casting in python and typescript.

EDIT: here's a simpler repro:

import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";

const ubuntu = aws.ec2.getAmi({
    mostRecent: true,
    filters: [
        {
            name: "name",
            values: ["ubuntu/images/hvm-ssd/ubuntu-jammy-22.04-amd64-server-*"],
        },
        {
            name: "virtualization-type",
            values: ["hvm"],
        },
    ],
    owners: ["099720109477"],
});
const web = new aws.ec2.Instance("web", {
    ami: ubuntu.then(ubuntu => ubuntu.id),
    instanceType: aws.ec2.InstanceType.T3_Micro,
    // @ts-ignore
    cpuCoreCount: "2" 
});

The issue is triggered by forcing a string into an int input. Seems like we previously silently accepted that and did the conversion somewhere but we no longer do the conversion and now TF raises an error.

I strongly suspect this affects all bridged providers.


I believe the issue in the original PR which introduced it is here: https://github.com/pulumi/pulumi-terraform-bridge/pull/1945/files#diff-5f10eecfa13490de36f3e3e71c19a2233316ebe835e2971f9a3e7d83e3b20250R434

We seem to return an int64 from makeTerraformInput instead of a normal 32 bit int and something down the line doesn't handle that well.

guineveresaenger added a commit to pulumi/pulumi-newrelic that referenced this issue May 8, 2024
This is a quick fix to address customer issues outlined in
pulumi/pulumi-terraform-bridge#1940.

While we develop a more complete fix for the above issue, this will
unblock customers and enable them to upgrade.
guineveresaenger added a commit to pulumi/pulumi-gcp that referenced this issue May 8, 2024
This is a quick fix to address customer issues outlined in
pulumi/pulumi-terraform-bridge#1940.
The [bridge version
used](https://github.com/pulumi/pulumi-terraform-bridge/tree/revert-1896-for-gcp)
is based off of the last pinned bridge commit, with
pulumi/pulumi-terraform-bridge#1896
 reverted.

While we develop a more complete fix for the above issue, this will
unblock customers and enable them to upgrade.
t0yv0 added a commit to pulumi/pulumi-aws that referenced this issue May 8, 2024
This is a quick fix to address customer issues outlined in
pulumi/pulumi-terraform-bridge#1940.

While we develop a more complete fix for the above issue, this will
unblock customers and enable them to upgrade.

---------

Co-authored-by: Anton Tayanovskyy <anton@pulumi.com>
@VenelinMartinov VenelinMartinov self-assigned this May 9, 2024
@VenelinMartinov VenelinMartinov removed the needs-triage Needs attention from the triage team label May 9, 2024
@mikhailshilkov mikhailshilkov added this to the 0.104 milestone May 9, 2024
VenelinMartinov added a commit to pulumi/pulumi-aws that referenced this issue May 9, 2024
This adds a program which uses a string for an int property.

This reproduces the issue seen in
pulumi/pulumi-terraform-bridge#1940
VenelinMartinov added a commit that referenced this issue May 9, 2024
Fixes #1940

The tf-plugin-sdk type checks input to int fields and only allows
explicit ints and strings, not int64 and similar:


https://github.com/hashicorp/terraform-plugin-sdk/blob/1f499688ebd9420768f501d4ed622a51b2135ced/helper/schema/schema.go#L2269

This corrects the type there and adds tests for implicitly converting
all primitive types.
@pulumi-bot pulumi-bot added the resolution/fixed This issue was fixed label May 9, 2024
@VenelinMartinov VenelinMartinov added the impact/regression Something that used to work, but is now broken label May 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
impact/regression Something that used to work, but is now broken kind/bug Some behavior is incorrect or out of spec p1 Bugs severe enough to be the next item assigned to an engineer resolution/fixed This issue was fixed
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants