使用 Horizon 开发服务器一段时间后,我突然收到“400 错误请求错误”。重新启动服务器后,我在终端中收到以下错误:
at ReqlRuntimeError.ReqlError [as constructor] (c:\Users\carl\AppData\Roaming\npm\node_modules\horizon\node_modules\rethinkdb\errors.js:23:13)
at new ReqlRuntimeError (c:\Users\carl\AppData\Roaming\npm\node_modules\horizon\node_modules\rethinkdb\errors.js:90:51)
at mkErr (c:\Users\carl\AppData\Roaming\npm\node_modules\horizon\node_modules\rethinkdb\util.js:177:10)
at Feed.IterableResult._addResponse (c:\Users\carl\AppData\Roaming\npm\node_modules\horizon\node_modules\rethinkdb\cursor.js:75:27)
at TcpConnection.<anonymous> (c:\Users\carl\AppData\Roaming\npm\node_modules\horizon\node_modules\rethinkdb\net.js:360:22)
at TcpConnection.cancel (c:\Users\carl\AppData\Roaming\npm\node_modules\horizon\node_modules\rethinkdb\util.js:26:16)
at TcpConnection.cancel (c:\Users\carl\AppData\Roaming\npm\node_modules\horizon\node_modules\rethinkdb\net.js:783:43)
at wrappedCb (c:\Users\carl\AppData\Roaming\npm\node_modules\horizon\node_modules\rethinkdb\net.js:270:17)
at tryCatcher (c:\Users\carl\AppData\Roaming\npm\node_modules\horizon\node_modules\rethinkdb\node_modules\bluebird\js\main\util.js:26:23)
at Promise.successAdapter (c:\Users\carl\AppData\Roaming\npm\node_modules\horizon\node_modules\rethinkdb\node_modules\bluebird\js\main\nodeify.js:23:30)
at Promise._settlePromiseAt (c:\Users\carl\AppData\Roaming\npm\node_modules\horizon\node_modules\rethinkdb\node_modules\bluebird\js\main\promise.js:579:21)
at Promise._settlePromises (c:\Users\carl\AppData\Roaming\npm\node_modules\horizon\node_modules\rethinkdb\node_modules\bluebird\js\main\promise.js:697:14)
at Async._drainQueue (c:\Users\carl\AppData\Roaming\npm\node_modules\horizon\node_modules\rethinkdb\node_modules\bluebird\js\main\async.js:123:16)
at Async._drainQueues (c:\Users\carl\AppData\Roaming\npm\node_modules\horizon\node_modules\rethinkdb\node_modules\bluebird\js\main\async.js:133:10)
at Immediate.Async.drainQueues [as _onImmediate] (c:\Users\carl\AppData\Roaming\npm\node_modules\horizon\node_modules\rethinkdb\node_modules\bluebird\js\main\async.js:15:14)
at processImmediate [as _immediateCallback] (timers.js:383:17)
该错误连续记录两到三次,然后它指出:
Horizon ready for connections �
但是当通过'localhost:8181'重新连接到服务器时,它再次在控制台中显示'400 Bad Request Error'。
管理界面显示没有问题。
在使用 Node.js v4.4.4 和 Horizon v1.0.1 的 Win10 64 位机器上使用入门指南中的代码时会发生这种情况。