mlabで作成された独自のmongoデータベースを、ユーザー管理のためにauth0に使用しようとしています。ここに彼らが提供したテンプレートがあります。Auth0カスタムデータベースmongodb、サインアップスクリプトがSandboxTimeoutErrorを返す
function create (user, callback) {
mongo('mongodb://user:[email protected]/my-db', function (db) {
var users = db.collection('users');
users.findOne({ email: user.email }, function (err, withSameMail) {
if (err) return callback(err);
if (withSameMail) return callback(new Error('the user already exists'));
bcrypt.hashSync(user.password, 10, function (err, hash) {
if (err) { return callback(err); }
user.password = hash;
users.insert(user, function (err, inserted) {
if (err) return callback(err);
callback(null);
});
});
});
});
}
接続URIを変更した後、電子メールとパスワードをスクリプトに付けることでユーザーを作成しようとしました。次のエラーが表示されます。
[SandboxTimeoutError] Script execution did not complete within 20 seconds. Are you calling the callback function?
私が提供したデバッグスクリプトに従いました。ここにログがあります:
$ wt logs -p "myservice-eu-logs"
[12:35:27.137Z] INFO wt: connected to streaming logs (container=myservice)
[12:35:29.993Z] INFO wt: new webtask request 1478435731301.992259
[12:35:30.047Z] INFO wt: { [Error: Cannot find module '../build/Release/bson'] code: 'MODULE_NOT_FOUND' }
[12:35:30.047Z] INFO wt: js-bson: Failed to load c++ bson extension, using pure JS version
[12:36:05.080Z] INFO wt: finished webtask request 1478435731301.992259 with HTTP 500 in 35096ms
お勧めはありますか?
は、あなたは、いくつかの外部ファイル/モジュールを逃すように見えますか? – mike510a
同様の問題は、ノードの[ここ](http://stackoverflow.com/questions/28651028/cannot-find-module-build-release-bson-code-module-not-found-js-bson)に掲載されています。しかし、私はAuth0の 'bson'変数にどこにアクセスできるか分かりません。 –