firebase / firebase/firebase-admin-node
auth.user().onCreate() fails with node: ../deps/uv/src/unix/epoll.c:312: uv__io_poll: Assertion `loop->watchers != NULL' failed.
- Ngôn ngữ chính
- TypeScript
- Star
- 1.7k
- Fork
- 419
- Merge trung bình
- 3 ngày 10 giờ
- Pull request đã merge (30 ngày)
- 16
Mô tả
* Operating System version: Firebase CloudFunctions NodeJS (v1)
* Firebase SDK version: "firebase-functions": "^4.1.1"
* Firebase Product: auth
* Node.js version: CloudFunctions v1
* NPM version: Deployed via firebase cli
### [REQUIRED] Step 3: Describe the problem
I use the `functions.auth.user().onCreate()` hook to automatically create a database entry when a new user registers. However, this hook sometimes fails with the following log:
`node: ../deps/uv/src/unix/epoll.c:312: uv__io_poll: Assertion `loop->watchers != NULL' failed.`
#### Steps to reproduce:
Here is the google cloud log:
```
{
"textPayload": "node: ../deps/uv/src/unix/epoll.c:312: uv__io_poll: Assertion `loop->watchers != NULL' failed.",
"insertId": "653bb6a900030d36d8cf181a",
"resource": {
"type": "cloud_function",
"labels": {
"region": "us-central1",
"project_id": "XXXXXXX",
"function_name": "auth-onRegistered"
}
},
"timestamp": "2023-10-27T13:10:01.199990Z",
"labels": {
"execution_id": "oxv3664a2uje",
"instance_id": "0037d6d5d3a7dcb74ae305ac7f40db1ec80f2048dd7c521217f638a659a3eca90a6fedc99509a9e10073d7934b12ba2cee8da5050c465062e73cf2d98207d9a4bb1c"
},
"logName": "projects/XXXXXXX/logs/cloudfunctions.googleapis.com%2Fcloud-functions",
"trace": "projects/XXXXXXX/traces/be85c3c2262f49dfc8dd2f0645bfe485",
"receiveTimestamp": "2023-10-27T13:10:01.539668946Z"
}
```
#### Relevant Code:
This is my code:
```
export default functions.runWith({ memory: "256MB", minInstances: 1 }).auth.user().onCreate(async (user) => {
await usersCollection.doc(user.uid).set({
'registeredAt': FieldValue.serverTimestamp(),
'profile': {
'name': '',
'image': null,
}
});
});
```
Hướng dẫn đóng góp
Hướng nghiên cứu
Bắt đầu với handler functions.auth.user().onCreate() được cung cấp và log Google Cloud cho auth-onRegistered, sau đó so sánh các phiên bản của Firebase Functions SDK và runtime Cloud Functions v1 Node.js. Được xem là hoàn tất khi tái hiện được assertion hoặc xác định được nguyên nhân của nó, đồng thời ghi lại một fix hoặc workaround đã được xác minh.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Đánh giá
- Công nghệ
- firebase, nodejs
- Lĩnh vực
- authentication, backend
- Loại issue
- Lỗi
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức độ hoạt động
- Đình trệ
- Độ rõ ràng
- Cần làm rõ
- Mức phù hợp với người mới
- 28/100