1Password / terraform-provider-onepassword

Use the 1Password Terraform Provider to reference, create, or update items in your 1Password Vaults.
https://1password.com/secrets
MIT License
317 stars 41 forks source link

onepassword_vault data source error #53

Open NasAmin opened 2 years ago

NasAmin commented 2 years ago

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 🙇

tlake commented 2 years ago

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"
abagayev commented 2 years ago

Having the same issue, do you have any updates?

paprockiw commented 1 year ago

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.