Skip to content

terraform 1.1.0: fatal: Remote branch <GIT SHA> not found in upstream origin #30119

@andresusanto

Description

@andresusanto

Terraform Version

1.1.0

Terraform Configuration Files

module "some_module_name" {
  source           = "git@github.com:andresusanto/repo//modules/some_module?ref=923e51e12c6e5a1c76dd42a59837d5359d6eaa92" # a valid git commit sha

  some_variable = var.some_variable
}

Expected Behavior

Terraform should be able to pull the module from the repo. I have confirmed that it works on terraform 1.0.11.

Actual Behavior

╷
│ Error: Failed to download module
│ 
│ Could not download module "some_module_name"
│ (../modules/test/main.tf:8) source code from
│ "git::ssh://git@github.com/andresusanto/test-repo?ref=923e51e12c6e5a1c76dd42a59837d5359d6eaa92":
│ error downloading
│ 'ssh://git@github.com/andresusanto/test-repo?ref=923e51e12c6e5a1c76dd42a59837d5359d6eaa92':
│ /usr/bin/git exited with 128: Cloning into
│ '.terraform/modules/env.some_module_name'...
│ Warning: Permanently added the ECDSA host key for IP address '140.82.112.4'
│ to the list of known hosts.
│ fatal: Remote branch 923e51e12c6e5a1c76dd42a59837d5359d6eaa92 not found in
│ upstream origin

Steps to Reproduce

Should be able to reproduce this by using any module with git source and ref pointing to commit sha on terraform 1.1.0.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugcliconfirmeda Terraform Core team member has reproduced this issuedependenciesAuto-pinningexplaineda Terraform Core team member has described the root cause of this issue in code

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions