We’re experiencing a problem associated with the terraspace plan
command, of all things.
We run Terraspace using GitLab CI and the terraspace
CLI + Terraform 1.5.5 (we’re still evaluating OpenTofu). One of our software engineers has pushed a commit to a merge request, which triggers a “plan” job. Basically, it runs terraspace plan
and then runs a conversion shell command to process the result so it can be seen in GitLab’s Terraform merge request widget.
The merge request ends like the excerpt below. It seems to be expecting some sort of input, but I’m really not sure what that would be for this command. Any ideas?
$ terraspace show $PROJECT_STACK --plan plans/${AWS_REGION}${PROJECT_STACK}.tfplan --json | convert_report > plans/${AWS_REGION}${PROJECT_STACK}.json
[1358](https://REDACTED.COMPANY.COM/PROJECT_GROUP1/SUBGROUP/PROJECT_NAME/-/jobs/113270#L1358)Building .terraspace-cache/us-east-1/dev/stacks/mimcloud-3-deploy
[1359](https://REDACTED.COMPANY.COM/PROJECT_GROUP1/SUBGROUP/PROJECT_NAME/-/jobs/113270#L1359)WARN: config.build.copy_modules is not set. Defaulting to true.
[1360](https://REDACTED.COMPANY.COM/PROJECT_GROUP1/SUBGROUP/PROJECT_NAME/-/jobs/113270#L1360)The terraspace building behavior is to copy modules from
[1361](https://REDACTED.COMPANY.COM/PROJECT_GROUP1/SUBGROUP/PROJECT_NAME/-/jobs/113270#L1361)the app/modules folder to the .terraspace-cache for speed.
[1362](https://REDACTED.COMPANY.COM/PROJECT_GROUP1/SUBGROUP/PROJECT_NAME/-/jobs/113270#L1362)Most do not need app/modules to be compiled.
[1363](https://REDACTED.COMPANY.COM/PROJECT_GROUP1/SUBGROUP/PROJECT_NAME/-/jobs/113270#L1363)Other files like app/stacks and tfvars files are still compiled.
[1364](https://REDACTED.COMPANY.COM/PROJECT_GROUP1/SUBGROUP/PROJECT_NAME/-/jobs/113270#L1364)This is a change from previous versions of Terraspace, where
[1365](https://REDACTED.COMPANY.COM/PROJECT_GROUP1/SUBGROUP/PROJECT_NAME/-/jobs/113270#L1365)all files were compiled.
[1366](https://REDACTED.COMPANY.COM/PROJECT_GROUP1/SUBGROUP/PROJECT_NAME/-/jobs/113270#L1366)You can turn this warning off by setting:
[1367](https://REDACTED.COMPANY.COM/PROJECT_GROUP1/SUBGROUP/PROJECT_NAME/-/jobs/113270#L1367).terraspace/config.rb
[1368](https://REDACTED.COMPANY.COM/PROJECT_GROUP1/SUBGROUP/PROJECT_NAME/-/jobs/113270#L1368) Terraspace.configure do |config|
[1369](https://REDACTED.COMPANY.COM/PROJECT_GROUP1/SUBGROUP/PROJECT_NAME/-/jobs/113270#L1369) config.build.copy_modules = true
[1370](https://REDACTED.COMPANY.COM/PROJECT_GROUP1/SUBGROUP/PROJECT_NAME/-/jobs/113270#L1370) end
[1371](https://REDACTED.COMPANY.COM/PROJECT_GROUP1/SUBGROUP/PROJECT_NAME/-/jobs/113270#L1371)In future Terraspace versions, the default will be true.
[1372](https://REDACTED.COMPANY.COM/PROJECT_GROUP1/SUBGROUP/PROJECT_NAME/-/jobs/113270#L1372)There will be no warning message, but it will still be configurable.
[1373](https://REDACTED.COMPANY.COM/PROJECT_GROUP1/SUBGROUP/PROJECT_NAME/-/jobs/113270#L1373)Current directory: .terraspace-cache/us-east-1/dev/stacks/mimcloud-3-deploy
[1374](https://REDACTED.COMPANY.COM/PROJECT_GROUP1/SUBGROUP/PROJECT_NAME/-/jobs/113270#L1374)=> terraform show -json plans/us-east-1_mimcloud-3-deploy.tfplan
[1375](https://REDACTED.COMPANY.COM/PROJECT_GROUP1/SUBGROUP/PROJECT_NAME/-/jobs/113270#L1375)/usr/local/bundle/gems/terraspace-2.2.8/lib/terraspace/shell.rb:120:in `handle_input': undefined method `strip' for nil:NilClass (NoMethodError)
[1376](https://REDACTED.COMPANY.COM/PROJECT_GROUP1/SUBGROUP/PROJECT_NAME/-/jobs/113270#L1376) logger.stdin_capture(answer.strip)
[1377](https://REDACTED.COMPANY.COM/PROJECT_GROUP1/SUBGROUP/PROJECT_NAME/-/jobs/113270#L1377) ^^^^^^
[1378](https://REDACTED.COMPANY.COM/PROJECT_GROUP1/SUBGROUP/PROJECT_NAME/-/jobs/113270#L1378) from /usr/local/bundle/gems/terraspace-2.2.8/lib/terraspace/shell.rb:68:in `block (3 levels) in handle_streams'
[1379](https://REDACTED.COMPANY.COM/PROJECT_GROUP1/SUBGROUP/PROJECT_NAME/-/jobs/113270#L1379) from /usr/local/bundle/gems/terraspace-2.2.8/lib/terraspace/shell.rb:65:in `each'
[1380](https://REDACTED.COMPANY.COM/PROJECT_GROUP1/SUBGROUP/PROJECT_NAME/-/jobs/113270#L1380) from /usr/local/bundle/gems/terraspace-2.2.8/lib/terraspace/shell.rb:65:in `block (2 levels) in handle_streams'
[1381](https://REDACTED.COMPANY.COM/PROJECT_GROUP1/SUBGROUP/PROJECT_NAME/-/jobs/113270#L1381) from /usr/local/bundle/gems/terraspace-2.2.8/lib/terraspace/shell.rb:60:in `each'
[1382](https://REDACTED.COMPANY.COM/PROJECT_GROUP1/SUBGROUP/PROJECT_NAME/-/jobs/113270#L1382) from /usr/local/bundle/gems/terraspace-2.2.8/lib/terraspace/shell.rb:60:in `block in handle_streams'
[1383](https://REDACTED.COMPANY.COM/PROJECT_GROUP1/SUBGROUP/PROJECT_NAME/-/jobs/113270#L1383) from /usr/local/lib/ruby/3.2.0/timeout.rb:189:in `block in timeout'
[1384](https://REDACTED.COMPANY.COM/PROJECT_GROUP1/SUBGROUP/PROJECT_NAME/-/jobs/113270#L1384) from /usr/local/lib/ruby/3.2.0/timeout.rb:36:in `block in catch'
[1385](https://REDACTED.COMPANY.COM/PROJECT_GROUP1/SUBGROUP/PROJECT_NAME/-/jobs/113270#L1385) from /usr/local/lib/ruby/3.2.0/timeout.rb:36:in `catch'
[1386](https://REDACTED.COMPANY.COM/PROJECT_GROUP1/SUBGROUP/PROJECT_NAME/-/jobs/113270#L1386) from /usr/local/lib/ruby/3.2.0/timeout.rb:36:in `catch'
[1387](https://REDACTED.COMPANY.COM/PROJECT_GROUP1/SUBGROUP/PROJECT_NAME/-/jobs/113270#L1387) from /usr/local/lib/ruby/3.2.0/timeout.rb:198:in `timeout'
[1388](https://REDACTED.COMPANY.COM/PROJECT_GROUP1/SUBGROUP/PROJECT_NAME/-/jobs/113270#L1388) from /usr/local/bundle/gems/terraspace-2.2.8/lib/terraspace/shell.rb:53:in `handle_streams'
[1389](https://REDACTED.COMPANY.COM/PROJECT_GROUP1/SUBGROUP/PROJECT_NAME/-/jobs/113270#L1389) from /usr/local/bundle/gems/terraspace-2.2.8/lib/terraspace/shell.rb:42:in `block in popen3'
[1390](https://REDACTED.COMPANY.COM/PROJECT_GROUP1/SUBGROUP/PROJECT_NAME/-/jobs/113270#L1390) from /usr/local/lib/ruby/3.2.0/open3.rb:228:in `popen_run'
[1391](https://REDACTED.COMPANY.COM/PROJECT_GROUP1/SUBGROUP/PROJECT_NAME/-/jobs/113270#L1391) from /usr/local/lib/ruby/3.2.0/open3.rb:103:in `popen3'
[1392](https://REDACTED.COMPANY.COM/PROJECT_GROUP1/SUBGROUP/PROJECT_NAME/-/jobs/113270#L1392) from /usr/local/bundle/gems/terraspace-2.2.8/lib/terraspace/shell.rb:36:in `popen3'
[1393](https://REDACTED.COMPANY.COM/PROJECT_GROUP1/SUBGROUP/PROJECT_NAME/-/jobs/113270#L1393) from /usr/local/bundle/gems/terraspace-2.2.8/lib/terraspace/shell.rb:26:in `shell'
[1394](https://REDACTED.COMPANY.COM/PROJECT_GROUP1/SUBGROUP/PROJECT_NAME/-/jobs/113270#L1394) from /usr/local/bundle/gems/terraspace-2.2.8/lib/terraspace/shell.rb:17:in `run'
[1395](https://REDACTED.COMPANY.COM/PROJECT_GROUP1/SUBGROUP/PROJECT_NAME/-/jobs/113270#L1395) from /usr/local/bundle/gems/terraspace-2.2.8/lib/terraspace/terraform/runner.rb:53:in `block in terraform'
[1396](https://REDACTED.COMPANY.COM/PROJECT_GROUP1/SUBGROUP/PROJECT_NAME/-/jobs/113270#L1396) from /usr/local/bundle/gems/terraspace-2.2.8/lib/terraspace/hooks/builder.rb:25:in `run_hooks'
[1397](https://REDACTED.COMPANY.COM/PROJECT_GROUP1/SUBGROUP/PROJECT_NAME/-/jobs/113270#L1397) from /usr/local/bundle/gems/terraspace-2.2.8/lib/terraspace/hooks/concern.rb:6:in `run_hooks'
[1398](https://REDACTED.COMPANY.COM/PROJECT_GROUP1/SUBGROUP/PROJECT_NAME/-/jobs/113270#L1398) from /usr/local/bundle/gems/terraspace-2.2.8/lib/terraspace/terraform/runner.rb:50:in `terraform'
[1399](https://REDACTED.COMPANY.COM/PROJECT_GROUP1/SUBGROUP/PROJECT_NAME/-/jobs/113270#L1399) from /usr/local/bundle/gems/terraspace-2.2.8/lib/terraspace/terraform/runner.rb:15:in `block in run'
[1400](https://REDACTED.COMPANY.COM/PROJECT_GROUP1/SUBGROUP/PROJECT_NAME/-/jobs/113270#L1400) from /usr/local/bundle/gems/terraspace-2.2.8/lib/terraspace/terraform/runner.rb:97:in `time_took'
[1401](https://REDACTED.COMPANY.COM/PROJECT_GROUP1/SUBGROUP/PROJECT_NAME/-/jobs/113270#L1401) from /usr/local/bundle/gems/terraspace-2.2.8/lib/terraspace/terraform/runner.rb:14:in `run'
[1402](https://REDACTED.COMPANY.COM/PROJECT_GROUP1/SUBGROUP/PROJECT_NAME/-/jobs/113270#L1402) from /usr/local/bundle/gems/terraspace-2.2.8/lib/terraspace/cli/commander.rb:12:in `run'
[1403](https://REDACTED.COMPANY.COM/PROJECT_GROUP1/SUBGROUP/PROJECT_NAME/-/jobs/113270#L1403) from /usr/local/bundle/gems/terraspace-2.2.8/lib/terraspace/cli.rb:202:in `show'
[1404](https://REDACTED.COMPANY.COM/PROJECT_GROUP1/SUBGROUP/PROJECT_NAME/-/jobs/113270#L1404) from /usr/local/bundle/gems/thor-1.2.2/lib/thor/command.rb:27:in `run'
[1405](https://REDACTED.COMPANY.COM/PROJECT_GROUP1/SUBGROUP/PROJECT_NAME/-/jobs/113270#L1405) from /usr/local/bundle/gems/thor-1.2.2/lib/thor/invocation.rb:127:in `invoke_command'
[1406](https://REDACTED.COMPANY.COM/PROJECT_GROUP1/SUBGROUP/PROJECT_NAME/-/jobs/113270#L1406) from /usr/local/bundle/gems/thor-1.2.2/lib/thor.rb:392:in `dispatch'
[1407](https://REDACTED.COMPANY.COM/PROJECT_GROUP1/SUBGROUP/PROJECT_NAME/-/jobs/113270#L1407) from /usr/local/bundle/gems/terraspace-2.2.8/lib/terraspace/command.rb:76:in `dispatch'
[1408](https://REDACTED.COMPANY.COM/PROJECT_GROUP1/SUBGROUP/PROJECT_NAME/-/jobs/113270#L1408) from /usr/local/bundle/gems/thor-1.2.2/lib/thor/base.rb:485:in `start'
[1409](https://REDACTED.COMPANY.COM/PROJECT_GROUP1/SUBGROUP/PROJECT_NAME/-/jobs/113270#L1409) from /usr/local/bundle/gems/terraspace-2.2.8/lib/terraspace/cli/concern.rb:65:in `start'
[1410](https://REDACTED.COMPANY.COM/PROJECT_GROUP1/SUBGROUP/PROJECT_NAME/-/jobs/113270#L1410) from /usr/local/bundle/gems/terraspace-2.2.8/exe/terraspace:7:in `<top (required)>'
[1411](https://REDACTED.COMPANY.COM/PROJECT_GROUP1/SUBGROUP/PROJECT_NAME/-/jobs/113270#L1411) from /usr/local/bundle/bin/terraspace:25:in `load'
[1412](https://REDACTED.COMPANY.COM/PROJECT_GROUP1/SUBGROUP/PROJECT_NAME/-/jobs/113270#L1412) from /usr/local/bundle/bin/terraspace:25:in `<main>'
[1413](https://REDACTED.COMPANY.COM/PROJECT_GROUP1/SUBGROUP/PROJECT_NAME/-/jobs/113270#L1413)parse error: Unfinished string at EOF at line 1, column 1073152