remyla / damas-core

JSON storage service. RESTful, CRUD, multi-user.
http://damas-software.org
GNU General Public License v3.0
56 stars 23 forks source link

server-nodejs: crash (experimental branch) #146

Open remyla opened 8 years ago

remyla commented 8 years ago

to reproduce:

in a console on the server:

$ damas add test2
{"_id":"2f74657374732f7465737432","author":"127.0.0.1","time":1467214235678}
$ damas read test2

(empty line output)

and the server stdout:

  express:router dispatching GET /api/verify/ +7s
  express:router query  : /api/verify/ +0ms
  express:router expressInit  : /api/verify/ +1ms
  express:router urlencodedParser  : /api/verify/ +0ms
  body-parser:urlencoded skip empty body +0ms
  express:router jsonParser  : /api/verify/ +0ms
  body-parser:json skip empty body +0ms
  express:router logger  : /api/verify/ +0ms
  express:router <anonymous>  : /api/verify/ +1ms
{}
  express:router serveStatic  : /api/verify/ +0ms
  send stat "/home/primcode/bin/damas-core/server-nodejs/public/api/verify/index.html" +0ms
  express:router serveStatic  : /api/verify/ +1ms
  send stat "/home/primcode/bin/damas-core/js/api/verify/index.html" +0ms
  express:router <anonymous>  : /api/verify/ +0ms
  morgan log request +2ms
GET /api/verify/ 200 2.599 ms - 2
  express:router dispatching POST /api/read/ +26ms
  express:router query  : /api/read/ +1ms
  express:router expressInit  : /api/read/ +0ms
  express:router urlencodedParser  : /api/read/ +0ms
  body-parser:urlencoded content-type "application/json" +0ms
  body-parser:urlencoded skip parsing +0ms
  express:router jsonParser  : /api/read/ +0ms
  body-parser:json content-type "application/json" +0ms
  body-parser:json content-encoding "identity" +0ms
  body-parser:json read body +1ms
  body-parser:json parse body +1ms
  body-parser:json parse json +0ms
  express:router logger  : /api/read/ +0ms
  express:router <anonymous>  : /api/read/ +0ms
[ '/tests/test2' ]
  express:router serveStatic  : /api/read/ +1ms
  express:router serveStatic  : /api/read/ +0ms
  express:router <anonymous>  : /api/read/ +0ms

/home/primcode/bin/damas-core/server-nodejs/node_modules/mongodb/lib/utils.js:98
    process.nextTick(function() { throw err; });
                                        ^
TypeError: Cannot read property 'length' of undefined
    at /home/primcode/bin/damas-core/server-nodejs/db/mongodb.js:118:51
    at Array.reduce (native)
    at /home/primcode/bin/damas-core/server-nodejs/db/mongodb.js:116:39
    at handleCallback (/home/primcode/bin/damas-core/server-nodejs/node_modules/mongodb/lib/utils.js:96:12)
    at /home/primcode/bin/damas-core/server-nodejs/node_modules/mongodb/lib/cursor.js:839:16
    at handleCallback (/home/primcode/bin/damas-core/server-nodejs/node_modules/mongodb/node_modules/mongodb-core/lib/cursor.js:159:5)
    at setCursorDeadAndNotified (/home/primcode/bin/damas-core/server-nodejs/node_modules/mongodb/node_modules/mongodb-core/lib/cursor.js:501:3)
    at nextFunction (/home/primcode/bin/damas-core/server-nodejs/node_modules/mongodb/node_modules/mongodb-core/lib/cursor.js:652:7)
    at Cursor.next [as _next] (/home/primcode/bin/damas-core/server-nodejs/node_modules/mongodb/node_modules/mongodb-core/lib/cursor.js:693:3)
    at fetchDocs (/home/primcode/bin/damas-core/server-nodejs/node_modules/mongodb/lib/cursor.js:835:10)

then exit

remyla commented 7 years ago
  '/wf/ch/chicken/rgp/wf_ch_chicken_rgp.3.ma',
  '/wf/ch/chicken/sur/',
  '/wf/ch/chicken/tex/',
  '/wf/ch/cityWoman/',
  '/wf/ch/cityWoman/comp/',
  '/wf/ch/cityWoman/moh/',
  '/wf/ch/cityWoman/moh/wf_ch_citywoman_moh.1.ma',
  '/wf/ch/cityWoman/moh/wf_ch_citywoman_moh.2.ma',
  '/wf/ch/cityWoman/moh/wf_ch_citywoman_moh.3.ma' ]

/home/primcode/bin/damas-core-experimental/server-nodejs/node_modules/mongodb/lib/utils.js:98
    process.nextTick(function() { throw err; });
                                        ^
TypeError: Cannot read property 'length' of undefined
    at /home/primcode/bin/damas-core-experimental/server-nodejs/db/mongodb.js:117:51
    at Array.reduce (native)
    at /home/primcode/bin/damas-core-experimental/server-nodejs/db/mongodb.js:115:39
    at handleCallback (/home/primcode/bin/damas-core-experimental/server-nodejs/node_modules/mongodb/lib/utils.js:96:12)
    at /home/primcode/bin/damas-core-experimental/server-nodejs/node_modules/mongodb/lib/cursor.js:844:16
    at handleCallback (/home/primcode/bin/damas-core-experimental/server-nodejs/node_modules/mongodb/node_modules/mongodb-core/lib/cursor.js:156:5)
    at setCursorDeadAndNotified (/home/primcode/bin/damas-core-experimental/server-nodejs/node_modules/mongodb/node_modules/mongodb-core/lib/cursor.js:496:3)
    at nextFunction (/home/primcode/bin/damas-core-experimental/server-nodejs/node_modules/mongodb/node_modules/mongodb-core/lib/cursor.js:633:7)
    at Cursor.next [as _next] (/home/primcode/bin/damas-core-experimental/server-nodejs/node_modules/mongodb/node_modules/mongodb-core/lib/cursor.js:674:3)
    at fetchDocs (/home/primcode/bin/damas-core-experimental/server-nodejs/node_modules/mongodb/lib/cursor.js:839:10)
remyla commented 7 years ago

to reproduce

https://xxx.xxx.xxx.xxx/console#search=&sort=_id&order=1

/home/primcode/bin/damas-core-experimental/server-nodejs/node_modules/mongodb/lib/utils.js:98
    process.nextTick(function() { throw err; });
                                        ^
TypeError: Cannot read property 'length' of undefined
    at /home/primcode/bin/damas-core-experimental/server-nodejs/db/mongodb.js:117:51
    at Array.reduce (native)
    at /home/primcode/bin/damas-core-experimental/server-nodejs/db/mongodb.js:115:39
    at handleCallback (/home/primcode/bin/damas-core-experimental/server-nodejs/node_modules/mongodb/lib/utils.js:96:12)
    at /home/primcode/bin/damas-core-experimental/server-nodejs/node_modules/mongodb/lib/cursor.js:844:16
    at handleCallback (/home/primcode/bin/damas-core-experimental/server-nodejs/node_modules/mongodb/node_modules/mongodb-core/lib/cursor.js:156:5)
    at setCursorDeadAndNotified (/home/primcode/bin/damas-core-experimental/server-nodejs/node_modules/mongodb/node_modules/mongodb-core/lib/cursor.js:496:3)
    at nextFunction (/home/primcode/bin/damas-core-experimental/server-nodejs/node_modules/mongodb/node_modules/mongodb-core/lib/cursor.js:633:7)
    at Cursor.next [as _next] (/home/primcode/bin/damas-core-experimental/server-nodejs/node_modules/mongodb/node_modules/mongodb-core/lib/cursor.js:674:3)
    at fetchDocs (/home/primcode/bin/damas-core-experimental/server-nodejs/node_modules/mongodb/lib/cursor.js:839:10)
remyla commented 7 years ago
POST /api/read/ 200 12.698 ms - -
/tests/test4

/home/primcode/bin/damas-core-experimental/server-nodejs/node_modules/mongodb/lib/utils.js:98
    process.nextTick(function() { throw err; });
                                        ^
TypeError: Cannot read property 'length' of undefined
    at /home/primcode/bin/damas-core-experimental/server-nodejs/db/mongodb.js:117:51
    at Array.reduce (native)
    at /home/primcode/bin/damas-core-experimental/server-nodejs/db/mongodb.js:115:39
    at handleCallback (/home/primcode/bin/damas-core-experimental/server-nodejs/node_modules/mongodb/lib/utils.js:96:12)
    at /home/primcode/bin/damas-core-experimental/server-nodejs/node_modules/mongodb/lib/cursor.js:844:16
    at handleCallback (/home/primcode/bin/damas-core-experimental/server-nodejs/node_modules/mongodb/node_modules/mongodb-core/lib/cursor.js:156:5)
    at setCursorDeadAndNotified (/home/primcode/bin/damas-core-experimental/server-nodejs/node_modules/mongodb/node_modules/mongodb-core/lib/cursor.js:496:3)
    at nextFunction (/home/primcode/bin/damas-core-experimental/server-nodejs/node_modules/mongodb/node_modules/mongodb-core/lib/cursor.js:633:7)
    at Cursor.next [as _next] (/home/primcode/bin/damas-core-experimental/server-nodejs/node_modules/mongodb/node_modules/mongodb-core/lib/cursor.js:674:3)
    at fetchDocs (/home/primcode/bin/damas-core-experimental/server-nodejs/node_modules/mongodb/lib/cursor.js:839:10)