- Operating System version: linux - ubuntu 23.10
- Firebase SDK version: 10.5
- Firebase Product: Firestore
- Node.js version: v16.19.0
- NPM version: 8.19.3
Problem
I tried a bulk upload in firestore emulator.
This is the error:
details: 'Received RST_STREAM with code 2 triggered by internal client error: Protocol error',
metadata: Metadata { internalRepr: Map(0) {}, options: {} },
note: 'Exception occurred in retry method that was not classified as transient'
Do you have any suggestion?
Thanks in advance
const admin = require('firebase-admin');
const firestore = admin.firestore();
const usersProfiles = require('./profileUsers.json');
firestore.settings({ preferRest: true });
const importaProfili = async () => {
usersProfiles.forEach(async (profile) => {
try {
await firestore.collection('users').add(profile);
console.log('success.');
} catch (error) {
console.log(`panic: `, error);
}
})
}
exports.importaProfili = importaProfili;