SUSE-Enceladus / blue-horizon

web-based user interface to terraforming the public cloud
GNU General Public License v3.0
11 stars 8 forks source link

[v19] Calling plan fully make blue-horizon constantly throwing 500 #188

Closed asmorodskyi closed 3 years ago

asmorodskyi commented 3 years ago
  1. Pass through all necessary actions till Plan step
  2. press "Plan" ==> nothing actually happen ====> after this attempt to navigate to any other page ( Welcome , Variables etc. ) will end up with 500 error opening another instance will show normal reset session dialog but than also fallback to 500

in /srv/www/blue-horizon/log/production.log I see this :

ERROR -- : [] 
Error: Could not load plugin

Plugin reinitialization required. Please run "terraform init".

Plugins are external binaries that Terraform uses to access and manipulate
resources. The configuration provided requires plugins which can't be located,
don't satisfy the version constraints, or are otherwise incompatible.

Terraform automatically discovers provider requirements from your
configuration, including providers used in child modules. To see the
requirements and constraints, run "terraform providers".

Failed to instantiate provider "registry.terraform.io/hashicorp/kubernetes" to
obtain schema: unknown provider "registry.terraform.io/hashicorp/kubernetes"

I, []  INFO -- : []   Rendered layouts/_sidebar.html.haml (4381.5ms)
I, []  INFO -- : [] Completed 500 Internal Server Error in 4384ms (ActiveRecord: 0.3ms)
F, [] FATAL -- : []   
F, [] FATAL -- : [] ActionView::Template::Error (no implicit conversion of nil into String):
F, [] FATAL -- : []     4:     %i.eos-icons.inactive menu
[]     5: %div.list-group.list-group-flush
[]     6:   - sidebar_menu_items.each do |key|
[]     7:     = sidebar_menu_item(key)
F, [] FATAL -- : []   
F, [ FATAL -- : [] app/services/terraform.rb:103:in `basename'
bear454 commented 3 years ago

As suspected, this is due to the terraform config failing to init... in this particular case the VM is explcitly prevented from downloading providers, and one provider had a version mismatch.

D, [2020-12-09T14:01:26.880414 #795] DEBUG -- : Running '/usr/bin/terraform init -backend=false -no-color'.
Initializing modules...

Initializing provider plugins...
- Using previously-installed hashicorp/aws v3.11.0
- Using previously-installed hashicorp/null v3.0.0
- Using previously-installed hashicorp/random v3.0.0
- Using previously-installed hashicorp/helm v1.3.2
- Using previously-installed hashicorp/local v2.0.0
- Finding hashicorp/kubernetes versions matching "1.13.3"...

Warning: Interpolation-only expressions are deprecated

  on cluster/eks/output.tf line 7, in output "aws-node-arn":
   7:   value = "${aws_iam_role.aws-node.arn}"

Terraform 0.11 and earlier required all non-constant expressions to be
provided via interpolation syntax, but this pattern is now deprecated. To
silence this warning, remove the "${ sequence from the start and the }"
sequence from the end of this expression, leaving just the inner expression.

Template interpolation syntax is still used to construct strings from
expressions when the template includes multiple interpolation sequences or a
mixture of literal strings and interpolations. This deprecation applies only
to templates that consist entirely of a single interpolation sequence.

(and 5 more similar warnings elsewhere)

Error: Failed to query available provider packages

Could not retrieve the list of available versions for provider
hashicorp/kubernetes: no available releases match the given constraints 1.13.3

E, [2020-12-09T14:01:28.440239 #795] ERROR -- : Failed while running 'init'.
E, [2020-12-09T14:01:28.440325 #795] ERROR -- : Error calling terraform init.
bear454 commented 3 years ago

While we could provide an error handler for this case, IMO it's pointless: if terraform cannot init, it definitely cannot apply, so there's 0% chance of successfully deploying.