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

[Bug]: Servers created with public_net disabled are delayed by 4 minutes at startup because "Failed to wait for network: Unexpected error while running command." #1074

Open
johnpccd opened this issue Jan 10, 2025 · 1 comment
Labels

Comments

@johnpccd
Copy link

What happened?

Trying to create an instance in an air-gapped environment (no public ip) using the code below:

The startup time of this instance is 4 minutes longer than if i enable ipv4_enabled.

Here is the output of /var/log/cloud-init-output.log

root@redis:~# cat  /var/log/cloud-init-output.log
Cloud-init v. 24.4-0ubuntu1~22.04.1 running 'init-local' at Fri, 10 Jan 2025 19:54:07 +0000. Up 9.56 seconds.
2025-01-10 19:54:07,926 - url_helper.py[WARNING]: Exception(s) [UrlError("HTTPConnectionPool(host='169.254.169.254', port=80): Max retries exceeded with url: /hetzner/v1/metadata/instance-id (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7f9f68fdbf70>: Failed to establish a new connection: [Errno 101] Network is unreachable'))")] during request to http://169.254.169.254/hetzner/v1/metadata/instance-id, raising last exception
2025-01-10 19:54:07,927 - url_helper.py[ERROR]: Timed out, no response from urls: ['http://169.254.169.254/hetzner/v1/metadata/instance-id']
Cloud-init v. 24.4-0ubuntu1~22.04.1 running 'init' at Fri, 10 Jan 2025 19:56:09 +0000. Up 131.52 seconds.
2025-01-10 19:58:09,953 - ubuntu.py[ERROR]: Failed to wait for network: Unexpected error while running command.
Command: ['systemctl', 'start', 'systemd-networkd-wait-online.service']
Exit code: 1
Reason: -
Stdout:
Stderr: Job for systemd-networkd-wait-online.service failed because the control process exited with error code.
        See "systemctl status systemd-networkd-wait-online.service" and "journalctl -xeu systemd-networkd-wait-online.service" for details.

What did you expect to happen?

I expect a flag or someway to prevent waiting for network if there's no ip address

Please provide a minimal working example

resource "hcloud_server" "redis" {
  name        = "redis"
  server_type = var.server_type
  image       = var.image
  location    = var.location
  ssh_keys    = [var.ssh_key_id]

  network {
    network_id = var.network_id
    ip         = var.redis_ip
	alias_ips = []
  }

  public_net {
    ipv4_enabled = false
    ipv6_enabled = false
  }

}
@johnpccd johnpccd added the bug label Jan 10, 2025
@jooola
Copy link
Member

jooola commented Jan 13, 2025

We are experiencing some issues with the metadata server, so the problem is upstream and not in the terraform provider.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants