MySQL XDevAPI因“队列为空”而崩溃

时间:2018-09-05 10:15:38

标签: mysql node.js

我在express服务器正在运行的情况下将开发机器放在一夜之间,当我醒来时,我发现快递服务器因以下错误而崩溃:

C:\Users\James\Projects\nine-tails\server\node_modules\@mysql\xdevapi\lib\WorkQueue.js:72
        throw new Error('Queue is empty');
        ^

Error: Queue is empty

该错误来自xdevapi模块,但我似乎无法在文档的队列中找到任何内容,也不知道为什么发生此错误。

有什么建议吗?

编辑:以下是错误的整个日志:

0 info it worked if it ends with ok
1 verbose cli [ 'C:\\Program Files\\nodejs\\node.exe',
1 verbose cli   'C:\\Users\\James\\AppData\\Roaming\\npm\\node_modules\\npm\\bin\\npm-cli.js',
1 verbose cli   'run',
1 verbose cli   'start:express' ]
2 info using npm@6.4.0
3 info using node@v10.8.0
4 verbose run-script [ 'prestart:express', 'start:express', 'poststart:express' ]
5 info lifecycle server@1.0.0~prestart:express: server@1.0.0
6 info lifecycle server@1.0.0~start:express: server@1.0.0
7 verbose lifecycle server@1.0.0~start:express: unsafe-perm in lifecycle true
8 verbose lifecycle server@1.0.0~start:express: PATH: C:\Users\James\AppData\Roaming\npm\node_modules\npm\node_modules\npm-lifecycle\node-gyp-bin;C:\Users\James\Projects\nine-tails\server\node_modules\.bin;C:\Program Files\Git\mingw64\bin;C:\Program Files\Git\usr\bin;C:\Users\James\bin;C:\Python37\Scripts;C:\Python37;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0;C:\Windows\System32\OpenSSH;C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;C:\ProgramData\chocolatey\bin;C:\Program Files\nodejs;C:\Program Files\Git\cmd;C:\Program Files\PuTTY;C:\metasploit-framework\bin;C:\tools\php72;C:\Users\James\AppData\Local\Microsoft\WindowsApps;C:\Users\James\AppData\Roaming\npm;C:\Program Files\Docker Toolbox;C:\Users\James\AppData\Local\Programs\Microsoft VS Code\bin;C:\Users\James\AppData\Local\GitHubDesktop\bin
9 verbose lifecycle server@1.0.0~start:express: CWD: C:\Users\James\Projects\nine-tails\server
10 silly lifecycle server@1.0.0~start:express: Args: [ '/d /s /c',
10 silly lifecycle   'cross-env NODE_ENV=development DEBUG=express,database,routes node server.js' ]
11 silly lifecycle server@1.0.0~start:express: Returned: code: 1  signal: null
12 info lifecycle server@1.0.0~start:express: Failed to exec start:express script
13 verbose stack Error: server@1.0.0 start:express: `cross-env NODE_ENV=development DEBUG=express,database,routes node server.js`
13 verbose stack Exit status 1
13 verbose stack     at EventEmitter.<anonymous> (C:\Users\James\AppData\Roaming\npm\node_modules\npm\node_modules\npm-lifecycle\index.js:304:16)
13 verbose stack     at EventEmitter.emit (events.js:182:13)
13 verbose stack     at ChildProcess.<anonymous> (C:\Users\James\AppData\Roaming\npm\node_modules\npm\node_modules\npm-lifecycle\lib\spawn.js:55:14)
13 verbose stack     at ChildProcess.emit (events.js:182:13)
13 verbose stack     at maybeClose (internal/child_process.js:962:16)
13 verbose stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:249:5)
14 verbose pkgid server@1.0.0
15 verbose cwd C:\Users\James\Projects\nine-tails\server
16 verbose Windows_NT 10.0.17134
17 verbose argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Users\\James\\AppData\\Roaming\\npm\\node_modules\\npm\\bin\\npm-cli.js" "run" "start:express"
18 verbose node v10.8.0
19 verbose npm  v6.4.0
20 error code ELIFECYCLE
21 error errno 1
22 error server@1.0.0 start:express: `cross-env NODE_ENV=development DEBUG=express,database,routes node server.js`
22 error Exit status 1
23 error Failed at the server@1.0.0 start:express script.
23 error This is probably not a problem with npm. There is likely additional logging output above.
24 verbose exit [ 1, true ]

C:\Users\James\Projects\nine-tails\server\node_modules\@mysql\xdevapi\lib\WorkQueue.js:72
        throw new Error('Queue is empty');
        ^

Error: Queue is empty
    at WorkQueue.process (C:\Users\James\Projects\nine-tails\server\node_modules\@mysql\xdevapi\lib\WorkQueue.js:72:15)
    at Client.handleServerMessage (C:\Users\James\Projects\nine-tails\server\node_modules\@mysql\xdevapi\lib\Protocol\Client.js:201:21)
    at Client.handleNetworkFragment (C:\Users\James\Projects\nine-tails\server\node_modules\@mysql\xdevapi\lib\Protocol\Client.js:245:14)
    at TLSSocket.stream.on.data (C:\Users\James\Projects\nine-tails\server\node_modules\@mysql\xdevapi\lib\Protocol\Client.js:65:36)
    at TLSSocket.emit (events.js:182:13)
    at addChunk (_stream_readable.js:283:12)
    at readableAddChunk (_stream_readable.js:264:11)
    at TLSSocket.Readable.push (_stream_readable.js:219:10)
    at TLSWrap.onread (net.js:639:20)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! server@1.0.0 start:express: `cross-env NODE_ENV=development DEBUG=express,database,routes node server.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the server@1.0.0 start:express script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\James\AppData\Roaming\npm-cache\_logs\2018-09-05T09_06_40_255Z-debug.log

1 个答案:

答案 0 :(得分:0)

除非X插件(MySQL服务器)发送一些带外或意外消息(这很奇怪),否则不会发生。

无论如何,要处理的内容并不多。也许您可以扩展日志记录基础结构(或使连接器中的响应处理程序有些混乱),也可以查看实际发生的情况。

如果您发现有趣的事情,建议您使用Connector for Node.js类别在官方MySQL issue tracker中创建错误报告。

免责声明:我是项目负责人。