terraform-provider-onepassword icon indicating copy to clipboard operation
terraform-provider-onepassword copied to clipboard

onepassword_vault data source error

Open NasAmin opened this issue 4 years ago • 3 comments

Your environment

Mac

Terraform Provider Version: 1.1.3

Connect Server Version:

OS: Mac

Terraform Version: 1.0.5

What happened?

Getting an error using the onepassword_vault data source.

What did you expect to happen?

The data source should have been retrieved and I should be able to retrieve the vault's uuid

Steps to reproduce

terraform {
  required_providers {
    onepassword = {
      source  = "1Password/onepassword"
      version = "~> 1.1.3"
    }
  }
}

data "onepassword_vault" "vault" {
  name = "my vault"  
}

terraform init && terraform apply

Notes & Logs

Error:

 Error: decoding response: invalid character '<' looking for beginning of value  with data.onepassword_vault.vault,
  on main.tf line 11, in data "onepassword_vault" "vault":   11: data "onepassword_vault" "vault" {

I have also set OP_CONNECT_TOKEN.

I'll really appreciate some guidance 🙇

NasAmin avatar Dec 20 '21 18:12 NasAmin

I'm no expert in this space, but I'm also working on setting up a connect server and recently ran into this error. I don't have a proper answer for you, but in my case using cURL to try and hit the API gave me a more-useful error. In my case, I was getting an HTML response (it started with <html> which was the source of my invalid character '<') returned from my load balancer. I imagine you might have better luck troubleshooting with cURL than with Terraform.

curl -H "Authorization: Bearer ${ONEPASS_TOKEN}" -H "Content-type: application/json"  "${ONEPASS_URL}/v1/vaults"

tlake avatar Feb 22 '22 18:02 tlake

Having the same issue, do you have any updates?

abagayev avatar Jul 11 '22 09:07 abagayev

Getting the same thing happening on terraform 1.1.6, with version 1.1.4 of the provider. I get the same thing when I define a data source for onepassword items.

This looks like this could be an issue with unmarshalling data from the API--which is a pretty serious bug that hasn't been addressed for months at this point. As well, the documentation is sparse.

Is this project just dead? It feels like a waste of time even trying to use it.

paprockiw avatar Sep 13 '22 21:09 paprockiw