• 5

A PHP Error was encountered

Severity: Notice

Message: Undefined index: userid

Filename: views/question.php

Line Number: 191


File: /home/prodcxja/public_html/questions/application/views/question.php
Line: 191
Function: _error_handler

File: /home/prodcxja/public_html/questions/application/controllers/Questions.php
Line: 433
Function: view

File: /home/prodcxja/public_html/questions/index.php
Line: 315
Function: require_once

name Punditsdkoslkdosdkoskdo

Unable to delete a subnet I created in GCP

I have a subnet in GCP, under the default network, called xxx-general

If I try to delete this subnet (as it's no longer required), I get an error:

Failed to delete the subnet. Error: The subnetwork resource 'projects/xxxxx-cloud-network/regions/europe-west2/subnetworks/xxx-general' is already being used by 'projects/xxxxx-cloud-network/regions/europe-west2/addresses/g000001'

Instance g000001 doesn't even exist. I have looked around GCP, at the instances and VPC Network configs etc, but I can't see why this network thinks it's attached to anything.

I have tried creating g000001 and ensuring it's assigned to another subnet, but it doesn't help.

Does anyone know how to delete the subnet?


I believe you have a static reserved internal IP named g000001. I do not believe it is an instance as suggested by ...../addresses/g000001.

Once you delete that IP address, you should get better results.

  • 0
Reply Report
      • 1
    • This is what I assumed but the guide at link doesn't work. 1) It assumes the instance exists and has a static IP. 2) Even if I create the instance (named exactly the same), it creates with an ephemeral (auto) IP.

Sorted it.

Despite the error only pertaining to Region europe-west2, the Zone in which I needed to recreate the instance (in order to re-apply and re-release the static internal IP) does matter.

I was recreating instance g000001 in europe-west2-a - which wasn't getting me anywhere. When I recreated instance g000001 in europe-west2-c, I could change the ephemeral IP to static (at which point I could select the troublesome pre-defined static 10.16.1.x entry from a dropdown).

Once those settings were committed and the instance was created, I went back in and edited the g000001 instance, released the internal static IP, saved it, deleted the instance... and voila, I was then able to delete the subnet.

I can only imagine that when I deleted g000001 originally, GCP doesn't delete/release the reserved IPs in the background.

  • 0
Reply Report

Warm tip !!!

This article is reproduced from Stack Exchange / Stack Overflow, please click

Trending Tags