25

I am spending the past 3 hours of finding ways to release Google Compute Engine API In-use IP addresses as I have 8/8 in use. I googled, read the manuals but there is no way of releasing it anywhere in the console. I am trying to setup a Rails app. When compiling it got stuck with errors as I didn't provide the correct socket for DB (which doesn't really matter here). When getting stuck I released with hitting Ctrl+C in my terminal and that I assume is the issue. - I am brand new to Google Cloud, hence I can only assume.

The error message:

ERROR: (gcloud.app.deploy) Error Response: [400] The following quotas were exceeded: IN_USE_ADDRESSES (quota: 8, used: 8 + needed: 2).
https://appengine.googleapis.com/v1/apps/workepics/services/default/versions?alt=json

Here visualised in the console: enter image description here

When I click within the console on compute engines I am only being asked if I want to create one. There is no other option.

Any help would be appreciated! Thank you.

Georg Keferböck
  • 353
  • 1
  • 3
  • 8
  • https://cloud.google.com/compute/quotas "If you expect a notable upcoming increase in usage, you can proactively request quota adjustments from the Quotas page in the Cloud Platform Console." – ceejayoz Aug 18 '17 at 20:20
  • 1
    @ceejayoz I do not want an increase in quotas. I basically just want to find a way to release the current In-use IP addresses. I compiled my application a few times and it appears with each compile a new IP address was added. – Georg Keferböck Aug 18 '17 at 21:05
  • 1
    See https://stackoverflow.com/questions/37381694/google-app-engine-how-to-correctly-deploy-an-app, then. Your old deploys are still running (and costing you money). You'll want to terminate them. – ceejayoz Aug 18 '17 at 21:13
  • 1
    Lifesaver! @ceejayoz – Georg Keferböck Aug 18 '17 at 21:18
  • Glad I could help. – ceejayoz Aug 18 '17 at 21:26
  • 1
    @ceejayoz can you please add these two links into an answer so I can give you the points: https://cloud.google.com/sdk/gcloud/reference/app/versions/list https://cloud.google.com/sdk/gcloud/reference/app/versions/stop These links explain how to stop and delete Versions. I wasn't familiar with the concept and therefore didn't know. Perhaps someone else finds themselves in a similar situation. Thanks – Georg Keferböck Aug 18 '17 at 21:28
  • Done and cheers! – ceejayoz Aug 18 '17 at 21:31

5 Answers5

13

I can't take full credit for this answer - I just remembered this one - but a deployment to Google's cloud leaves the old deployment in place (and thus using an IP and your hard-earned money) indefinitely.

Deployments can be triggered with --stop-previous-version to prevent this behavior, and you can use list and stop to find and remove the old deployments so they no longer use resources.

ceejayoz
  • 32,469
  • 7
  • 81
  • 105
  • 1
    Ran this one-liner to clean up my old deployments: `gcloud app versions list | grep -v SERVING | awk '{print $2}' | tail -n +1 | xargs -I {} gcloud app versions delete {}` – user2688473 May 01 '18 at 06:34
5

I don't even have an app deployed, just a Kubernetes cluster, so none of the suggestions helped for me. I kept deleting the cluster then recreating.

Found this page that lists the external IPs in use, which seems to be the root of the problem. Should work no matter what the reason is for your used-up IP addresses: https://console.cloud.google.com/networking/addresses/list

For my case of load balancers being the problem: I deleted all my clusters and still saw addresses in use. Then I found this page that lets me delete the load balancer IP mappings: https://console.cloud.google.com/net-services/loadbalancing/advanced/forwardingRules/list Recreated the clusters and services, and everything works fine now.

I don't know why deleting the cluster didn't free the addresses this one time. Maybe because I cancelled in the middle of one cluster's creation.

sudo
  • 265
  • 3
  • 10
  • 1
    Yes! Thanks so much--load balancers for me as well. I was very sloppy about my cluster/resource creation, so I'm guessing that was the cause. This should be the accepted answer since it's the most general solution. – Michael Hays May 10 '18 at 07:31
  • If I could only reproduce this, I'd submit a bug report because it does seem like a bug. – sudo May 10 '18 at 20:28
3

I got the same error, but the reason was that my build was pointing to a wrong project(gcloud config list). I had configured cloud SQL in my code but it was in a different project then the app engine where I was trying to deploy. The error shown was exactly as mentioned in the above issue.

Neelima
  • 31
  • 1
1

For this issue, while creating the VM do not provide the external IP -

  1. Click on Management, Security, Disks, Networking, Sole Tenancy
  2. Click on Network
  3. Click on Network Interface
  4. In External IP - give None

This worked for me

kenlukas
  • 2,886
  • 2
  • 14
  • 25
sahithya
  • 11
  • 1
0

I had the problem on kubernetes when I wanted to add a new node. Solved like this:

  • kubectl get svc
  • Delete old services with kubectl delete svc [service-name]

Hope this helps anyone else.

Tobias Ernst
  • 103
  • 2