Skip to content
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

Failed to configure remote backend "atlas" when migrate to 0.9 #12806

Closed
dot opened this issue Mar 17, 2017 · 3 comments · Fixed by #12818
Closed

Failed to configure remote backend "atlas" when migrate to 0.9 #12806

dot opened this issue Mar 17, 2017 · 3 comments · Fixed by #12818
Assignees

Comments

@dot
Copy link

dot commented Mar 17, 2017

Terraform Version

Terraform v0.9.0

Steps to Reproduce

in v0.8.8
terraform remote config -backend="atlas" -backend-config="name=my/atlas"

Then, bump terraform to v0.9.0

And, add this configuration.

terraform {
  backend "atlas" {
    name = "my/atlas"
  }
}

and run terraform init

Actual Behavior

# terraform init
Downloading modules (if any)...
Get: ....... 
Get: .......
Initializing the backend...
Legacy remote state was detected!

Terraform has detected you still have legacy remote state enabled while
also having a backend configured. Terraform will now ask if you want to
migrate your legacy remote state data to the configured backend.


Do you want to copy the legacy remote state from "atlas"?
  Terraform can copy the existing state in your legacy remote state
  backend to your newly configured backend. Please answer "yes" or "no".

  Enter a value: yes


One or more errors occurred while configuring the legacy remote state.
If fixing these errors requires changing your remote state configuration,
you must switch your configuration to the new remote backend configuration.
You can learn more about remote backends at the URL below:

TODO: URL

The error(s) configuring the legacy remote state:

Failed to configure remote backend "atlas": unknown remote client type: atlas

State file

after run terrafrom init tfstate file is

{
    "version": 3,
    "terraform_version": "0.8.8",
    "serial": 77,
    "lineage": "xxxxxxx",
    "remote": {
        "type": "atlas",
        "config": {
            "name": "my/atlas"
        }
    },
    "backend": {
        "type": "atlas",
        "config": {
            "name": "my/atlas"
        },
        "hash": (xxx)
    },
..................
@dot dot changed the title Failed to configure remote backend "atlas" in migrate to 0.9 Failed to configure remote backend "atlas" when migrate to 0.9 Mar 17, 2017
@mitchellh mitchellh self-assigned this Mar 17, 2017
mitchellh added a commit that referenced this issue Mar 17, 2017
Fixes #12806

This should've been part of 2c19aa6

This is the same issue, just missed a spot. Tests are hard to cover for
this since we're removing the legacy backends one by one, eventually
it'll be gone. A good sign is that we don't import backendlegacy at all
anymore in command/
@mitchellh
Copy link
Contributor

Thanks, fixed in PR :)

@ghost
Copy link

ghost commented Apr 17, 2017

I don't think this is working. Here is the problem I am running into:

having problem using atlas as a backend with terraform 0.9.3
added the following config terraform {
required_version = ">= 0.9.0"
backend "atlas" {
name = "romildo/aws-global"
}
}
run terraform init which was a success Initializing the backend...
Terraform has been successfully initialized!
You may now begin working with Terraform. Try running "terraform plan" to see
any changes that are required for your infrastructure. All Terraform commands
should now work.
If you ever set or change modules or backend configuration for Terraform,
rerun this command to reinitialize your environment. If you forget, other
commands will detect it and remind you to do so if necessary.
but when running terraform push it keep asking to run init again
romildo@bigbear:~/RubymineProjects/terraform-best-practices/terraform/providers/aws/global$ terraform push -name $ATLAS_USERNAME/aws-global -var "atlas_token=$ATLAS_TOKEN" -var "atlas_username=$ATLAS_USERNAME" ../../../../terraform/
Backend reinitialization required. Please run "terraform init".
Reason: Unsetting the previously set backend "atlas"
The "backend" is the interface that Terraform uses to store state,
perform operations, etc. If this message is showing up, it means that the
Terraform configuration you're using is using a custom configuration for
the Terraform backend.
Changes to backend configurations require reinitialization. This allows
Terraform to setup the new configuration, copy existing state, etc. This is
only done during "terraform init". Please run that command now then try again.
If the change reason above is incorrect, please verify your configuration
hasn't changed and try again. At this point, no changes to your existing
configuration or state have been made.
Failed to load backend: Initialization required. Please see the error message above.
any ideas what is the problem?????

@ghost
Copy link

ghost commented Apr 13, 2020

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.

If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@ghost ghost locked and limited conversation to collaborators Apr 13, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants