Deploy Laravel app on google app engine! INVALID_ARGUMENT: Network 'default' does not exist

1,157 views
Skip to first unread message

Ben Abdesslem Sarah

unread,
Mar 13, 2020, 11:18:38 AM3/13/20
to Google App Engine
Hi,

I'm triing to deploy a Laravel app on google app engine! 
When I run gloud app deploy in the google sdk command line, I'm getting this error : 
(gcloud.app.deploy) INVALID_ARGUMENT: Network 'default' does not exist

This is my app.yaml file :

runtimephp  
envflex  

runtime_config:
 document_rootpublic 

skip_files:
 - .env 

env_variables:
 APP_ENVlocal  
 APP_DEBUG : true 
 APP_KEYbase64:******************************/***= 
 APP_STORAGE/tmp
 VIEW_COMPILED_PATH/tmp

 CACHE_DRIVERdatabase
 SESSION_DRIVERdatabase 
 APP_LOGdaily
 APP_TIMEZONEUTC 
 DB_CONNECTIONmysql
 DB_HOSTlocalhost
 DB_PORT3306
 DB_DATABASE*************
 DB_USERNAMEroot
 DB_PASSWORD*************
 DB_SOCKET/cloudsql/******************
 
 QUEUE_DRIVERdatabase 

 GOOGLE_VISION_PROJECT_ID : *************
beta_settings:
   cloud_sql_instances****************************
   

George (Cloud Platform Support)

unread,
Mar 13, 2020, 12:48:55 PM3/13/20
to Google App Engine
Hello Ben, 

This is usually indicative of a situation characterized by a missing default network. Your default network could have been deleted at a certain moment in time. Recreating the default network should address the issue, or specifying your actual network in app.yaml:

network:
  instance_tag: TAG_NAME
  name: NETWORK_NAME
  subnetwork_name: SUBNETWORK_NAME

You may refer to the "app.yaml Configuration File" documentation page for related detail. 

Ben Abdesslem Sarah

unread,
Mar 13, 2020, 2:20:40 PM3/13/20
to Google App Engine
I already tried with adding this to my app.yaml file but it's not working.
I thing I don't have the right values for the TAG_NAME and the NETWORK_NAME.
Do you know what value should I put there ?
Thanks in advance


network:
  instance_tag
: TAG_NAME
  name
: NETWORK_NAME
  subnetwork_name
: SUBNETWORK_NAME

methkal

unread,
Mar 16, 2020, 7:36:35 AM3/16/20
to Google App Engine
instane_tag can be anything of your choice. you can use for example "aef-instance". this tag is assigned to each instance of the service upon its creation.
The network name has to be the short name not the resource path  (for example, mynetwork rather than https://www.googleapis.com/compute/v1/projects/my-project/global/networks/mynetwork).
For subnetwork_name use also the short name like subnetwork1 rather than https://www.googleapis.com/compute/v1/projects/my-project/global/networks/default/subnetworks/subnetwork1


if that doesn't work. can you post the error that you receive after these modifications?

Ben Abdesslem Sarah

unread,
Mar 16, 2020, 5:07:09 PM3/16/20
to google-a...@googlegroups.com
Hello,

This doesn't work. I don't know what to put there on the instance_tag.
And I have read so many times the Google documentation about Network settings.

C:\Users\someproject>gcloud app deploy
ERROR: (gcloud.app.deploy) An error occurred while parsing file: [C:\Users\someproject\app.yaml]
  in "C:\Users\someproject\app.yaml", line 42, column 17

The line 42 is instance_tag: aef-instance

 network:
  instance_tagaef-instance
  namemynetwork
  subnetwork_namesubnetwork1

If someone could help me, it will be really nice. Thank you in advance !  

--
You received this message because you are subscribed to the Google Groups "Google App Engine" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-appengi...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-appengine/16fbc448-a895-4e94-8a08-ec913b1181e2%40googlegroups.com.

Mua Rachmann

unread,
Mar 16, 2020, 6:29:18 PM3/16/20
to google-a...@googlegroups.com
The error indicates your yaml file is not properly formatted.
Try checking your indentation somewhere. Maybe something is not well aligned or given more spacing somewhere.
Generally it is two(2) spacing something of the sort. Let me know if the error still persists. For instance take a look at your

beta_settings:
   cloud_sql_instances****************************

It is way much indented than the others

Best,
Mua


Ben Abdesslem Sarah

unread,
Mar 18, 2020, 9:35:03 AM3/18/20
to google-a...@googlegroups.com
Hello,

Thank you, you're right for the identation.
But now I'm getting another error about the network. 
At this line in app.yaml : "namemynetwork "

Here is the error message:
Finished Step #1
PUSH
DONE
------------------------------------------------------------------------------------------------------------------------

ERROR: (gcloud.app.deploy) INVALID_ARGUMENT: Network 'mynetwork' does not exist

And that's my app.yaml file :

runtimephp  
envflex  

runtime_config:
 document_rootpublic   

skip_files:
 - .env 

network:
  instance_tagaef-instance
  namemynetwork
  subnetwork_namesubnetwork1

env_variables:
 APP_ENVlocal   
 APP_DEBUG : true 
 APP_KEYbase64:********************************/iOQ= 
 APP_STORAGE/tmp
 VIEW_COMPILED_PATH/tmp 
 
 CACHE_DRIVERdatabase
 SESSION_DRIVERdatabase 
 APP_LOGdaily
 APP_TIMEZONEUTC 
 DB_CONNECTIONmysql
 DB_HOSTlocalhost
 DB_PORT3306
 DB_DATABASE**************
 DB_USERNAMEroot
 DB_PASSWORD******************
 DB_SOCKET/cloudsql/*****************:europe-west1:*********
 
 QUEUE_DRIVERdatabase 
 MAIL_MAILERsmtp
 MAIL_HOSTsmtp.mailtrap.io
 MAIL_PORT2525
 MAIL_USERNAMEnull
 MAIL_PASSWORDnull

 GOOGLE_VISION_PROJECT_ID : *********************




Thanks in advance !!!

Mua Rachmann

unread,
Mar 18, 2020, 10:31:54 AM3/18/20
to google-a...@googlegroups.com
Hi,

You need to have added the tags before you can use them in your app.yaml file. Refer to this
https://cloud.google.com/vpc/docs/add-remove-network-tags you can create the tags via the console or via
gcloud command as follows

gcloud compute instances add-tags [INSTANCE-NAME]  --zone [ZONE]  --tags [TAGS]

Only then you can use them in your app.yaml file. As of now that error is due to no network tags being
created prior to deployment. I hope this helps.

Cheers,
Mua



--

MUA N. LAURENT
: Lead Software Engineer

Akwa, Douala,CM 00237 | 174 Royal Rd, Cape Town, WC 7405, SA
Phone: (237) 670-518-086

 

Pierre-Yves (Google Cloud Support)

unread,
Mar 18, 2020, 12:32:51 PM3/18/20
to Google App Engine
As previously mentioned, the "aef-instance" tag was probably not added prior to being referenced in the "app.yaml" file. Here is the documentation [1] on how to properly set the network settings in the configuration file, with an explanation on the "instance_tag" and "name" option. Here is how [2] to add the network tags that will subsequently be referenced.

[1] https://cloud.google.com/appengine/docs/flexible/nodejs/reference/app-yaml#network_settings
Le lun. 16 mars 2020 à 12:36, 'methkal' via Google App Engine <google-appengine@googlegroups.com> a écrit :
instane_tag can be anything of your choice. you can use for example "aef-instance". this tag is assigned to each instance of the service upon its creation.
The network name has to be the short name not the resource path  (for example, mynetwork rather than https://www.googleapis.com/compute/v1/projects/my-project/global/networks/mynetwork).
For subnetwork_name use also the short name like subnetwork1 rather than https://www.googleapis.com/compute/v1/projects/my-project/global/networks/default/subnetworks/subnetwork1


if that doesn't work. can you post the error that you receive after these modifications?

--
You received this message because you are subscribed to the Google Groups "Google App Engine" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-appengine+unsubscribe@googlegroups.com.

--
You received this message because you are subscribed to the Google Groups "Google App Engine" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-appengine+unsubscribe@googlegroups.com.

--
You received this message because you are subscribed to the Google Groups "Google App Engine" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-appengine+unsubscribe@googlegroups.com.

Ben Abdesslem Sarah

unread,
Mar 19, 2020, 2:41:17 PM3/19/20
to google-a...@googlegroups.com
Hello,

I can't create that tag and still don't know why ?

C:\someproject>gcloud compute instances add-tags aef-instance --zone europe-west1-b --tags mynetwork
ERROR: (gcloud.compute.instances.add-tags) Could not fetch resource:
 - The resource 'projects/*************/zones/europe-west1-b/instances/aef-instance' was not found

Do I need to create a VM instance first or a firewall-rules before ?
Like that : gcloud compute firewall-rules create

 Thank you so much for your help !!
Sarah

To unsubscribe from this group and stop receiving emails from it, send an email to google-appengi...@googlegroups.com.

--
You received this message because you are subscribed to the Google Groups "Google App Engine" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-appengi...@googlegroups.com.

--
You received this message because you are subscribed to the Google Groups "Google App Engine" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-appengi...@googlegroups.com.

--
You received this message because you are subscribed to the Google Groups "Google App Engine" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-appengi...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-appengine/376a9855-fea0-433b-a4c1-dc100810654a%40googlegroups.com.

Pierre-Yves (Google Cloud Support)

unread,
Mar 20, 2020, 9:14:54 AM3/20/20
to Google App Engine
Hi Sarah,

Under the App Engine flex environment, the app is served by underlying Compute Engine (GCE) instances already by default. You can read more about this here [1]. There is no need to create new ones. When using the “gcloud compute instances add-tags” command, the ‘instance-name’ should be the actual name of the existing GCE instance, instead of the tag you are assigning it. If you want the “instance_tag” to be set as ‘aef-instance’, the complete command should look like:

gcloud compute instances add-tags EXISTING_GCE_INSTANCE_NAME --zone europe-west1-b --tags aef-instance

You can read more about this command here [2]. Once that instance has been tagged properly, you can associate this newly tagged instance with the network name in the “network” section of the ‘app.yaml’ file. In order to get the existing GCE instance name, you may look at the bottom of the page from the Instances page [3] of your project in the Console. Make sure the correct service is selected in the dropdown menu at the top.


On Thursday, March 19, 2020 at 2:41:17 PM UTC-4, Ben Abdesslem Sarah wrote:
Hello,

I can't create that tag and still don't know why ?

C:\someproject>gcloud compute instances add-tags aef-instance --zone europe-west1-b --tags mynetwork
ERROR: (gcloud.compute.instances.add-tags) Could not fetch resource:
 - The resource 'projects/*************/zones/europe-west1-b/instances/aef-instance' was not found

Do I need to create a VM instance first or a firewall-rules before ?
Like that : gcloud compute firewall-rules create

 Thank you so much for your help !!
Sarah
To unsubscribe from this group and stop receiving emails from it, send an email to google-appengine+unsubscribe@googlegroups.com.

--
You received this message because you are subscribed to the Google Groups "Google App Engine" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-appengine+unsubscribe@googlegroups.com.

--
You received this message because you are subscribed to the Google Groups "Google App Engine" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-appengine+unsubscribe@googlegroups.com.

--
You received this message because you are subscribed to the Google Groups "Google App Engine" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-appengine+unsubscribe@googlegroups.com.

Ben Abdesslem Sarah

unread,
Mar 23, 2020, 8:00:51 AM3/23/20
to google-a...@googlegroups.com
Thank you so much for your help!
But I still don't know how to find the  EXISTING_GCE_INSTANCE_NAME ?
Where can I find this information?
I tried the project name and the sql instance name ! 
And of course, it's not working

Sarah

Le ven. 20 mars 2020 à 14:15, 'Pierre-Yves (Google Cloud Support)' via Google App Engine <google-a...@googlegroups.com> a écrit :
Hi Sarah,

Under the App Engine flex environment, the app is served by underlying Compute Engine (GCE) instances already by default. You can read more about this here [1]. There is no need to create new ones. When using the “gcloud compute instances add-tags” command, the ‘instance-name’ should be the actual name of the existing GCE instance, instead of the tag you are assigning it. If you want the “instance_tag” to be set as ‘aef-instance’, the complete command should look like:

gcloud compute instances add-tags EXISTING_GCE_INSTANCE_NAME --zone europe-west1-b --tags aef-instance

You can read more about this command here [2]. Once that instance has been tagged properly, you can associate this newly tagged instance with the network name in the “network” section of the ‘app.yaml’ file. In order to get the existing GCE instance name, you may look at the bottom of the page from the Instances page [3] of your project in the Console. Make sure the correct service is selected in the dropdown menu at the top.


On Thursday, March 19, 2020 at 2:41:17 PM UTC-4, Ben Abdesslem Sarah wrote:
Hello,

I can't create that tag and still don't know why ?

C:\someproject>gcloud compute instances add-tags aef-instance --zone europe-west1-b --tags mynetwork
ERROR: (gcloud.compute.instances.add-tags) Could not fetch resource:
 - The resource 'projects/*************/zones/europe-west1-b/instances/aef-instance' was not found

Do I need to create a VM instance first or a firewall-rules before ?
Like that : gcloud compute firewall-rules create

 Thank you so much for your help !!
Sarah

To unsubscribe from this group and stop receiving emails from it, send an email to google-appengi...@googlegroups.com.

--
You received this message because you are subscribed to the Google Groups "Google App Engine" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-appengi...@googlegroups.com.

--
You received this message because you are subscribed to the Google Groups "Google App Engine" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-appengi...@googlegroups.com.

--
You received this message because you are subscribed to the Google Groups "Google App Engine" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-appengi...@googlegroups.com.

--
You received this message because you are subscribed to the Google Groups "Google App Engine" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-appengi...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-appengine/c724b020-7a0e-4f94-8b03-9fd97f79309c%40googlegroups.com.

noverlyjoseph

unread,
Mar 24, 2020, 8:54:18 AM3/24/20
to Google App Engine
The Network part of the yaml is optional and should be use only if you have one setup, other than that it is not needed.
Could you try remove it, and deploy to see if it'll work, make sure the yaml formatting is correct, as this might have been the original
issue here.


On Monday, March 23, 2020 at 8:00:51 AM UTC-4, Ben Abdesslem Sarah wrote:
Thank you so much for your help!
But I still don't know how to find the  EXISTING_GCE_INSTANCE_NAME ?
Where can I find this information?
I tried the project name and the sql instance name ! 
And of course, it's not working

Sarah

Le ven. 20 mars 2020 à 14:15, 'Pierre-Yves (Google Cloud Support)' via Google App Engine <google-appengine@googlegroups.com> a écrit :
Hi Sarah,

Under the App Engine flex environment, the app is served by underlying Compute Engine (GCE) instances already by default. You can read more about this here [1]. There is no need to create new ones. When using the “gcloud compute instances add-tags” command, the ‘instance-name’ should be the actual name of the existing GCE instance, instead of the tag you are assigning it. If you want the “instance_tag” to be set as ‘aef-instance’, the complete command should look like:

gcloud compute instances add-tags EXISTING_GCE_INSTANCE_NAME --zone europe-west1-b --tags aef-instance

You can read more about this command here [2]. Once that instance has been tagged properly, you can associate this newly tagged instance with the network name in the “network” section of the ‘app.yaml’ file. In order to get the existing GCE instance name, you may look at the bottom of the page from the Instances page [3] of your project in the Console. Make sure the correct service is selected in the dropdown menu at the top.


On Thursday, March 19, 2020 at 2:41:17 PM UTC-4, Ben Abdesslem Sarah wrote:
Hello,

I can't create that tag and still don't know why ?

C:\someproject>gcloud compute instances add-tags aef-instance --zone europe-west1-b --tags mynetwork
ERROR: (gcloud.compute.instances.add-tags) Could not fetch resource:
 - The resource 'projects/*************/zones/europe-west1-b/instances/aef-instance' was not found

Do I need to create a VM instance first or a firewall-rules before ?
Like that : gcloud compute firewall-rules create

 Thank you so much for your help !!
Sarah

To unsubscribe from this group and stop receiving emails from it, send an email to google-appengine+unsubscribe@googlegroups.com.

--
You received this message because you are subscribed to the Google Groups "Google App Engine" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-appengine+unsubscribe@googlegroups.com.

--
You received this message because you are subscribed to the Google Groups "Google App Engine" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-appengine+unsubscribe@googlegroups.com.

--
You received this message because you are subscribed to the Google Groups "Google App Engine" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-appengine+unsubscribe@googlegroups.com.

--
You received this message because you are subscribed to the Google Groups "Google App Engine" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-appengine+unsubscribe@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages