Azure DevOps Release pipeline Terraform Init task failed with "The backend configuration argument" error -
cvanama opened this issue · 6 comments
Hi Team,
Suddenly from yesterday evening we are seeing the azure devops release pipeline failed in the Terraform Init task with below error.
As of wednesday all the pipelines are working good, and every thing broke with the below error. Is this something with the latest version of terraform ? Could you please help on this.
Please find the below errors from the log:
2021-04-16T13:29:42.5195843Z ##[section]Starting: terraform init
2021-04-16T13:29:42.5468729Z ==============================================================================
2021-04-16T13:29:42.5469119Z Task : Terraform CLI
2021-04-16T13:29:42.5469402Z Description : Execute terraform cli commands
2021-04-16T13:29:42.5469695Z Version : 0.6.8
2021-04-16T13:29:42.5469928Z Author : Charles Zipp
2021-04-16T13:29:42.5470183Z Help :
2021-04-16T13:29:42.5470655Z ==============================================================================
2021-04-16T13:29:43.6001643Z [command]C:\hostedtoolcache\windows\terraform\0.15.0\x64\terraform.exe version
2021-04-16T13:29:43.8781691Z Terraform v0.15.0
2021-04-16T13:29:43.8782409Z on windows_amd64
2021-04-16T13:29:43.8970060Z
2021-04-16T13:29:43.9305944Z [command]C:\hostedtoolcache\windows\terraform\0.15.0\x64\terraform.exe init -backend-config=storage_account_name=prodxxxx -backend-config=container_name=terraformstate -backend-config=key=Pxxxxsor -backend-config=resource_group_name=xx-xxx-rg -backend-config=arm_subscription_id=xxxx -backend-config=arm_tenant_id=*** -backend-config=arm_client_id=*** -backend-config=arm_client_secret=*** -var-file=prod.tfvars
2021-04-16T13:29:44.2189925Z
2021-04-16T13:29:44.2191135Z �[0m�[1mInitializing the backend...�[0m
2021-04-16T13:29:44.2208473Z �[31m�[31m╷�[0m�[0m
2021-04-16T13:29:44.2209240Z �[31m│�[0m �[0m�[1m�[31mError: �[0m�[0m�[1mInvalid backend configuration argument�[0m
2021-04-16T13:29:44.2210371Z �[31m│�[0m �[0m
2021-04-16T13:29:44.2210870Z �[31m│�[0m �[0m�[0mThe backend configuration argument "arm_subscription_id" given on the
2021-04-16T13:29:44.2211423Z �[31m│�[0m �[0mcommand line is not expected for the selected backend type.
2021-04-16T13:29:44.2211828Z �[31m╵�[0m�[0m
2021-04-16T13:29:44.2212098Z �[0m�[0m
2021-04-16T13:29:44.2212402Z �[31m�[31m╷�[0m�[0m
2021-04-16T13:29:44.2212884Z �[31m│�[0m �[0m�[1m�[31mError: �[0m�[0m�[1mInvalid backend configuration argument�[0m
2021-04-16T13:29:44.2213326Z �[31m│�[0m �[0m
2021-04-16T13:29:44.2214271Z �[31m│�[0m �[0m�[0mThe backend configuration argument "arm_tenant_id" given on the command
2021-04-16T13:29:44.2214922Z �[31m│�[0m �[0mline is not expected for the selected backend type.
2021-04-16T13:29:44.2215300Z �[31m╵�[0m�[0m
2021-04-16T13:29:44.2215589Z �[0m�[0m
2021-04-16T13:29:44.2215885Z �[31m�[31m╷�[0m�[0m
2021-04-16T13:29:44.2216369Z �[31m│�[0m �[0m�[1m�[31mError: �[0m�[0m�[1mInvalid backend configuration argument�[0m
2021-04-16T13:29:44.2216805Z �[31m│�[0m �[0m
2021-04-16T13:29:44.2217273Z �[31m│�[0m �[0m�[0mThe backend configuration argument "arm_client_id" given on the command
2021-04-16T13:29:44.2217796Z �[31m│�[0m �[0mline is not expected for the selected backend type.
2021-04-16T13:29:44.2218181Z �[31m╵�[0m�[0m
2021-04-16T13:29:44.2218448Z �[0m�[0m
2021-04-16T13:29:44.2218749Z �[31m�[31m╷�[0m�[0m
2021-04-16T13:29:44.2219361Z �[31m│�[0m �[0m�[1m�[31mError: �[0m�[0m�[1mInvalid backend configuration argument�[0m
2021-04-16T13:29:44.2219801Z �[31m│�[0m �[0m
2021-04-16T13:29:44.2220281Z �[31m│�[0m �[0m�[0mThe backend configuration argument "arm_client_secret" given on the command
2021-04-16T13:29:44.2220829Z �[31m│�[0m �[0mline is not expected for the selected backend type.
2021-04-16T13:29:44.2221198Z �[31m╵�[0m�[0m
2021-04-16T13:29:44.2221480Z �[0m�[0m
2021-04-16T13:29:44.2444897Z
2021-04-16T13:29:44.2665139Z ##[error]Terraform command 'init' failed with exit code '1'.
2021-04-16T13:29:44.2687314Z ##[error]�[31m�[31m╷�[0m�[0m
�[31m│�[0m �[0m�[1m�[31mError: �[0m�[0m�[1mInvalid backend configuration argument�[0m
�[31m│�[0m �[0m
�[31m│�[0m �[0m�[0mThe backend configuration argument "arm_subscription_id" given on the
�[31m│�[0m �[0mcommand line is not expected for the selected backend type.
�[31m╵�[0m�[0m
�[0m�[0m
�[31m�[31m╷�[0m�[0m
�[31m│�[0m �[0m�[1m�[31mError: �[0m�[0m�[1mInvalid backend configuration argument�[0m
�[31m│�[0m �[0m
�[31m│�[0m �[0m�[0mThe backend configuration argument "arm_tenant_id" given on the command
�[31m│�[0m �[0mline is not expected for the selected backend type.
�[31m╵�[0m�[0m
�[0m�[0m
�[31m�[31m╷�[0m�[0m
�[31m│�[0m �[0m�[1m�[31mError: �[0m�[0m�[1mInvalid backend configuration argument�[0m
�[31m│�[0m �[0m
�[31m│�[0m �[0m�[0mThe backend configuration argument "arm_client_id" given on the command
�[31m│�[0m �[0mline is not expected for the selected backend type.
�[31m╵�[0m�[0m
�[0m�[0m
�[31m�[31m╷�[0m�[0m
�[31m│�[0m �[0m�[1m�[31mError: �[0m�[0m�[1mInvalid backend configuration argument�[0m
�[31m│�[0m �[0m
�[31m│�[0m �[0m�[0mThe backend configuration argument "arm_client_secret" given on the command
�[31m│�[0m �[0mline is not expected for the selected backend type.
�[31m╵�[0m�[0m
�[0m�[0m
2021-04-16T13:29:45.0445001Z ##[section]Finishing: terraform init
This is currently blocked on on reviewer at #889, so I'd advise you ping the relevant assignee there to bump the pull, see relevant workaround there too
Duplicate of #942
Can confirm that even with the latest Task (TerraformTaskV2@2) this still is the case. It seems the AzureRM backend is not working, Terraform believes it is a local backend.
Makes the Task somewhat useless as I have to setup all the configuration for the backend but then it cannot even use it.
I may as well just script the CLI calls to Terraform CLI myself.
@cvanama, Not sure if you use the correct task.. The log file you supplied is not for the same extension
@OliverRC, If you can provide a log output and perhaps your terraform file (you can xx out any secrets) it would be great for me to look into you issue
closing this task since PR is done. Please reopen if you feel it is incorrect and add more details.