Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

failed oci_load_balancer_listener creation has successful state. #430

Closed
nshttpd opened this issue Jan 18, 2018 · 5 comments
Closed

failed oci_load_balancer_listener creation has successful state. #430

nshttpd opened this issue Jan 18, 2018 · 5 comments

Comments

@nshttpd
Copy link

nshttpd commented Jan 18, 2018

Terraform Version

Terraform v0.11.1
+ provider.oci v2.0.6

Description:

attempting to create a oci_load_balancer_listener, oci_load_balancer_backend(s), oci_load_balancer_backendset. The backend and backendset were successful, but the listener failed with :

Error: Error applying plan:

1 error(s) occurred:

* oci_load_balancer_listener.em_secure_upload: 1 error(s) occurred:

* oci_load_balancer_listener.em_secure_upload: Resource creation failed, state FAILED

In the state file it's stored with the FAILED state in there :

                "oci_load_balancer_listener.em_secure_upload": {
                    "type": "oci_load_balancer_listener",
                    "depends_on": [
                        "data.terraform_remote_state.shared"
                    ],
                    "primary": {
                        "id": "ocid1.loadbalancerworkrequest.oc1.phx.ninja",
                        "attributes": {
                            "default_backend_set_name": "secure-backend",
                            "id": "ocid1.loadbalancerworkrequest.oc1.phx.ninja",
                            "load_balancer_id": "ocid1.loadbalancer.oc1.phx.lbinphx",
                            "name": secure-upload",
                            "port": "4888",
                            "protocol": "TCP",
                            "state": "FAILED"
                        },
                        "meta": {},
                        "tainted": false
                    },
                    "deposed": [],
                    "provider": "provider.oci"
                },

I would think that a FAILED work request shouldn't be stored as a successful state modification. If one taints the item to try and get it to be created :

Error: Error applying plan:

1 error(s) occurred:

* oci_load_balancer_listener.em_secure_upload (destroy): 1 error(s) occurred:

* oci_load_balancer_listener.em_secure_upload: unexpected state 'FAILED', wanted target 'SUCCEEDED_WORK_REQUEST, SUCCEEDED'. last error: %!s(<nil>)

I've had to manually edit the .tfstate file and remove the FAILED item to get attempt the apply again.

@kohashim
Copy link
Member

Thank you for the report. This is a known issue originally reported at #414. We are investigating. Thank you for your patience.

kohashim added a commit that referenced this issue Jan 23, 2018
…k request

eventually fails.

This will partially solve #414 and #430.  The ideal solution is to automatically
retry on work request failures.
@kohashim
Copy link
Member

A mitigation has been made and landed in the master branch: 66f1065, which removes at least the necessity of removing the failed resources from the state file when destroying. The next release will include this fix. Otherwise you can clone the master branch to try it out.

The ideal solution is still to retry on the failure of a work request in a load balancer resource, which is in our backlog.

@nshttpd
Copy link
Author

nshttpd commented Jan 26, 2018

Just built from Master and tested this out since I had a backend set work request fail on creation. It worked as expected to properly handle FAILED states.

@kohashim
Copy link
Member

kohashim commented Feb 5, 2018

Glad to hear. Closing.

@kohashim kohashim closed this as completed Feb 5, 2018
@codycushing
Copy link
Contributor

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants