This message was deleted.
# infisical-feedback
s
This message was deleted.
āœ… 1
v
Hi @Kamil! I think @Daniel Hougaard is looking into making this experience more seamless in the latest CLI version.
d
Yes! We're looking to make our providers such as the CLI, more user friendly for users using the EU region. For how you can do
infisical login
and select the self-hosted option, and enter
<https://eu.infisical.com>
as the domain.
šŸ‘ 1
m
Is there a way to use cli infisical login and set the host to eu.infisical.com? This is causing us a major issue.
v
@Max Ricketts Yes, indeed. You can
export INFISICAL_API_URL="<https://your-self-hosted-infisical.com/api>"
and point to the EU cluster.
d
We're rolling out a new update shortly that will allow you to directly select the EU region when you use
infisical login
!
šŸ‘ 1
m
When you say shortly. is that hours/days/weeks. Excited to get this.
And thanks for the quick reply, really appreciate it.
Do you have a time scale on this. Should I carry on work with the US instance while this comes out. Or is the update coming out very soon. Cheers
d
Hi @Max Ricketts, I've just rolled out a new update that should resolve this! Please update to version
v0.31.2
and type
infisical login
. Let me know if this works for you!
m
Excellent new!! I will test this this morning.
I can't see that the documentation has been updated on here. https://infisical.com/docs/cli/commands/login#method
I have tried the following
d
All you need to do is
infisical login
and then select the Infisical Cloud (EU) option. Can you please show me what you're seeing?
m
I am using this in a pipeline with this command export INFISICAL_TOKEN=$(infisical login --method=universal-auth --client-id=xxx --client-secret=xxx --silent --plain)
So I need to set the domain in the command. I have also tried setting the env variable INFISICAL_API_URL and that did not work
i have tried also putting the --domain=https://eu.infisical.com/api in the above export command. still shows an error output error: unable to authenticate with universal auth [err=APIError: CallUniversalAuthLogin unsuccessful response [POST https://app.infisical.com/api/v1/auth/universal-auth/login] [status-code=404]] If this issue continues, get support at https://infisical.com/slack
d
Gotcha! For the universal-auth method you'd need to aither pass the
--domain
flag or set the
INFISICAL_API_URL
environment variable. I've just tried using the --domain flag, which works on my end. Can you please verify that this exact command doesn't point to the EU Infisical instance when you try to use it?
Copy code
infisical login --method universal-auth --client-id test --client-secret test --domain=<https://eu.infisical.com/api>
m
Testing now
d
Actually, I just tried this out on my end after updating my local CLI version. There seems to have been a change, I'm taking a look at this now!
šŸ‘ 1
m
Not getting the same output as you
Tried clearing the domains with --clear-domains to see if that was preventing it. but still same result.
d
Found the issue. Seems like it's happening because you're currently logged in with user-auth, and then it attempts to use the user-auth URL. A temporary fix should be to do
infisical reset
, which will remove your local login state
@Max Ricketts
m
I'll give it a go
Locally that has worked. I shall run my pipelines and see if that works. each runner is ephemeral, so the reset should not be needed.
Pipelines isn't working. I have logged into the docker and verified the version and it is 0.31.2. This is an alpine image and was working very well with the US instance of app.infisical.com While I am in the container I can run export INFISICAL_TOKEN=$(infisical login --method=universal-auth --client-id=xxx --client-secret=xxx --domain=https://eu.infisical.com/api --silent --plain) This give me a token and I can see it with echo $INFISICAL_TOKEN when I run the set command in the docker infisical secrets set --silent --path="/Cloudflare" API-KEYV5=xxx--projectId=xxx--env="prod" I get this error error: unable to retrieve secrets [err=CallGetRawSecretsV3: Unsuccessful response [GET https://app.infisical.com/api/v3/secrets/raw?environment=prod&amp;secretPath=%2FCloudflare&amp;workspaceId=4051db50-8b6f-4994-b3cf-4ae301a7109c] [status-code=403] [response={"statusCode":403,"message":"invalid signature","error":"TokenError"}]] i have copied and pasted the exact same command in my local command which works, but in the docker this does not. it seems to reset to app.infisicla
d
@Max Ricketts can you please try to set the
--domain
flag?
m
in the set secret? or the login. on the login I have set the domain
d
Both please
I believe your pipeline is not keeping state, so you most likely need to set the
--domain
flag on all the infisical CLI commands
m
This has worked.
bit dodgy that is displays the secret in the logs though.
Thank you for your help today Daniel. Been most helpful
You are going to love me by the end of the day šŸ™‚ - I have plummed in now the settings for terraform. and it is failing.
d
Glad we got the first issue resolved! Can you share some more details about what in Terraform is failing?
m
I can. two ticks
here is my terraform file terraform { backend "http" { } required_version = "~>1.7" required_providers { cloudflare = { source = "cloudflare/cloudflare" version = "~>4.0" } infisical = { version = "~>0.10" source = "infisical/infisical" } random = { source = "hashicorp/random" version = "~>3.6" } local = { source = "hashicorp/local" version = "~>2.5" } } } provider "cloudflare" { } provider "local" { } provider "infisical" { auth = { universal = { client_id = var.infisical_client_id client_secret = var.infisical_secret_id host = "https://eu.infisical.com/api" } } } resource "random_password" "tunnel_secret" { length = 64 } resource "cloudflare_zero_trust_tunnel_cloudflared" "office_tunnel" { account_id = var.cf_account_id name = "Tunnel" secret = base64sha256(random_password.tunnel_secret.result) } resource "cloudflare_zero_trust_tunnel_route" "int_corp_devices" { for_each = var.network_routes account_id = var.cf_account_id tunnel_id = cloudflare_zero_trust_tunnel_cloudflared.office_tunnel.id network = each.value.ip_address comment = each.value.comment } # ##### add secret to infisical Cloudflare project. resource "infisical_secret" "cf_token" { name = "Cloudflare Tunnel Token" value = cloudflare_zero_trust_tunnel_cloudflared.office_tunnel.tunnel_token env_slug = "prod" workspace_id = var.infisical_project_id folder_path = "/Cloudflare" }
This is the error. Planning failed. OpenTofu encountered an error while generating this plan. │ Error: Unable to Create Infisical API Client │ with provider["registry.opentofu.org/infisical/infisical"], │ on main.tf line 31, in provider "infisical": │ 31: provider "infisical" { │ │ An unexpected error occurred when creating the Infisical API client. If the │ error is not clear, please get in touch at infisical.com/slack. │ Infisical Client Error: unable to authenticate with machine identity │ [err=UniversalMachineIdentityAuth: Unsuccessful response: │ [response={"statusCode":404,"message":"No identity with specified client ID │ was found","error":"NotFound"}]]
I have double checked the ID, Secret and project ID
d
Let me run through our logs, one second
m
i have also tried it wuth out the /api at the end on the host. as the docs state default is app.infisical.com without /api
d
Yeah the /api part is not necessary, we'll automatically suffix it if it's missing
šŸ‘ 1
@Max Ricketts Can you please try again and let me know once you've tried?
m
i have tried again
d
Yeah seems like it's trying to target our US instance
Let me take a look into this
šŸ‘ 1
Ah! I found the issue. Your code:
Copy code
provider "infisical" {
  auth = {
    universal = {
      client_id     = var.infisical_client_id
      client_secret = var.infisical_secret_id
      host          = "<https://eu.infisical.com/api>"
    }
  }
}
Replace it with:
Copy code
provider "infisical" {
  host          = "<https://eu.infisical.com/api>"
  auth = {
    universal = {
      client_id     = var.infisical_client_id
      client_secret = var.infisical_secret_id
    }
  }
}
The
host
variable lives outside the auth object
m
let me try that
Boom
amazing.
that has worked
Really appreciate your time and effort on this. I know I am on the free version at the moment, and the support has been fantastic. Won't be long till we are on pro
ā¤ļø 1
Just go to test the ansible runs now
d
Awesome really glad to hear that and thank you so much! Let me know if anything else comes up
šŸ‘ 1
m
Sorry i jumped the gun.
This didn't work
😢 1
bigger error thoguh.
Planning failed. OpenTofu encountered an error while generating this plan. 78 ā•· 79 │ Error: Unable to Create Infisical API Client 80 │ 81 │ with provider["registry.opentofu.org/infisical/infisical"], 82 │ on main.tf line 31, in provider "infisical": 83 │ 31: provider "infisical" { 84 │ 85 │ An unexpected error occurred when creating the Infisical API client. If the 86 │ error is not clear, please get in touch at infisical.com/slack. 87 │ 88 │ Infisical Client Error: unable to authenticate with machine identity 89 │ [err=UniversalMachineIdentityAuth: Unsuccessful response: 90 │ [response=<!DOCTYPE html><html lang="en"><head><meta charSet="utf-8"/><meta 91 │ name="viewport" content="width=device-width"/><meta name="next-head-count" 92 │ content="2"/><link rel="preload" 93 │ href="/_next/static/css/20c75f09c03b97f3.css" as="style"/><link 94 │ rel="stylesheet" href="/_next/static/css/20c75f09c03b97f3.css" 95 │ data-n-g=""/><noscript data-n-css=""></noscript><script defer="" 96 │ nomodule="" 97 │ src="/_next/static/chunks/polyfills-c67a75d1b6f99dc8.js"></script><script 98 │ src="/_next/static/chunks/webpack-3786541e2b738350.js" 99 │ defer=""></script><script 100 │ src="/_next/static/chunks/framework-e980b8a6a6be3cf8.js" 101 │ defer=""></script><script 102 │ src="/_next/static/chunks/main-740c0074a2665a3b.js" 103 │ defer=""></script><script 104 │ src="/_next/static/chunks/pages/_app-9c923bb22cfc8039.js" 105 │ defer=""></script><script 106 │ src="/_next/static/chunks/pages/404-240de0e6a5dfc839.js" 107 │ defer=""></script><script 108 │ src="/_next/static/unPNpZy6tvLJ5-vhwegqU/_buildManifest.js" 109 │ defer=""></script><script 110 │ src="/_next/static/unPNpZy6tvLJ5-vhwegqU/_ssgManifest.js" 111 │ defer=""></script></head><body><div id="__next" data-reactroot=""><div 112 │ class="Toastify"></div><div class="bg-bunker-800"><div class="container 113 │ relative mx-auto flex h-screen w-full flex-col items-center justify-center 114 │ space-y-8 px-8 text-mineshaft-50 dark[color schemedark]"><img 115 │ src="/images/loading/loading.gif" height="70" width="120" alt="loading 116 │ animation" decoding="async" loading="lazy"/><div class="text-xs 117 │ text-primary">Loading configurations</div></div></div></div><script 118 │ id="__NEXT_DATA__" 119 │ type="application/json">{"props":{"pageProps":{}},"page":"/404","query":{},"buildId":"unPNpZy6tvLJ5-vhwegqU","nextExport":true,"autoExport":true,"isFallback":false,"locale":"en","locales":["en","ko","fr","pt-BR","pt-PT","es"],"defaultLocale":"en","scriptLoader":[]}</script></body></html>]]
want me to try with out the /api on the end?
šŸ™ 1
d
Could you please remove
/api
from the host?
m
running now
Planning failed. OpenTofu encountered an error while generating this plan. │ Error: Error Reading Infisical secret │ with infisical_secret.cf_token, │ on main.tf line 61, in resource "infisical_secret" "cf_token": │ 61: resource "infisical_secret" "cf_token" { │ Could not read Infisical secret named Cloudflare Tunnel Token: │ CallGetSingleRawSecretByNameV3: Unsuccessful response. Please make sure │ your secret path, workspace and environment name are all correct │ [response={"statusCode":404,"message":"Project not found during bot lookup. │ Are you sure you are using the correct project ID?","error":"NotFound"}]
i'll double check the project id
project id is indeed correct
and checked id and secret again. i can pm you my id secret and project if you want to test
i can delete secret later and create a new one
Got to go to lunch, so please let me know what else I can try and I will when i get back.
d
I think it might be faster if we hop on a quick call, do you have a spare 5 minutes once you get back?
m
i can do that now
whats the best way to contact each other?
d
A Huddle would work! I will need 10 minutes to finish up my current work if that's fine with you!
m
lets do that when i get back. I'll be about 30-40 mins
I'll be ready in about 10-15 mins if you are still available @Daniel Hougaard