Google App Engine Deploy error 13 - Deployment Manager operation failed - google-app-engine

I am trying to deploy an app first time and getting this at the very end of 'gcloud app deploy' operation.
ERROR: (gcloud.app.deploy) Error Response: [13] Deployment Manager operation failed, name: operation-1522364367335-5689513556e59-0732922b-1662dc1e, error:
[
{
"code":"RESOURCE_ERROR",
"location":"/deployments/aef-default-20180329t155754/resources/aef-default-20180329t155754-hcfw",
"message":{
"ResourceType":"compute.v1.firewall",
"ResourceErrorCode":"404",
"ResourceErrorMessage":{
"code":404,
"errors":[
{
"domain":"global",
"message":"The resource 'projects/kubernetes-staging/global/networks/default' was not found",
"reason":"notFound"
}
],
"message":"The resource 'projects/kubernetes-staging/global/networks/default' was not found",
"statusMessage":"Not Found",
"requestPath":"https://www.googleapis.com/compute/v1/projects/kubernetes-staging/global/firewalls",
"httpMethod":"POST"
}
}
},
{
"code":"RESOURCE_ERROR",
"location":"/deployments/aef-default-20180329t155754/resources/aef-default-20180329t155754-00it",
"message":{
"ResourceType":"compute.v1.instanceTemplate",
"ResourceErrorCode":"404",
"ResourceErrorMessage":{
"code":404,
"errors":[
{
"domain":"global",
"message":"The resource 'projects/kubernetes-staging/global/networks/default' was not found",
"reason":"notFound"
}
],
"message":"The resource 'projects/kubernetes-staging/global/networks/default' was not found",
"statusMessage":"Not Found",
"requestPath":"https://www.googleapis.com/compute/v1/projects/kubernetes-staging/global/instanceTemplates",
"httpMethod":"POST"
}
}
}
]

As the error states, the default global network (entitled 'default') hasn't been found, which appears to be the reason why your app isn't deploying.
You can create a global network by executing this command in Cloud Shell before deploying your app:
$ gcloud compute networks create default --subnet-mode auto
If you didn't modify the original default network, it would suggest that the issue is related to the network settings in your app.yaml configuration file. Information on configuring these settings can be found here.
If you follow the steps above but are still having trouble, I suggest that you create a new issue in the Public Issue Tracker and provide us with the contents of your app.yaml file as well as your Project ID, where I'd be happy to investigate further.
(Disclaimer: I work for Google Cloud Platform Support)

Related

How can I run React in Development mode with .NetCore in IIS?

I've used the Visual Studio template for .NetCore/React web app. By default, it runs in Development mode using IIS Express. However, if I set up a site in IIS, and a launch profile, I get an error in the browser:
AggregateException: One or more errors occurred. (One or more errors
occurred. (The NPM script 'start' exited without indicating that the
create-react-app server was listening for requests. The error output
was: Error: EPERM: operation not permitted, mkdir
'C:\Windows\system32\config\systemprofile\AppData\Roaming\npm'
My launchSettings.json has the following for the IIS profile:
"IIS": {
"commandName": "IIS",
"launchBrowser": true,
"launchUrl": "http://localhost",
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development"
}
}
From the error, it looks like it may be a permission issue that I need to have the IIS app pool running under, but I can't find any documentation that tells me anything about that.
What am I missing? Again, this is an otherwise unmodified project from the template. The Startup.cs is running React as would be expected with:
app.UseSpa(spa =>
{
spa.Options.SourcePath = "ClientApp";
if (env.IsDevelopment())
{ spa.UseReactDevelopmentServer(npmScript: "start"); }
});
According to your description, I suggest you could firstly modify the IIS default application pool's identity to make sure it has the permission to run npm.
I suggest you could follow below steps:
1.Open the IIS management console, locate the application pool,find the default application pool and click the advanced setting.
Find the identity setting and modify the build-in account to localsystem
Then I suggest you could add the npm path in the system environment.
Go to Control Panel\System and Security\System and find advanced system settings
2.Click environment variable
3.Find the path inside the system variable and add the npm path as below:
C:\Users\{username}\AppData\Roaming\npm

Why can't I deploy to GAE using the gcloud command in go?

I'm trying to deploy an application written in go to GAE. When I call gcloud app deploy it says this:
Updating service [default]...failed.
ERROR: (gcloud.app.deploy) Error Response: [9] Cloud build 64850a38-3b7b-4223-97bc-27643b8ab1d5 status: FAILURE.
Build error details: go build: cannot use -o with multiple packages
.
Check the build log for errors: https://console.cloud.google.com/gcr/builds/64850a38-3b7b-4223-97bc-27643b8ab1d5?project=609165667740
I have looked everywhere but I can't find information related to this error in this context.

AppEngine Deploy is Conflicting SHA1 sum for a file

I want to deploy an update to our app but we have an issue with gcloud command which failed to "Conflicting SHA1 sum for file". Here is the output:
➜ gcloud app deploy xxx-xxx-xxxx.yaml --project xxx-xxx-xxxx --quiet
Services to deploy:
descriptor: [/home/vzool/Workspace/xxx-xxxx-xxxxxxxxxxx/xxx-xxx-xxxx.yaml]
source: [/home/vzool/Workspace/xxx-xxxx-xxxxxxxxxxx]
target project: [xxx-xxx-xxxx]
target service: [default]
target version: [20180917t110153]
target url: [https://xxx-xxx-xxxx.appspot.com]
Beginning deployment of service [default]...
╔════════════════════════════════════════════════════════════╗
╠═ Uploading 1 file to Google Cloud Storage ═╣
╚════════════════════════════════════════════════════════════╝
File upload done.
Updating service [default]...failed.
ERROR: (gcloud.app.deploy) Error Response: [3] The following errors occurred while copying files to App Engine:
File https://storage.googleapis.com/staging.xxx-xxx-xxxx.appspot.com/c819d7599ceb31df8d4370eed1981defcb5034c6 failed with: Conflicting SHA1 sum for file. Expected "ddb6af3b_cf4bff57_613fb78d_208480fa_1717b3c4" but received "c819d759_9ceb31df_8d4370ee_d1981def_cb5034c6".
Details: [
[
{
"#type": "type.googleapis.com/google.rpc.ResourceInfo",
"description": "Conflicting SHA1 sum for file. Expected \"ddb6af3b_cf4bff57_613fb78d_208480fa_1717b3c4\" but received \"c819d759_9ceb31df_8d4370ee_d1981def_cb5034c6\".",
"resourceName": "https://storage.googleapis.com/staging.xxx-xxx-xxxx.appspot.com/c819d7599ceb31df8d4370eed1981defcb5034c6",
"resourceType": "file"
}
]
]
I do delete this file c819d7599ceb31df8d4370eed1981defcb5034c6 but everytime new hash will be generated, delete entire block staging.xxx-xxx-xxxx.appspot.com and I did clear Memcache but with no luck trying all these options! :(
I don't know what to do anymore with this, any suggestions may help me out?
Thanks
I think after sometime in research the issue, the app itself has a live feature which lead to update one file while you open live page.
So, that change what gcloud uploaded.
gcloud upload then verify. And if file changed after upload and before verify gcloud will through this error on your face. Ha ha ha ^_^
OP's answer seemed to indicate that a file got touched during the gcloud deploy process.
The solution for me was to:
git checkout some random branch
git checkout the branch I was actually trying to deploy again
run gcloud app deploy . --version my_version_id --project my_project_id

Google cloud deployment manager couldn't create deployment using "logging.v2.sink" by Permission Denied

I deployed logging.v2.sink using Google Cloud Deployment Manager, however the deployment was failed by permission denied.
The problem was also happened in this logsink example of Google Cloud Deployment Manager.
The result is following:
- code: RESOURCE_ERROR
location: /deployments/my-project-id/resources/sink
message:
{
"ResourceType": "logging.v2.sink",
"ResourceErrorCode": "403",
"ResourceErrorMessage": {
"code": 403,
"message": "The\n caller does not have permission",
"status": "PERMISSION_DENIED",
"statusMessage": "Forbidden",
"requestPath": "https://logging.googleapis.com/v2/projects/my-project-id/sinks",
"httpMethod": "POST"
}
}
The deployment was executed by owner role, moreover I can create logging sink using cli.
gcloud installed in local is newest (v217.0.0).
Why does this problem happen?
I misunderstood permissions of cloud deployment manager.
I noticed that the accounts of deploying template and creating resources are different(https://cloud.google.com/deployment-manager/docs/access-control).
When I add the Logging Admin role to the service account, deployment succeeds.
[PROJECT_NUMBER]#cloudservices.gserviceaccount.com
Ran into the same problem. Elaborating the answer above:
Deployment manager uses [PROJECT_NUMBER]#cloudservices.gserviceaccount.com to create resources on your behalf. You can check the policy binding for this service account:
gcloud projects get-iam-policy [PROJECT_NUMBER]
This service account has roles/editor on the project by default, which has the following policies for logging sinks:
- logging.sinks.get
- logging.sinks.list
You can confirm this using this command:
gcloud iam roles describe roles/editor
roles/logging.configWriter has logging.sinks.{list, create, get, update, delete} permissions, so you can add a new policy binding to your project and then retry:
gcloud projects add-iam-policy-binding secstate-gcp-test02 \
--member serviceAccount:[PROJECT_ID]#cloudservices.gserviceaccount.com \
--role roles/logging.configWriter

AppEngine App Deploy gives "Failed to copy file."

I'm deploying a Laravel app to a fresh App Engine project. But I'm getting this error constantly. I tried creating a new project and deploying too.
╔════════════════════════════════════════════════════════════╗
╠═ Uploading 9625 files to Google Cloud Storage ═╣
╚════════════════════════════════════════════════════════════╝
File upload done.
Updating service [default]...failed.
ERROR: (gcloud.app.deploy) Error Response: [3] Errors were encountered while copying files to App Engine.
Details: [
[
{
"#type": "type.googleapis.com/google.rpc.ResourceInfo",
"description": "Failed to copy file.",
"resourceName": "https://storage.googleapis.com/staging.rsvp.appspot.com/df4bc71e8832337e997291648609c4e207b5aa55",
"resourceType": "file"
}
]
]
WHat is the problem here and how can I fix it?
The reason for this issue was, I had some large size files ( > 30Mb ) in my project folder. I removed them and redeployed, it worked without an issue.
As OP already mentioned, the reason is large files. Here is how you can also find out which file is causing the problem.
If you have an error such as
Details: [
[
{
"#type": "type.googleapis.com/google.rpc.ResourceInfo",
"description": "Failed to copy file.",
"resourceName": "https://storage.googleapis.com/staging.bemmu1-hrd.appspot.com/b463c152ee1498bd4d27c1ea67c7f8e82cb4b220",
"resourceType": "file"
}
]
]
Note the hash that appears in resourceName, in this case "b463c152ee1498bd4d27c1ea67c7f8e82cb4b220".
Search for it in the most recent log file (mine was /Users/bemmu/.config/gcloud/logs/2019.07.30/00.45.43.657001.log) and you'll find it as part of a really long string, in my case:
...'templates/envato/images/arrangement.png': {'sourceUrl': 'https://storage.googleapis.com/staging.bemmu1-hrd.appspot.com/b463c152ee1498bd4d27c1ea67c7f8e82cb4b220'...
From this I could see that in my case the offending file was arrangement.png

Resources