Google App Engine - Issue with creating a bulkloading config - google-app-engine

I keep getting the below error while trying to create a bulkloader_config
HTTPError: HTTP Error 404: Not Found
[ERROR ] Authentication Failed: Incorrect credentials or unsupported authentication type (e.g. OpenId).
Command I am trying to execute
appcfg.py create_bulkloader_config --filename=bulkloader.yaml --url=https://<app-id>.appspot.com/_ah/remote_api --application=s~<app-id>
app.yaml as below
application: <app-id>
version: alpha-1-1-2
runtime: python27
api_version: 1
threadsafe: yes
builtins:
- appstats: on
- remote_api: on
Help appreciated as to what could be going wrong. The username and password are spot on.

Related

App Engine flexible deployment error "You have to set document_root in the runtime_config section in app.yaml"

I just started receiving this error message when deploying with gcloud app deploy, resulting in a failed deployment.
My yaml file does have runtime_config: document_root defined, and I have successfully deployed countless times before.
This is the error message I'm seeing:
Step #1: Digest: ...
Step #1: Status: Downloaded newer image for
gcr.io/gcp-runtimes/php/gen-dockerfile#sha256:26c300e0afd68577f9bd3f2565bd690379ed797b74eed8517cc93e86f2c1be5a
Step #1: gcr.io/gcp-runtimes/php/gen-dockerfile#sha256:26c300e0afd68577f9bd3f2565bd690379ed797b74eed8517cc93e86f2c1be5a
Step #1: + php /builder/create_dockerfile.php create --php72-image
gcr.io/google-appengine/php72#sha256:6255560e92bfff2d4debc198156bdbeeefccf97b4f315c84c5e6bc03387dc6f7
--php71-image gcr.io/google-appengine/php71#sha256:ea560b34d5da1e51aca89373ee90e2c67637fd141914d582753927e9d05f5d11
--php70-image gcr.io/google-appengine/php70#sha256:84b209e24bf340e3afbadde366ddb6c20d6879fe513bf600fc5a440767363917
--php56-image gcr.io/google-appengine/php56#sha256:8cd9595ab8672c906c029d58276ec5547d34e2781e278f6af0715ca8ac15bab1
Step #1: Step #1: In GenFilesCommand.php line 297: Step #1:
Step #1: You have to set document_root in the runtime_config section
in app.yaml. Step #1:
Step #1: Step #1: create [--php72-image PHP72-IMAGE] [--php71-image
PHP71-IMAGE] [--php70-image PHP70-IMAGE] [--php56-image PHP56-IMAGE]
[-w|--workspace WORKSPACE] Step #1: Finished Step #1 ERROR ERROR:
build step 1
"gcr.io/gcp-runtimes/php/gen-dockerfile#..."
failed: exit status 1
Updating service [...] (this may take several minutes)...failed.
ERROR: (gcloud.app.deploy) Error Response: [9] Cloud build
... status: FAILURE.
Build error details: Build error details not available..
Contents of my yaml configuration:
runtime: php
runtime_config:
document_root: wordpress
nginx_conf_include: nginx-app.conf
env: flex
api_version: 1
service: SERVICE_ID
threadsafe: true
automatic_scaling:
min_num_instances: 1
max_num_instances: 10
resources:
cpu: 4
memory_gb: 12
disk_size_gb: 10
beta_settings:
cloud_sql_instances: REDACTED
handlers:
- url: /(.*\.(htm|html|css|js|scss|map))
static_files: wordpress/\1
upload: wordpress/.*\.(htm|html|css|js|scss|map)$
application_readable: true
secure: always
- url: /(.*\.(ico|jpg|jpeg|png|gif|woff|ttf|otf|eot|svg))
static_files: wordpress/\1
upload: wordpress/.*\.(ico|jpg|jpeg|png|gif|woff|ttf|otf|eot|svg)$
application_readable: true
secure: always
- url: /(.*\.php)
script: wordpress/index.php
secure: always
skip_files:
- ^.sass-cache
- ^.git
- ^.log
- .sass-cache/
- .git/
- ^vendor
- ^node_modules
- ^wonolog
env_variables:
WHITELIST_FUNCTIONS: escapeshellarg,escapeshellcmd,exec,pclose,popen,shell_exec,phpversion,php_uname
It has been confirmed by the Google App Engine Team that this was an issue from their side, which prevented a custom-named yaml file from being deployed.
The App Engine Team has advised that this issue was due to a change on
our side that prevented flex builds. That change was rolled back.

Google App Engine - PHP - Mail not Working

I'm trying to send an email via PHP on GAE.
I use the code from here: cloud.google.com/appengine/docs/standard/php/mail
And a very minimal app.yaml that looks like so:
runtime: php72
handlers:
- url: .*
secure: always
script: auto
I get an error in app engine logs:
[ERROR 0 /index.php] PHP message: PHP Fatal error: Uncaught google\appengine\runtime\RPCFailedError: Remote implementation for mail.Send failed in /srv/vendor/google/appengine-php-sdk/google/appengine/runtime/VmApiProxy.php:179 Stack trace: #0 /srv/vendor/google/appengine-php-sdk/google/appengine/runtime/ApiProxy.php(40): google\appengine\runtime\VmApiProxy->makeSyncCall('mail', 'Send', Object(google\appengine\MailMessage), Object(google\appengine\base\VoidProto), 60) #1 /srv/vendor/google/appengine-php-sdk/google/appengine/api/mail/Message.php(146): google\appengine\runtime\ApiProxy::makeSyncCall('mail', 'Send', Object(google\appengine\MailMessage), Object(google\appengine\base\VoidProto)) #2 /srv/source/contactForm.php(188): google\appengine\api\mail\Message->send()
When using regular PHP mail function, it also fails.
On local dev env for GAE PHP it also crashes with the following error:
Uncaught google\appengine\runtime\RPCFailedError: Remote implementation for mail.Send failed in /home/dima/google-cloud-sdk/platform/google_appengine/php/sdk/google/appengine/runtime/RemoteApiProxy.php:92
Any ideas?

Issues while creating and deploying an app to google app engine

I am running into this error while deploying my app to google app-engine.
Error:
Error 404: --- begin server output ---
This application does not exist (project_id=u'homework-153002'). To create an App Engine application in this project, run "gcloud beta app create" in your console.
--- end server output ---
When I try to create the app using the above command this is what I see:
ERROR: (gcloud.beta.app.create) You do not have permission to access app [homework] (or it may not exist): Operation not allowed
I have created a project in google developers api website with project_name of "homework" and random id. Here is the url for that:
https://console.developers.google.com/apis/library?project=homework-153002
Any pointers on what I might be doing wrong here?
This is my yaml file:
application: homework-153002
version: 1
runtime: python27
api_version: 1
threadsafe: yes
handlers:
- url: .*
script: main.app
libraries:
- name: webapp2
version: "2.5.2"
Your app URL indicates your app ID is homework-153002, but the
error message indicates you're connecting to an ap called homework - likely not your own, hence the permission issue.
Simply correcting the app ID in your deployment command and/or your app.yaml file should suffice.
As your comment indicates, for your case (gcloud deployment) the solution was:
gcloud config set project homework-153002
gcloud beta app create
appcfg.py update homework/

App Engine Python Modules and inbound mail service

I am using App Engine Modules in my python project. (https://developers.google.com/appengine/docs/python/modules/#Python_Background_threads)
I am also receiving email in m project:
https://developers.google.com/appengine/docs/python/mail/receivingmail
I want to direct the emails to my worker module and not the default module. To that end my worker.yaml has the following settings
worker.yaml
api_version: 1
application: integrate
module: worker
version: 1-0-0
runtime: python27
threadsafe: true
inbound_services:
- mail
builtins:
- deferred: on
handlers:
- url: /admin/.+
script: src.worker.main.app
login: admin
- url: /_ah/mail/.+
script: src.worker.main.app
login: admin
- url: /.*
script: src.worker.main.app
app.yaml
api_version: 1
application: integrate
version: 1-0-0
runtime: python27
threadsafe: true
builtins:
- deferred: on
handlers:
- url: /admin/.+
script: src.default.main.app
login: admin
- url: /.*
script: src.default.main.app
I even tried adding a dispatch.yaml
application: integrate
dispatch:
- url: "*/_ah/mail/.+"
module: worker
But no matter what I do the emails which reach my app are handled by the default module. Any idea what I am missing here? I see the emails coming in but no matter what I do they only go to the default module.
Inbound services could be used only within default module and that is expected behavior. The fact that it works for you locally in devserver is a bug, actually.
Just some additional info for the answer which may help folks in a similar situation.
I noticed in the DevServer log:
"Skipping dispatch.yaml rules because /_ah/mail/[EMAIL_ADDRESS_FOR_APP] is not a dispatchable path."
This is no doubt due to local config, however.
Regardless, the workaround I have now using Tasks is:
Dispatch or directly handle Inbound Mail in the default module
Provide a script handler that creates a Task, taking the relevant MailMessage data as the payload
Set the TaskQueue in queue.yaml to target the module you wish to process the payload data, e.g. a 'worker' module

Unexpected attribute 'indexes' error while following GAE tutorial

I am following google app engine getting started tutorials. I am at this point; https://developers.google.com/appengine/docs/python/gettingstartedpython27/templates
I have tried to follow it to the point, but when I started my application from google app engine launcher, I see this in the logs;
---- a long traceback, followed by ----
File "C:\Program Files (x86)\Google\google_appengine\google\appengine\api\yaml_listener.py", line 177, in _HandleEvents
raise yaml_errors.EventError(e, event_object)
google.appengine.api.yaml_errors.EventError: Unexpected attribute 'indexes' for object of type AppInfoExternal.
in "C:\Users\muhammed\Desktop\guestbook\app.yaml", line 18, column 1
2013-09-12 13:01:26 (Process exited with code 1)
Here is how my app.yaml file looks like;
application: your-app-id
version: 1
runtime: python27
api_version: 1
threadsafe: true
handlers:
- url: /.*
script: guestbook.application
libraries:
- name: webapp2
version: latest
- name: jinja2
version: latest
indexes:
- kind: Greeting
ancestor: yes
properties:
- name: date
direction: desc
What am I doing wrong here?
The tutorial doesn't tell you to put indexes into app.yaml. They go in a separate file, index.yaml. But you usually don't have to bother, as the dev server will create them for you when you run your code locally.

Resources