Question

Error with firewalls api, shows `Server was unable to give you a response.`

Most firewalls declared on Terraform .hcl file does not get created when using tarraform as in this docs https://www.terraform.io/docs/providers/do/r/firewall.html

Shows error like this,

Error: Error applying plan:

5 error(s) occurred:

* module.default-firewall.digitalocean_firewall.outbound-ntp: 1 error(s) occurred:

* digitalocean_firewall.outbound-ntp: Error creating firewall: POST https://api.digitalocean.com/v2/firewalls: 500 Server was unable to give you a response.
* digitalocean_firewall.gluster_client: 1 error(s) occurred:

* digitalocean_firewall.gluster_client: Error creating firewall: POST https://api.digitalocean.com/v2/firewalls: 500 Server was unable to give you a response.
* module.default-firewall.digitalocean_firewall.outbound-dns: 1 error(s) occurred:

* digitalocean_firewall.outbound-dns: Error creating firewall: POST https://api.digitalocean.com/v2/firewalls: 500 Server was unable to give you a response.
* module.docker-swarm-firewall.digitalocean_firewall.swarm-mode-internal-fw: 1 error(s) occurred:

* digitalocean_firewall.swarm-mode-internal-fw: Error creating firewall: POST https://api.digitalocean.com/v2/firewalls: 500 Server was unable to give you a response.
* module.default-firewall.digitalocean_firewall.outbound-http: 1 error(s) occurred:

* digitalocean_firewall.outbound-http: Error creating firewall: POST https://api.digitalocean.com/v2/firewalls: 500 Server was unable to give you a response.


Submit an answer


This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

Sign In or Sign Up to Answer

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Accepted Answer

I believe terraform was trying to apply firewalls to droplet resources, and dependent resource was not available to handle it at the time. So some of the firewalls were applied randomly on each try. Related issue on github: https://github.com/thojkooi/terraform-digitalocean-docker-swarm-firewall/issues/8

jarland
DigitalOcean Employee
DigitalOcean Employee badge
January 8, 2019

Hey friend,

I believe this uses our firewall product, though it may use software firewall inside of a droplet. The first seems more likely. It may be good to cross post this to GitHub so that the maintainers can review it as well:

https://github.com/terraform-providers/terraform-provider-digitalocean/issues

If you do get an answer elsewhere, please share it here so I can know how to help others who experience the same.

Jarland

Try DigitalOcean for free

Click below to sign up and get $200 of credit to try our products over 60 days!

Sign up

Get our biweekly newsletter

Sign up for Infrastructure as a Newsletter.

Hollie's Hub for Good

Working on improving health and education, reducing inequality, and spurring economic growth? We'd like to help.

Become a contributor

Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.

Welcome to the developer cloud

DigitalOcean makes it simple to launch in the cloud and scale up as you grow — whether you're running one virtual machine or ten thousand.

Learn more
DigitalOcean Cloud Control Panel