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

value passing causes dependency resolution failures in child modules #239

Closed
ryane opened this issue Sep 13, 2016 · 4 comments
Closed

value passing causes dependency resolution failures in child modules #239

ryane opened this issue Sep 13, 2016 · 4 comments
Assignees
Labels
Milestone

Comments

@ryane
Copy link
Contributor

ryane commented Sep 13, 2016

For example, samples/query.hcl at the root does work:

$ ./converge plan --local samples/query.hcl                                                                              <<<
2016-09-13T11:26:28-04:00 |WARN| setting session-local token    token=11e0c8cb-5901-4467-847c-c76c95a1edff
2016-09-13T11:26:28-04:00 |INFO| serving        addr=:26930 component=rpc
2016-09-13T11:26:28-04:00 |INFO| planning       component=client file=samples/query.hcl
2016-09-13T11:26:28-04:00 |INFO| resolving dependencies component=rpc function=ResolveDependencies runID=d8c916c4-c4f0-4685-a7d1-3ca9a52ac210
2016-09-13T11:26:28-04:00 |INFO| loading resources      component=rpc function=SetResources runID=d8c916c4-c4f0-4685-a7d1-3ca9a52ac210
2016-09-13T11:26:28-04:00 |INFO| got status     component=client file=samples/query.hcl id=root/task.query.hostname run=STARTED stage=PLAN
2016-09-13T11:26:28-04:00 |INFO| got status     component=client file=samples/query.hcl id=root/file.content.hostname data run=STARTED stage=PLAN
2016-09-13T11:26:28-04:00 |INFO| got status     component=client file=samples/query.hcl id=root run=STARTED stage=PLAN

root/task.query.hostname:
        Messages:
                check (returned: 0)
                radon-2.local


        Has Changes: no
        Changes: No changes

root/file.content.hostname data:
        Messages:
        Has Changes: yes
        Changes:
                hostname.txt: "<file-missing>" => "radon-2.local"

Summary: 0 errors, 1 changes

but if you include it as a module, you get dependency resolution errors. Add a file called samples/query-parent.hcl with the following contents

module "query.hcl" "query-test" {}
$ ./converge plan --local samples/query-parent.hcl
2016-09-13T11:25:40-04:00 |WARN| setting session-local token    token=b939648e-9a52-47bf-8411-33d1494c263f
2016-09-13T11:25:40-04:00 |INFO| serving        addr=:26930 component=rpc
2016-09-13T11:25:40-04:00 |INFO| planning       component=client file=samples/query-parent.hcl
2016-09-13T11:25:40-04:00 |INFO| resolving dependencies component=rpc function=ResolveDependencies runID=9f21d6ce-328a-4e6a-a924-545a2a197140
2016-09-13T11:25:40-04:00 |ERROR| could not load        component=rpc error=could not resolve dependencies: 1 error(s) occurred:

* root/module.query-test/file.content.hostname data: unresolvable call to task.query.hostname.status.stdout location=samples/query-parent.hcl runID=9f21d6ce-328a-4e6a-a924-545a2a197140
2016-09-13T11:25:40-04:00 |FATAL| could not get responses       component=client error=error getting status response: rpc error: code = 2 desc = loading samples/query-parent.hcl: could not resolve dependencies: 1 error(s) occurred:

* root/module.query-test/file.content.hostname data: unresolvable call to task.query.hostname.status.stdout file=samples/query-parent.hcl
@ryane
Copy link
Contributor Author

ryane commented Sep 19, 2016

this is still a problem

@BrianHicks BrianHicks added this to the 0.2.0-beta2 milestone Sep 19, 2016
@BrianHicks BrianHicks removed the ready label Sep 19, 2016
@rebeccaskinner rebeccaskinner self-assigned this Sep 20, 2016
@rebeccaskinner
Copy link
Contributor

The problem is that during preprocessing when we try to find the vertex that is being references we assume the nodes are both peer'd at "root/" which fails to hold true when we're talking about nodes under a module. We need to figure out what the correct vertex peer is to make sure we're referencing the right vertex. The naive solution is straightforward but I want to ensure that we don't break things for the case where we have multiple modules that may be referencing their own versions of the same node.

@BrianHicks
Copy link
Contributor

Did this get solved? It was in the "ready to go" column

@ryane
Copy link
Contributor Author

ryane commented Sep 22, 2016

fixed in #288

@ryane ryane closed this as completed Sep 22, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants