This error came when trying to deploy a python web app through gcloud - after the y/n question when you code gcloud app deploy
ERROR: (gcloud.app.deploy) The operation "operations/acf.p2-222084527338-d61d0401-cb0a-4f69-a07c-131799bd4cf8" resulted in a failure "[Hook call/poll resulted in failed op for service 'compute.googleapis.com': The service is currently being deactivated and deactivation must complete before activation can occur.
Help Token: Ae-hA1M43mY8ADlPerCsLr9bUDXGJzibJgQCO0CGx3Kz1JRn6XpVB5Q_ebTfPxKEuaBwHKVFwspMAyx7_epjrFKFEzDDbDBy_oYncVroZlxGECPx] with failed services [compute.googleapis.com]".
Details: "[<DetailsValueListEntry
additionalProperties: [<AdditionalProperty
key: '#type'
value: <JsonValue
string_value: 'type.googleapis.com/google.rpc.PreconditionFailure'>>, <AdditionalProperty
key: 'violations'
value: <JsonValue
array_value: <JsonArray
entries: [<JsonValue
object_value: <JsonObject
It appears that you're deploying to App Engine flex.
This uses Compute Engine VMs for (App Engine) app instances.
You must use|enable Compute Engine in order to use App Engine flex.
I suspect (!?) that someone in your project disabled Compute Engine before you tried to deploy your app and it's telling you that, if you want to deploy to App Engine flex, you will need to (re)enable Compute Engine.
Related
Hi I have an application that I would like to deploy on heroku. The question is how would I deploy a streamlit app with secrets.toml?
Currently the connection can be done locally via this
credentials = service_account.Credentials.from_service_account_info(
st.secrets["gcp_service_account"])
However when I deploy it to heroku, this doesn't seem to connect.
Please help.
On heroku I entered the gcp_service_account credentials as a config var (from the heroku dashboard go to 'Settings' --> 'Reveal Config Vars' as below:
Instead of st.secrets["<key>"], use os.environ["<key>"] in your python code as below:
gsheet_url = os.environ['private_gsheets_url']
For nested secrets like the gcp service account credentials, I first parse the json string as below:
parsed_credentials = json.loads(os.environ["gcp_service_account"])
credentials = service_account.Credentials.from_service_account_info(parsed_credentials,scopes=scopes)
Hope this helps.
I can get my signalr code to connect + work no problem in my local environment by setting host with web url
"Host": {
"LocalHttpPort": 7070,
"CORS": "http://localhost:4200",
"CORSCredentials": true
}
Then I deploy it to the portal and go to CORS and add the web url that my storage blob static website is hosted on inside CORS for the signalr function app. When I login to my app with the web url matching cors value I get this for some reason
Also according to the docs (bottom part of page) I have to enable Access-Control-Allow-Crendentials
but it seems that a function app running on python doesn't have that option
How can I enable Access-Control-Allow-Crendentials in a python function app?
Yes, there is no way to set it on azure portal. Not only 'Access-Control-Allow-Crendentials', but also many other config settings cannot set by using azure portal when you are based on linux web app.
To achieve that you want, you can use below cmd in powershell:(It works when you are based on azure web app. azure function is based on web app sandbox, so below cmd also works on function.)
az resource update --name web --resource-group yourresoursegroupname --namespace Microsoft.Web --resource-type config --parent sites/yourfunctionname --set properties.cors.supportCredentials=true
This is the offcial doc:
https://learn.microsoft.com/en-us/azure/app-service/app-service-web-tutorial-rest-api#enable-cors
If your app requires credentials such as cookies or authentication
tokens to be sent, the browser may require the
ACCESS-CONTROL-ALLOW-CREDENTIALS header on the response. To enable
this in App Service, set properties.cors.supportCredentials to true in
your CORS config. This cannot be enabled when allowedOrigins includes
'*'.
On my side, I can change the config setting. Let me know whether you can change the config.:)
So i'm new to shopify development but I have an app built in python which I am running locally using manage.py runserver 8000 The app runs and I am presented with a login/install page.
I have set up a dev store so I enter this url into the box and click login/install. At this point I am presented with an error
I am using python and have set the shopify settings
SHOPIFY_APP_API_KEY = '**hidden**'
SHOPIFY_APP_SECRET = '**hidden**'
SHOPIFY_APP_NAME = 'MyApp'
SHOPIFY_APP_API_SCOPE = ['read_products', ]
SHOPIFY_APP_IS_EMBEDDED = True
SHOPIFY_APP_DEV_MODE = True
The hidden settings are set to the API credentials I got from the dashboard. So my app is served locally on http://127.0.0.1:8000. Can I test this app on my dev store without deploying it to Heroku? or does it need to be deployed to test?
My problem was that my app needed to be using ssl. Using ngok I managed to host http://127.0.0.1:8000 over ssl with a live url
I am trying to use google app engine to create my own proxy for internet browsing, as my college blocks almost everything. Every time I try I end up with terminal sitting there for hours not doing anything and lagging my computer. If anyone can help me with this it would be greatly appreciated. Is it the fact that when it asks for a python command to launch I skip it? Please help and thanks in advance.
Terminal is doing this:
gcloud app deploy
You are about to deploy the following services:
- test-proxy-151010/default/20161129t214424 (from [/Users/OliverPinel/app.yaml])
Deploying to URL: [https://test-proxy-151010.appspot.com]
Do you want to continue (Y/n)? y
If this is your first deployment, this may take a while...failed.
WARNING: We couldn't validate that your project is ready to deploy to App Engine Flexible Environment. If deployment fails, please check the following message and try again:
Server responded with code [400]:
Bad Request Unexpected HTTP status 400.
Failed Project Preparation (app_id='s~test-proxy-151010'). Out of retries. Last error: Temporary error occurred while verifying project: TEMPORARY_ERROR: Operation does not satisfy the following requirements: billing-enabled {Billing must be enabled for activation of service '' in project 'test-proxy-151010' to proceed., https://console.developers.google.com/project/test-proxy-151010/settings}
com.google.api.management.server.common.exceptions.ServiceManagementNonRetriableStorageException: Operation does not satisfy the following requirements: billing-enabled {Billing must be enabled for activation of service '' in project 'test-proxy-151010' to proceed.,
h ttps://console.developers.google.com/project/test-proxy-151010/settings}
at com.google.api.management.server.integrations.usage.requirements.RequirementChecker.lambda$checkAllAsync$3(RequirementChecker.java:158)
at com.google.common.util.concurrent.AbstractTransformFuture$TransformFuture.doTransform(AbstractTransformFuture.java:246)
at com.google.common.util.concurrent.AbstractTransformFuture$TransformFuture.doTransform(AbstractTransformFuture.java:236)
at com.google.common.util.concurrent.AbstractTransformFuture.run(AbstractTransformFuture.java:137)
at com.google.common.util.concurrent.MoreExecutors$DirectExecutor.execute(MoreExecutors.java:439)
at com.google.common.util.concurrent.AbstractFuture.executeListener(AbstractFuture.java:903)
at com.google.common.util.concurrent.AbstractFuture.complete(AbstractFuture.java:814)
at com.google.common.util.concurrent.AbstractFuture.set(AbstractFuture.java:656)
at com.google.common.util.concurrent.CollectionFuture$CollectionFutureRunningState.handleAllCompleted(CollectionFuture.java:81)
at com.google.common.util.concurrent.AggregateFuture$RunningState.processCompleted(AggregateFuture.java:245)
at com.google.common.util.concurrent.AggregateFuture$RunningState.decrementCountAndMaybeComplete(AggregateFuture.java:232)
at com.google.common.util.concurrent.AggregateFuture$RunningState.access$300(AggregateFuture.java:78)
at com.google.common.util.concurrent.AggregateFuture$RunningState$1.run(AggregateFuture.java:135)
at com.google.common.util.concurrent.MoreExecutors$DirectExecutor.execute(MoreExecutors.java:439)
at com.google.common.util.concurrent.AbstractFuture.executeListener(AbstractFuture.java:903)
at com.google.common.util.concurrent.AbstractFuture.complete(AbstractFuture.java:814)
at com.google.common.util.concurrent.AbstractFuture.set(AbstractFuture.java:656)
at com.google.net.rpc3.client.AbstractRpcFuture.success(AbstractRpcFuture.java:114)
at com.google.net.rpc3.client.RpcStub$RpcCallbackDispatcher$1.runInContext(RpcStub.java:847)
at com.google.tracing.TraceContext$TraceContextRunnable$1.run(TraceContext.java:457)
at com.google.tracing.CurrentContext.runInContext(CurrentContext.java:276)
at com.google.tracing.TraceContext$AbstractTraceContextCallback.runInInheritedContextNoUnref(TraceContext.java:316)
at com.google.tracing.TraceContext$AbstractTraceContextCallback.runInInheritedContext(TraceContext.java:308)
at com.google.tracing.TraceContext$TraceContextRunnable.run(TraceContext.java:454)
at com.google.net.rpc3.client.RpcStub$RpcCallbackDispatcher.runCallback(RpcStub.java:885)
at com.google.net.rpc3.client.RpcStub$RpcCallbackDispatcher.rpcFinished(RpcStub.java:895)
at com.google.net.rpc3.client.RpcStub$RpcCallbackDispatcher.success(RpcStub.java:874)
at com.google.net.rpc3.impl.client.RpcClientInternalContext.runCallbacks(RpcClientInternalContext.java:1243)
at com.google.net.rpc3.impl.client.RpcClientInternalContext.finishRpcAndNotifyApp(RpcClientInternalContext.java:1140)
at com.google.net.rpc3.client.loadbalancer.ReplicatedRpcChannel$InterceptedCallback.finishRpc(ReplicatedRpcChannel.java:1087)
at com.google.net.rpc3.client.loadbalancer.ReplicatedRpcChannel$InterceptedCallback.rpcFinished(ReplicatedRpcChannel.java:949)
at com.google.net.rpc3.client.loadbalancer.ReplicatedRpcChannel$InterceptedCallback.success(ReplicatedRpcChannel.java:911)
at com.google.net.rpc3.impl.client.RpcClientInternalContext.runCallbacks(RpcClientInternalContext.java:1243)
at com.google.net.rpc3.impl.client.RpcClientInternalContext.finishRpcAndNotifyApp(RpcClientInternalContext.java:1140)
at com.google.net.rpc3.impl.client.RpcNetChannel.afterFinishingActiveRpc(RpcNetChannel.java:1676)
at com.google.net.rpc3.impl.client.RpcNetChannel.finishRpc(RpcNetChannel.java:1491)
at com.google.net.rpc3.impl.client.RpcNetChannel.handleResponse(RpcNetChannel.java:3306)
at com.google.net.rpc3.impl.client.RpcNetChannel.messageReceived(RpcNetChannel.java:3045)
at com.google.net.rpc3.impl.client.RpcNetChannel.access$2900(RpcNetChannel.java:181)
at com.google.net.rpc3.impl.client.RpcNetChannel$TransportCallback.receivedMessage(RpcNetChannel.java:4254)
at com.google.net.rpc3.impl.client.RpcChannelTransportData$TransportCallback.receivedMessage(RpcChannelTransportData.java:688)
at com.google.net.rpc3.impl.wire.RpcBaseTransport.receivedMessage(RpcBaseTransport.java:463)
at com.google.net.rpc3.impl.wire.RpcClientTcpTransport.parseOneMessage(RpcClientTcpTransport.java:889)
at com.google.net.rpc3.impl.wire.RpcClientTcpTransport.parseMessages(RpcClientTcpTransport.java:766)
at com.google.net.rpc3.impl.wire.RpcClientTcpTransport.access$400(RpcClientTcpTransport.java:47)
at com.google.net.rpc3.impl.wire.RpcClientTcpTransport$2.dataReceived(RpcClientTcpTransport.java:366)
at com.google.net.async3.SocketConnection.handleNetworkReadEvent(SocketConnection.java:1104)
at com.google.net.async3.SocketConnection.access$800(SocketConnection.java:47)
at com.google.net.async3.SocketConnection$NetworkReadHandlerImpl.run(SocketConnection.java:1125)
at com.google.net.eventmanager.AbstractFutureTask$Sync.innerRun(AbstractFutureTask.java:260)
at com.google.net.eventmanager.AbstractFutureTask.run(AbstractFutureTask.java:121)
at com.google.net.eventmanager.EventManagerImpl.runTask(EventManagerImpl.java:594)
at com.google.net.eventmanager.EventManagerImpl.internalRunWorkerLoop(EventManagerImpl.java:1012)
at com.google.net.eventmanager.EventManagerImpl.runWorkerLoop(EventManagerImpl.java:892)
at com.google.net.eventmanager.WorkerThreadInfo.runWorkerLoop(WorkerThreadInfo.java:161)
at com.google.net.eventmanager.EventManagerImpl$WorkerThread.run(EventManagerImpl.java:1877)
Suppressed: java.util.concurrent.ExecutionException:
Beginning deployment of service [default]...
WARNING: Deployment of App Engine Flexible Environment apps is currently in Beta
WARNING: Could not generate [source-context.json]: Could not list remote URLs from source directory: /Users/OliverPinel
Building and pushing image for service [default]
(then it does nothing)
I have a Flask app which looks like this:
from flask import Flask
import boto3
application = Flask(__name__)
#application.route("/")
def home():
return "Server successfully loaded"
#application.route("/app")
def frontend_from_aws():
s3 = boto3.resource("s3")
frontend = s3.Object(bucket_name = "my_bucket", key = "frontend.html")
return frontend.get()["Body"].read()
if __name__ == "__main__":
application.debug = True
application.run()
Everything works perfectly when I test locally, but when I deploy the app to Elastic Beanstalk the second endpoint gives an internal server error:
The server encountered an internal error and was unable to complete your request. Either the server is overloaded or there is an error in the application.
I didn't see anything alarming in the logs, though I'm not completely sure I'd know where to look. Any ideas?
Update: As a test, I moved frontend.html to a different bucket and modified the "/app" endpoint accordingly, and mysteriously it worked fine. So apparently this has something to do with the settings for the original bucket. Does anybody know what the right settings might be?
I found a quick and dirty solution: IAM policies (AWS console -> Identity & Access Management -> Policies). There was an existing policy called AmazonS3FullAccess, and after I attached aws-elasticbeanstalk-ec2-role to it my app was able to read and write to S3 at will. I'm guessing that more subtle access management can be achieved by creating custom roles and policies, but this was good enough for my purposes.
Did you set up your AWS credentials on your Elastc Beanstalk instance as they are on your local machine (i.e. in ~/.aws/credentials)?