我正在运行CosmosDB,当我尝试查找用户并更新其信息时,我发现了一个奇怪的间歇性错误。
我的电话:
bcrypt.hash(newpassword, salt, null, (err, hash) =>
{
if (err) { return next(err); }
User.findByIdAndUpdate(user.id, { password: hash, resetPassword: {} }, (err) =>
{
if (err) { return next(err); }
const { email } = user;
res.json({ email, token: tokenForUser(user) });
});
});
错误:
> MongoError: Message: {"Errors":["The requested operation cannot be
> performed at this region"]} ActivityId:
> 0ff0db7f-0000-0000-0000-000000000000, Request URI:
> /apps/7ef8ebd7-3aa2-4da3-bbc0-23dd39025348/services/5b9e0c68-6a68-4fae-a9f1-f968d368a9a7/partitions/34a98539-b29b-4f4d-86c8-dd96141721a4/replicas/131495233632205703p/
> at Function.MongoError.create (C:\Users\BaruchKogan\Documents\Visual Studio
> 2017\Projects\TrellisAuth\node_modules\mongodb-core\lib\error.js:31:11)
> at C:\Users\BaruchKogan\Documents\Visual Studio 2017\Projects\TrellisAuth\node_modules\mongodb-core\lib\connection\pool.js:497:72
> at authenticateStragglers (C:\Users\BaruchKogan\Documents\Visual Studio
> 2017\Projects\TrellisAuth\node_modules\mongodb-core\lib\connection\pool.js:443:16)
> at Connection.messageHandler (C:\Users\BaruchKogan\Documents\Visual Studio
> 2017\Projects\TrellisAuth\node_modules\mongodb-core\lib\connection\pool.js:477:5)
> at TLSSocket.<anonymous> (C:\Users\BaruchKogan\Documents\Visual Studio
> 2017\Projects\TrellisAuth\node_modules\mongodb-core\lib\connection\connection.js:331:22)
> at emitOne (events.js:96:13)
> at TLSSocket.emit (events.js:188:7)
> at readableAddChunk (_stream_readable.js:176:18)
> at TLSSocket.Readable.push (_stream_readable.js:134:10)
> at TLSWrap.onread (net.js:547:20)
任何想法意味着什么或如何进行故障排除?