Terraform Error Cannot get property 'output'

Hello,
this is my first time trying Morpheus. I’ve been optimist about it, but getting stuck with what seems to be a deeper technical issue on my first use case. I’m using the Community Edition to attempt to run a Terraform for AWS. I keep getting an error saying:

prepare instance error: Cannot get property 'output' on null object

At first I tried connecting to my github repository, but I’ve boiled everything down to a barebones, local TF file and get the same error. I followed Morpheus’ documentation and enabled debugging which showed this error, but it’s not helpful to me.

2023-12-22_19:10:56.72431 ''[2023-12-22 19:10:56,838] [http-nio-127.0.0.1-8080-exec-9] ERROR c.m.i.TerraformService - executeTerraformCommand error: groovy.lang.MissingMethodException: No signature of method: com.bertramlabs.plugins.hcl4j.RuntimeSymbols.VariableTree.readLines() is applicable for argument types: () values: []
2023-12-22_19:10:56.83870 Possible solutions: getLine() 
2023-12-22_19:10:56.83871 'groovy.lang.MissingMethodException: No signature of method: com.bertramlabs.plugins.hcl4j.RuntimeSymbols.VariableTree.readLines() is applicable for argument types: () values: []

What I did was create a spec template, Instance Type, Instance Layout and now I’m trying to provision it as an instance.

createInstanceError

Thank you for any pointers!

Do you have output defined in your TF? Are you able to share any of the code (minus credentials please).

@rboyd Any ideas?

Thanks for your reply. I’ve tried boiling down the TF code as much as I can. Same error. Here are some screenshots of the config spec and Layout. Under Admin, Settings, Provisioning I have the terraform settings set to Auto with version 1.6.6 defined. I found the terraform binary on the Linux server Morpheus is running, so I know the terraform binary is there. It’s also pulling in my variables from vartiables.tf when I tried with a variable.tf file. It’s a fresh Morpheus install, V. 6.2.4.

I do not have any outputs defined.

Does your layout have any other spec templates defined to it?

I did a quick test with a blank tf similar to your and was successful.

Layout

Spec template:

Success:

I also tested a number of different ways and cant reproduce this error with the same simple TF code above.

Can you also test with creating an App Blueprint (instead of an instance type) with the same spec and then creating the app from Provisioning - Apps. When deploying you will have some additional options under App Settings for backend type. The default is internal and the other option is local. If you test with each of these options on separate runs do you see the same results?

I was able to create a TF App Blueprint with that simple, empty code. Next I created a local TF file as a spec template to create a security group in AWS with a TFVARS with the access key info. That worked as an App Blueprint and the security group successfully provisioned in my AWS account. However when I try using the same spec template to create an instance (Instance Type + Layout) I get the same “error prepare instance error: Cannot get property ‘output’ on null object.”
I’ve tried creating new Instance Types and Layouts, but that didn’t help. This is just a sandbox instance I wanted to try Morpheus with. Next week I’ll try building a fresh instance of Morpheus on a new server. Thank you for your suggestions.

I figured out what I did wrong. Under my AWS Cloud, I created a profile. I automatically assumed it was an AWS-Terraform profile and formatted it like a credentials file. I understand now that’s not exactly what that does. When I deleted my profile everything works well now. Thank you for testing on your end.