the string provided in credentials is neither valid json nor a valid file path
smmnazar opened this issue · 1 comments
Hi Team,
I am using terraform task to run terraform init command in gcp provider. Init, Validate and plan commands are working fine in build pipeline but I am getting below error in release pipeline for terraform init command.
2021-12-29T10:38:08.3302055Z �[0m�[1mInitializing the backend...�[0m
2021-12-29T10:38:08.3306013Z �[0m�[0m�[1mBackend configuration changed!�[0m
2021-12-29T10:38:08.3306934Z
2021-12-29T10:38:08.3307884Z Terraform has detected that the configuration specified for the backend
2021-12-29T10:38:08.3308985Z has changed. Terraform will now check for existing state in the backends.
2021-12-29T10:38:08.3310142Z �[0m
2021-12-29T10:38:08.3362452Z �[31m�[31m╷�[0m�[0m
2021-12-29T10:38:08.3363871Z �[31m│�[0m �[0m�[1m�[31mError: �[0m�[0m�[1mthe string provided in credentials is neither valid json nor a valid file path�[0m
2021-12-29T10:38:08.3364800Z �[31m│�[0m �[0m
2021-12-29T10:38:08.3365630Z �[31m│�[0m �[0m�[0m
2021-12-29T10:38:08.3366382Z �[31m╵�[0m�[0m
2021-12-29T10:38:08.3399599Z �[0m�[0m
2021-12-29T10:38:08.3515114Z ##[error]Error: The process '/usr/local/bin/terraform' failed with exit code 1
2021-12-29T10:38:08.3570461Z ##[section]Finishing: Terraform Init
Please help what is wrong in release pipeline.?
Regards,
Mohamed Nazar
The issue has been resolved after I have added the steps to delete .terraform folder and .terraform.lock.hcl file in the artifact. Once after this deletion I am able to see terraform plan and apply works fine.