Skip to content
This repository has been archived by the owner on Jun 21, 2024. It is now read-only.

API bug: Type mismatch at device->network_ports[...].data.bonded in JSON API for n2.xlarge.x86 machines #173

Closed
iaguis opened this issue Apr 1, 2020 · 3 comments
Labels

Comments

@iaguis
Copy link

iaguis commented Apr 1, 2020

I'm seeing an error creating an n2.xlarge.x86 instance with the terraform Packet provider:

module.worker-pool-1.packet_device.nodes[1]: Creation complete after 11m16s [id=1b683f59-340b-49b4-8f1d-57c4522373d3]

Error: json: cannot unmarshal string into Go struct field PortData.network_ports.data.bonded of type bool

  on ../lokomotive-kubernetes/packet/flatcar-linux/kubernetes/workers/workers.tf line 1, in resource "packet_device" "nodes":

   1: resource "packet_device" "nodes" {

Querying the API I see that one of the device->network_ports[...].data.bonded fields is a string instead of a bool:

"network_ports": [
    {
      "id": "205e1809-ebdc-4e07-bbf2-456d93a78129",
      "type": "NetworkBondPort",
      "name": "bond0",
      "data": {
        "bonded": true # good
      },
      "network_type": "layer3",
      "native_virtual_network": null,
      "hardware": {
        "href": "/hardware/f12e9fa1-a72b-4d61-8a07-8ae63f5cf3b4"
      },
      "virtual_networks": [],
      "connected_port": null,
      "href": "/ports/205e1809-ebdc-4e07-bbf2-456d93a78129"
    },
    {
      "id": "1402621b-cb04-45b0-b512-84d1d76b9bb6",
      "type": "NetworkBondPort",
      "name": "bond1",
      "data": {
        "bonded": "true" # bad
      },
      "network_type": "layer3",
      "native_virtual_network": null,
      "hardware": {
        "href": "/hardware/f12e9fa1-a72b-4d61-8a07-8ae63f5cf3b4"
      },
      "virtual_networks": [],
      "connected_port": null,
      "href": "/ports/1402621b-cb04-45b0-b512-84d1d76b9bb6"
    }

A similar issue on m2.large.x86 was reported before: #140

@vielmetti
Copy link

Also noted at coreos/afterburn#381 where afterburn also has potential limitations right now on quad-NIC systems.

@t0mk
Copy link
Contributor

t0mk commented Apr 2, 2020

@vielmetti @iaguis Thanks for reporting. This is API bug, and one that's been reported before as #140 (as you've pointed out).
This can be worked around in packngo, but it would be more clean to fix it in the API.

@vielmetti
Copy link

The API bug was traced to data entered incorrectly at system enrollment time, and has been corrected in the database. packngo should be reporting correct answers for these systems now.

@vielmetti vielmetti changed the title Type mismatch at device->network_ports[...].data.bonded in JSON API for n2.xlarge.x86 machines API bug: Type mismatch at device->network_ports[...].data.bonded in JSON API for n2.xlarge.x86 machines Apr 3, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

3 participants