Im having problems deploying my GAE. I've got two running already so I should have all the right lirbaries and whatnot. But obviously Im missing something.
I registered my applet with googe appengine developers.
i enter the app_id in the app.yaml of the project as application name.
in cmd, i go to google_appengine and run the "appcfg.py update" on the root directory of my project. "C:/Development/GAE/projectname"
type in email and pw,
and then i get this error msg
12:47 AM Application: processing#######; version: 1
12:47 AM Host: appengine.google.com
12:47 AM
Starting update of app: processing######, version: 1
12:47 AM Getting current resource limits.
Password for ############gmail.com: Invalid username or password.
2014-09-19 00:47:36,404 ERROR appcfg.py:2416 An error occurred processing file '': HTTP Error 401: Unauthorized. Aborting.
Error 401: --- begin server output ---
Must authenticate first.
--- end server output ---
Any ideas what Im missing? Ive triple-checked all these steps cause thats all i can think of.
My App.yaml contains this
application: processing######
version: 1
runtime: python27
api_version: 1
threadsafe: yes
handlers:
- url: /statics
static_dir: statics
- url: /sketches
static_dir: sketches
- url: .*
script: main.app
libraries:
- name: webapp2
version: "2.5.2"
- name: jinja2
version: latest
Ive upgraded my GAE to the latest version too, still no change. I also tried uploading it to a different application, same problem.
Ive added 2 static folder I use for to run Processing embedded in my website.
PS my app runs fine locally and there's nothing that throws errors or doesnt compile. I think the fault lies somewehre else.
Cheers
Ok so as usual, more research eventually revealed the answer. And stackoverflow.
Guess I missed this first because it specified with php.Stack Overflow Question
Basically i wasnt doing anything wrong afterall, the permission problem was that it was being blocked by my google account.
I had to go to my Account Security permissions, and enable access from less-secure devices.
This must be a new, recent setting Google changed, becuase Ive already deployed 2 apps before.
To mention here for other people with the same problem:
First go through the steps I went through to make sure everything is set up correctly.
Then you should solving it the way I did.
Otherwise you can try setting it up so you can upload without password, this might avoid the problem if it lies somewehre else --oauth without pw
Finally I read that for some people the problem was in timezones. When the time on their computer was different to GAE or server I think that lead to miscommunication, so double-check that your time is set correctly and that it agrees with the time you see in the Launcher Log.
well for me the below 02 options worked
appcfg.py update . --oauth2 --noauth_local_webserver
The authentication flow was :
the command and options generated a url in stdout, which i copied and accessed from my browser, the browser generated a code, which I gave in my command line. I could see appcfg as one of the apps under connected apps and services of my google account.
It seems like an error with your user or password.
Are you sure you can access the project in the developer console, the email configured under permissions is the one which you are using to connect and the app id in yaml file is the same ID on the developers console? If so, the only thing I can imagine is a fail in your password.
Maybe a key pressed? Try typing it in a text processor.
A last idea, deploy the app via the launcher of the sdk. Add the existing app in the file menu (search the app.yaml file) and click deploy to see if there you can authenticate.
Related
When I run the project locally, everything works perfect. But when I deploy the project in production, I get the message "The page has expired due to inactivity" every time I submit a form with POST mnethod.
There are many questions about this problem and I've tried every possible solution:
1- My form contains the token {{ csrf_field() }}
2- I've changed the name of my app (APP_NAME)
The session driver and the cache drive are set to 'file'.
I heard that maybe the storage file is not writable and this is where it stores session. I don't know how to check it, if my project is deployed in GCLoud (Google Cloud Platform).
Thanks
UPDATE 1
I posted my question in Laracast and someone said that it happens when it can't write on the storage/sessions file. When I deploy my project to GCloud, I don't know how to make it writable by the server.
My composer.json file has this config right now:
"post-install-cmd": [
"Illuminate\\Foundation\\ComposerScripts::postInstall",
"php artisan optimize",
"chmod -R 755 bootstrap\/cache"
]
UPDATE 2
For now I changed the SESSION_DRIVER to cookie and it works in production.
Change the SESSION_DRIVER in your app.yaml to cookies, like :
env_variables:
# Put production environment variables here.
APP_LOG: errorlog
APP_DEBUG: false
SESSION_DRIVER : cookie
I am following the instructions on http://beta.appinventor.mit.edu/learn/reference/other/tinywebdb.html , trying to create a custom TinyWebDB for a grade 10 class I teach. After creating a new Project (the instructions say create an Application, but I only see a Create a new project button), I change the project name in the local file app.yaml file, load it in, and click on Deploy. I get the following error message:
Starting update of app: npicswebdb, version: 1
01:35 PM Getting current resource limits.
2016-03-09 13:35:26,727 ERROR appcfg.py:2396 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's~npicswebdb').
--- end server output ---
2016-03-09 13:35:26 (Process exited with code 1)
Is there some way I need to log in to the App Engine Launcher so it connects with my App Engine in the cloud? There is nothing in the instructions about doing that, and I don't see any way to do that in the launcher.
Thanks for your help.
Try adding "--no_cookies":
appcfg.py -A projectname update app.yaml --no_cookies
Delete cookie file something like this: ~/.appcfg_oauth2_tokens_java.
Re-run your command, it will prompt to login from browser and copy-paste a token back to the terminal.
Similar to the other answers. I run into the same issue and removing those stored credentials helped me, i.e:
rm ~/.appcfg_oauth2_tokens_java
rm ~/.appcfg_cookies
Found more details here: IT Code Hub - AppEngine deployment
This has worked for years. Today is not working.
Running appcfg.py download_data --flags..., and cannot get properly authorized.
Ran gcloud auth login
and got back:
Saved Application Default Credentials.
You are now logged in as [correct#gmail.com].
Your current project is [correct].
but when I run appcfg.py download_data ... I get this error:
raise ApplicationDefaultCredentialsError(ADC_HELP_MSG)
oauth2client.client.ApplicationDefaultCredentialsError: The
Application Default Credentials are not available. They are available if
running in Google Compute Engine. Otherwise, the environment variable
GOOGLE_APPLICATION_CREDENTIALS must be defined pointing to a file
defining the credentials. See
https://developers.google.com/accounts/docs/application-default
credentials for more information.
I updated the Google Cloud SDK, and now get a different error:
client.py:539 Attempting refresh to obtain initial access_token
client.py:797 Refreshing access_token
Error 302: --- begin server output ---
--- end server output ---
I have also set the credentials in Terminal:
set GOOGLE_APPLICATION_CREDENTIALS "https://www.myurl/credentials.json"
set CLOUDSDK_PYTHON_SITEPACKAGES 1
gcloud config set project "correct_project_name"
I have also tried setting the env_variable flag in the appcfg command:
--env_variable=GOOGLE_APPLICATION_CREDENTIALS:"https://www.myurl/credentials.json"
Seems to be a GAE bug. Removing the login:admin from the remote_api handler in app.yaml fixes it in production, but not local dev server. The 302 was telling me that the app was trying to redirect, perhaps to a Google login page. Was never seeing the prompt asking for email and password.
handlers:
- url: /remote_api
script: google.appengine.ext.remote_api.handler.application
#login: admin <-- removing admin fixes it in production
secure: always
On the dev server, removing the admin login yields this:
client.py:797 Refreshing access_token
Error 401: --- begin server output ---
You must be logged in as an administrator to access this.
--- end server output ---
Did Google change something in the --oauth2 workflow? I appear to be authorized, but the download crashes at the auth step.
Thanks.
Seems to be a bug in GoogleAppEngineLauncher-1.9.27, where it does not allow a login prompt. When reverting back to 1.9.26, it works. Interestingly, my gcloud components still have the 1.9.27 version:
>$ gcloud version
Google Cloud SDK 0.9.83
alpha 2015.10.08
app 2015.10.16
app-engine-python 1.9.27
beta 2015.10.08
core 2015.10.16
core-nix 2015.09.03
gcloud 2015.10.16
temporary solution: go to https://console.developers.google.com/storage/browser/appengine-sdks/featured/ to get version 1.9.26
Submitted bug report: https://code.google.com/p/google-cloud-sdk/issues/detail?id=340
Google App Engine SDK for PHP (at local environment) returns error on any try to use Google Cloud Storage. Error message is:
Fatal error: Uncaught exception 'google\appengine\runtime\RPCFailedError' with message 'Remote implementation for app_identity_service.GetAccessToken failed' in /media/data/home/vladimir/setup/gae/google_appengine/php/sdk/google/appengine/runtime/RemoteApiProxy.php on line 92
It exactly repeats the problem described here:
App engine update breaks CloudStorage in dev php env
Test code from the question above shows the same result.
I tried App Engine SDK for PHP versions 1.9.19, 1.9.20, 1.9.21 without success.
On Win10 this issue can be solved by generating an application-default credentials file:
D:\Workspace\Sourcecode>gcloud auth application-default login
Credentials saved to file: [C:\Users\Otje\AppData\Roaming\gcloud\application_default_credentials.json]
And then setting the environment in commandline:
D:\Workspace\Sourcecode>SET GOOGLE_APPLICATION_DEFAULT=C:\Users\Otje\AppData\Roaming\gcloud\application_default_credentials.json
Seems to me GAE on local just outputs limited error information when it can't find the right credentials to succesfully connect to remote endpoint.
It seems that it was GAE's server side issue. They fixed it. I discovered that it started to work as expected today without any changes applied by me.
I'm trying to get Push-to-Deploy to work with GAE through GitHub set-up as the code repo source.
This is now Day 3 and I've run into several bugs like:
Creating a Release pipeline failing for no apparent reason
Getting Error 500 when I finally managed get the source pulled over to GAE
Changes in Github are propagated to GAE (they're visible under Source code -> Browse), but the Release routine isn't run and (understandably so) the app is not being served at the web address.
I tried creating several new projects and I exhibited various versions of the bugs above.
Here's where I'm at now:
I created a brand new project, setup Github as my repo, created a Release Pipeline and did a push afterwards (to Github) just to try and trigger the Deploy routine to no avail. The code tree is visible under Source code -> Browse, along with commit dates and so on, but the Release pipeline isn't run.
App ID is skillful-signer-695 and the platform of choice is php.
Any ideas?
Update:
Nearly 24 hours after I set-up the project and did a test commit to trigger the Release pipeline, it finally got executed! Its result is marked as 'SUCCESS.
Now if I try and hit the project's URL I get a:
Error 500 - The server encountered an error and could not complete your request.
Any help will be greatly appreciated!
Update 2:
I got some more info by looking at the logs:
A problem was encountered with the process that handled this request, causing it to exit. This is likely to cause a new process to be used for the next request to your application. (Error code 204)
Perhaps there's something wrong with my (quite simple) app.yaml?
application: skillful-signer-695
version: 1
runtime: php
api_version: 1
threadsafe: false
handlers:
# Serve images as static resources.
- url: /(.+\.(gif|png|jpg))$
static_files: \1
upload: .+\.(gif|png|jpg)$
application_readable: true
# Serve php scripts.
- url: /.*
script: index.php
It seems a lot of different people are experiencing the same thing and it has to do with app.yaml, but I can't figure out what I'm doing wrong... The above is pretty much pasted from the example in the docs.
we were finally able to get this working - turns out there were some issues with the codebase for the website, which were leading to the 500 error (that's Code Igniter for you, I guess).
In addition, we had to add some lines to the app.yaml for css and fonts to show up. Here's what we ended up with:
application: skillful-signer-695
version: 1
runtime: php
api_version: 1
threadsafe: false
handlers:
- url: /assets/(.*\.(css|js|ttf))$
static_files: assets/\1
upload: assets/.*\.(css|js|ttf)$
# Serve images as static resources.
- url: /(.+\.(gif|png|jpg))$
static_files: \1
upload: .+\.(gif|png|jpg)$
application_readable: true
# Serve php scripts.
- url: /.*
script: index.php
Aside from the issues on our end, I believe we ran into several GAE bugs (inconsistent pull times from GitHub, Dashboard issues, incomplete docs, etc.) which are normal for Beta software, but nasty nonetheless. Thanks for the help!
p.s. We ran something else, which might save somebody some time digging around - if you're trying to use sockets (for example to send an email via SMTP from your support form hosted on GAE since the standard PHP mail command doesn't work) you'll find that Sockets are enabled only after you enter your billing info. They don't really charge you anything for light use, but I guess Google considers this a Premium feature.
All the best!
I am having issues with Push 2 Not Deploy feature, because -at least for now- GAE does not resolve git submodules.
If you have submodules or ignoring essential files from git, your application will not work.
For example: I am sending e-mails from GAE and my login_data.py is ignored by git via .gitignore
If you use appcfg.py update --oauth . your login_data.py will be sent. Using push2deploy in a this situation will end up a big error like this:
Error: Server Error
The server encountered an error and could not complete your request.
Please try again in 30 seconds.