oracle / terraform-provider-oci

Terraform Oracle Cloud Infrastructure provider
https://www.terraform.io/docs/providers/oci/
Mozilla Public License 2.0
758 stars 676 forks source link

Oci data science UpdateNotebookSession update fails without privateEndpointId Ticket2 #2014

Closed bieksaz closed 6 months ago

bieksaz commented 10 months ago

Description

when testing creation of notebooks in data science project using the following code initially I create only 2 notebooks (Notebook_Business_1 and Notebook_Business_2) and it works fine. But then if I rerun it again with modified parameter nbs_name_business by adding one more notebook (Notebook_Business_3) to it - it tries to modify notebooks Notebook_Business_1 and Notebook_Business_2 (because of automatically amended defined_tags that are not coming from my notebook build) to remove defined_tags that it did not add itself and also to create new notebook (Notebook_Business_3). Theoretically it should all be fine, BUT, I get a failure Error: 400-InvalidParameter, Invalid OCID privateEndpointId It seems that this failure ONLY appears on modify operations, as the new Notebook_Business_3 gets created. And if I would remove one already created notebook from the input list it would then successfully destroy it, but all the modify notebooks ops would be failing again.. If you look at the failure - they all expect an OPTIONAL parameter privateEndpointId (as per documentation) which I did not provide as I do not use it here.. Seems that this UpdateNotebookSession function has a bug in it, as it treats parameter privateEndpointId as mandatory

affected_resources = oci_datascience_notebook_session, terraform

CODE snippet:

variable "nbs_name_business" {
  description = "Notebook session names for BUSINESS"
  type        = string
  default     = "Notebook_Business_1,Notebook_Business_2,Notebook_Business_3"
}

locals {
    local_nbs_name_business = split(",",var.nbs_name_business)
}

resource "oci_datascience_notebook_session" "notebook_businessArea" {
    count          = length(local.local_nbs_name_business)
    compartment_id = data.oci_identity_compartments.app_compartment.compartments[0].id
    project_id     = data.oci_datascience_projects.ds_project_businessArea.projects.0.id
    display_name   = local.local_nbs_name_business[count.index]
    defined_tags   = var.defined_tags["datascience"]

    notebook_session_configuration_details {
        shape      = var.nbs_shape
        subnet_id  = data.oci_core_subnets.ds.subnets.0.id

        block_storage_size_in_gbs = var.storage_gbs

        dynamic "notebook_session_shape_config_details" {
            for_each = var.nbs_shape_flex == true ? [1] : [0]
            content {
                memory_in_gbs = var.nbs_shape_memory
                ocpus         = var.nbs_shape_ocpus
            }
        }
    }
}

Error message:

│ Error: 400-InvalidParameter, Invalid OCID privateEndpointId │ Suggestion: Please update the parameter(s) in the Terraform config as per error message Invalid OCID privateEndpointId │ Documentation: https://registry.terraform.io/providers/oracle/oci/latest/docs/resources/datascience_notebook_session │ API Reference: https://docs.oracle.com/iaas/api/#/en/data-science/20190101/NotebookSession/UpdateNotebookSession │ Request Target: PUT https://datascience.eu-frankfurt-1.oci.oraclecloud.com/20190101/notebookSessions/ocid1.datasciencenotebooksession.oc1.eu-frankfurt-1.amaaaaaa2ky4jjyac45p3nyeeh4lcm7nv474kberdryxwq3agr47lszgt2da │ Provider version: 5.23.0, released on . This provider is 15250 Update(s) behind to current. │ Service: Datascience Notebook Session │ Operation Name: UpdateNotebookSession │ OPC request ID: e64ad334875afcce4920e157a5e3782a/2FCF0815B96841B7076E16023F6D9F2D/9A910468C54B69A6EBA27DFFC3FADBE5 │ │ │ with oci_datascience_notebook_session.notebook_businessArea[0], │ on main.tf line 164, in resource "oci_datascience_notebook_session" "notebook_businessArea": │ 164: resource "oci_datascience_notebook_session" "notebook_businessArea" {

Provider information:

tf-oci-pub commented 10 months ago

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

nzmarch commented 7 months ago

Hi @bieksaz, we are currently working on a fix for this issue. As a sanity check can you try to explicitly submit privateEndpointId=null in your Terraform code?

bieksaz commented 7 months ago

Hi Nathan, its been quite some time since i opened this issue. Anyway, we now moved everything to use private endpoint, so I dont have a testing environment to do such test for you. But its a straight forward test, so you should be able to run it on youra

Sent from Outlook for iOShttps://aka.ms/o0ukef


From: Nathan March @.> Sent: Thursday, March 7, 2024 7:52:28 PM To: oracle/terraform-provider-oci @.> Cc: Zydrunas Bieksa @.>; Mention @.> Subject: Re: [oracle/terraform-provider-oci] Oci data science UpdateNotebookSession update fails without privateEndpointId Ticket2 (Issue #2014)

Hi @bieksazhttps://github.com/bieksaz, we are currently working on a fix for this issue. As a sanity check can you try to explicitly submit privateEndpointId=null in your Terraform code?

— Reply to this email directly, view it on GitHubhttps://github.com/oracle/terraform-provider-oci/issues/2014#issuecomment-1984315245, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AOQOVYNTDHGAAE3NFQIDQFDYXDAPZAVCNFSM6AAAAABA4PHVCSVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSOBUGMYTKMRUGU. You are receiving this because you were mentioned.Message ID: @.***>

nzmarch commented 7 months ago

I have resolved this issue now. There was an issue with how we were processing empty strings. Now we accept empty strings from terraform provider.

vsin12 commented 6 months ago

The fix has been done on API side.