Problem running shinobi and nodejs 9.x



  • Hi, I'm trying to run shinobi in a raspberry pi 2.
    I followed the guide and the instalation was quite easy (nice guide !).
    My problem is, after I log in in the shinobi login screen, I get this error:

    TypeError: s.sqlQuery is not a function
    at IncomingMessage.req.default (/home/pi/shinobi/camera.js:3094:15)
    at /home/pi/shinobi/camera.js:3286:28
    at Layer.handle [as handle_request] (/home/pi/shinobi/node_modules/express/lib/router/layer.js:95:5)
    at next (/home/pi/shinobi/node_modules/express/lib/router/route.js:137:13)
    at Route.dispatch (/home/pi/shinobi/node_modules/express/lib/router/route.js:112:3)
    at Layer.handle [as handle_request] (/home/pi/shinobi/node_modules/express/lib/router/layer.js:95:5)
    at /home/pi/shinobi/node_modules/express/lib/router/index.js:281:22
    at param (/home/pi/shinobi/node_modules/express/lib/router/index.js:354:14)
    at param (/home/pi/shinobi/node_modules/express/lib/router/index.js:365:14)
    at Function.process_params (/home/pi/shinobi/node_modules/express/lib/router/index.js:410:3)

    I'm using shinobi from todays master branch.
    NodeJS v9.3
    Thanks for your time !



  • Problem was solved, (when your connection to the DB is wrong this happens)



  • Hi
    How did you solve this?
    What install method did you use to install Shinobi on the RaspberryPi?
    Did you have to modify the documented install method to get Shinobi to run on the Raspberry?

    I encountered the same error when I tried to install it on my Pi a few weeks ago and have not been able to solve it.

    Would really appreciate if you could give me some hints.


  • administrators

    @Gonzalo sorry i didnt reply sooner.. glad you got it going! it would be real cool if you could tell us what you had to do to fix it šŸ˜„ thanks!!



  • Hi,

    Running into the same issue after the first reboot, already verified the startup but mysql service is running as it should.
    Please comment on what you have performed to fix the database connection, here a view on my message when trting to login :

    TypeError: s.sqlQuery is not a function
    at IncomingMessage.req.default (/home/Shinobi/camera.js:3362:15)
    at /home/Shinobi/camera.js:3554:28
    at Layer.handle [as handle_request] (/home/Shinobi/node_modules/express/lib/router/layer.js:95:5)
    at next (/home/Shinobi/node_modules/express/lib/router/route.js:137:13)
    at Route.dispatch (/home/Shinobi/node_modules/express/lib/router/route.js:112:3)
    at Layer.handle [as handle_request] (/home/Shinobi/node_modules/express/lib/router/layer.js:95:5)
    at /home/Shinobi/node_modules/express/lib/router/index.js:281:22
    at param (/home/Shinobi/node_modules/express/lib/router/index.js:354:14)
    at param (/home/Shinobi/node_modules/express/lib/router/index.js:365:14)
    at Function.process_params (/home/Shinobi/node_modules/express/lib/router/index.js:410:3)

    All pm2 modules are loading without an issue :

    sudo pm2 restart all
    Use --update-env to update environment variables
    [PM2] Applying action restartProcessId on app [all](ids: 0,1,2,3)
    [PM2] cron āœ“
    [PM2] shinobi-motion āœ“
    [PM2] shinobi-opencv āœ“
    [PM2] camera āœ“
    ā”Œā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”¬ā”€ā”€ā”€ā”€ā”¬ā”€ā”€ā”€ā”€ā”€ā”€ā”¬ā”€ā”€ā”€ā”€ā”€ā”€ā”¬ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”¬ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”¬ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”¬ā”€ā”€ā”€ā”€ā”€ā”¬ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”¬ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”¬ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”
    ā”‚ App name ā”‚ id ā”‚ mode ā”‚ pid ā”‚ status ā”‚ restart ā”‚ uptime ā”‚ cpu ā”‚ mem ā”‚ user ā”‚ watching ā”‚
    ā”œā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”¼ā”€ā”€ā”€ā”€ā”¼ā”€ā”€ā”€ā”€ā”€ā”€ā”¼ā”€ā”€ā”€ā”€ā”€ā”€ā”¼ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”¼ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”¼ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”¼ā”€ā”€ā”€ā”€ā”€ā”¼ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”¼ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”¼ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”¤
    ā”‚ camera ā”‚ 0 ā”‚ fork ā”‚ 7577 ā”‚ online ā”‚ 1 ā”‚ 0s ā”‚ 0% ā”‚ 17.8 MB ā”‚ root ā”‚ disabled ā”‚
    ā”‚ cron ā”‚ 1 ā”‚ fork ā”‚ 7392 ā”‚ online ā”‚ 1 ā”‚ 1s ā”‚ 20% ā”‚ 42.7 MB ā”‚ root ā”‚ disabled ā”‚
    ā”‚ shinobi-motion ā”‚ 2 ā”‚ fork ā”‚ 7415 ā”‚ online ā”‚ 1 ā”‚ 1s ā”‚ 18% ā”‚ 42.9 MB ā”‚ root ā”‚ disabled ā”‚
    ā”‚ shinobi-opencv ā”‚ 3 ā”‚ fork ā”‚ 7552 ā”‚ online ā”‚ 19 ā”‚ 0s ā”‚ 63% ā”‚ 31.3 MB ā”‚ root ā”‚ disabled ā”‚
    ā””ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”“ā”€ā”€ā”€ā”€ā”“ā”€ā”€ā”€ā”€ā”€ā”€ā”“ā”€ā”€ā”€ā”€ā”€ā”€ā”“ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”“ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”“ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”“ā”€ā”€ā”€ā”€ā”€ā”“ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”“ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”“ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”˜
    Use pm2 show <id|name> to get more details about an app

    Please advice where the db connection issue was detected.



  • I made some progress and it looks like it has to do with permissions.
    Installation has been performed as root (sudo su) and after a reboot modules are loaded in the configured user.
    After launching from root shell (pm2 flush && pm2 restart all && pm2 logs) the system works as expected.



  • @peekaazet can you elaborate a little more. I'm getting the same error. I run the pm2 commands and got the following:

    sudo pm2 flush && pm2 restart all && pm2 logs
    [PM2] Flushing /home/anthony/.pm2/pm2.log
    [PM2] Flushing
    [PM2] /home/anthony/.pm2/logs/camera-out-0.log
    [PM2] /home/anthony/.pm2/logs/camera-error-0.log
    [PM2] Flushing
    [PM2] /home/anthony/.pm2/logs/cron-out-1.log
    [PM2] /home/anthony/.pm2/logs/cron-error-1.log
    [PM2] Logs flushed
    [PM2][ERROR] Permission denied, command needs to be runned as root or set the right permission via chown
    [PM2][ERROR] Files that needs permissions: /home/anthony/.pm2/rpc.sock and /home/anthony/.pm2/pub.sock



  • got it to work. Had to chown the files mentioned.


 

Looks like your connection to Shinobi Forum was lost, please wait while we try to reconnect.