File size: 16,069 Bytes
31eedc3
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
b8392c6
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
2025-09-29 20:55:32.648 INFO [send_notifications] Initialized Firebase app with provided service account
2025-09-29 20:55:37.477 INFO [send_notifications] Fetched 0 user_notifications in 4.829s
2025-09-29 20:56:31.327 INFO [send_notifications] Initialized Firebase app with provided service account
2025-09-29 20:56:31.949 INFO [send_notifications] Fetched 0 user_notifications in 0.622s
2025-09-29 20:57:02.298 INFO [send_notifications] Initialized Firebase app with provided service account
2025-09-29 20:57:02.923 INFO [send_notifications] Fetched 3 user_notifications in 0.626s
2025-09-29 20:57:03.203 INFO [send_notifications] Fetched 0 attendance rows for 1 events in 0.280s
2025-09-29 20:57:03.465 INFO [send_notifications] Fetched 2 FCM token rows in 0.262s
2025-09-29 20:57:03.465 INFO [send_notifications] Sent notification for event 201 to 0 users. fcm_response=None
2025-09-29 20:57:03.723 INFO [send_notifications] Upserted 1 notifications in 0.258s
2025-09-29 20:57:03.972 INFO [send_notifications] Deleted 3 user_notifications in 0.249s
2025-09-29 20:58:56.714 INFO [send_notifications] Initialized Firebase app with provided service account
2025-09-29 20:58:57.363 INFO [send_notifications] Fetched 0 user_notifications in 0.648s
2025-09-29 20:59:12.770 INFO [send_notifications] Initialized Firebase app with provided service account
2025-09-29 20:59:13.273 INFO [send_notifications] Fetched 3 user_notifications in 0.503s
2025-09-29 20:59:13.519 INFO [send_notifications] Fetched 0 attendance rows for 1 events in 0.246s
2025-09-29 20:59:13.775 INFO [send_notifications] Fetched 2 FCM token rows in 0.255s
2025-09-29 20:59:13.775 INFO [send_notifications] Sent notification for event 201 to 0 users. fcm_response=None
2025-09-29 20:59:14.015 INFO [send_notifications] Upserted 1 notifications in 0.240s
2025-09-29 20:59:14.247 INFO [send_notifications] Deleted 3 user_notifications in 0.232s
2025-09-29 21:00:16.562 INFO [send_notifications] Initialized Firebase app with provided service account
2025-09-29 21:00:16.563 DEBUG [send_notifications] Fetching user_notifications from Supabase
2025-09-29 21:00:17.159 INFO [send_notifications] Fetched 0 user_notifications in 0.596s
2025-09-29 21:00:17.159 DEBUG [send_notifications] No notifications to process. Sleeping for 10 minutes.
2025-09-29 21:00:34.273 INFO [send_notifications] Initialized Firebase app with provided service account
2025-09-29 21:00:34.273 DEBUG [send_notifications] Fetching user_notifications from Supabase
2025-09-29 21:00:34.804 INFO [send_notifications] Fetched 3 user_notifications in 0.531s
2025-09-29 21:00:34.804 DEBUG [send_notifications] Aggregated notifications into 1 events
2025-09-29 21:00:34.804 DEBUG [send_notifications] Fetching event_attendance for event_ids: [201]
2025-09-29 21:00:35.048 INFO [send_notifications] Fetched 0 attendance rows for 1 events in 0.243s
2025-09-29 21:00:35.048 DEBUG [send_notifications] Fetching FCM tokens for user_ids (count=3)
2025-09-29 21:00:35.279 INFO [send_notifications] Fetched 2 FCM token rows in 0.231s
2025-09-29 21:00:35.279 DEBUG [send_notifications] No tokens provided to send_fcm
2025-09-29 21:00:35.279 INFO [send_notifications] Sent notification for event 201 to 0 users. fcm_response=None
2025-09-29 21:00:35.279 DEBUG [send_notifications] Upserting 1 notification rows
2025-09-29 21:00:35.529 INFO [send_notifications] Upserted 1 notifications in 0.250s
2025-09-29 21:00:35.529 DEBUG [send_notifications] Deleting 3 user_notifications
2025-09-29 21:00:35.790 INFO [send_notifications] Deleted 3 user_notifications in 0.261s
2025-09-29 21:00:35.790 DEBUG [send_notifications] Deleted processed notifications for event 201.
2025-09-29 21:03:09.066 INFO [send_notifications] Initialized Firebase app with provided service account
2025-09-29 21:03:09.067 DEBUG [send_notifications] Fetching user_notifications from Supabase
2025-09-29 21:03:10.465 INFO [send_notifications] Fetched 0 user_notifications in 1.398s
2025-09-29 21:03:10.465 DEBUG [send_notifications] No notifications to process. Sleeping for 10 minutes.
2025-09-29 21:03:27.018 INFO [send_notifications] Initialized Firebase app with provided service account
2025-09-29 21:03:27.019 DEBUG [send_notifications] Fetching user_notifications from Supabase
2025-09-29 21:03:27.528 INFO [send_notifications] Fetched 3 user_notifications in 0.509s
2025-09-29 21:03:27.528 DEBUG [send_notifications] Aggregated notifications into 1 events
2025-09-29 21:03:27.528 DEBUG [send_notifications] Fetching event_attendance for event_ids: [201]
2025-09-29 21:03:27.783 INFO [send_notifications] Fetched 0 attendance rows for 1 events in 0.255s
2025-09-29 21:03:27.783 DEBUG [send_notifications] Fetching FCM tokens for user_ids (count=3)
2025-09-29 21:03:28.036 INFO [send_notifications] Fetched 2 FCM token rows in 0.253s
2025-09-29 21:03:28.036 DEBUG [send_notifications] No tokens provided to send_fcm
2025-09-29 21:03:28.036 INFO [send_notifications] Sent notification for event 201 to 0 users. fcm_response=None
2025-09-29 21:03:28.036 DEBUG [send_notifications] Upserting 1 notification rows
2025-09-29 21:03:28.281 INFO [send_notifications] Upserted 1 notifications in 0.245s
2025-09-29 21:03:28.281 DEBUG [send_notifications] Deleting 3 user_notifications
2025-09-29 21:03:28.533 INFO [send_notifications] Deleted 3 user_notifications in 0.252s
2025-09-29 21:03:28.533 DEBUG [send_notifications] Deleted processed notifications for event 201.
2025-09-29 21:07:57.944 INFO [send_notifications] Initialized Firebase app with provided service account
2025-09-29 21:07:57.945 DEBUG [send_notifications] Fetching user_notifications from Supabase
2025-09-29 21:07:58.647 INFO [send_notifications] Fetched 3 user_notifications in 0.702s
2025-09-29 21:07:58.647 DEBUG [send_notifications] Aggregated notifications into 1 events
2025-09-29 21:07:58.647 DEBUG [send_notifications] Fetching event_attendance for event_ids: [201]
2025-09-29 21:07:58.903 INFO [send_notifications] Fetched 0 attendance rows for 1 events in 0.256s
2025-09-29 21:07:58.903 DEBUG [send_notifications] Fetching FCM tokens for user_ids (count=3)
2025-09-29 21:07:59.175 INFO [send_notifications] Fetched 2 FCM token rows in 0.272s
2025-09-29 21:07:59.175 DEBUG [send_notifications] No tokens provided to send_fcm
2025-09-29 21:07:59.175 INFO [send_notifications] Sent notification for event 201 to 0 users. fcm_response=None
2025-09-29 21:07:59.175 DEBUG [send_notifications] Upserting 1 notification rows
2025-09-29 21:07:59.416 INFO [send_notifications] Upserted 1 notifications in 0.241s
2025-09-29 21:07:59.416 DEBUG [send_notifications] Deleting 3 user_notifications
2025-09-29 21:07:59.657 INFO [send_notifications] Deleted 3 user_notifications in 0.241s
2025-09-29 21:07:59.657 DEBUG [send_notifications] Deleted processed notifications for event 201.
2025-09-29 21:09:07.318 INFO [send_notifications] Initialized Firebase app with provided service account
2025-09-29 21:09:07.319 DEBUG [send_notifications] Fetching user_notifications from Supabase
2025-09-29 21:09:07.895 INFO [send_notifications] Fetched 0 user_notifications in 0.576s
2025-09-29 21:09:07.895 DEBUG [send_notifications] No notifications to process. Sleeping for 10 minutes.
2025-09-29 21:09:21.071 INFO [send_notifications] Initialized Firebase app with provided service account
2025-09-29 21:09:21.071 DEBUG [send_notifications] Fetching user_notifications from Supabase
2025-09-29 21:09:21.591 INFO [send_notifications] Fetched 3 user_notifications in 0.520s
2025-09-29 21:09:21.591 DEBUG [send_notifications] Aggregated notifications into 1 events
2025-09-29 21:09:21.591 DEBUG [send_notifications] Fetching event_attendance for event_ids: [201]
2025-09-29 21:09:21.834 INFO [send_notifications] Fetched 3 attendance rows for 1 events in 0.243s
2025-09-29 21:09:21.834 DEBUG [send_notifications] Fetching FCM tokens for user_ids (count=3)
2025-09-29 21:09:22.087 INFO [send_notifications] Fetched 2 FCM token rows in 0.253s
2025-09-29 21:09:22.087 INFO [send_notifications] Sending FCM multicast message to 2 tokens
2025-09-29 21:09:22.100 ERROR [send_notifications] Failed to send FCM multicast message: Message.data must not contain non-string values.
Traceback (most recent call last):
  File "/home/muneeb/Projects/SendNotifications/main.py", line 195, in send_fcm
    res = messaging.send_each_for_multicast(message)
  File "/home/muneeb/Projects/SendNotifications/.venv/lib64/python3.13/site-packages/firebase_admin/messaging.py", line 240, in send_each_for_multicast
    return _get_messaging_service(app).send_each(messages, dry_run)
           ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^
  File "/home/muneeb/Projects/SendNotifications/.venv/lib64/python3.13/site-packages/firebase_admin/messaging.py", line 449, in send_each
    message_data = [self._message_data(message, dry_run) for message in messages]
                    ~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^
  File "/home/muneeb/Projects/SendNotifications/.venv/lib64/python3.13/site-packages/firebase_admin/messaging.py", line 520, in _message_data
    data = {'message': _MessagingService.encode_message(message)}
                       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^
  File "/home/muneeb/Projects/SendNotifications/.venv/lib64/python3.13/site-packages/firebase_admin/messaging.py", line 415, in encode_message
    return cls.JSON_ENCODER.default(message)
           ~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^
  File "/home/muneeb/Projects/SendNotifications/.venv/lib64/python3.13/site-packages/firebase_admin/_messaging_encoder.py", line 692, in default
    'data': _Validators.check_string_dict('Message.data', o.data),
            ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/muneeb/Projects/SendNotifications/.venv/lib64/python3.13/site-packages/firebase_admin/_messaging_encoder.py", line 128, in check_string_dict
    raise ValueError(f'{label} must not contain non-string values.')
ValueError: Message.data must not contain non-string values.
2025-09-29 21:09:22.105 ERROR [send_notifications] Error in notification service main loop: Message.data must not contain non-string values.
Traceback (most recent call last):
  File "/home/muneeb/Projects/SendNotifications/main.py", line 246, in notification_service
    response = send_fcm(tokens, notif["title"], notif["body"], data)
  File "/home/muneeb/Projects/SendNotifications/main.py", line 195, in send_fcm
    res = messaging.send_each_for_multicast(message)
  File "/home/muneeb/Projects/SendNotifications/.venv/lib64/python3.13/site-packages/firebase_admin/messaging.py", line 240, in send_each_for_multicast
    return _get_messaging_service(app).send_each(messages, dry_run)
           ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^
  File "/home/muneeb/Projects/SendNotifications/.venv/lib64/python3.13/site-packages/firebase_admin/messaging.py", line 449, in send_each
    message_data = [self._message_data(message, dry_run) for message in messages]
                    ~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^
  File "/home/muneeb/Projects/SendNotifications/.venv/lib64/python3.13/site-packages/firebase_admin/messaging.py", line 520, in _message_data
    data = {'message': _MessagingService.encode_message(message)}
                       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^
  File "/home/muneeb/Projects/SendNotifications/.venv/lib64/python3.13/site-packages/firebase_admin/messaging.py", line 415, in encode_message
    return cls.JSON_ENCODER.default(message)
           ~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^
  File "/home/muneeb/Projects/SendNotifications/.venv/lib64/python3.13/site-packages/firebase_admin/_messaging_encoder.py", line 692, in default
    'data': _Validators.check_string_dict('Message.data', o.data),
            ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/muneeb/Projects/SendNotifications/.venv/lib64/python3.13/site-packages/firebase_admin/_messaging_encoder.py", line 128, in check_string_dict
    raise ValueError(f'{label} must not contain non-string values.')
ValueError: Message.data must not contain non-string values.
2025-09-29 21:10:25.942 INFO [send_notifications] Initialized Firebase app with provided service account
2025-09-29 21:10:25.942 DEBUG [send_notifications] Fetching user_notifications from Supabase
2025-09-29 21:10:26.563 INFO [send_notifications] Fetched 3 user_notifications in 0.621s
2025-09-29 21:10:26.563 DEBUG [send_notifications] Aggregated notifications into 1 events
2025-09-29 21:10:26.563 DEBUG [send_notifications] Fetching event_attendance for event_ids: [201]
2025-09-29 21:10:26.840 INFO [send_notifications] Fetched 3 attendance rows for 1 events in 0.277s
2025-09-29 21:10:26.841 DEBUG [send_notifications] Fetching FCM tokens for user_ids (count=3)
2025-09-29 21:10:27.111 INFO [send_notifications] Fetched 2 FCM token rows in 0.271s
2025-09-29 21:10:27.111 INFO [send_notifications] Sending FCM multicast message to 2 tokens
2025-09-29 21:10:28.517 INFO [send_notifications] FCM multicast send result: <firebase_admin.messaging.BatchResponse object at 0x7f8f28d99400>
2025-09-29 21:10:28.517 INFO [send_notifications] Sent notification for event 201 to 2 users. fcm_response=1
2025-09-29 21:10:28.517 DEBUG [send_notifications] Upserting 1 notification rows
2025-09-29 21:10:28.769 INFO [send_notifications] Upserted 1 notifications in 0.252s
2025-09-29 21:10:28.769 DEBUG [send_notifications] Deleting 3 user_notifications
2025-09-29 21:10:29.042 INFO [send_notifications] Deleted 3 user_notifications in 0.273s
2025-09-29 21:10:29.042 DEBUG [send_notifications] Deleted processed notifications for event 201.
2025-09-29 21:10:47.458 INFO [send_notifications] Initialized Firebase app with provided service account
2025-09-29 21:10:47.459 DEBUG [send_notifications] Fetching user_notifications from Supabase
2025-09-29 21:10:48.002 INFO [send_notifications] Fetched 3 user_notifications in 0.543s
2025-09-29 21:10:48.002 DEBUG [send_notifications] Aggregated notifications into 1 events
2025-09-29 21:10:48.002 DEBUG [send_notifications] Fetching event_attendance for event_ids: [201]
2025-09-29 21:10:48.244 INFO [send_notifications] Fetched 3 attendance rows for 1 events in 0.242s
2025-09-29 21:10:48.244 DEBUG [send_notifications] Fetching FCM tokens for user_ids (count=3)
2025-09-29 21:10:48.504 INFO [send_notifications] Fetched 2 FCM token rows in 0.260s
2025-09-29 21:10:48.504 INFO [send_notifications] Sending FCM multicast message to 2 tokens
2025-09-29 21:10:49.836 INFO [send_notifications] FCM multicast send result: <firebase_admin.messaging.BatchResponse object at 0x7f3faf69d400>
2025-09-29 21:10:49.836 INFO [send_notifications] Sent notification for event 201 to 2 users. fcm_response=1
2025-09-29 21:10:49.836 DEBUG [send_notifications] Upserting 1 notification rows
2025-09-29 21:10:50.094 INFO [send_notifications] Upserted 1 notifications in 0.257s
2025-09-29 21:10:50.094 DEBUG [send_notifications] Deleting 3 user_notifications
2025-09-29 21:10:50.331 INFO [send_notifications] Deleted 3 user_notifications in 0.238s
2025-09-29 21:10:50.332 DEBUG [send_notifications] Deleted processed notifications for event 201.
2025-09-30 20:42:12.112 INFO [send_notifications] Initialized Firebase app with provided service account
2025-09-30 20:42:12.113 DEBUG [send_notifications] Fetching user_notifications from Supabase
2025-09-30 20:42:13.065 INFO [send_notifications] Fetched 0 user_notifications in 0.952s
2025-09-30 20:42:13.065 DEBUG [send_notifications] No notifications to process. Sleeping for 10 minutes.
2025-09-30 20:51:10.751 INFO [send_notifications] Initialized Firebase app with provided service account
2025-09-30 20:51:45.015 INFO [send_notifications] Initialized Firebase app with provided service account
2025-09-30 20:51:45.015 DEBUG [send_notifications] Fetching user_notifications from Supabase
2025-09-30 20:51:46.065 INFO [send_notifications] Fetched 0 user_notifications in 1.049s
2025-09-30 20:51:46.065 DEBUG [send_notifications] No notifications to process. Sleeping for 10 minutes.