mirror of
https://github.com/patrickchugh/terravision.git
synced 2026-05-09 08:25:25 +02:00
[GH-ISSUE #109] Terravision fails with "Unhandled error: <class 'TypeError'>, can only concatenate str (not "bool") to str" #55
Labels
No labels
bug
enhancement
enhancement
good first issue
good first issue
good first issue
pipeline
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/terravision#55
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @BaffledJimmy on GitHub (Mar 7, 2024).
Original GitHub issue: https://github.com/patrickchugh/terravision/issues/109
Hello,
I am having a problem running Terravision against some TF that creates an EC2, VPC, subnet, routing table, internet gateway and a SG with some CIDRs in it. Basically an EC2 in AWS and the supporting stuff it needs to get online / be reachable. I also have a count argument so I can make multiple EC2s at the same time. TF also templates out an Ansible inventory via a local-file template. Don't think makes any odds, but on M1 MacBook.
Am using code cloned this morning so current version.
Environment:
(venv) ➜ Terraform git:(main) ✗ tree
.
├── ansible_inventory.tpl
├── instance.tf
├── outputs.tf
├── providers.tf
├── security_group.tf
├── variables.tf
└── vpc.tf
1 directory, 7 files
./terravision draw --source ~/Dev/Project/Terraform --debug
TypeError: can only concatenate str (not "bool") to str
Preflight check..
dot command detected: /usr/bin/dot
gvpr command detected: /usr/bin/gvpr
git command detected: /usr/bin/git
terraform command detected: /usr/bin/terraform
Checking Terraform Version...
Initializing the backend...
Initializing provider plugins...
Terraform has been successfully initialized!
You may now begin working with Terraform. Try running "terraform plan" to see
any changes that are required for your infrastructure. All Terraform commands
should now work.
If you ever set or change modules or backend configuration for Terraform,
rerun this command to reinitialize your working directory. If you forget, other
commands will detect it and remind you to do so if necessary.
Terraform v1.7.4
Initalising workspace: default
Generating Terraform Plan..
Terraform used the selected providers to generate the following execution
plan. Resource actions are indicated with the following symbols:
Terraform will perform the following actions:
aws_instance.EC2Workstation[0] will be created
ami = "ami-0d18e50ca22537278"
arn = (known after apply)
associate_public_ip_address = true
availability_zone = (known after apply)
cpu_core_count = (known after apply)
cpu_threads_per_core = (known after apply)
disable_api_stop = (known after apply)
disable_api_termination = (known after apply)
ebs_optimized = (known after apply)
get_password_data = false
host_id = (known after apply)
host_resource_group_arn = (known after apply)
iam_instance_profile = (known after apply)
id = (known after apply)
instance_initiated_shutdown_behavior = (known after apply)
instance_lifecycle = (known after apply)
instance_state = (known after apply)
instance_type = "t2.medium"
ipv6_address_count = (known after apply)
ipv6_addresses = (known after apply)
key_name = "SSHKey"
monitoring = (known after apply)
outpost_arn = (known after apply)
password_data = (known after apply)
placement_group = (known after apply)
placement_partition_number = (known after apply)
primary_network_interface_id = (known after apply)
private_dns = (known after apply)
private_ip = (known after apply)
public_dns = (known after apply)
public_ip = (known after apply)
secondary_private_ips = (known after apply)
security_groups = (known after apply)
source_dest_check = true
spot_instance_request_id = (known after apply)
subnet_id = (known after apply)
tags = {
}
tags_all = {
}
tenancy = (known after apply)
user_data = (known after apply)
user_data_projecte64 = (known after apply)
user_data_replace_on_change = false
vpc_security_group_ids = (known after apply)
root_block_device {
}
}
aws_internet_gateway.project_internetgateway will be created
}
}
}
aws_route_table.project_route_table will be created
},
]
}
}
}
aws_route_table_association.a will be created
}
aws_security_group.SG_projectFirewalling will be created
]
},
]
]
},
]
},
]
},
]
},
]
},
]
},
[redacted list of CIDRs]]
]
},
[redacted list of CIDRs]]
]
},
]
}
aws_subnet.project_subnet will be created
}
}
}
aws_vpc.project_vpc will be created
}
}
}
Plan: 7 to add, 0 to change, 0 to destroy.
Changes to Outputs:
]
]
─────────────────────────────────────────────────────────────────────────────
Saved the plan to: /tmp/tfplan.bin
To perform exactly these actions, run the following command to apply:
terraform apply "/tmp/tfplan.bin"
Analysing plan..
Unprocessed terraform graph dictionary:
{
"aws_instance.EC2Workstation
1": [],1""aws_internet_gateway.project_internetgateway": [
"aws_route_table.project_route_table"
],
"aws_route_table.project_route_table": [
"aws_route_table_association.a"
],
"aws_route_table_association.a": [],
"aws_security_group.SG_projectFirewalling": [
"aws_instance.EC2Workstation
],
"aws_subnet.project_subnet": [
"aws_instance.EC2Workstation~1",
"aws_route_table_association.a"
],
"aws_vpc.project_vpc": [
"aws_internet_gateway.project_internetgateway",
"aws_security_group.SG_projectFirewalling",
"aws_subnet.project_subnet",
"aws_subnet.project_subnet"
]
}
Parsing Terraform Source Files..
Added Source Location: /tmp/EC2Workstation/Terraform
Parsing /tmp/EC2Workstation/Terraform/outputs.tf
Found 2 output stanza(s)
Parsing /tmp/EC2Workstation/Terraform/security_group.tf
Found 1 resource stanza(s)
Parsing /tmp/EC2Workstation/Terraform/providers.tf
Parsing /tmp/EC2Workstation/Terraform/variables.tf
Found 5 variable stanza(s)
Parsing /tmp/EC2Workstation/Terraform/instance.tf
Found 1 resource stanza(s)
Parsing /tmp/EC2Workstation/Terraform/vpc.tf
Found 5 resource stanza(s)
Processing variables..
Processing resources..
aws_security_group.SG_projectFirewalling
aws_instance.EC2Workstation
aws_vpc.project_vpc
aws_internet_gateway.project_internetgateway
aws_subnet.project_subnet
aws_route_table.project_route_table
aws_route_table_association.a
Checking for additional links between 7 resources..
aws_vpc.project_vpc --> aws_route_table.project_route_table
Unhandled error: <class 'TypeError'>, can only concatenate str (not "bool") to str, <traceback object at 0xffff91ddcbc0>
Use the latest Ubuntu base image
FROM ubuntu:latest
Install Graphviz and other dependencies
RUN apt-get update && apt-get install -y
graphviz
git
python3-pip
python-is-python3
gnupg
software-properties-common
wget
&& wget -O- https://apt.releases.hashicorp.com/gpg | gpg --dearmor | tee /usr/share/keyrings/hashicorp-archive-keyring.gpg > /dev/null
&& echo "deb [signed-by=/usr/share/keyrings/hashicorp-archive-keyring.gpg] https://apt.releases.hashicorp.com $(. /etc/os-release && echo $VERSION_CODENAME) main" | tee /etc/apt/sources.list.d/hashicorp.list
&& apt-get update
&& apt-get install -y terraform
&& rm -rf /var/lib/apt/lists/*
Set the working directory to the Terravision directory
WORKDIR /app/
Install Terravision dependencies from requirements.txt
COPY . .
RUN pip install -r requirements.txt
Grant execution permission to the terravision script
RUN chmod +x terravision
Default command to be executed when the container starts
CMD ["./terravision", "draw", "--source", "/tmp/Project/Terraform"]
docker build . --platform=linux/arm64 --tag terravision:latest --no-cache
docker run -v $(pwd)/../Project/Terraform:/tmp/Project/Terraform/ -e AWS_ACCESS_KEY_ID="blah" -e AWS_SECRET_ACCESS_KEY="blah" -e AWS_SESSION_TOKEN="blah" terravision:latest
@PaulRoze commented on GitHub (Jun 30, 2024):
I got the same issue 😞
@patrickchugh commented on GitHub (Apr 27, 2026):
@PaulRoze @BaffledJimmy The code has changed significantly since this issue was opened. Can I close the case now?
@BaffledJimmy commented on GitHub (Apr 27, 2026):
All good from my end!
@PaulRoze commented on GitHub (Apr 27, 2026):
I don't have any pending actions on my end. Please feel free to close the case whenever you're ready. Thank you!