hashicorp / terraform-provider-google

Terraform Provider for Google Cloud Platform
https://registry.terraform.io/providers/hashicorp/google/latest/docs
Mozilla Public License 2.0
2.31k stars 1.73k forks source link

Transfer job does not detect changes when path is changed to `""` #13673

Open omgMath opened 1 year ago

omgMath commented 1 year ago

Community Note

Terraform Version

Terraform v1.3.7

Affected Resource(s)

Terraform Configuration Files

resource "google_storage_transfer_job" "my-transfer-job" {
  description = "My description"
  project     = "my-project"

  transfer_spec {
    transfer_options {
      delete_objects_unique_in_sink = false
    }
    gcs_data_sink {
      bucket_name = "sink-bucket"
      path        = "/"
    }
    gcs_data_source {
      bucket_name = "source-bucket"
      path        = "/"
    }
  }
  schedule {
    schedule_start_date {
      year  = 2022
      month = 12
      day   = 6
    }
    start_time_of_day {
      hours   = 04
      minutes = 0
      seconds = 0
      nanos   = 0
    }
  }
}

Expected Behavior

We first configured the path to be as above, i.e. path = "/", until we realized we should leave it empty. When changing the path from "/" to "" in above configuration, the path should be removed from the transfer job.

Actual Behavior

The path is not changed, i.e. it stays "/".

Steps to Reproduce

  1. Create transfer job with path = "/"
  2. terraform apply
  3. Change the path to "".
  4. terraform apply

b/302672749

edwardmedia commented 1 year ago

@omgMath can you share your debug log?

omgMath commented 1 year ago

Sure. It was a bit cluttered by outputs of other resources, but I tried to reduce it to the juicy parts - let me know if something is missing.

TF_LOG=DEBUG ./terraform.sh -e prod -c 'apply -target=google_storage_transfer_job.my-transfer-job'

2023-02-08T07:55:30.185+0100 [INFO]  Terraform version: 1.3.7
2023-02-08T07:55:30.185+0100 [DEBUG] using github.com/hashicorp/go-tfe v1.9.0
2023-02-08T07:55:30.185+0100 [DEBUG] using github.com/hashicorp/hcl/v2 v2.15.0
2023-02-08T07:55:30.185+0100 [DEBUG] using github.com/hashicorp/terraform-config-inspect v0.0.0-20210209133302-4fd17a0faac2
2023-02-08T07:55:30.185+0100 [DEBUG] using github.com/hashicorp/terraform-svchost v0.0.0-20200729002733-f050f53b9734
2023-02-08T07:55:30.185+0100 [DEBUG] using github.com/zclconf/go-cty v1.12.1
2023-02-08T07:55:30.185+0100 [INFO]  Go runtime version: go1.19.4
2023-02-08T07:55:30.185+0100 [INFO]  CLI args: []string{"terraform", "init", "-backend-config", "backend-prod.tfvars", "-reconfigure"}
2023-02-08T07:55:30.185+0100 [DEBUG] Attempting to open CLI config file: ${HOME}/.terraformrc
2023-02-08T07:55:30.185+0100 [INFO]  Loading CLI configuration from ${HOME}/.terraformrc
2023-02-08T07:55:30.185+0100 [DEBUG] ignoring non-existing provider search directory terraform.d/plugins
2023-02-08T07:55:30.185+0100 [DEBUG] ignoring non-existing provider search directory ${HOME}/.terraform.d/plugins
2023-02-08T07:55:30.186+0100 [DEBUG] ignoring non-existing provider search directory ${HOME}/.local/share/terraform/plugins
2023-02-08T07:55:30.186+0100 [DEBUG] ignoring non-existing provider search directory /usr/share/ubuntu/terraform/plugins
2023-02-08T07:55:30.186+0100 [DEBUG] ignoring non-existing provider search directory /usr/share/gnome/terraform/plugins
2023-02-08T07:55:30.186+0100 [DEBUG] ignoring non-existing provider search directory /usr/local/share/terraform/plugins
2023-02-08T07:55:30.186+0100 [DEBUG] ignoring non-existing provider search directory /usr/share/terraform/plugins
2023-02-08T07:55:30.186+0100 [DEBUG] ignoring non-existing provider search directory /var/lib/snapd/desktop/terraform/plugins
2023-02-08T07:55:30.186+0100 [INFO]  CLI command args: []string{"init", "-backend-config", "backend-prod.tfvars", "-reconfigure"}
2023-02-08T07:55:30.186+0100 [INFO]  Checkpoint disabled. Not running.
Initializing modules...
2023-02-08T07:55:30.192+0100 [DEBUG] Module installer: begin foo
2023-02-08T07:55:30.193+0100 [DEBUG] Module installer: begin bar

Initializing the backend...
2023-02-08T07:55:30.349+0100 [DEBUG] checking for provisioner in "."
2023-02-08T07:55:30.353+0100 [DEBUG] checking for provisioner in "/usr/bin"

Successfully configured the backend "gcs"! Terraform will automatically
use this backend unless the backend configuration changes.
2023-02-08T07:55:30.700+0100 [DEBUG] checking for provisioner in "."
2023-02-08T07:55:30.703+0100 [DEBUG] checking for provisioner in "/usr/bin"

Initializing provider plugins...
- terraform.io/builtin/terraform is built in to Terraform
- Reusing previous version of hashicorp/google from the dependency lock file
2023-02-08T07:55:30.904+0100 [DEBUG] Service discovery for registry.terraform.io at https://registry.terraform.io/.well-known/terraform.json
2023-02-08T07:55:30.923+0100 [DEBUG] GET https://registry.terraform.io/v1/providers/hashicorp/google/versions
- Using previously-installed hashicorp/google v4.36.0

Terraform has been successfully initialized!

You may now begin working with Terraform. Try running "terraform plan" to see
any changes that are required for your infrastructure. All Terraform commands
should now work.

If you ever set or change modules or backend configuration for Terraform,
rerun this command to reinitialize your working directory. If you forget, other
commands will detect it and remind you to do so if necessary.
2023-02-08T07:55:31.257+0100 [INFO]  Terraform version: 1.3.7
2023-02-08T07:55:31.257+0100 [DEBUG] using github.com/hashicorp/go-tfe v1.9.0
2023-02-08T07:55:31.257+0100 [DEBUG] using github.com/hashicorp/hcl/v2 v2.15.0
2023-02-08T07:55:31.257+0100 [DEBUG] using github.com/hashicorp/terraform-config-inspect v0.0.0-20210209133302-4fd17a0faac2
2023-02-08T07:55:31.257+0100 [DEBUG] using github.com/hashicorp/terraform-svchost v0.0.0-20200729002733-f050f53b9734
2023-02-08T07:55:31.257+0100 [DEBUG] using github.com/zclconf/go-cty v1.12.1
2023-02-08T07:55:31.257+0100 [INFO]  Go runtime version: go1.19.4
2023-02-08T07:55:31.257+0100 [INFO]  CLI args: []string{"terraform", "apply", "-target=google_storage_transfer_job.my-transfer-job", "-var-file=prod.tfvars"}
2023-02-08T07:55:31.257+0100 [DEBUG] Attempting to open CLI config file: ${HOME}/.terraformrc
2023-02-08T07:55:31.257+0100 [INFO]  Loading CLI configuration from ${HOME}/.terraformrc
2023-02-08T07:55:31.257+0100 [DEBUG] ignoring non-existing provider search directory terraform.d/plugins
2023-02-08T07:55:31.257+0100 [DEBUG] ignoring non-existing provider search directory ${HOME}/.terraform.d/plugins
2023-02-08T07:55:31.258+0100 [DEBUG] ignoring non-existing provider search directory ${HOME}/.local/share/terraform/plugins
2023-02-08T07:55:31.258+0100 [DEBUG] ignoring non-existing provider search directory /usr/share/ubuntu/terraform/plugins
2023-02-08T07:55:31.258+0100 [DEBUG] ignoring non-existing provider search directory /usr/share/gnome/terraform/plugins
2023-02-08T07:55:31.258+0100 [DEBUG] ignoring non-existing provider search directory /usr/local/share/terraform/plugins
2023-02-08T07:55:31.258+0100 [DEBUG] ignoring non-existing provider search directory /usr/share/terraform/plugins
2023-02-08T07:55:31.258+0100 [DEBUG] ignoring non-existing provider search directory /var/lib/snapd/desktop/terraform/plugins
2023-02-08T07:55:31.258+0100 [INFO]  CLI command args: []string{"apply", "-target=google_storage_transfer_job.my-transfer-job", "-var-file=prod.tfvars"}
2023-02-08T07:55:31.258+0100 [INFO]  Checkpoint disabled. Not running.
2023-02-08T07:55:31.402+0100 [DEBUG] checking for provisioner in "."
2023-02-08T07:55:31.406+0100 [DEBUG] checking for provisioner in "/usr/bin"
2023-02-08T07:55:31.407+0100 [INFO]  backend/local: starting Apply operation
2023-02-08T07:55:31.765+0100 [DEBUG] created provider logger: level=debug
2023-02-08T07:55:31.765+0100 [INFO]  provider: configuring client automatic mTLS
2023-02-08T07:55:31.804+0100 [DEBUG] provider: starting plugin: path=.terraform/providers/registry.terraform.io/hashicorp/google/4.36.0/linux_amd64/terraform-provider-google_v4.36.0_x5 args=[.terraform/providers/registry.terraform.io/hashicorp/google/4.36.0/linux_amd64/terraform-provider-google_v4.36.0_x5]
2023-02-08T07:55:31.804+0100 [DEBUG] provider: plugin started: path=.terraform/providers/registry.terraform.io/hashicorp/google/4.36.0/linux_amd64/terraform-provider-google_v4.36.0_x5 pid=14769
2023-02-08T07:55:31.804+0100 [DEBUG] provider: waiting for RPC address: path=.terraform/providers/registry.terraform.io/hashicorp/google/4.36.0/linux_amd64/terraform-provider-google_v4.36.0_x5
2023-02-08T07:55:31.812+0100 [INFO]  provider.terraform-provider-google_v4.36.0_x5: configuring server automatic mTLS: timestamp=2023-02-08T07:55:31.812+0100
2023-02-08T07:55:31.834+0100 [DEBUG] provider.terraform-provider-google_v4.36.0_x5: plugin address: address=/tmp/plugin1434324369 network=unix timestamp=2023-02-08T07:55:31.834+0100
2023-02-08T07:55:31.834+0100 [DEBUG] provider: using plugin: version=5
2023-02-08T07:55:31.910+0100 [DEBUG] provider.stdio: received EOF, stopping recv loop: err="rpc error: code = Unavailable desc = error reading from server: EOF"
2023-02-08T07:55:31.911+0100 [DEBUG] provider: plugin process exited: path=.terraform/providers/registry.terraform.io/hashicorp/google/4.36.0/linux_amd64/terraform-provider-google_v4.36.0_x5 pid=14769
2023-02-08T07:55:31.912+0100 [DEBUG] provider: plugin exited
2023-02-08T07:55:31.912+0100 [DEBUG] Building and walking validate graph
2023-02-08T07:55:31.913+0100 [DEBUG] ProviderTransformer: "google_storage_transfer_job.my-transfer-job" (*terraform.NodeValidatableResource) needs provider["registry.terraform.io/hashicorp/google"]
2023-02-08T07:55:31.914+0100 [ERROR] AttachSchemaTransformer: No provider config schema available for provider["terraform.io/builtin/terraform"]
2023-02-08T07:55:31.914+0100 [INFO]  ReferenceTransformer: reference not found: "each.key"
2023-02-08T07:55:31.915+0100 [DEBUG] ReferenceTransformer: "google_storage_transfer_job.my-transfer-job" references: [something]
2023-02-08T07:55:31.919+0100 [DEBUG] Starting graph walk: walkValidate
2023-02-08T07:55:31.921+0100 [DEBUG] created provider logger: level=debug
2023-02-08T07:55:31.921+0100 [INFO]  provider: configuring client automatic mTLS
2023-02-08T07:55:31.930+0100 [DEBUG] provider: starting plugin: path=.terraform/providers/registry.terraform.io/hashicorp/google/4.36.0/linux_amd64/terraform-provider-google_v4.36.0_x5 args=[.terraform/providers/registry.terraform.io/hashicorp/google/4.36.0/linux_amd64/terraform-provider-google_v4.36.0_x5]
2023-02-08T07:55:31.930+0100 [DEBUG] provider: plugin started: path=.terraform/providers/registry.terraform.io/hashicorp/google/4.36.0/linux_amd64/terraform-provider-google_v4.36.0_x5 pid=14782
2023-02-08T07:55:31.930+0100 [DEBUG] provider: waiting for RPC address: path=.terraform/providers/registry.terraform.io/hashicorp/google/4.36.0/linux_amd64/terraform-provider-google_v4.36.0_x5
2023-02-08T07:55:31.938+0100 [INFO]  provider.terraform-provider-google_v4.36.0_x5: configuring server automatic mTLS: timestamp=2023-02-08T07:55:31.937+0100
2023-02-08T07:55:31.962+0100 [DEBUG] provider: using plugin: version=5
2023-02-08T07:55:31.962+0100 [DEBUG] provider.terraform-provider-google_v4.36.0_x5: plugin address: address=/tmp/plugin3584894878 network=unix timestamp=2023-02-08T07:55:31.961+0100
2023-02-08T07:55:32.090+0100 [DEBUG] provider.stdio: received EOF, stopping recv loop: err="rpc error: code = Unavailable desc = error reading from server: EOF"
2023-02-08T07:55:32.092+0100 [DEBUG] provider: plugin process exited: path=.terraform/providers/registry.terraform.io/hashicorp/google/4.36.0/linux_amd64/terraform-provider-google_v4.36.0_x5 pid=14782
2023-02-08T07:55:32.092+0100 [DEBUG] provider: plugin exited
2023-02-08T07:55:32.092+0100 [INFO]  backend/local: apply calling Plan
2023-02-08T07:55:32.092+0100 [DEBUG] Building and walking plan graph for NormalMode
2023-02-08T07:55:32.093+0100 [DEBUG] ProviderTransformer: "google_storage_transfer_job.my-transfer-job (expand)" (*terraform.nodeExpandPlannableResource) needs provider["registry.terraform.io/hashicorp/google"]
2023-02-08T07:55:32.094+0100 [ERROR] AttachSchemaTransformer: No provider config schema available for provider["terraform.io/builtin/terraform"]

2023-02-08T07:55:32.096+0100 [DEBUG] ReferenceTransformer: "google_storage_transfer_job.my-transfer-job (expand)" references: [something]
2023-02-08T07:55:32.099+0100 [DEBUG] Starting graph walk: walkPlan
2023-02-08T07:55:32.099+0100 [INFO]  ReferenceTransformer: reference not found: "var.environment"
2023-02-08T07:55:32.099+0100 [DEBUG] Initializing remote state backend: gcs
data.terraform_remote_state.my-remote-state: Reading...
2023-02-08T07:55:32.099+0100 [DEBUG] Initializing remote state backend: gcs
data.terraform_remote_state.my-remote-state: Read complete after 0s
2023-02-08T07:55:32.345+0100 [DEBUG] created provider logger: level=debug
2023-02-08T07:55:32.345+0100 [INFO]  provider: configuring client automatic mTLS
2023-02-08T07:55:32.372+0100 [DEBUG] provider: starting plugin: path=.terraform/providers/registry.terraform.io/hashicorp/google/4.36.0/linux_amd64/terraform-provider-google_v4.36.0_x5 args=[.terraform/providers/registry.terraform.io/hashicorp/google/4.36.0/linux_amd64/terraform-provider-google_v4.36.0_x5]
2023-02-08T07:55:32.372+0100 [DEBUG] provider: plugin started: path=.terraform/providers/registry.terraform.io/hashicorp/google/4.36.0/linux_amd64/terraform-provider-google_v4.36.0_x5 pid=14796
2023-02-08T07:55:32.372+0100 [DEBUG] provider: waiting for RPC address: path=.terraform/providers/registry.terraform.io/hashicorp/google/4.36.0/linux_amd64/terraform-provider-google_v4.36.0_x5
2023-02-08T07:55:32.383+0100 [INFO]  provider.terraform-provider-google_v4.36.0_x5: configuring server automatic mTLS: timestamp=2023-02-08T07:55:32.383+0100
2023-02-08T07:55:32.407+0100 [DEBUG] provider: using plugin: version=5
2023-02-08T07:55:32.407+0100 [DEBUG] provider.terraform-provider-google_v4.36.0_x5: plugin address: address=/tmp/plugin1578750652 network=unix timestamp=2023-02-08T07:55:32.407+0100
2023-02-08T07:55:32.525+0100 [WARN]  ValidateProviderConfig from "provider[\"registry.terraform.io/hashicorp/google\"]" changed the config value, but that value is unused
2023-02-08T07:55:32.526+0100 [INFO]  provider.terraform-provider-google_v4.36.0_x5: 2023/02/08 07:55:32 [INFO] Authenticating using DefaultClient...: timestamp=2023-02-08T07:55:32.526+0100
2023-02-08T07:55:32.526+0100 [INFO]  provider.terraform-provider-google_v4.36.0_x5: 2023/02/08 07:55:32 [INFO]   -- Scopes: [https://www.googleapis.com/auth/cloud-platform https://www.googleapis.com/auth/userinfo.email]: timestamp=2023-02-08T07:55:32.526+0100
2023-02-08T07:55:32.526+0100 [INFO]  provider.terraform-provider-google_v4.36.0_x5: 2023/02/08 07:55:32 [INFO] Authenticating using DefaultClient...: timestamp=2023-02-08T07:55:32.526+0100
2023-02-08T07:55:32.526+0100 [INFO]  provider.terraform-provider-google_v4.36.0_x5: 2023/02/08 07:55:32 [INFO]   -- Scopes: [https://www.googleapis.com/auth/cloud-platform https://www.googleapis.com/auth/userinfo.email]: timestamp=2023-02-08T07:55:32.526+0100
2023-02-08T07:55:32.526+0100 [INFO]  provider.terraform-provider-google_v4.36.0_x5: 2023/02/08 07:55:32 [DEBUG] Waiting for state to become: [success]: timestamp=2023-02-08T07:55:32.526+0100
2023-02-08T07:55:32.644+0100 [INFO]  provider.terraform-provider-google_v4.36.0_x5: 2023/02/08 07:55:32 [INFO] Terraform is using this identity: terraform@competec-terraform-admin.iam.gserviceaccount.com: timestamp=2023-02-08T07:55:32.644+0100
2023-02-08T07:55:32.645+0100 [INFO]  ReferenceTransformer: reference not found: "local.my-remote-state"
2023-02-08T07:55:32.645+0100 [DEBUG] ReferenceTransformer: "google_storage_transfer_job.my-transfer-job" references: []
google_storage_transfer_job.my-transfer-job: Refreshing state... [id=my-project-id/14751411415119138317]
2023-02-08T07:55:32.659+0100 [INFO]  provider.terraform-provider-google_v4.36.0_x5: 2023/02/08 07:55:32 [INFO] Instantiating Google Cloud Storage Transfer client for path https://storagetransfer.googleapis.com/: timestamp=2023-02-08T07:55:32.659+0100
2023-02-08T07:55:32.659+0100 [INFO]  provider.terraform-provider-google_v4.36.0_x5: 2023/02/08 07:55:32 [DEBUG] Retry Transport: starting RoundTrip retry loop: timestamp=2023-02-08T07:55:32.659+0100
2023-02-08T07:55:32.659+0100 [INFO]  provider.terraform-provider-google_v4.36.0_x5: 2023/02/08 07:55:32 [DEBUG] Retry Transport: request attempt 0: timestamp=2023-02-08T07:55:32.659+0100
2023-02-08T07:55:32.660+0100 [INFO]  provider.terraform-provider-google_v4.36.0_x5: 2023/02/08 07:55:32 [DEBUG] Google API Request Details:
---[ REQUEST ]---------------------------------------
GET /v1/transferJobs/14751411415119138317?alt=json&prettyPrint=false&projectId=my-project-id HTTP/1.1
Host: storagetransfer.googleapis.com
User-Agent: google-api-go-client/0.5 Terraform/1.3.7 (+https://www.terraform.io) Terraform-Plugin-SDK/2.10.1 terraform-provider-google/dev
X-Goog-Api-Client: gl-go/1.18.1 gdcl/0.92.0
Accept-Encoding: gzip

-----------------------------------------------------: timestamp=2023-02-08T07:55:32.660+0100
2023-02-08T07:55:33.535+0100 [INFO]  provider.terraform-provider-google_v4.36.0_x5: 2023/02/08 07:55:33 [DEBUG] Google API Response Details:
---[ RESPONSE ]--------------------------------------
HTTP/2.0 200 OK
Alt-Svc: h3=":443"; ma=2592000,h3-29=":443"; ma=2592000
Cache-Control: private
Content-Type: application/json; charset=UTF-8
Date: Wed, 08 Feb 2023 06:55:33 GMT
Server: ESF
Vary: Origin
Vary: X-Origin
Vary: Referer
X-Content-Type-Options: nosniff
X-Frame-Options: SAMEORIGIN
X-Xss-Protection: 0

{
 "name": "transferJobs/14751411415119138317",
 "description": "My description",
 "projectId": "my-project-id",
 "transferSpec": {
  "gcsDataSource": {
   "bucketName": "source-bucket",
   "path": "/"
  },
  "gcsDataSink": {
   "bucketName": "sink-bucket",
   "path": "/"
  },
  "transferOptions": {}
 },
 "schedule": {
  "scheduleStartDate": {
   "year": 2022,
   "month": 12,
   "day": 6
  },
  "startTimeOfDay": {
   "hours": 4
  },
  "repeatInterval": "86400s"
 },
 "status": "ENABLED",
 "creationTime": "2023-02-08T06:39:32.941374205Z",
 "lastModificationTime": "2023-02-08T06:39:32.941374205Z"
}
-----------------------------------------------------: timestamp=2023-02-08T07:55:33.535+0100
2023-02-08T07:55:33.535+0100 [INFO]  provider.terraform-provider-google_v4.36.0_x5: 2023/02/08 07:55:33 [DEBUG] Retry Transport: Stopping retries, last request was successful: timestamp=2023-02-08T07:55:33.535+0100
2023-02-08T07:55:33.536+0100 [INFO]  provider.terraform-provider-google_v4.36.0_x5: 2023/02/08 07:55:33 [DEBUG] Retry Transport: Returning after 1 attempts: timestamp=2023-02-08T07:55:33.535+0100
2023-02-08T07:55:33.548+0100 [INFO]  provider.terraform-provider-google_v4.36.0_x5: 2023/02/08 07:55:33 [DEBUG] A computed value with the empty string as the new value and a non-empty old value was found. Interpreting the empty string as "unset" to align with legacy behavior.: timestamp=2023-02-08T07:55:33.548+0100
2023-02-08T07:55:33.548+0100 [INFO]  provider.terraform-provider-google_v4.36.0_x5: 2023/02/08 07:55:33 [DEBUG] A computed value with the empty string as the new value and a non-empty old value was found. Interpreting the empty string as "unset" to align with legacy behavior.: timestamp=2023-02-08T07:55:33.548+0100
2023-02-08T07:55:33.549+0100 [WARN]  Provider "registry.terraform.io/hashicorp/google" produced an invalid plan for google_storage_transfer_job.my-transfer-job, but we are tolerating it because it is using the legacy plugin SDK.
    The following problems may be the cause of any confusing errors from downstream operations:
      - .status: planned value cty.StringVal("ENABLED") for a non-computed attribute
      - .schedule[0].repeat_interval: planned value cty.StringVal("86400s") for a non-computed attribute
      - .transfer_spec[0].transfer_options[0].delete_objects_from_source_after_transfer: planned value cty.False for a non-computed attribute
      - .transfer_spec[0].transfer_options[0].overwrite_objects_already_existing_in_sink: planned value cty.False for a non-computed attribute
2023-02-08T07:55:33.550+0100 [DEBUG] provider.terraform-provider-google_v4.36.0_x5: 2023/02/08 07:55:33 [DEBUG] [core] [Server #1 ListenSocket #2] ListenSocket deleted 
2023-02-08T07:55:33.550+0100 [DEBUG] provider.terraform-provider-google_v4.36.0_x5: 2023/02/08 07:55:33 [DEBUG] [transport] transport: http2Server.HandleStreams failed to read frame: read unix /tmp/plugin1578750652->@: use of closed network connection 
2023-02-08T07:55:33.550+0100 [DEBUG] provider.stdio: received EOF, stopping recv loop: err="rpc error: code = Unavailable desc = error reading from server: EOF"
2023-02-08T07:55:33.553+0100 [DEBUG] provider: plugin process exited: path=.terraform/providers/registry.terraform.io/hashicorp/google/4.36.0/linux_amd64/terraform-provider-google_v4.36.0_x5 pid=14796
2023-02-08T07:55:33.553+0100 [DEBUG] provider: plugin exited
2023-02-08T07:55:33.553+0100 [DEBUG] no planned changes, skipping apply graph check

No changes. Your infrastructure matches the configuration.

Terraform has compared your real infrastructure against your configuration and found no differences, so no changes are needed.
omgMath commented 1 year ago

Also tried with the newest provider (4.52.0) version. Same behavior, but more logs - the line "2023-02-08T08:13:21.184+0100 [INFO] provider.terraform-provider-google_v4.52.0_x5: 2023/02/08 08:13:21 [DEBUG] A computed value with the empty string as the new value and a non-empty old value was found. Interpreting the empty string as "unset" to align with legacy behavior.: timestamp=2023-02-08T08:13:21.184+0100" caught my eye...

...
---[ REQUEST ]---------------------------------------
GET /v1/transferJobs/14751411415119138317?alt=json&prettyPrint=false&projectId=my-project HTTP/1.1
Host: storagetransfer.googleapis.com
User-Agent: google-api-go-client/0.5 Terraform/1.3.7 (+https://www.terraform.io) Terraform-Plugin-SDK/2.10.1 terraform-provider-google/4.52.0
X-Goog-Api-Client: gl-go/1.18.1 gdcl/0.105.0
Accept-Encoding: gzip

-----------------------------------------------------: timestamp=2023-02-08T08:13:20.227+0100
2023-02-08T08:13:21.179+0100 [INFO]  provider.terraform-provider-google_v4.52.0_x5: 2023/02/08 08:13:21 [DEBUG] Google API Response Details:
---[ RESPONSE ]--------------------------------------
HTTP/2.0 200 OK
Alt-Svc: h3=":443"; ma=2592000,h3-29=":443"; ma=2592000
Cache-Control: private
Content-Type: application/json; charset=UTF-8
Date: Wed, 08 Feb 2023 07:13:20 GMT
Server: ESF
Vary: Origin
Vary: X-Origin
Vary: Referer
X-Content-Type-Options: nosniff
X-Frame-Options: SAMEORIGIN
X-Xss-Protection: 0

{
 "name": "transferJobs/14751411415119138317",
 "description": "My description",
 "projectId": "my-project",
 "transferSpec": {
  "gcsDataSource": {
   "bucketName": "source-bucket",
   "path": "/"
  },
  "gcsDataSink": {
   "bucketName": "sink-bucket",
   "path": "/"
  },
  "transferOptions": {}
 },
 "schedule": {
  "scheduleStartDate": {
   "year": 2022,
   "month": 12,
   "day": 6
  },
  "startTimeOfDay": {
   "hours": 4
  },
  "repeatInterval": "86400s"
 },
 "status": "ENABLED",
 "creationTime": "2023-02-08T06:39:32.941374205Z",
 "lastModificationTime": "2023-02-08T06:39:32.941374205Z"
}
-----------------------------------------------------: timestamp=2023-02-08T08:13:21.179+0100
2023-02-08T08:13:21.179+0100 [INFO]  provider.terraform-provider-google_v4.52.0_x5: 2023/02/08 08:13:21 [DEBUG] Retry Transport: Stopping retries, last request was successful: timestamp=2023-02-08T08:13:21.179+0100
2023-02-08T08:13:21.179+0100 [INFO]  provider.terraform-provider-google_v4.52.0_x5: 2023/02/08 08:13:21 [DEBUG] Retry Transport: Returning after 1 attempts: timestamp=2023-02-08T08:13:21.179+0100
2023-02-08T08:13:21.181+0100 [WARN]  Provider "registry.terraform.io/hashicorp/google" produced an unexpected new value for google_storage_transfer_job.my-transfer-job during refresh.
      - .transfer_spec[0].transfer_options[0].overwrite_when: was null, but now cty.StringVal("")
2023-02-08T08:13:21.184+0100 [INFO]  provider.terraform-provider-google_v4.52.0_x5: 2023/02/08 08:13:21 [DEBUG] A computed value with the empty string as the new value and a non-empty old value was found. Interpreting the empty string as "unset" to align with legacy behavior.: timestamp=2023-02-08T08:13:21.184+0100
2023-02-08T08:13:21.184+0100 [INFO]  provider.terraform-provider-google_v4.52.0_x5: 2023/02/08 08:13:21 [DEBUG] A computed value with the empty string as the new value and a non-empty old value was found. Interpreting the empty string as "unset" to align with legacy behavior.: timestamp=2023-02-08T08:13:21.184+0100
2023-02-08T08:13:21.185+0100 [WARN]  Provider "registry.terraform.io/hashicorp/google" produced an invalid plan for google_storage_transfer_job.my-transfer-job, but we are tolerating it because it is using the legacy plugin SDK.
    The following problems may be the cause of any confusing errors from downstream operations:
      - .status: planned value cty.StringVal("ENABLED") for a non-computed attribute
      - .transfer_spec[0].transfer_options[0].delete_objects_from_source_after_transfer: planned value cty.False for a non-computed attribute
      - .transfer_spec[0].transfer_options[0].overwrite_objects_already_existing_in_sink: planned value cty.False for a non-computed attribute
      - .transfer_spec[0].transfer_options[0].overwrite_when: planned value cty.StringVal("") for a non-computed attribute
      - .schedule[0].repeat_interval: planned value cty.StringVal("86400s") for a non-computed attribute
2023-02-08T08:13:21.186+0100 [DEBUG] provider.terraform-provider-google_v4.52.0_x5: 2023/02/08 08:13:21 [DEBUG] [transport] transport: http2Server.HandleStreams failed to read frame: read unix /tmp/plugin3528672322->@: use of closed network connection 
2023-02-08T08:13:21.186+0100 [DEBUG] provider.stdio: received EOF, stopping recv loop: err="rpc error: code = Unavailable desc = error reading from server: EOF"
2023-02-08T08:13:21.188+0100 [DEBUG] provider: plugin process exited: path=.terraform/providers/registry.terraform.io/hashicorp/google/4.52.0/linux_amd64/terraform-provider-google_v4.52.0_x5 pid=17836
2023-02-08T08:13:21.188+0100 [DEBUG] provider: plugin exited
2023-02-08T08:13:21.197+0100 [DEBUG] no planned changes, skipping apply graph check

No changes. Your infrastructure matches the configuration.
edwardmedia commented 1 year ago

@omgMath I can repro this issue. It appears to be a terraform bug. To workaround, it seems fine if you change the path to " " (space), does it work for you?

omgMath commented 1 year ago

Thanks for checking! I cannot workaround it with " ", it reports the following error Error: googleapi: Error 400: GCS source Path argument must end with '/', badRequest.

I worked around it by just recreating the resource.

iBrandyJackson commented 6 months ago

I see where this is noted as an upstream-terraform issue, however, I also saw this terraform bug, directing the reporter back to the provider to solve here: https://github.com/hashicorp/terraform/issues/32757

rileykarson commented 5 months ago

This is something that Terraform Core technically handles correctly, but the Terraform Plugin SDK doesn't. So right label (since upstream-terraform refers to both) and correct resolution for that issue. Having an issue against the SDK isn't super valuable because they'll recommend we upgrade to the Terraform Plugin Framework.