Description
It's pretty easy to upload a template via the Web UI that fails immediately, e.g. by tarring the parent directory of a template instead of tarring it's contents.
Currently, there's no feedback if this happens, instead the page loads indefinitely:
Opening the dev console reveals the provisioner logs mentioning the error are being received.
The same template uploaded via the CLI streams the provisioner logs, and includes an error message:
$ tar c oops-parent-dir/ | coder templates push --directory - mytemplate
=== ✘ Queued [0ms]
==> ⧗ Running
==> ⧗ Running
=== ✘ Running [2ms]
==> ⧗ Setting up
=== ✘ Setting up [0ms]
==> ⧗ Parsing template parameters
=== ✘ Parsing template parameters [2ms]
==> ⧗ Detecting persistent resources
2024-10-30 13:33:27.227Z Error: No configuration files
2024-10-30 13:33:27.227Z Plan requires configuration to be present. Planning without a configuration would mark everything for destruction, which is normally not what is desired. If you would like to destroy everything, run plan with the -destroy option. Otherwise, create a Terraform configuration file (.tf file) and try again.
=== ✘ Detecting persistent resources [93ms]
==> ⧗ Cleaning Up
=== ✘ Cleaning Up [4ms]
=== ✘ Cleaning Up [2222ms]
Encountered an error running "coder templates push", see "coder templates push --help" for more information
error: template import provision for start: terraform plan: exit status 1