Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Error when querying users: cannot unmarshal string into Go struct field .users of type bool #3369

Closed
@winiciusallan

Description

@winiciusallan

When fetching for an user using terraform openstack provider the following error appears

Error: Unable to query openstack_identity_user_v3: json: cannot unmarshal string into Go struct field .users of type bool

The returned JSON from the API is the following one

2025-05-08T13:38:05.863-0300 [INFO]  provider.terraform-provider-openstack: 2025/05/08 13:38:05 [DEBUG] OpenStack Response Body: {
  "links": {
    "next": null,
    "previous": null,
    "self": "http://my.ip.com:5000/v3/users?domain_id=45c8d81c02294128a56cd8cf18cc567d\u0026name=winicius.silva"
  },
  "users": [
    {
      "description": "foo bar",
      "domain_id": "45c8d81c02294128a56cd8cf18cc567d",
      "email": "[email protected]",
      "enabled": "True",
      "id": "9b2f6152672cc408db3ef74844d266425b0559aea8a8547166fbcf4afdddb5b9",
      "links": {
        "self": "http://my.ip.com:5000/v3/users/9b2f6152672cc408db3ef74844d266425b0559aea8a8547166fbcf4afdddb5b9"
      },
      "name": "winicius.silva",
      "options": {},
      "password_expires_at": null
    }
  ]
}: timestamp=2025-05-08T13:38:05.863-0300

Well, I think the API is broken when trying to unmarshall the "enabled" value from string to bool. Searching in issues list, I've found a related issue #3147.

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