Deploying app to Google App Engine (python) - google-app-engine-python

I'm new to this and trying to deploy a first app to the app engine. However, when i try to i get this message:
"This application does not exist (app_id=u'udacity')."
I fear it might have to do with the app.yaml file so i'll just leave here what i have there:
application: udacity
version: 1
runtime: python27
api_version: 1
threadsafe: yes
handlers:
- url: /favicon.ico
static_files: favicon.ico
upload: favicon.ico
url: /.*
script: main.app
libraries:
- name: webapp2
version: "2.5.2"
Thanks in advance.

Did you set up a Google Cloud Project for your application? This is where the app_id is created. If you haven't set up a project, you need to.
If you have set up a project, it seems like you might be using the wrong application id. Head over to the dashboard page of the Google Cloud Console. From there, you should see your app_id listed in the top left corner. Make sure to use this id when deploying.
Good Luck!

create the project in your google app engine account by specifiying the
Application identifier and title(say you have given your application identifier
is=helloworld)
Go to the google app engine launcher and match your project name in the
app.yaml
with the name identifier you created in your google app engine account and then deploy it.

Related

How do I verify my cf app configuration items

I'm just starting to play with the IBM cloud offering. I've built a simple flask app and am trying to deployt it via a toolchain. When I run my toolchain the app deploys successfully, however I can't access the url.
I am looking at the deployment logs and have a couple of questions.
First, I see this:
2020-12-24T15:00:39.66+0000 [APP/PROC/WEB/0] OUT * Environment: production
But the environment I thought I was deploying to was dev. How do I change the environment I expect the toolchain to deploy to?
I'm assuming that the url that shows up in the log output should be accessible, but it isn't.
My manifest has random-route: true defined. How do I check that the url in the logs is available and pointing to my deployed cf app??
Thanks for any help and Happy Holidays!
Have you checked the app using the cloud console ui at https://cloud.ibm.com There should be a link to the app url.
It is possible to differentiate between def and prod via environment variables. I believe you can pass environment variables via the manifest file. You can sent via ibmcloud cf set-env and then ibmcloud cf restage.
So the reason my app was failing was I was missing a couple of items/components
First, from the code I needed these lines in my python.
port = int(os.getenv('PORT', 5000))
if __name__ == '__main__':
app.run(debug=True, host='0.0.0.0', port=port)
The cloud foundry deployment maps the external facing url to your app.
In order to do that it needs to know what port to use and that first snippet sets it to the port defined as an environment variable (IBM Cloud defines this) or port 5000 if the variable is not set.
The second snippet is the standard script special variable evaluation and execution control mechanism.
I didn't have this or the app.run call.
adding these allowed me to get the app running by pushing it from my machine locally. Now that i have it deploying successfully, I'll start working on getting it to deploy via a toolchain.
I figured all of this out by reviewing this tutorial I found on github and comparing what they were doing and what I was doing.
https://github.com/IBM-Cloud/get-started-python
Lastly, to see how the app has been mapped go the cloud foundry section of the ui and select the app. From there you can look at the logs and they show how the app maps in the url resource access history. That being said, fundamentally this wasn't going to help me solve my problem as it was related to my source code, not the actual route mapping.
Seems your toolchain has environment variable set which you can change by setting the following:
ibmcloud cf env-set flask_app Environment development
It can also be set via mainfest.yml file as shown below:
env:
env_name: development
URL is given on the UI that you may refer. Other way to check the URL is to look for the route so you may use
ibmcloud cf app flask_app
If you see any issues in accessing the app using route so it means there is some problem with the app causing this to happen.

Cannot Deploy Application on Eclipse (Bluemix)

I am trying to create my first web app on Bluemix.
I created a Java Liberty Runtime and downloaded the Starter Code to
work on Eclipse.
I installed IBM Bluemix tools to Eclipse and
imported the starter code as an archive file.
When I try to run application on IBM Bluemix Server, it is recognizing the starter code as another new application and saying "There is a deployed application with the same name." So, I cannot update the application on eclipse and also there is two different applications are being seen on server view:
When I try to go application homepage it is giving:
Not Found
The application or context root for this request has not been found: /
Thanks for any comments.
The IBM Eclipse Tools for Bluemix recently added the ability to map and unmap a Bluemix app with a project in your workspace: https://developer.ibm.com/bluemix/2015/04/02/updates-ibm-eclipse-tools-bluemix/
To map a project, right click on an existing application in the Servers view and select Map to Project.
I was able to get this to work. I modified the manifest.yml file a bit to have a unique name and hostname. When you deploy this change the hostname and name to something unique.
applications:
- disk_quota: 1024M
host: e-urlabel-jbs
name: e-urlabel-jbs
path: webStarterApp.war
domain: mybluemix.net
instances: 1
memory: 512M
Note. I changed the domain as my account is in the US instance, but for yours to work change it to eu-gb.mybluemix.net.
I just realized that there is a recent update which provides ability to map and unmap Bluemix apps with projects in the workspace. It has come with the fresh version of the Eclipse Bluemix Tools. I solved the issue by mapping my Starter Code and Bluemix Project:
right click on an existing application in the Servers view
select Map to Project
Source: https://developer.ibm.com/bluemix/2015/04/02/updates-ibm-eclipse-tools-bluemix/

How to deploy web application onto Google App Engine

This may be a vague question but I have been unable to find any help/tutorials specific to my situation and am stuck.
I have built a website using Eclipse (Dynamic Web Project.) I then deployed this application using Tomcat and can see it by going to localhost, however, I am struggling on how to actually deploy it to the cloud.
I am trying to use Google App Engine but am open to other (free) alternatives for deploying my web application.
With Google App Engine, I registered for an account, made a new project, connected it to my github repository and confirmed the correct code is listed.
However, when navigating to project_id.appspot.com (mine is http://mapp-development.appspot.com) I get a 404 error.
I have attempted various deployments and even made an entirely new Google Web Application Project in Eclipse for testing which worked but weirdly deployed to http://1-dot-mapp-develop.appspot.com/ and is the test files which I do not know how to correctly modify.
Is there any way to upload/deploy my existing web application to Google App Engine (as a .war or otherwise)?
I am new to web development and apologize for any unclear specifications. Any help would be greatly appreciated!
Edit: I have also tried (in Eclipse) right clicking the project and choosing "Deploy to App Engine" under Google however it states "mapp-website is not an App Engine project".
Edit2: I had a stupid mistake, I confused my Project ID (mapp-development) and app id (mapp-develop). I am able to successfully make a new Google web project and deploy it to mapp-develop.appspot.com
Sorry for the trouble!
Here are three ways to deploy:
Make an App Engine project in Eclipse
Deploy via Git
Deploy via GitHub
It seems like you tried #1 with a project named 1-dot-mapp-develop. If you select deploy from Eclipse, a dialog box will pop up with a link to "App Engine Project Settings" where you can change the project name (to mapp-development and version).

Eclipse and Google App Engine: " Registration with Endpoints Server...FAILED!"

i've got a problem with google appengine and eclipse.
I'm going and try to be very specific:
I'm trying to make it work NOT locally, so i've done the following:
1) create a project in the google developer console
2) created a google app engine new project in eclipse passing the project number and the api key obtained in the google developer console
3) deployed the app engine project on appengine.google.com, and it says that the state is "running"
4) to do the previous point i had to give the app id number generated in the developer console
5) i set this variable: LOCAL_ANDROID_RUN to false, because i want to do it online
that's it, i get the following error:
2) Registration with Endpoints Server...FAILED!
Unable to register your device with Cloud Endpoints server running at https://myapp.appspot.com/_ah/api/ etc etc
Ah and "myapp" is not a generalization i made to hide the app id of my app, thats exactly what it tells, it seems like the id i gave it is not passed to the url...
I've been trying this for 2 hours, it's getting painful, please help me!^^

how to test develop facebook app with google app engine on local machine

Is it possible to develop facebook using google app engine locally, without having to upload application every time I change it?
I assume you are getting API error 191 when you try to access the Facebook API from the dev appserver?
API Error Code: 191
API Error Description: The specified URL is not owned by the application
Error Message: redirect_uri is not owned by the application.
If you are developing on your localhost, you can set the 'Site Domain' field in your facebook app settings to (appname).appspot.com and then edit the HOSTS file on your system.
In my environment I just entered:
127.0.0.1 devlocal.(appname).appspot.com
As long as the browser's URL matches *.(appname).appspot.com, it will work.
You could set the Website field in your Facebook app settings to http://localhost:XXXX or http://127.0.0.1:XXXX for development and then change it over to the actual once ready for deployment. This worked well for me.
I ran into this issue a couple years ago and wrote a long article about how I solved it for my needs.
http://www.upwithabang.com/articles/GAE-facebook-win7.html
It covers the setting up of an Apache server on your laptop then telling Facebook and the GAE to behave as if it hosted on a production server. This solves the pain of constant uploads for testing every little change.
Hopefully this is helpful to someone, if not a little late.