Sunbeam cluster bootstrap fails with terraform invalid provider registry host

Bug #2024312 reported by Lev Zharikov
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Snap
Fix Released
Medium
Liam Young

Bug Description

Description: When running the "sunbeam cluster bootstrap" command to deploy an OpenStack cloud using Sunbeam according to the tutorial presented on microstack.run webiste, the command fails with the following errors:
Sunbeam Cluster not initialized
terraform init failed:
Initializing the backend...

Successfully configured the backend "http"! Terraform will automatically
use this backend unless the backend configuration changes.

Initializing provider plugins...
- Finding juju/juju versions matching ">= 0.7.0"...

Error: Invalid provider registry host

The host "registry.terraform.io" given in in provider source address
"registry.terraform.io/juju/juju" does not offer a Terraform provider
registry.

Error: Command '['/snap/openstack/182/bin/terraform', 'init', '-upgrade', '-no-color']' returned non-zero exit status 1.

Steps to reproduce:

Install the openstack snap with "sudo snap install openstack --channel 2023.1"
Run the "sunbeam prepare-node-script | bash -x && newgrp snap_daemon"
Run the "sunbeam cluster bootstrap" command

Possible error reasons:

Terraform is not available in my region (tried using the mirror by creating the .terraformrc file in a user's home directory and in /snap/openstack/182/bin/terraform directory with provider_installation, but it did not resolve the problem)

OS information:
Ubuntu 22.04.2 LTS

summary: - sunbeam cluster bootstrap crashes because of terraform
+ Sunbeam cluster bootstrap fails with terraform invalid provider registry
+ host
Revision history for this message
James Page (james-page) wrote :

Hi Lev

Lack of access to registry.terraform.io would likely cause challenges; we do ship all of the providers required as part of the snap but I think terraform will still check as part of the init step.

You may be able to workaround this is you put your .terraformrc file into $HOME/snap/openstack/current rather than in the actual HOME directory - the sandboxing within the snap means that HOME gets set to this location.

As we ship everything needed we should probably configure this all as part of the snap so no access to the registry is required.

tags: added: isolated
tags: added: terraform
Revision history for this message
Lev Zharikov (leozaur1808) wrote :

Thank you, this worked.

Liam Young (gnuoy)
Changed in snap-openstack:
status: New → Confirmed
importance: Undecided → Medium
assignee: nobody → Liam Young (gnuoy)
Revision history for this message
Liam Young (gnuoy) wrote :
Changed in snap-openstack:
status: Confirmed → Fix Committed
James Page (james-page)
Changed in snap-openstack:
status: Fix Committed → Fix Released
James Page (james-page)
Changed in snap-openstack:
milestone: none → 2023.1.2
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.