Skip to content

Bug: files_sync resource fails on first read/sync due to JSON unmarshalling error (runtime type mismatch) #4

@joshworktango

Description

@joshworktango

Issue description:
When the first sync happens the below error appears. Before a sync happens there is no error.

Expected Behavior:
The files_sync.my_sync resource should be created successfully, and the first sync operation should complete without error, allowing subsequent terraform apply operations to read the state without issue.

Steps to reproduce:

Using the below provider/terraform version, create a files_sync using the below resource. Then run

  • terraform init
  • terraform plan
  • terraform apply

Wait for a sync to happen

  • terraform plan - see the error now

Provider version: 0.1.395

Terraform version: 1.9.0

Terraform resource:

resource "files_sync" "my_sync" {
  name                  = "Sync Name"
  description           = "Sync report files to remote server"
  src_path              = "<path>"
  dest_path             = "<dst path>/incoming"
  src_remote_server_id  = <ID>
  keep_after_copy       = false
  delete_empty_folders  = false
  disabled              = false
  sync_interval_minutes = 5
}

Resulting error:

Error: Error Reading Files Sync
with files_sync.my_sync,
on ../modules/customer-report/main.tf line 24, in resource "files_sync" "my_sync":
24: resource "files_sync" "my_sync" {
Could not read sync id 8868: json: cannot unmarshal number into Go struct field syncRun.runtime of type string

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions