terraform-routeros / terraform-provider-routeros

Terraform Provider for Mikrotik RouterOS
Mozilla Public License 2.0
187 stars 53 forks source link

Schema warnings when managing Ethernet Interfaces #298

Closed mircea-pavel-anton closed 10 months ago

mircea-pavel-anton commented 10 months ago

Describe the bug

A lot of warning appear in the console when trying to manage routeros_interface_ethernet objects

To Reproduce

Using provider version 1.23.0 and RouterOS version 7.9.2, try to create a new routeros_interface_ethernet object.

Expected behavior

The object should be created without generating any warnings or errors.

Stack Trace

Applying the following config:

terraform {
  required_providers {
    routeros = {
      source  = "terraform-routeros/routeros"
      version = "1.23.0"
    }
  }
}

provider "routeros" {
  hosturl  = var.mikrotik_router_url
  username = var.mikrotik_router_username
  password = var.mikrotik_router_password
  insecure = var.mikrotik_router_insecure_skip_tls_verify
}

resource "routeros_interface_ethernet" "desktop-iface" {
  factory_name = "sfp-sfpplus1"
  name         = "desktop"
  l2mtu        = 1514
}

Produces this result:

mike@DESKTOP-48UPPAD:/com.docker.devenvironments.code/infra/mikrotik$ terraform apply

Terraform used the selected providers to generate the following execution plan. Resource actions are indicated with the following symbols:
  + create

Terraform will perform the following actions:

  # routeros_interface_ethernet.desktop-iface will be created
  + resource "routeros_interface_ethernet" "desktop-iface" {
... (ommited for brevity)
    }

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

routeros_interface_ethernet.desktop-iface: Creating...
routeros_interface_ethernet.desktop-iface: Creation complete after 0s [id=*9]
╷
│ Warning: Field 'tx_deferred' not found in the schema
│ 
│   with routeros_interface_ethernet.desktop-iface,
│   on interfaces.tf line 1, in resource "routeros_interface_ethernet" "desktop-iface":
│    1: resource "routeros_interface_ethernet" "desktop-iface" {
│ 
│ [MikrotikResourceDataToTerraform] The field was lost during the Schema development: ▷ 'tx_deferred': '0' ◁
╵
╷
│ Warning: Field 'tx_excessive_collision' not found in the schema
│ 
│   with routeros_interface_ethernet.desktop-iface,
│   on interfaces.tf line 1, in resource "routeros_interface_ethernet" "desktop-iface":
│    1: resource "routeros_interface_ethernet" "desktop-iface" {
│ 
│ [MikrotikResourceDataToTerraform] The field was lost during the Schema development: ▷ 'tx_excessive_collision': '0' ◁
╵
╷
│ Warning: Field 'tx_single_collision' not found in the schema
│ 
│   with routeros_interface_ethernet.desktop-iface,
│   on interfaces.tf line 1, in resource "routeros_interface_ethernet" "desktop-iface":
│    1: resource "routeros_interface_ethernet" "desktop-iface" {
│ 
│ [MikrotikResourceDataToTerraform] The field was lost during the Schema development: ▷ 'tx_single_collision': '0' ◁
╵
╷
│ Warning: Field 'tx_fcs_error' not found in the schema
│ 
│   with routeros_interface_ethernet.desktop-iface,
│   on interfaces.tf line 1, in resource "routeros_interface_ethernet" "desktop-iface":
│    1: resource "routeros_interface_ethernet" "desktop-iface" {
│ 
│ [MikrotikResourceDataToTerraform] The field was lost during the Schema development: ▷ 'tx_fcs_error': '0' ◁
╵
╷
│ Warning: Field 'tx_multiple_collision' not found in the schema
│ 
│   with routeros_interface_ethernet.desktop-iface,
│   on interfaces.tf line 1, in resource "routeros_interface_ethernet" "desktop-iface":
│    1: resource "routeros_interface_ethernet" "desktop-iface" {
│ 
│ [MikrotikResourceDataToTerraform] The field was lost during the Schema development: ▷ 'tx_multiple_collision': '0' ◁
╵

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

Additional context

When using ROS v7.12 (stable), this part outright fails with an error saying that full_duplex is an unknown argument. I had to downgrade my ROS version.

vaerh commented 10 months ago

Hi, this issue is due to the fact that the resource was created for ROS v7.10. If you can stay on version 7.10 for the time being, please do so. I hope to be able to migrate to 7.11 and 7.12 soon, but this requires a lot of work across the provider.

mircea-pavel-anton commented 10 months ago

@vaerh Thank you for the response and thank you for this provider! I'll stay on 7.10 for now, no problem. Just wanted to report the issue. It's not blocking/affecting me in any way thus far other than the warning messages.

vaerh commented 10 months ago

:tada: This issue has been resolved in version 1.25.0 :tada:

The release is available on GitHub release

Your semantic-release bot :package::rocket: