fvumbaca / terraform-proxmox-k3s

A terraform module to get k3s up and running on Proxmox VE real quick.
MIT License
83 stars 44 forks source link

mariadb setup error #10

Open jrodan opened 2 years ago

jrodan commented 2 years ago

Describe the bug Running the example with a ubuntu 18 LTS template in proxmox leads to the following result for the support-node:

module.k3s.proxmox_vm_qemu.k3s-support (remote-exec): E: Unable to locate package mariadb-server
module.k3s.proxmox_vm_qemu.k3s-support (remote-exec): sed: can't read /etc/mysql/mariadb.conf.d/50-server.cnf: No such file or directory
module.k3s.proxmox_vm_qemu.k3s-support (remote-exec): sudo: mariadb: command not found
module.k3s.proxmox_vm_qemu.k3s-support (remote-exec): sudo: mariadb: command not found
module.k3s.proxmox_vm_qemu.k3s-support (remote-exec): sudo: mariadb: command not found
module.k3s.proxmox_vm_qemu.k3s-support (remote-exec): sudo: mariadb: command not found
module.k3s.proxmox_vm_qemu.k3s-support (remote-exec): sudo: mariadb: command not found
module.k3s.proxmox_vm_qemu.k3s-support (remote-exec): sudo: mariadb: command not found
module.k3s.proxmox_vm_qemu.k3s-support (remote-exec): sudo: mariadb: command not found

Running the install command afterwards directly in the shell works as expected.

jrodan commented 2 years ago

my best guess: cloud init runs a apt-get update && apt-get upgrade. Somehow there occurs a timing issue with this script. Changing to the following works:

    sudo apt-get update
    sudo apt-get upgrade -y
    sudo apt install mariadb-server -y

But it only works because it takes more time - time in which the init can be finished? had not further looked into it.

mannp commented 2 years ago

I have found that perhaps due to apt mirror timeouts, that the apt installations don't complete and things continue but ultimately fail, as things have not been installed correctly.

Looks like that might have happened here and mariadb did not actually get installed.

I wondered about a way to add the mirror being used depending on your location, but have not explored it any further.