Google App Engine Over quota error - google-app-engine

The recommended way by Google to capture the over quota error when you run out of money on your credit card seems not to capture the error:
error_handlers:
- error_code: over_quota
file: over_quota.html
handlers:
- url: /_ah/queue/deferred
script: djangoappengine/deferred/handler.py
login: admin
- url: /test.*
login: admin
script: groupbuy/tests/gaeunit.py
- url: /_ah/stats/.*
script: djangoappengine/appstats/ui.py
- url: /media/admin
static_dir: django/contrib/admin/media
expiration: '0'
- url: /static
static_dir: groupbuy/static
- url: /robots.txt
static_files: groupbuy/static/robots.txt
upload: groupbuy/static/robots.txt
- url: /.*
script: djangoappengine/main/main.py
It seems the error handler over_quota.html is not captured, what could be wrong in the urls or is it ordering?

Related

why {app-url}/reset-password/{token} url showing page not found in react app deployed on google cloud where it working in local?

Token: {app-url}/reset-password/eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE2MTI3OTUxNjksInVzZXJJZCI6NjB9.YS1seObMs45hcTDH4nSbTNh1W4fTTqPcpF4TUamfFFk
Error: Error: Not Found
The requested URL /reset-password/eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE2MTI3OTUxNjksInVzZXJJZCI6NjB9.YS1seObMs45hcTDH4nSbTNh1W4fTTqPcpF4TUamfFFk was not found on this server.
Code:
<Route exact path="/reset-password/:token" component={ResetPassword} />
Does this issue bcs app deployed in GCloud or any thing needs to change in react code (project is create react app not webpack) ?
app.yaml
runtime: nodejs12
handlers:
- url: /(.*\..+)$
static_files: build/\1
upload: build/(.*\..+)$
- url: /.*
static_files: build/index.html
upload: build/index.html
Needs to change app.yaml
runtime: nodejs12
handlers:
- url: /static
static_dir: build/static
- url: /(.*\.(json|ico|js|png))$
static_files: build/\1
upload: build/.*\.(json|ico|js|png)$
- url: .*
static_files: build/index.html
upload: build/index.html
thanks to https://stackoverflow.com/a/55831186

Could not guess mimetype

On the test server goapp serv it works, on the appengine itself it get overwritten by application/octet-stream.
How can I tell appengine to stop doing that?
Could not guess mimetype for home/fonts/FontAwesome.otf. Using application/octet-stream...
My config file:
application: test
version: 0
runtime: go
api_version: go1
threadsafe: true
handlers:
- url: /home
static_dir: home
- url: /home/font/(.*\.woff)
static_files: home/font/\1
upload: home/font/(.*\.woff)
http_headers:
Content-Type: application/font-woff
- url: /home/font/(.*\.svg)
static_files: home/font/\1
upload: home/font/(.*\.svg)
http_headers:
Content-Type: image/svg+xml
- url: /home/font/(.*\.eot)
static_files: home/font/\1
upload: home/font/(.*\.eot)
http_headers:
Content-Type: application/vnd.ms-fontobject
- url: /home/font/(.*\.ttf)
static_files: home/font/\1
upload: home/font/(.*\.ttf)
http_headers:
Content-Type: application/x-font-ttf
- url: /home/font/(.*\.otf)
static_files: home/font/\1
upload: home/font/(.*\.otf)
http_headers:
Content-Type: application/x-font-otf
- url: /favicon.ico
static_files: home/favicon.ico
upload: home/favicon.ico
- url: /documentation
static_dir: documentation
- url: /.*
script: _go_app
inbound_services:
- warmup
I believe the reason it's working locally is that your system has the required mime type defined for the .otf extension in the /etc/mime.types or equivalent.
AppEngine probably doesn't have that. So you have to give it a hint about the correct MIME type. It looks like you're trying to do but, but you are using "http_headers". Try "mime_type" instead:
- url: /home/font/(.*\.otf)
static_files: home/font/\1
upload: home/font/(.*\.otf)
mime_type: application/x-font-otf
I hope that works for you. The documentation is at:
https://developers.google.com/appengine/docs/python/config/appconfig#Python_app_yaml_Static_file_handlers
It's also worth noting that generic rule should go last, like this:
handlers:
- url: /static/fonts/(.*\.otf)
static_files: static/fonts/\1
upload: static/fonts/(.*\.otf)
mime_type: application/x-font-otf
- url: /static/fonts/(.*\.ttf)
static_files: static/fonts/\1
upload: static/fonts/(.*\.ttf)
mime_type: application/x-font-ttf
- url: /static
static_dir: static

Google app engine + Go + serve static files + what is wrong with the config

I have this in app.yaml
application: test
version: 1
runtime: go
api_version: go1
handlers:
- url: /
static_files: client/index.html
upload: client/index.html
- url: /index\.html
static_files: client/index.html
upload: client/index.html
- url: /(.*\.(css|gif|png|jpg|ico|js|html))
static_files: client/\1
upload: client/(.*\.(css|gif|png|jpg|ico|js|html))
- url: /.*
script: _go_app
I start the app with "dev_appserver.py test".
When I open in the browser localhost:8080 or localhost:8080/index.html
I get a 404
application: test
version: 1
runtime: go
api_version: go1
handlers:
- url: /
static_files: app/client/index.html
upload: app/client/index.html
- url: /(.*\.(css|gif|png|jpg|ico|js|html))
static_files: app/client/\1
upload: app/client/(.*\.(css|gif|png|jpg|ico|js|html))
- url: /.*
script: _go_app

How to configure the app.yaml for using images?

i have a big problem with images for my project with python (appspots.com).
How to configure the app.yaml for images?
My Images are in the directory /css/images/xy.png
The log say:
INFO 2012-04-22 17:29:42,601 dev_appserver.py:2884] "GET
/css/images/ui-bg_glass_75_e6e6e6_1x400.png HTTP/1.1" 404 -
My app.yaml (only handlers):
- url: /js
static_dir: js
- url: /css/main.css
static_files: css/main.css
upload: css/main.css
- url: /css/jquery-ui-1.8.19.custom.css
static_files: css/jquery-ui-1.8.19.custom.css
upload: css/jquery-ui-1.8.19.custom.css
- url: .*
script: main.py
- url: /css/images/.*
static_dir: css/images
I hope that you can help me :)
The problem is that you have .* before /css/images./* and that pattern matches everything. Rearrange it like this:
- url: /js
static_dir: js
- url: /css/main.css
static_files: css/main.css
upload: css/main.css
- url: /css/jquery-ui-1.8.19.custom.css
static_files: css/jquery-ui-1.8.19.custom.css
upload: css/jquery-ui-1.8.19.custom.css
- url: /css/images
static_dir: css/images
- url: .*
script: main.py
EDIT:
Try removing the /.* from the end of the pattern, as illustrated above.

GAE is not serving my robots.txt

I have the following defined in my app.yaml:
handlers:
- url: /favicon.ico
static_files: img/favicon.ico
upload: noop
- url: /apple-touch-icon.png
static_files: img/apple-touch-icon.png
upload: noop
- url: /images
static_dir: img
- url: /robots.txt
static_files: media/robots.txt
upload: noop
- url: /humans.txt
static_files: media/humans.txt
upload: noop
There are other mappings after the declaration for /humans.txt but I'll remove them for brevity.
The noop directory is an empty directory.
However my browser gives me a 404 when I try to access these urls:
http://myapp.appspot.com/humans.txt
http://myapp.appspot.com/robots.txt
Why ?
Since you're using static files, upload should match the static_files location:
- url: /robots.txt
static_files: media/robots.txt
upload: media/robots.txt
- url: /humans.txt
static_files: media/humans.txt
upload: media/humans.txt

Resources