Ubuntu - Running gcloud app deploy command is throwing error - node.js

I was following along this tutorial on YouTube. I created an empty project on gcp, then ran gcloud init and switched to that project, then I ran gcloud app deploy and I ran into problems. In this tutorial video, it was not mentioned that I should enable Cloud Build API to deploy. So I don't know if only not enabling the Cloud Build API was the problem or something else was the problem.
Here's my app.yaml
runtime: nodejs12
I've tried many other stack overflow posts' answers like this one, but nothing worked for me. When I run gcloud app deploy when I am inside my new project, I am getting this error:
ERROR: (gcloud.app.deploy) Error Response: [7] Access Not Configured. Cloud Build has not been used in project XXX before or it is disabled. Enable it by visiting https://console.developers.google.com/apis/api/cloudbuild.googleapis.com/overview?project=[projectId] then retry. If you enabled this API recently, wait a few minutes for the action to propagate to our systems and retry.
I am using Ubuntu 20.04 LTS - x86-64.

You must complete two steps:
Enable Google Cloud Billing.
Enable Cloud Build API.
You cannot skip enabling Cloud Billing. Once you set up the Billing Account, you might have to wait a few minutes before you can enable APIs.
The first 120 minutes of Cloud Build time is free. Then you will be charged $.003 per minute.
The page is a collection of documents on Google Cloud Billing.
Google Cloud Billing Documentation
You can enable the Cloud Build API in the console or via the CLI.
Enable Cloud Build API in the console
gcloud services enable cloudbuild.googleapis.com
gcloud services enable

Related

Build fails while deploying from GitHub to azure app service (node JS Twilio backend)

I am trying to deploy my backend code to azure app services using the GITHUB actions, the code has been committed and in the action, yml file is also generated, and after clicking the build it fails with an error. Error: Process completed with exit code 1.
It depends which Action you used.
It is recommended to start with "Deploying Node.js to Azure App Service" and its prerequisites (creating an Azure App Service plan, creating a web app, configuring an Azure publish profile and create an AZURE_WEBAPP_PUBLISH_PROFILE secret.)
You can then create your workflow, following the example "deployments/azure-webapps-node.yml" as a possible template, for you to adapt.

Google App Engine gcloud app deploy error [5] using Node.js

I've been successfully deploying my node.js GAE web app for months using gcloud app deploy. It's been a month or so since my last deployment and I've made a few updates since then that I want to get out. So I did my usual
gcloud app deploy
and it uploaded the files and then failed, giving me this error:
(gcloud.app.deploy) Error Response: [5] failed to getGaiaID for "<SERVICE NAME WAS HERE"": generic::not_found: Account disabled: 810593457260
At first I thought it was a payment issue - but my payment info is up to date. The only major change to the code I recall is that between this deploy and the last deployment, I started versioning the project with git and pushing to github.
Does anyone have any ideas? In particular, is there any reason Git or GitHub .git would interfere with a gcloud deployment?
Thanks
So, oddly enough, my account ended up not being disabled. My last three attempts at deploying all occurred at unsecured network locations (airport, hotel, convention center). Apparently, Google gives a disabled account warning when you try to deploy over an unsecure network
Therefore the command gcloud app deploy will not be successful when performed over an unsecure internet network.
Later, attempting to make a deploy over unsecure networks disabled the project in GAE. Since billing was in good standing, they continued to serve my content (and bill for it) but changes to the service were disabled.
To enable them again, follow the instructions:
To enable a service account, at minimum the user must be granted the Service Account Admin role (roles/iam.serviceAccountAdmin) or the Editor basic role (roles/editor)
In the Cloud Console, go to the Service accounts page.
Select the project
Click the name of the service account that you want to enable
Under Service account status, click Enable service account, then click Enable to confirm the change.
Other resources:
How to understand the service accounts
How to create and manage service accounts

Azure App Service suddenly stopped with PhantomJS error

We have a Restify API running in Azure App Service on Linux for a while now. Suddenly this app (both test and prod, they run as seperate apps) stopped working. Based on the logs the error is related to a package we are using node-highcharts-exporting which is dependent on PhantomJS. App Service is using Node 8.1.
We tried re-deploying the code, upgrading node version to 8.12 (do not want to use latest version with out testing) but still no luck.
Deployment Logs: (This part is successful. This is just for reference)
Container logs: (Startup fails here)
Tried to replicate the same environment on-prem and everything works fine. Created a new App Service which is also running into same issue. Any help is much appreciated.
Update 1:
I think I figured out what is happening. This is related to font libraries on linux https://github.com/ariya/phantomjs/issues/10904
I need to install libfontconfig but this is not supported on Azure App Service.
Yes, it is due to sandbox restriction on a App Service. Just to highlight, the standard/native Azure Web Apps run in a secure environment called a sandbox. Each app runs inside its own sandbox, isolating its execution from other instances on the same machine as well as providing an additional degree of security and privacy which would otherwise not be available.
Not supported scenarios on standard App Service - PhantomJS (/Selenium): tries to connect to local address, and also uses GDI+.Known issue for all PDF generators based on wkhtmltopdf or phantomjs: custom fonts are not rendered (system-installed font is used instead) because of sandbox GDI API limitations.See App Service GitHub sandbox page.
Based on your requirement, however you could use a custom container in App Service (You can use a custom Docker image) that lets you make OS changes that your app needs.
Checkout these document for more details on this topic:
Run a custom Linux container in Azure App Service (You can use a custom Docker image): https://learn.microsoft.com/azure/app-service/containers/quickstart-docker
Run a custom Windows container in Azure (Preview):
https://learn.microsoft.com/azure/app-service/app-service-web-get-started-windows-container

(gcloud.app.deploy) Error Response: [7] Access Not Configured. Cloud Build has not been used in project

I am running into this error while deploying my django(2.1) app with python(3.5) to appengine. Before, I was using python 2 and python27 in app.yaml, there was no such error, but now when I have python 3.5.2 and python37 in my app.yaml, I am running into this error after "gcloud app deploy". Do I really have to enable billing or am I doing something wrong? Is there a way out? The full error is
ERROR: (gcloud.app.deploy) Error Response: [7] Access Not Configured. Cloud Build has not been used in project chaipani-217815 before or it is disabled. Enable it by visiting https://console.developers.google.com/apis/api/cloudbuild.googleapis.com/overview?project=chaipani-217815 then retry. If you enabled this API recently, wait a few minutes for the action to propagate to our systems and retry.
You must enable billing first, then you can enable the Cloud Build service for your project.
We ran in to an issue where an incomplete deploy (that hung and had to be aborted) had errors setting some internal service account permissions and kept getting the "Cloud Build has not been used in project before or it is disabled" error despite the Cloud Build API being enabled and a billing account set up.
We solved the issue by disabling the Cloud Build API, waiting a couple hours (to ensure the service accounts were deleted), and then re-enabling.
I solved this problem using the following commands at the root directory of my project:
gcloud init
gcloud components update
After I updated the project settings with my GCP account the problem was solved.
You go that link then click "Enable" button. A popup showed, then click to Set account. (see the picture)

How to make Google App Service publicly visible

I have a Node JS app that I have running on Google Cloud Platform using the Google Shell, using git clone etc. I can preview the endpoint, but only I can access it. How would I make this public?
I tried "gcloud app deploy" but it seems this needs billing access, even though I'm using the trial. Or is that correct? I'm part of an organisation so not the user that's signed up for the trial, so would that mean getting the person who did to enable my account?
Nick.
There are many options in Google Cloud Platform to deploy your Node.js application and expose the endpoint to the public internet: App Engine, Compute Engine, Kubernetes Engine.
As I can understand you are using Cloud Shell to download the code from a Git repository and to test your application in there. Web Preview will prompt you to the Google log in page, so it is not an option if you want the endpoint be accessible to others publicly.
The command you are using (gcloud app deploy) is for App Engine. I think you are in the right direction here, since App Engine will serve as the container of your application and will let you deploy your service to the public internet without any additional configuration. At this point I would recommend you to follow the step by step guide in [1].
About the role required to enable the App Engine API, you will need a project owner or project editor role.
Cheers.

Resources