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

Terragrunt: Failed to properly parse git/ssh dependency with sub directory #33772

Closed
rarkins opened this issue Jan 22, 2025 · 1 comment · Fixed by #33810
Closed

Terragrunt: Failed to properly parse git/ssh dependency with sub directory #33772

rarkins opened this issue Jan 22, 2025 · 1 comment · Fixed by #33810
Labels
manager:terragrunt priority-4-low Low priority, unlikely to be done unless it becomes important to more people type:bug Bug fix of existing functionality

Comments

@rarkins
Copy link
Collaborator

rarkins commented Jan 22, 2025

Discussed in #33370

Originally posted by mblum14 January 2, 2025

How are you running Renovate?

Self-hosted Renovate

If you're self-hosting Renovate, tell us which platform (GitHub, GitLab, etc) and which version of Renovate.

CLI 39.86.4

Please tell us more about your question or problem

https://github.com/mblum14/renovate-reproduction-33370

I have the following terragrunt file:

# terragrunt.hcl
terraform {
  source = "git::ssh://[email protected]/myorg/my-terraform-module.git//sub/directory?rev=v2.0.0"
}

The problem is the parsed packageName does not contain the GitHub domain, so git tags cannot be looked up to determine if newer version of myorg/my-terraform-module are available. The parsed package name is null/myorg/my-terraform-module.git when I would expect it to have been ssh://[email protected]/myorg/my-terraform-module.git.

Abbreviated renovate output from scanning the project file:

{
  "repositories": {
    "myorg/my-terragrunt-repo": {
      "problems": [
        {
          "name": "renovate",
          "level": 40,
          "url": "null/myorg/my-terraform-module.git",
          "msg": "Attempting to use non-git url for git operations"
        },
        {
          "name": "renovate",
          "level": 40,
          "warnings": [
            "Failed to look up git-tags package null/myorg/my-terraform-module.git"
          ],
          "files": ["terragrunt.hcl"],
          "msg": "Package lookup failures"
        }
      ],
      "branches": [],
      "packageFiles": {
        "terragrunt": [
          {
            "deps": [
              {
                "depType": "gitTags",
                "depName": "my.enterprise.github/myorg/my-terraform-module",
                "currentValue": "v2.0.0",
                "datasource": "git-tags",
                "packageName": "null/myorg/my-terraform-module.git",
                "update": [],
                "versioning": "server-coerced",
                "warnings": [
                  {
                    "topic": "null/myorg/my-terraform-module.git",
                    "message": "Failed to look up git-tags package null/myorg/my-terraform-module.git"
                  }
                ]
              }
            ]
          }
        ]
      }
    }
  }
}

Logs (if relevant)

[!NOTE]
The system I'm working on is on an air-gapped network, so copying the entire log isn't exactly do-able but I'll try to include the relevant bits

Logs

DEBUG: Matched 1 file(s) for manager terragrunt: terragrunt.hcl
DEBUG: Found terragrunt package files (repository=myorg/my-terragrunt-repo)
DEBUG: Found terragrunt package files (repository=myorg/my-terragrunt-repo)
 INFO: Dependency extraction complete (repository=myorg/my-terragrunt-repo, baseBranch=master)
       "stats": {
         "managers": {
           "terraform-version": {"fileCount": 1, "depCount": 1},
           "terragrunt": {"fileCount": 1, "depCount": 1},
           "terragrunt-version": {"fileCount": 1, "depCount": 1}
         },
         "total": {"fileCOunt": 3, "depCount": 3}
       }
DEBUG: Datasource unknown error (repository=myorg/my-terragrunt-repo)
       "datasource": "git-tags",
       "packageName": "null/myorg/my-terraform-module.git",
       "err": {
         "task": {
           "commands": [
             "ls-remote",
             "null/myorg/my-terraform-module.git"
           ],
           "format": "utf-8",
           "parser": "[function]"
         },
         "message": "fatal: 'null/myorg/my-terraform-module.git' does not appear to be a git repository\nfatal: Could not read from remote repository.\n\nPlease make sure you have the correct access rights\nand the repository exists.\n",
         "stack": "Error: fatal: 'null/myorg/my-terraform-module.git' does not appear to be a git repository\nfatal: Could not read from remote repository.\n\nPlease make sure you have the correct access rights\nand the repository exists.\n\n.   at Object.action (/alt/.volta/tools/image/packages/renovate/lib/node_modules/renovate/node_modules/simple-git/src/lib/plugins/error-detection.plugin.ts:42:29)\n.   at PluginStore.exec (/alt/.volta/tools/image/packages/renovate/lib/node_modules/renovate/node_modules/simple-git/src/lib/plugins/plugin-store.ts:54:29)\n.   at /alt/.volta/tools/image/packages/renovate/lib/node_modules/renovate/node_modules/simple-git/src/lib/runners/git-executor-chain.ts:124:42\n.   at new Promise (<anonymous>)\n.   at GitExecutorChain.handleTaskData (/alt/.volta/tools/image/packages/renovate/lib/node_modules/renovate/node_modules/simple-git/src/lib/runners/git-executor-chain.ts:121:14)\n.   at GitExecutorChain.<anonymous> (/alt/.volta/tools/image/packages/renovate/lib/node_modules/renovate/node_modules/simple-git/src/lib/runners/git-executor-chain.ts:97:40)\n.   at Generator.newx (<anonymous>)\n    at fulfilled (/alt/.volta/tools/image/packages/renovate/lib/node_modules/renovate/node_modules/simple-git/dist/cjs/index.js:52:24)"
DEBUG: Failed to look up git-tags package null/myorg/my-terraform-module.git (repository=myorg/my-terragrunt-repo, packageFile=terragrunt.hcl, dependency=null/myorg/my-terraform-module.git)
@rarkins rarkins added manager:terragrunt priority-4-low Low priority, unlikely to be done unless it becomes important to more people type:bug Bug fix of existing functionality labels Jan 22, 2025
@renovate-release
Copy link
Collaborator

🎉 This issue has been resolved in version 39.158.1 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
manager:terragrunt priority-4-low Low priority, unlikely to be done unless it becomes important to more people type:bug Bug fix of existing functionality
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants