Comments (6)
It's probably the healthcheck. To deal with it, I just put this in my https functions:
if req.method == "GET" and req.path == "/__/health":
logger.debug("Returning OK to healthcheck")
return https_fn.Response("OK")
If it's not that, print req.path
to find out what it is.
from firebase-functions-python.
@ekalosak Sorry if I misunderstood the issue, but does #134 fix this issue? Seems unrelated to me.
If indeed the issue is this extra GET request triggering the warning log with the None
request body, we should probably either try to fix that or if it's not something we can control, at least document it. The PR is still valid, just not sure if this issue should be considered fixed once that's merged in
from firebase-functions-python.
Hello @ekalosak. Could you provide a minimal reproducible example as well as your python version and contents of your requirements.txt
?
from firebase-functions-python.
@exaby73 That strikes me as correct.
The next line above in the stack trace is:
/.../venv/lib/python3.11/site-packages/firebase_functions/private/util.py", line 125, in _on_call_valid_
method
> _logging.warning("Request has invalid method.", request.method)
While I believe you are quite right that #134 will not fix the reported error, I believe the fix is something quite similar. The offending line is in the same util.py.
minimal reproducible example
python -c 'import logging; logging.warning("won't work", ("GET",))'
expected result
--- Logging error ---
Traceback (most recent call last):
File "/.../3.11.4/lib/python3.11/logging/__init__.py", line 1110, in emit
msg = self.format(record)
^^^^^^^^^^^^^^^^^^^
File "/.../3.11.4/lib/python3.11/logging/__init__.py", line 953, in format
return fmt.format(record)
^^^^^^^^^^^^^^^^^^
File "/.../3.11.4/lib/python3.11/logging/__init__.py", line 687, in format
record.message = record.getMessage()
^^^^^^^^^^^^^^^^^^^
File "/.../3.11.4/lib/python3.11/logging/__init__.py", line 377, in getMessage
msg = msg % self.args
~~~~^~~~~~~~~~~
TypeError: not all arguments converted during string formatting
Call stack:
File "<string>", line 1, in <module>
Message: 'asdf'
Arguments: (('GET',),)
Notice that string coercion fails for tuples.
So that's an easy fix of course, just extract the string value from the 1-tuple request.method
and 🚀
Regarding the GET request - as berengamble says above that seems likely to be a desirable health check. The desired behavior, I imagine, aught not to be to remove the health check but instead to fix the error in the utility that logs such requests.
from firebase-functions-python.
Fix: #138
from firebase-functions-python.
Fixed by merge of #138 .
from firebase-functions-python.
Related Issues (20)
- Can not request firebase function by using Cloud Task HOT 23
- firebase use flask route get "ECONNRESET" ,The restful api never response until 60s timeout HOT 4
- Sporadic datetime parse error HOT 9
- Unable to import logger HOT 6
- ModuleNotFoundError: No module named 'util' HOT 5
- Types are not exported HOT 9
- Parameterized configuration is not working HOT 1
- Missing retry in storage and firestore trigger decorators
- CORS Error on_call Cloud Function HOT 11
- logging library doesn't support Exceptions HOT 1
- Configure CPU-allocation, the run.googleapis.com/cpu-throttling boolean in Cloud Run HOT 2
- Firestore Emulator Cloud Trigger Issue with Write Operations HOT 1
- RetryConfig seems to be ignored on `@tasks_fn.on_task_dispatched` HOT 1
- auth-blocking-functions | Cannot extract event_type from identity_fn.AuthBlockingEvent HOT 1
- Container silently freezes on making a request to firestore if multiple requests were created before container starts HOT 2
- Cannot set invoker to public for HTTP request function HOT 3
- Firestore updates cause intermittent freezing of event triggers HOT 4
- Time data format error HOT 1
- Traceback (most recent call last): File "/layers/google.python.pip/pip/lib/python3.11/site-packages/flask/app.py", line 1463, in wsgi_app response = self.full_dispatch_request()
- KeyError: 'datacontenttype' HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from firebase-functions-python.