Skip to content

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

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

No inventory was parsed, only implicit localhost is available #50

Closed
b4nganto opened this issue Mar 3, 2022 · 2 comments
Closed

No inventory was parsed, only implicit localhost is available #50

b4nganto opened this issue Mar 3, 2022 · 2 comments
Assignees
Labels
help wanted Extra attention is needed

Comments

@b4nganto
Copy link

b4nganto commented Mar 3, 2022

When try to deploy stack with terraform 1.1.6, an error appear "No inventory was parsed, only implicit localhost is available", and then the deploy failed.

Terraform Version
1.1.6

SLD Version
2.1.1

Crash Output
No inventory was parsed, only implicit localhost is available

Debug Output

[2022-03-03 11:23:52,446: INFO/ForkPoolWorker-1] create config a-hismanto in /home/sld/.aws/config done
[2022-03-03 11:23:52,447: INFO/ForkPoolWorker-1] create credentials a-hismanto in /home/sld/.aws/credentials done
[2022-03-03 11:23:52,858: WARNING/ForkPoolWorker-1] [WARNING]: No inventory was parsed, only implicit localhost is available
[2022-03-03 11:24:07,533: WARNING/ForkPoolWorker-1] [WARNING]: Failed to list Terraform workspaces: workspaces not supported
[2022-03-03 11:24:07,534: WARNING/ForkPoolWorker-1] localhost | FAILED! => {
"changed": false,
"cmd": "/tmp/1.1.6/terraform destroy -no-color -auto-approve -lock=true -var-file aws_vpc.tfvars.json",
"msg": "\nError: error configuring Terraform AWS Provider: no valid credential sources for Terraform AWS Provider found.\n\nPlease see https://registry.terraform.io/providers/hashicorp/aws\nfor more information about providing credentials.\n\nError: NoCredentialProviders: no valid providers in chain\ncaused by: EnvAccessKeyNotFound: failed to find credentials in the environment.\nSharedCredsLoad: failed to load profile, .\nEC2RoleRequestError: no EC2 instance role found\ncaused by: EC2MetadataError: failed to make EC2Metadata request\n404 Not Found\n\nThe resource could not be found.\n\n \n\tstatus code: 404, request id: \n\n\n with provider["registry.terraform.io/hashicorp/aws"],\n on provider.tf line 1, in provider "aws":\n 1: provider "aws" {",
"rc": 1,
"stderr": "\nError: error configuring Terraform AWS Provider: no valid credential sources for Terraform AWS Provider found.\n\nPlease see https://registry.terraform.io/providers/hashicorp/aws\nfor more information about providing credentials.\n\nError: NoCredentialProviders: no valid providers in chain\ncaused by: EnvAccessKeyNotFound: failed to find credentials in the environment.\nSharedCredsLoad: failed to load profile, .\nEC2RoleRequestError: no EC2 instance role found\ncaused by: EC2MetadataError: failed to make EC2Metadata request\n404 Not Found\n\nThe resource could not be found.\n\n \n\tstatus code: 404, request id: \n\n\n with provider["registry.terraform.io/hashicorp/aws"],\n on provider.tf line 1, in provider "aws":\n 1: provider "aws" {\n\n",
"stderr_lines": [
"",
"Error: error configuring Terraform AWS Provider: no valid credential sources for Terraform AWS Provider found.",
"",
"Please see https://registry.terraform.io/providers/hashicorp/aws",
"for more information about providing credentials.",
"",
"Error: NoCredentialProviders: no valid providers in chain",
"caused by: EnvAccessKeyNotFound: failed to find credentials in the environment.",
"SharedCredsLoad: failed to load profile, .",
"EC2RoleRequestError: no EC2 instance role found",
"caused by: EC2MetadataError: failed to make EC2Metadata request",
"404 Not Found",
"",
"The resource could not be found.",
"",
" ",
"\tstatus code: 404, request id: ",
"",
"",
" with provider["registry.terraform.io/hashicorp/aws"],",
" on provider.tf line 1, in provider "aws":",
" 1: provider "aws" {",
""
],
"stdout": "",
"stdout_lines": []
}

@D10S0VSkY-OSS D10S0VSkY-OSS self-assigned this Mar 4, 2022
@D10S0VSkY-OSS
Copy link
Owner

D10S0VSkY-OSS commented Mar 4, 2022

Hi @b4nganto,
It looks like you're having a problem with your credentials, please check that your credentials are correct.
Another thing that could be is that you have passed a provider.tf or tfvars with some parameter or variable indicating an account or profile...
Note that SLD manages its own terraform backend and generates tfvars dynamically.
You can see a simple example

Whether you can manage the SLD backend, and where you want it to hold state. In case of S3 it would be something like

Setting deplyment remote-state environment variables

          env:
          - name: SLD_STORE
            value: "S3"
          - name: SLD_BUCKET
            value: "s3-sld-bucket-tf-state"

complete example

apiVersion: apps/v1
kind: Deployment
metadata:
  name: remote-state
  labels:
    name: remote-state
spec:
  replicas: 4 
  selector:
    matchLabels:
      name: remote-state
  template:
    metadata:
      labels:
        name: remote-state
      annotations:
        sidecar.istio.io/inject: "false"
    spec:
      subdomain: primary
      containers:
        - name: remote-state
          image: sld-remote-state
          imagePullPolicy: Always
          command: ["python3", "-m", "uvicorn", "main:app", "--host", "0.0.0.0", "--port", "8080", "--workers", "1"]
          env:
          - name: SLD_STORE
            value: "S3"
          - name: SLD_BUCKET
            value: "s3-sld-bucket-tf-state"
          ports:
            - containerPort: 8080
          livenessProbe:
            httpGet:
              path: /
              port: 8080
              httpHeaders:
              - name: status
                value: healthy
            initialDelaySeconds: 60
            periodSeconds: 60
          resources:
            limits:
              memory: 900Mi
              cpu: 1
            requests:
              memory: 300Mi
              cpu: 200m

@D10S0VSkY-OSS D10S0VSkY-OSS added the help wanted Extra attention is needed label Mar 4, 2022
@D10S0VSkY-OSS
Copy link
Owner

You can see a simple example of a vpc stack :
sld_vlc_poc
Deploy stack with tf version 1.1.6
image
Result:
image

Repository owner locked and limited conversation to collaborators Apr 9, 2022
@D10S0VSkY-OSS D10S0VSkY-OSS converted this issue into discussion #58 Apr 9, 2022

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

Labels
help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants