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

Chunklist panic with empty list #22021

Closed
melbit-michaelw opened this issue Jul 9, 2019 · 1 comment · Fixed by #22119
Closed

Chunklist panic with empty list #22021

melbit-michaelw opened this issue Jul 9, 2019 · 1 comment · Fixed by #22119

Comments

@melbit-michaelw
Copy link

Terraform Version

$ terraform version
Terraform v0.12.3

Terraform Configuration Files

I have a very large module which contains the following as part of an output:

chunklist(aws_subnet.public.*.id, length(var.azs))

Due to the size and content of the module I'm not able to share full code, but the problem appears easy to reproduce so that shouldn't be a problem.

In this instance, aws_subnet.public.*.id returns an empty list, and length(var.azs) returns 3.

I was also able to reproduce using the terraform console which is where the crash output is from:

$ terraform console
> chunklist([], 3)

>  
Error: Error in function call

Debug Output

Crash Output

https://gist.github.com/melbit-michaelw/c827a37598d144028c7d674f8021a66c

Expected Behavior

I expected it to return an empty list when the input was an empty list.

Actual Behavior

Crash. See crash log.

Steps to Reproduce

Easiest method is the terraform console example above.

Additional Context

References

This looks similar to #21403

@ghost
Copy link

ghost commented Aug 18, 2019

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.

If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@ghost ghost locked and limited conversation to collaborators Aug 18, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants