Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Not able to retrieve the device #327

Closed
jjsaunier opened this issue Jan 30, 2024 · 4 comments
Closed

Not able to retrieve the device #327

jjsaunier opened this issue Jan 30, 2024 · 4 comments
Labels
question Further information is requested

Comments

@jjsaunier
Copy link

I'm currently migrating some infra of dev workspace org using the tailscale terraform version 0.13.13 but I'm facing this issue

╷
│ Error: Could not find device with name dev-workspace-nat
│
│   with data.tailscale_device.dev_workspace_nat,
│   on dev-workspace.tf line 50, in data "tailscale_device" "dev_workspace_nat":
│   50: data "tailscale_device" "dev_workspace_nat" {
│

I'm unable to retrieve the device whereas it's correctly registered.

image

I'm retrieving the device via

data "tailscale_device" "dev_workspace_nat" {
    name = "dev-workspace-nat"
    wait_for = "60s"
}

Am I missing something or doing something wrong? I have followed the logic on the terraform doc https://registry.terraform.io/providers/tailscale/tailscale/latest/docs/resources/device_key

I'm interested to get your feedback, this is ruining my plans 😅

@jjsaunier jjsaunier added the question Further information is requested label Jan 30, 2024
@jjsaunier jjsaunier changed the title Not able to retrieve th device Not able to retrieve the device Jan 30, 2024
@knyar
Copy link
Collaborator

knyar commented Jan 30, 2024

First step would probably be to use the same credentials you're passing to the Tailscale terraform provider to issue an list devices API call manually and check that you see the node there.

@jjsaunier
Copy link
Author

jjsaunier commented Jan 30, 2024

Thanks for your insight

I can retrieve the machine; however the name is not the one I expected.

I got "name": "dev-workspace-nat.tail6efba.ts.net"

If I understand correctly, I should concat my machine name with .tail6efba.ts.net to get back to the actual name?

@knyar
Copy link
Collaborator

knyar commented Feb 1, 2024

Yeah, it seems that the name should be an FQDN, just like the name in the example is.

@knyar knyar closed this as completed Feb 1, 2024
@jjsaunier
Copy link
Author

Yes, got it working thanks

To be honest the example is not super clear, in fact you know only if you know and make sense after you re read it. May be a little description like: name is formatted like <device-name>.<tailscale-domain> make it clearer

Anyway, thanks for your answers!

knyar added a commit that referenced this issue Feb 1, 2024
Add support for looking up devices by short name (hostname) as an
alternative to the full name (name). Expose both fields in the list of
devices.

Updates #327

Signed-off-by: Anton Tolchanov <[email protected]>
knyar added a commit that referenced this issue Feb 1, 2024
Add support for looking up devices by short name (hostname) as an
alternative to the full name (name). Expose both fields in the list of
devices.

Updates #327

Signed-off-by: Anton Tolchanov <[email protected]>
knyar added a commit that referenced this issue Feb 2, 2024
Add support for looking up devices by short name (hostname) as an
alternative to the full name (name). Expose both fields in the list of
devices.

Updates #327

Signed-off-by: Anton Tolchanov <[email protected]>
knyar added a commit that referenced this issue Feb 2, 2024
Add support for looking up devices by short name (hostname) as an
alternative to the full name (name). Expose both fields in the list of
devices.

Updates #327

Signed-off-by: Anton Tolchanov <[email protected]>
knyar added a commit that referenced this issue Feb 2, 2024
Add support for looking up devices by short name (hostname) as an
alternative to the full name (name). Expose both fields in the list of
devices.

Updates #327

Signed-off-by: Anton Tolchanov <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants