Closed alexpilon666 closed 1 year ago
Quick update after some testing and more stacktrace analysis: According to the Gemfile.lock
, the only Gem that depends on tilt
is render_me_pretty
....a Gem that hasn't been updated since December of 2021. render_me_pretty
is a direct dependency of the terraspace
Gem, and no other Gem has it listed as a dependency.
Looks like tilt 2.2.0 was release today. https://rubygems.org/gems/tilt It seems like it introduced issues. 🧐 Bummer.
render_me_pretty
is a simple gem that uses tilt under the hood to render ERB, written by yours truly. It simply wraps tilt to provide a pretty error output with original source code line.
RE: Our current workaround is to uninstall tilt v2.2.0 and manually reinstall v2.1.0 after running bundle install/update, which solves the problem, but is not ideal.
Glad you were around to find a workaround. Note, you can also use the Gemfile
and pin terraspace
as well other gems with bundler. IE: You can pin tilt
. Here's an example that you can modify for your needs.
Gemfile
source "https://rubygems.org"
gem "terraspace", "~> 2.2"
gem "terraspace_plugin_aws"
gem "rspec-terraspace"
gem "tilt", "~> 2.1.0"
That should pin tilt
as well as other gem dependencies with a Gemfile.lock
.
To check that the gem is pinned to the desired version
bundle info tilt
You should commit Gemifle.lock
so others or the pipeline use the exact same dependencies.
Will have to dig into what's new with tilt
that's causing issues. Also, will review and consider PRs. No sweat either way of course. 👍
Here are also some docs around this: https://terraspace.cloud/docs/install/gems-locking/ Will also consider PRs for docs improvements.
Fixed by https://github.com/tongueroo/render_me_pretty/pull/2 Released in render_me_pretty 0.9.0. You should be able to unpin tilt and run a bundle update
which also updates render_me_pretty
to 0.9.0 with the fix.
Remember to confirm that render_me_pretty
is updated. Example commands:
bundle update
bundle info render_me_pretty
Just removed the pinned version for tilt
and ran a bundle update
: Can confirm, Terraspace commands work again!
Thhanks for the quick fix, greatly appreciated :)
Checklist
My Environment
Expected Behaviour
Terraspace commands should execute properly.
Current Behavior
When running any Terraspace command, we get a Ruby stacktrace that prevents execution of any command whatsoever.
Step-by-step reproduction instructions
bundle update
in the Terraspace projet folderterraspace plan <stack_name>
Ruby stack trace
2023-06-05T18:21:29.3854999Z ##[section]Starting: Run 'terraspace all plan qa --out /tmp/554466/qa.plan -y ; terraspace logs plan -a' 2023-06-05T18:21:29.3860825Z ============================================================================== 2023-06-05T18:21:29.3860992Z Task : Bash 2023-06-05T18:21:29.3861080Z Description : Run a Bash script on macOS, Linux, or Windows 2023-06-05T18:21:29.3861188Z Version : 3.214.0 2023-06-05T18:21:29.3861258Z Author : Microsoft Corporation 2023-06-05T18:21:29.3861918Z Help : https://docs.microsoft.com/azure/devops/pipelines/tasks/utility/bash 2023-06-05T18:21:29.3862038Z ============================================================================== 2023-06-05T18:21:29.5510139Z Generating script. 2023-06-05T18:21:29.5549916Z ========================== Starting Command Output =========================== 2023-06-05T18:21:29.5551976Z [command]/usr/bin/bash /home/0svc_tfs/devops-linux/agent01/_work/_temp/59bb13fa-67ee-4604-9ce3-76a656bc85f3.sh 2023-06-05T18:21:32.1303001Z WARN: Unable to find line number. Fallback and print out full backtrace. 2023-06-05T18:21:32.1304130Z /opt/terraspace/embedded/lib/ruby/gems/3.0.0/gems/tilt-2.2.0/lib/tilt/template.rb:104:in `render' 2023-06-05T18:21:32.1304668Z /opt/terraspace/embedded/lib/ruby/gems/3.0.0/gems/render_me_pretty-0.8.4/lib/render_me_pretty/erb.rb:91:in `render' 2023-06-05T18:21:32.1305638Z /opt/terraspace/embedded/lib/ruby/gems/3.0.0/gems/render_me_pretty-0.8.4/lib/render_me_pretty.rb:11:in `result' 2023-06-05T18:21:32.1306220Z /opt/terraspace/embedded/lib/ruby/gems/3.0.0/gems/terraspace-2.2.6/lib/terraspace/compiler/erb/render.rb:14:in `build' 2023-06-05T18:21:32.1306808Z /opt/terraspace/embedded/lib/ruby/gems/3.0.0/gems/terraspace-2.2.6/lib/terraspace/compiler/strategy/tfvar/tfvars.rb:4:in `run' 2023-06-05T18:21:32.1307377Z /opt/terraspace/embedded/lib/ruby/gems/3.0.0/gems/terraspace-2.2.6/lib/terraspace/compiler/strategy/tfvar.rb:17:in `block in run' 2023-06-05T18:21:32.1307906Z /opt/terraspace/embedded/lib/ruby/gems/3.0.0/gems/terraspace-2.2.6/lib/terraspace/compiler/strategy/tfvar.rb:11:in `each' 2023-06-05T18:21:32.1308460Z /opt/terraspace/embedded/lib/ruby/gems/3.0.0/gems/terraspace-2.2.6/lib/terraspace/compiler/strategy/tfvar.rb:11:in `run' 2023-06-05T18:21:32.1308860Z /opt/terraspace/embedded/lib/ruby/gems/3.0.0/gems/terraspace-2.2.6/lib/terraspace/compiler/perform.rb:35:in `compile_tfvars' 2023-06-05T18:21:32.1309358Z /opt/terraspace/embedded/lib/ruby/gems/3.0.0/gems/terraspace-2.2.6/lib/terraspace/dependency/resolver.rb:12:in `block in resolve' 2023-06-05T18:21:32.1309852Z /opt/terraspace/embedded/lib/ruby/gems/3.0.0/gems/terraspace-2.2.6/lib/terraspace/compiler/dirs_concern.rb:18:in `block in with_each_mod' 2023-06-05T18:21:32.1310296Z /opt/terraspace/embedded/lib/ruby/gems/3.0.0/gems/terraspace-2.2.6/lib/terraspace/compiler/dirs_concern.rb:15:in `each' 2023-06-05T18:21:32.1310700Z /opt/terraspace/embedded/lib/ruby/gems/3.0.0/gems/terraspace-2.2.6/lib/terraspace/compiler/dirs_concern.rb:15:in `with_each_mod' 2023-06-05T18:21:32.1311193Z /opt/terraspace/embedded/lib/ruby/gems/3.0.0/gems/terraspace-2.2.6/lib/terraspace/dependency/resolver.rb:10:in `resolve' 2023-06-05T18:21:32.1311733Z /opt/terraspace/embedded/lib/ruby/gems/3.0.0/gems/terraspace-2.2.6/lib/terraspace/all/runner.rb:25:in `build_batches' 2023-06-05T18:21:32.1312242Z /opt/terraspace/embedded/lib/ruby/gems/3.0.0/gems/terraspace-2.2.6/lib/terraspace/all/runner.rb:13:in `block in run' 2023-06-05T18:21:32.1312713Z /opt/terraspace/embedded/lib/ruby/gems/3.0.0/gems/terraspace-2.2.6/lib/terraspace/all/runner.rb:188:in `time_took' 2023-06-05T18:21:32.1313153Z /opt/terraspace/embedded/lib/ruby/gems/3.0.0/gems/terraspace-2.2.6/lib/terraspace/all/runner.rb:12:in `run' 2023-06-05T18:21:32.1313633Z /opt/terraspace/embedded/lib/ruby/gems/3.0.0/gems/terraspace-2.2.6/lib/terraspace/cli/all.rb:43:in `plan' 2023-06-05T18:21:32.1314020Z /opt/terraspace/embedded/lib/ruby/gems/3.0.0/gems/thor-1.2.2/lib/thor/command.rb:27:in `run' 2023-06-05T18:21:32.1314391Z /opt/terraspace/embedded/lib/ruby/gems/3.0.0/gems/thor-1.2.2/lib/thor/invocation.rb:127:in `invoke_command' 2023-06-05T18:21:32.1315230Z /opt/terraspace/embedded/lib/ruby/gems/3.0.0/gems/thor-1.2.2/lib/thor.rb:392:in `dispatch' 2023-06-05T18:21:32.1315598Z /opt/terraspace/embedded/lib/ruby/gems/3.0.0/gems/terraspace-2.2.6/lib/terraspace/command.rb:76:in `dispatch' 2023-06-05T18:21:32.1315957Z /opt/terraspace/embedded/lib/ruby/gems/3.0.0/gems/thor-1.2.2/lib/thor/invocation.rb:116:in `invoke' 2023-06-05T18:21:32.1316488Z /opt/terraspace/embedded/lib/ruby/gems/3.0.0/gems/thor-1.2.2/lib/thor.rb:243:in `block in subcommand' 2023-06-05T18:21:32.1316938Z /opt/terraspace/embedded/lib/ruby/gems/3.0.0/gems/thor-1.2.2/lib/thor/command.rb:27:in `run' 2023-06-05T18:21:32.1317341Z /opt/terraspace/embedded/lib/ruby/gems/3.0.0/gems/thor-1.2.2/lib/thor/invocation.rb:127:in `invoke_command' 2023-06-05T18:21:32.1317801Z /opt/terraspace/embedded/lib/ruby/gems/3.0.0/gems/thor-1.2.2/lib/thor.rb:392:in `dispatch' 2023-06-05T18:21:32.1318390Z /opt/terraspace/embedded/lib/ruby/gems/3.0.0/gems/terraspace-2.2.6/lib/terraspace/command.rb:76:in `dispatch' 2023-06-05T18:21:32.1318838Z /opt/terraspace/embedded/lib/ruby/gems/3.0.0/gems/thor-1.2.2/lib/thor/base.rb:485:in `start' 2023-06-05T18:21:32.1319214Z /opt/terraspace/embedded/lib/ruby/gems/3.0.0/gems/terraspace-2.2.6/lib/terraspace/cli/concern.rb:65:in `start' 2023-06-05T18:21:32.1319619Z /opt/terraspace/embedded/lib/ruby/gems/3.0.0/gems/terraspace-2.2.6/exe/terraspace:7:in `Code Sample
Solution Suggestion
After analysing our last successful run, and comparing it to our first failed run, we discovered that the only change in the Gem bundles came from an update to the
tilt
package from v2.1.0 to v2.2.0. After looking at the stack trace, this corresponds with the initial line:/opt/terraspace/embedded/lib/ruby/gems/3.0.0/gems/tilt-2.2.0/lib/tilt/template.rb:104:in
render'`.I have no idea which package uses
tilt
as a dependency, but if it's something Terraspace-related/controlled, it would be ideal to eithher havetilt
fixed rapidly, or fix the version of the dependency to v2.1.0 until v2.2.x is fixed.Our current workaround is to uninstall
tilt
v2.2.0 and manually reinstallv2.1.0
after runningbundle install/update
, which solves the problem, but is not ideal.Thanks!