You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
when implementing a custom http state backend, when user request to take the lock, if the backend decide the user does not have permissions, then it can return a "403 Forbidden", in that case the output the user see uts
│ Error: Error acquiring the state lock
│
│ Error message: HTTP remote state endpoint invalid auth
│
│ Terraform acquires a state lock to protect the state from being written
│ by multiple users at the same time. Please resolve the issue above and try
│ again. For most commands, you can disable locking with the "-lock=false"
│ flag, but this is not recommended.
independent of the body of the response, robing the http backend server the opportunity to provide information to the user on what to do.
Attempted Solutions
no could not find one
Proposal
I'm happy to write this, but my solution would be to on the backend code and probbaly other special casesto read the body of the response, and if the body its JSON with the field "errmsg" then display that message... if not, display the original error.
example... if the response body its:
{
"msg": "You dont have permission to access this state file, please request it through http://bar.biz/request/tf"
}
then the display should look like
│ Error: Error acquiring the state lock
│
│ Error message: You dont have permission to access this state file, please request it through http://bar.biz/request/tf
│
│ Terraform acquires a state lock to protect the state from being written
│ by multiple users at the same time. Please resolve the issue above and try
│ again. For most commands, you can disable locking with the "-lock=false"
│ flag, but this is not recommended.
References
none that i could find
The text was updated successfully, but these errors were encountered:
Terraform Version
Use Cases
when implementing a custom http state backend, when user request to take the lock, if the backend decide the user does not have permissions, then it can return a "403 Forbidden", in that case the output the user see uts
independent of the body of the response, robing the http backend server the opportunity to provide information to the user on what to do.
Attempted Solutions
no could not find one
Proposal
I'm happy to write this, but my solution would be to on the backend code and probbaly other special casesto read the body of the response, and if the body its JSON with the field "errmsg" then display that message... if not, display the original error.
example... if the response body its:
then the display should look like
│ Error: Error acquiring the state lock
│
│ Error message: You dont have permission to access this state file, please request it through http://bar.biz/request/tf
│
│ Terraform acquires a state lock to protect the state from being written
│ by multiple users at the same time. Please resolve the issue above and try
│ again. For most commands, you can disable locking with the "-lock=false"
│ flag, but this is not recommended.
References
none that i could find
The text was updated successfully, but these errors were encountered: