-
Notifications
You must be signed in to change notification settings - Fork 182
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
Terraform validate reporting "Module not installed" unnecessarily #1013
Comments
I've got the exact same problem as @wagnerone. I believe it started happening only in the last week or so. Environment InformationTerraform InformationVersion: 1.1.4 Visual Studio Code
Visual Studio Code ExtensionsVisual Studio Code Extensions(Click to Expand)
|
Occurs with terraform-ls 0.25.2 and 0.26.0. Only occurs after I content change/save any .tf. If I start vscode and simply look at .tf's, I don't get the error. |
I concur with everything @staranto added. |
Hi @wagnerone and @staranto, thanks for the detailed reports. From your description and from looking at the error log you have As a short-term workaround you can set Can you both print a tree of the file structure you're describing so I can ensure I understand correctly how your project is structured? It can be simplified to only include the relevant paths. I have the paths shown in @staranto's log, but I want to be sure I understand correctly. |
@jprogan - Thanks for the response.
For example
IOW.... root in iac/ includes module in iac/test, which includes module in iac/_modules/ec2 |
To add some more context here: The extension (through language server) doesn't do anything more than call out to
There is a valid argument to be made about supporting some kind of "partial" validation of the part of configuration that "is validatable", but This is one of the main reasons we make validation on save opt-in. We could try to run This breaks pretty quickly with >1 installations. See for example https://github.com/hashicorp/terraform-ls/tree/main/internal/langserver/handlers/testdata/main-module-multienv/env where Which one should we pick? I think they can all be relevant, but you probably expect to mainly see diagnostics which are relevant to the installation point, not to the module's internal behaviour. e.g. you probably want to see mismatched module inputs/outputs at the installation point and missing required We do plan to re-implement some parts of validate as part of #720 Does #720 sound like it would provide the validation you expect? |
I'm going to close this optimistically in favour of #720 as I don't see anything else actionable here.
The only downside is that it may not be as detailed validation since we would only do the validation based on static provider schema, so e.g. it won't run custom |
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. |
Issue Type: Bug
This is causing lots of distracting red alarm visuals in Vscode in the past few days.
The "main.tf" in the error below is a module calling another module, so it will never have an init executed in "itself".
Its init is one level up in the parent module that calls this module, which then calls another module.
[{
"resource": ".../main.tf",
"owner": "generated_diagnostic_collection_name#0",
"severity": 8,
"message": "Module not installed: This module is not yet installed. Run "terraform init" to install all modules required by this configuration.",
"source": "terraform validate",
"startLineNumber": 1,
"startColumn": 1,
"endLineNumber": 1,
"endColumn": 13
}]
Extension version: 2.21.0
VS Code version: Code - Insiders 1.66.0-insider (c5dece632b4b1ea98db872e1edcfc92994503274, 2022-03-24T15:07:58.609Z)
OS version: Darwin arm64 21.4.0
Restricted Mode: No
System Info
canvas_oop_rasterization: disabled_off
direct_rendering_display_compositor: disabled_off_ok
gpu_compositing: enabled
metal: disabled_off
multiple_raster_threads: enabled_on
oop_rasterization: enabled
opengl: enabled_on
rasterization: enabled
raw_draw: disabled_off_ok
skia_renderer: enabled_on
video_decode: enabled
video_encode: enabled
webgl: enabled
webgl2: enabled
A/B Experiments
The text was updated successfully, but these errors were encountered: