kube-hetzner / terraform-hcloud-kube-hetzner

Optimized and Maintenance-free Kubernetes on Hetzner Cloud in one command!
MIT License
2.39k stars 368 forks source link

Rancher K3s Common (stable) not installing #330

Closed grouvie closed 2 years ago

grouvie commented 2 years ago

When running the script with the default configuration I get the following error:

module.kube-hetzner.module.control_planes["0-0-control-plane-fsn1"].hcloud_server.server (local-exec): Waiting for MicroOS to reboot and become available...
module.kube-hetzner.module.agents["0-0-agent-plane-fsn1"].hcloud_server.server (remote-exec): Permission to access 'https://rpm.rancher.io/k3s/stable/common/microos/noarch/repodata/repomd.xml' denied.
module.kube-hetzner.module.agents["0-0-agent-plane-fsn1"].hcloud_server.server (remote-exec): Error building the cache:
module.kube-hetzner.module.agents["0-0-agent-plane-fsn1"].hcloud_server.server (remote-exec): [rancher-k3s-common-stable|https://rpm.rancher.io/k3s/stable/common/microos/noarch] Valid metadata not found at specified URL
module.kube-hetzner.module.agents["0-0-agent-plane-fsn1"].hcloud_server.server (remote-exec): History:
module.kube-hetzner.module.agents["0-0-agent-plane-fsn1"].hcloud_server.server (remote-exec):  - Unknown error reading from 'https://rpm.rancher.io/k3s/stable/common/microos/noarch'
module.kube-hetzner.module.agents["0-0-agent-plane-fsn1"].hcloud_server.server (remote-exec):  - ABORT request: Aborting requested by user
module.kube-hetzner.module.agents["0-0-agent-plane-fsn1"].hcloud_server.server (remote-exec):  - Permission to access 'https://rpm.rancher.io/k3s/stable/common/microos/noarch/repodata/repomd.xml' denied.

module.kube-hetzner.module.agents["3-0-storage"].hcloud_server.server: Provisioning with 'remote-exec'...
module.kube-hetzner.module.agents["3-0-storage"].hcloud_server.server (remote-exec): Connecting to remote host via SSH...
module.kube-hetzner.module.agents["3-0-storage"].hcloud_server.server (remote-exec):   Host: 88.99.35.9
module.kube-hetzner.module.agents["3-0-storage"].hcloud_server.server (remote-exec):   User: root
module.kube-hetzner.module.agents["3-0-storage"].hcloud_server.server (remote-exec):   Password: false
module.kube-hetzner.module.agents["3-0-storage"].hcloud_server.server (remote-exec):   Private key: true
module.kube-hetzner.module.agents["3-0-storage"].hcloud_server.server (remote-exec):   Certificate: false
module.kube-hetzner.module.agents["3-0-storage"].hcloud_server.server (remote-exec):   SSH Agent: false
module.kube-hetzner.module.agents["3-0-storage"].hcloud_server.server (remote-exec):   Checking Host Key: false
module.kube-hetzner.module.agents["3-0-storage"].hcloud_server.server (remote-exec):   Target Platform: unix
module.kube-hetzner.module.agents["3-0-storage"].hcloud_server.server (remote-exec): Connected!
module.kube-hetzner.module.agents["3-0-storage"].hcloud_server.server (remote-exec): + transactional-update shell
module.kube-hetzner.module.agents["3-0-storage"].hcloud_server.server (remote-exec): Checking for newer version.
module.kube-hetzner.module.control_planes["1-0-control-plane-nbg1"].hcloud_server.server (remote-exec): + aria2c --follow-metalink=mem https://download.opensuse.org/tumbleweed/appliances/openSUSE-MicroOS.x86_64-OpenStack-Cloud.qcow2.meta4

module.kube-hetzner.module.control_planes["1-0-control-plane-nbg1"].hcloud_server.server (remote-exec): 09/28 16:29:31 [NOTICE] Downloading 1 item(s)
module.kube-hetzner.module.control_planes["1-0-control-plane-nbg1"].hcloud_server.server (remote-exec): [#ac37f5 0B/0B CN:1 DL:0B]
module.kube-hetzner.module.control_planes["1-0-control-plane-nbg1"].hcloud_server.server (remote-exec): 09/28 16:29:32 [NOTICE] Download complete: [MEMORY]openSUSE-MicroOS.x86_64-16.0.0-OpenStack-Cloud-Snapshot20220926.qcow2.meta4
module.kube-hetzner.module.agents["3-0-storage"].hcloud_server.server: Still creating... [1m50s elapsed]
module.kube-hetzner.module.agents["1-0-agent-plane-nbg1"].hcloud_server.server: Still creating... [1m50s elapsed]
module.kube-hetzner.module.agents["2-0-agent-plane-hel1"].hcloud_server.server: Still creating... [1m50s elapsed]
module.kube-hetzner.module.agents["0-0-agent-plane-fsn1"].hcloud_server.server: Still creating... [1m50s elapsed]
module.kube-hetzner.module.control_planes["1-0-control-plane-nbg1"].hcloud_server.server: Still creating... [1m50s elapsed]
module.kube-hetzner.module.control_planes["2-0-control-plane-hel1"].hcloud_server.server: Still creating... [1m50s elapsed]
module.kube-hetzner.module.control_planes["0-0-control-plane-fsn1"].hcloud_server.server: Still creating... [1m50s elapsed]
module.kube-hetzner.module.agents["2-0-agent-plane-hel1"].hcloud_server.server (local-exec): Waiting for MicroOS to reboot and become available...
module.kube-hetzner.module.control_planes["1-0-control-plane-nbg1"].hcloud_server.server (remote-exec): [#1c3bd9 0B/410MiB(0%) CN:1 DL:0B]
module.kube-hetzner.module.control_planes["2-0-control-plane-hel1"].hcloud_server.server (local-exec): Waiting for MicroOS to reboot and become available...
module.kube-hetzner.module.control_planes["0-0-control-plane-fsn1"].hcloud_server.server (local-exec): Waiting for MicroOS to reboot and become available...
module.kube-hetzner.module.control_planes["1-0-control-plane-nbg1"].hcloud_server.server (remote-exec): [#1c3bd9 57MiB/410MiB(14%) CN:1 DL:59Mi
module.kube-hetzner.module.agents["0-0-agent-plane-fsn1"].hcloud_server.server (remote-exec): Some of the repositories have not been refreshed because of an error.
module.kube-hetzner.module.control_planes["1-0-control-plane-nbg1"].hcloud_server.server (remote-exec): [#1c3bd9 121MiB/410MiB(29%) CN:1 DL:61M
module.kube-hetzner.module.agents["0-0-agent-plane-fsn1"].hcloud_server.server (remote-exec): transactional-update 4.0.1 started
module.kube-hetzner.module.agents["0-0-agent-plane-fsn1"].hcloud_server.server (remote-exec): Options: shell
module.kube-hetzner.module.agents["0-0-agent-plane-fsn1"].hcloud_server.server (remote-exec): Separate /var detected.
module.kube-hetzner.module.agents["0-0-agent-plane-fsn1"].hcloud_server.server (remote-exec): 2022-09-28 14:29:36 tukit 4.0.1 started
module.kube-hetzner.module.agents["0-0-agent-plane-fsn1"].hcloud_server.server (remote-exec): 2022-09-28 14:29:36 Options: -c1 open
module.kube-hetzner.module.agents["0-0-agent-plane-fsn1"].hcloud_server.server (remote-exec): 2022-09-28 14:29:36 Using snapshot 1 as base for new snapshot 2.
module.kube-hetzner.module.agents["0-0-agent-plane-fsn1"].hcloud_server.server (remote-exec): 2022-09-28 14:29:36 No previous snapshot to sync with - skipping
module.kube-hetzner.module.agents["0-0-agent-plane-fsn1"].hcloud_server.server (remote-exec): ID: 2
module.kube-hetzner.module.agents["0-0-agent-plane-fsn1"].hcloud_server.server (remote-exec): 2022-09-28 14:29:36 Transaction completed.
module.kube-hetzner.module.agents["0-0-agent-plane-fsn1"].hcloud_server.server (remote-exec): Opening chroot in snapshot 2, continue with 'exit'
module.kube-hetzner.module.agents["0-0-agent-plane-fsn1"].hcloud_server.server (remote-exec): 2022-09-28 14:29:36 tukit 4.0.1 started
module.kube-hetzner.module.agents["0-0-agent-plane-fsn1"].hcloud_server.server (remote-exec): 2022-09-28 14:29:36 Options: call 2 bash
module.kube-hetzner.module.agents["0-0-agent-plane-fsn1"].hcloud_server.server (remote-exec): 2022-09-28 14:29:36 Executing `bash`:
module.kube-hetzner.module.agents["0-0-agent-plane-fsn1"].hcloud_server.server (remote-exec): Permission to access 'https://rpm.rancher.io/k3s/stable/common/microos/noarch/repodata/repomd.xml' denied.

module.kube-hetzner.module.agents["0-0-agent-plane-fsn1"].hcloud_server.server (remote-exec): Abort, retry, ignore? [a/r/i/...? shows all options] (a): a
module.kube-hetzner.module.agents["0-0-agent-plane-fsn1"].hcloud_server.server (remote-exec): Error building the cache:
module.kube-hetzner.module.agents["0-0-agent-plane-fsn1"].hcloud_server.server (remote-exec): [rancher-k3s-common-stable|https://rpm.rancher.io/k3s/stable/common/microos/noarch] Valid metadata not found at specified URL
module.kube-hetzner.module.agents["0-0-agent-plane-fsn1"].hcloud_server.server (remote-exec): History:
module.kube-hetzner.module.agents["0-0-agent-plane-fsn1"].hcloud_server.server (remote-exec):  - Unknown error reading from 'https://rpm.rancher.io/k3s/stable/common/microos/noarch'
module.kube-hetzner.module.agents["0-0-agent-plane-fsn1"].hcloud_server.server (remote-exec):  - ABORT request: Aborting requested by user
module.kube-hetzner.module.agents["0-0-agent-plane-fsn1"].hcloud_server.server (remote-exec):  - Permission to access 'https://rpm.rancher.io/k3s/stable/common/microos/noarch/repodata/repomd.xml' denied.
module.kube-hetzner.module.agents["0-0-agent-plane-fsn1"].hcloud_server.server (remote-exec):
module.kube-hetzner.module.agents["0-0-agent-plane-fsn1"].hcloud_server.server (remote-exec): Warning: Skipping repository 'Rancher K3s Common (stable)' because of the above error.
module.kube-hetzner.module.agents["0-0-agent-plane-fsn1"].hcloud_server.server (remote-exec): Some of the repositories have not been refreshed because of an error.
module.kube-hetzner.module.agents["0-0-agent-plane-fsn1"].hcloud_server.server (remote-exec): Loading repository data...
module.kube-hetzner.module.agents["0-0-agent-plane-fsn1"].hcloud_server.server (remote-exec): Reading installed packages...
module.kube-hetzner.module.control_planes["1-0-control-plane-nbg1"].hcloud_server.server (remote-exec): [#1c3bd9 179MiB/410MiB(43%) CN:1 DL:60M
module.kube-hetzner.module.agents["0-0-agent-plane-fsn1"].hcloud_server.server (remote-exec): Resolving package dependencies...

Any clues what is causing this and how to fix it?

phaer commented 2 years ago

Relevant part:

2022-09-28 14:29:36 Executing `bash`:
Permission to access 'https://rpm.rancher.io/k3s/stable/common/microos/noarch/repodata/repomd.xml' denied.
Abort, retry, ignore? [a/r/i/...? shows all options] (a): a
Error building the cache:

The server could not communicate with k3s mirror to fetch packages for microos. Is this reproducable for you @grouvie? The URL 'https://rpm.rancher.io/k3s/stable/common/microos/noarch/repodata/repomd.xml' works fine from here. If it is: Do you have any extra firewall rules in place? Otherwise it could just be unlucky timing (i.e. some sort of maintenance on the mirrors side)=

grouvie commented 2 years ago

The url also works fine for me in my browser. Curl in wsl works, too. Just when I use the script it does not seem to work.

phaer commented 2 years ago

You've tried it more than once?

grouvie commented 2 years ago

Yes. I tried it multiple times yesterday and today.

mysticaltech commented 2 years ago

@grouvie Trying again in this context means destroying fully, and redoing. That's what you did?

And also start fresh from a new Hetzner project!

Also please do share your kube.tf without the sensitive values if you can.

grouvie commented 2 years ago

Starting from a fresh Hetzner project did the trick. Thanks a lot for the help.

I used the renamed kube.tf.example with adjusted keys and token.