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

Internal DO API failures lead to non-informative error messages #193

Open
y8 opened this issue Nov 19, 2021 · 0 comments
Open

Internal DO API failures lead to non-informative error messages #193

y8 opened this issue Nov 19, 2021 · 0 comments
Labels
bug Something isn't working

Comments

@y8
Copy link

y8 commented Nov 19, 2021

SUMMARY

For last few days I was lucky to face failures in multiple components somewhere inside DO infra: API were throwing 500's here and there.

As a result, I've seen few places where errors are not handled well or information provided by error handler is not clear about what exactly happened.

STEPS TO REPRODUCE

At least following actions failed

- name: Create volume
  community.digitalocean.digital_ocean_block_storage:
    state: present
    command: create
    volume_name: "test-name-vol"
    region: "fra1"
    block_size: "10"
- name: Create firewall rule
  community.digitalocean.digital_ocean_firewall:
    name: fw-test-rule
    state: present
    outbound_rules: []
    inbound_rules:
      - protocol: "tcp"
        ports: "20000-20100"
        sources:
          tags: ["group-foobar"]
    tags: ["fw-rules"]

As a result only "Internal Server Error" were printed, giving no details what exactly happened and at which stage.

Seems like send method is a good place to handle failures and rate-limit related errors, to ensure consistent error handling:

def send(self, method, path, data=None):
url = self._url_builder(path)
data = self.module.jsonify(data)
if method == "DELETE":
if data == "null":
data = None
resp, info = fetch_url(
self.module,
url,
data=data,
headers=self.headers,
method=method,
timeout=self.timeout,
)
return Response(resp, info)

Most likely, DO support will be involved and they would ask to provide following information:

  1. Request URI, params and body
  2. Response code, headers and body

So it would be great to have this info in error message, along with link to DO status page and support center.

Thanks!

@mamercad mamercad added the bug Something isn't working label Nov 20, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants