Comments (5)
Same issue for me, just I started with the sample
i functions: Beginning execution of "europe-west1-onfirestoredocumentwritten"
> [2023-05-24 14:06:55,688] ERROR in app: Exception on /functions/projects/ [POST]
> Traceback (most recent call last):
> File "/workspaces/firebase-sample/functions/venv/lib/python3.11/site-packages/flask/app.py", line 2190, in wsgi_app
> response = self.full_dispatch_request()
> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> File "/workspaces/firebase-sample/functions/venv/lib/python3.11/site-packages/flask/app.py", line 1486, in full_dispatch_request
> rv = self.handle_user_exception(e)
> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> File "/workspaces/firebase-sample/functions/venv/lib/python3.11/site-packages/flask/app.py", line 1484, in full_dispatch_request
> rv = self.dispatch_request()
> ^^^^^^^^^^^^^^^^^^^^^^^
> File "/workspaces/firebase-sample/functions/venv/lib/python3.11/site-packages/flask/app.py", line 1469, in dispatch_request
> return self.ensure_sync(self.view_functions[rule.endpoint])(**view_args)
> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> File "/workspaces/firebase-sample/functions/venv/lib/python3.11/site-packages/functions_framework/__init__.py", line 174, in view_func
> function(event)
> File "/workspaces/firebase-sample/functions/venv/lib/python3.11/site-packages/firebase_functions/firestore_fn.py", line 208, in on_document_written_wrapped
> return _firestore_endpoint_handler(
> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> File "/workspaces/firebase-sample/functions/venv/lib/python3.11/site-packages/firebase_functions/firestore_fn.py", line 114, in _firestore_endpoint_handler
> event_time = _dt.datetime.strptime(
> ^^^^^^^^^^^^^^^^^^^^^^
> File "/usr/local/lib/python3.11/_strptime.py", line 568, in _strptime_datetime
> tt, fraction, gmtoff_fraction = _strptime(data_string, format)
> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> File "/usr/local/lib/python3.11/_strptime.py", line 349, in _strptime
> raise ValueError("time data %r does not match format %r" %
> ValueError: time data '2023-05-24T14:06:54.424379216Z' does not match format '%Y-%m-%dT%H:%M:%S.%f%z'
i functions: Finished "europe-west1-onfirestoredocumentwritten" in 21.14ms
versions:
firebase-functions: 59d68cf
firebase cli version: 12.2.0
firebase emulator version: v1.17.4
I did a short research and the class implements the generic CloudEvent. Current version from the spec is v1.0.2 says the Timestamp format is RFC 3339 - it should match with %Y-%m-%dT%H:%M:%S.%f%z
. Maybe the issue is with the emulator because 2023-05-24T14:06:54.424379216Z
fractional seconds component 424379216
exceeds the six-digit limit specified by the RFC.
from firebase-functions-python.
Is there a workaround for this right now? I can't run test my firestore cloud functions at all without running into this error.
from firebase-functions-python.
Same problem here. Yesterday it worked, when I deployed my python function for the first time on functions emulator. After that I keep getting this error.
from firebase-functions-python.
We are having the same issue in a live environment when the milliseconds happen to be 0. It looks like on line 65 of cloudevents.http.event.py it is trying to add the time attribute to the event using isoformat which is dropping off the milliseconds. Then in firebase_functions.pubsub_fn.py on line 108 it is trying to parse that time assuming that there are milliseconds and it is throwing the same error everyone else is seeing.
File "/layers/google.python.pip/pip/lib/python3.11/site-packages/functions_framework/__init__.py", line 174, in view_func
function(event)
File "/layers/google.python.pip/pip/lib/python3.11/site-packages/firebase_functions/pubsub_fn.py", line 184, in on_message_published_wrapped
return _message_handler(func, raw)
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/layers/google.python.pip/pip/lib/python3.11/site-packages/firebase_functions/pubsub_fn.py", line 108, in _message_handler
time = _dt.datetime.strptime(
^^^^^^^^^^^^^^^^^^^^^^
File "/layers/google.python.runtime/python/lib/python3.11/_strptime.py", line 568, in _strptime_datetime
tt, fraction, gmtoff_fraction = _strptime(data_string, format)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/layers/google.python.runtime/python/lib/python3.11/_strptime.py", line 349, in _strptime
raise ValueError("time data %r does not match format %r" %
ValueError: time data '2023-06-13T15:17:49Z' does not match format '%Y-%m-%dT%H:%M:%S.%f%z'
from firebase-functions-python.
Release exist with this fix? I'm still have this issue sometimes
from firebase-functions-python.
Related Issues (20)
- 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 4
- 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
- Getting incorrect CORS 403 Error, resolves if I delete the Firebase function and re-deploy HOT 1
- cloud functions v2 crashes on 0.3.0 firebase-functions HOT 2
- Issues with @storage_fn.on_object_finalized() and Firebase Emulator HOT 3
- KeyError: `authtype` HOT 2
- Key error ['authtype'] in v0.3.0 when on_document_updated triggered from HTTP request HOT 3
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.