question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Can't locate module locally

See original GitHub issue

Installation details

  • PyCharm 2019.1.1 (Professional Edition) Build #PY-191.6605.12, built on April 3, 2019 JRE: 11.0.2+9-b159.34 amd64 JVM: OpenJDK 64-Bit Server VM by JetBrains s.r.o Windows 10 10.0
  • intellij-hcl plugin version: v0.6.14
  • Terraform version: v0.11.13

Terraform Configuration Files

module vmhost {
  source = "git::https://bitbucket.somedomain.net/scm/magic/project.git//magic/modules/vmhost"
}

Exception

module is highlighted yellow and the error "Can’t locate module locally: Terraform Module ‘vmhost’ with source “git::https://bitbucket.somedomain.net/scm/magic/project.git//magic/modules/vmhost” directory not found locally, use ‘terraform get’ to fetch modules.

Expected Behavior

It should handle the sub folder checkout from git

Actual Behavior

It reports it is unable to find the directory

Steps to Reproduce

Please list the steps required to reproduce the issue, for example:

  1. check code into git/bitbucket with multiple folders for modules
  2. reference one folder as per above as a source

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:18 (4 by maintainers)

github_iconTop GitHub Comments

8reactions
zbmowreycommented, Dec 17, 2021

which terraform version? It’s happening to me too. I’ve 1.1.0 right now, but I was using 1.0.11 and had no issues

I can confirm that 1.0.11 is good, but 1.1.0 and 1.1.1 both cause this issue for me.

4reactions
midu-gitcommented, Dec 28, 2021
Read more comments on GitHub >

github_iconTop Results From Across the Web

Terraform: cannot locate module locally: unknown reason
Fixed it by making sure the Source field in .terraform/modules/modules.json matches exactly the source in the TF file. If doesn't match, modify it...
Read more >
Terraform Cannot locate module locally: Unknown reason
i am encountering with the issue which is terraform cant not locate the module locally. I really appreciate your advise. Thanks in advance....
Read more >
Anyone else use IntelliJ and lost ability to drill into modules?
Also modules which have sources outside of the current workspace will appear as "Cannot locate module locally, unknown reason".
Read more >
Cannot find module 'X' error in Node.js | bobbyhadz
If you are getting the "Cannot find module" error when trying to run a local file, make sure that the path you passed...
Read more >
ansible.builtin.find module – Return a list of files based on ...
In most cases, you can use the short module name find even without specifying the collections: keyword. However, we recommend you use the...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found