terraform-provider-oci icon indicating copy to clipboard operation
terraform-provider-oci copied to clipboard

terraform 1.2.6 panic error on macOS (works on linux) - runtime error: invalid memory address or nil pointer dereference

Open infa-ddeore opened this issue 1 year ago • 4 comments

Community Note

  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
  • Please do not leave "+1" or "me too" comments, they generate extra noise for issue followers and do not help prioritize the request
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment

Terraform Version and Provider Version

$ terraform -v Terraform v1.2.6 on darwin_amd64

  • provider registry.terraform.io/oracle/oci v4.80.0

Affected Resource(s)

terraform oracle/oci

Terraform Configuration Files

terraform {
  required_providers {
    oci = {
      source  = "oracle/oci"
      version = "4.80.0"
    }
  }
}

resource "oci_core_vcn" "internal" {
  dns_label      = "internal"
  cidr_block     = "172.16.0.0/20"
  compartment_id = "ocid1.compartment.oc1..xxxxxxxxxxxxxxx"
  display_name   = "My internal VCN"
}

Debug Output

Github Gist: https://gist.github.com

Panic Output

Error: panicked while retrying operation. Panic was: runtime error: invalid memory address or nil pointer dereference │ Stack: goroutine 101 [running]: │ github.com/oracle/oci-go-sdk/v65/common.Retry.func1.1() │ github.com/oracle/oci-go-sdk/[email protected]/common/retry.go:813 +0x7b │ panic({0x537ca60, 0x907e460}) │ runtime/panic.go:1038 +0x215 │ github.com/oracle/oci-go-sdk/v65/common.Retry.func1() │ github.com/oracle/oci-go-sdk/[email protected]/common/retry.go:888 +0x556 │ created by github.com/oracle/oci-go-sdk/v65/common.Retry │ github.com/oracle/oci-go-sdk/[email protected]/common/retry.go:807 +0x267 │ │ │ with oci_core_vcn.internal, │ on main.tf line 18, in resource "oci_core_vcn" "internal": │ 18: resource "oci_core_vcn" "internal" { │

Expected Behavior

it should work

Actual Behavior

panic error

Steps to Reproduce

  1. setup oci cli with api_key auth method
  2. install terraform 1.2.6
  3. terraform init
  4. terraform apply

Important Factoids

same tf with api_key method works fine on linux but fails on macOS tried the latest version v4.87.0 and all other versions till v4.80.0, all have same issue

References

infa-ddeore avatar Aug 05 '22 06:08 infa-ddeore

Resolution will be provided into next release . https://github.com/oracle/terraform-provider-oci/compare/v4.87.0...hot_fix_4.87.1?expand=1

ravinitp avatar Aug 05 '22 07:08 ravinitp

Resolution will be provided into next release . https://github.com/oracle/terraform-provider-oci/compare/v4.87.0...hot_fix_4.87.1?expand=1

wonderful, thanks for the quick reply, any idea when will 4.87.1 be available ?

infa-ddeore avatar Aug 06 '22 04:08 infa-ddeore

@ravinitp 4.88.0 gives below error on mac

$ terraform init

Initializing the backend...

Initializing provider plugins...
- Reusing previous version of oracle/oci from the dependency lock file
╷
│ Error: Failed to install provider
│ 
│ Error while installing oracle/oci v4.88.0: could not query provider registry for registry.terraform.io/oracle/oci: failed to retrieve authentication checksums for
│ provider: 404 Not Found returned from github.com
╵

however, i manually downloaded the provider binary and tried using but it fails with this error:

oci_core_vcn.internal: Creating...
oci_core_vcn.internal: Still creating... [10s elapsed]
oci_core_vcn.internal: Still creating... [20s elapsed]
oci_core_vcn.internal: Still creating... [30s elapsed]
oci_core_vcn.internal: Still creating... [40s elapsed]
oci_core_vcn.internal: Still creating... [50s elapsed]
oci_core_vcn.internal: Still creating... [1m0s elapsed]
oci_core_vcn.internal: Still creating... [1m10s elapsed]
oci_core_vcn.internal: Still creating... [1m20s elapsed]
oci_core_vcn.internal: Still creating... [1m30s elapsed]
oci_core_vcn.internal: Still creating... [1m40s elapsed]
oci_core_vcn.internal: Still creating... [1m50s elapsed]
oci_core_vcn.internal: Still creating... [2m0s elapsed]
oci_core_vcn.internal: Still creating... [2m10s elapsed]
╷
│ Error: Post "https://iaas.ap-hyderabad-1.oraclecloud.com/20160918/vcns": dial tcp: i/o timeout
│ 
│   with oci_core_vcn.internal,
│   on main.tf line 10, in resource "oci_core_vcn" "internal":
│   10: resource "oci_core_vcn" "internal" {
│ 
╵

do you know if this issue is fixed already or do i need to wait 4.87.1 ?

infa-ddeore avatar Aug 11 '22 06:08 infa-ddeore

@ravinitp this issue still persist on v4.88.1

infa-ddeore avatar Aug 16 '22 04:08 infa-ddeore

Thank you for reporting the issue. We have raised an internal ticket to track this. Our service engineers will get back to you.

ravinitp avatar Apr 11 '23 13:04 ravinitp

Please let us know if the issue is still seen with latest OCI Provider version. To always use the latest version, remove the version field in required_providers block and it will be as below:

terraform { required_providers { oci = { source = "oracle/oci" } } }

NagaRajuPasunuri avatar Apr 17 '23 12:04 NagaRajuPasunuri

Works as expected with the latest versions. Hence closing out this ticket.

MeharwadeDivya avatar Apr 19 '23 12:04 MeharwadeDivya

` Plan: 1 to add, 0 to change, 0 to destroy.

Do you want to perform these actions? Terraform will perform the actions described above. Only 'yes' will be accepted to approve.

Enter a value: yes

oci_core_vcn.internal: Creating... oci_core_vcn.internal: Creation complete after 4s [id=ocid1.vcn.oc1.iad.xxxx]

Apply complete! Resources: 1 added, 0 changed, 0 destroyed.`

MeharwadeDivya avatar Apr 19 '23 12:04 MeharwadeDivya