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)
Related
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.
I am having a problem that when I get user location by using http://freegeoip.net/json, it seems to get the location from where the Heroku server is located.
I used Flask to make the web app.
I uploaded the web app through Heroku.
Per the api docs here you need to pass the ip of the user like 'http://freegeoip.net/json/%s' % request.remote_addr. Otherwise it will return the location of the requester, which in your case is your heroku server.
I start web service on azure, deploy the python project(3), it is successfully started, and some routes like:
#app.route('/')
def OK():
return 'OK!'
working ok.
But when requesting this code:
#app.route('/predict_states/<userRequests>')
def CreatePrediction(userRequests):
predict = Predict([userRequests], model)
return jsonify(predict)
the model is:
with open("model.pkl", 'rb') as f:
model = dill.load(f)
azure return an error 500:
IIS received the request; however, an internal error occurred during the processing of the request. The root cause of this error depends on which module handles the request and what was happening in the worker process when this error occurred.
IIS was not able to access the web.config file for the Web site or application. This can occur if the NTFS permissions are set incorrectly.
IIS was not able to process configuration for the Web site or application.
The authenticated user does not have permission to use this DLL.
The request is mapped to a managed handler but the .NET Extensibility Feature is not installed.
What could be the problem?
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)?
I'm trying to deploy a basic HelloWorld app on Google Engine following their tutorial for Python. I created a helloworld.py file and an app.yaml file and copied the code from their online tutorial. I signed up for Google App Engine and have tried everything but keep getting the following error:
2015-08-19 19:22:08,006 ERROR appcfg.py:2438 An error occurred processing file '':
HTTP Error 403: Forbidden Unexpected HTTP status 403. Aborting.
Error 403: --- begin server output ---
You do not have permission to modify this app (app_id=u'helloworld').
--- end server output ---
If deploy fails you might need to 'rollback' manually.
The "Make Symlinks..." menu option can help with command-line work.
*** appcfg.py has finished with exit code 1 ***
Here is the code from helloworld.py:
import webapp2
class MainPage(webapp2.RequestHandler):
def get(self):
self.response.headers['Content-Type'] = 'text/plain'
self.response.write('Hello, Udacity!')
app = webapp2.WSGIApplication([
('/', MainPage),
], debug=True)
And here is my code from the app.yaml file:
application: helloworld
version: 1
runtime: python27
api_version: 1
threadsafe: true
handlers:
- url: /.*
script: helloworld.app
Is there a problem with permissions i.e. Google App's or my laptop's settings? I have tried everything that's out there on stackoverflow so any new suggestions will be much appreciated!!
In my case, I got refused because the appcfg save my ouauth2 token in the file ~/.appcfg_oauth2_tokens, which happen to be another account of appengine . Simply remove the file and try again. It should work. This is in Mac, I am not sure about windows though.
Ok there is a MUCH easier way to do this now.
If you are getting this message "You do not have permission to modify this app"
but your id is correct within app.YAML do the following:
Bring up the Google App Engine Launcher on your desktop
Click on the control tab on the top left --> "Clear Deployment Credentials"
Thats it!!!
The application name in app.yaml is sort of like a domain name. Once someone has reserved it, no one else can use it. You need to go here, and then select "Create a project..." from the dropdown at the top of the screen. In the popup, it will suggest a project id, or you can select your own. Many project id's are taken so you will need to specify something unusual to get something that is not taken.
You then put this project id in your app.yaml in the application line. You should then be able to upload your project.
Make sure you have created a project in GAE which project ID is exactly same to your configuration in app.yaml
workflow:
Create a project in GAE and set a name
At the same window you can edit the project ID
copy the project ID and paste it when you create a new application in GAE launcher (or edit your app.yaml to set the value of application)
deploy it and type {project-id}.appspot.com in your browser\ Good luck!
App ID ( 'application:' ) in app.yaml mentioned is 'helloworld' which seems to be default for hello world app. Create a new app using: https://console.cloud.google.com/home/dashboard and use the new app ID in app.yaml.
Please have a look at: Application for gae does not deploy that has answer to similar question for Linux platform, where we need to delete : ~/.appcfg_oauth2_tokens* to resolve the permission error.