jishi / node-sonos-http-api

An HTTP API bridge for Sonos easing automation. Hostable on any node.js capable device, like a raspberry pi or similar.
http://jishi.github.io/node-sonos-http-api/
MIT License
1.83k stars 462 forks source link

service stopping #719

Closed autofrank closed 4 years ago

autofrank commented 4 years ago

Hi I'm running the http api on pi and it has been working for a few years now Earlier today the api started to go offline and restart itself approx every minute. I updated sonos to latest a few days ago and no other related changes

Is there somewhere I can try and debug to see why this is suddenly happening dump of npm-debug.log is below 0 info it worked if it ends with ok 1 verbose cli [ '/usr/local/bin/node', '/usr/local/bin/npm', 'start' ] 2 info using npm@2.15.9 3 info using node@v4.5.0 4 verbose run-script [ 'prestart', 'start', 'poststart' ] 5 info prestart sonos-http-api@1.5.0 6 info start sonos-http-api@1.5.0 7 verbose unsafe-perm in lifecycle true 8 info sonos-http-api@1.5.0 Failed to exec start script 9 verbose stack Error: sonos-http-api@1.5.0 start:node server.js 9 verbose stack Exit status 1 9 verbose stack at EventEmitter.<anonymous> (/usr/local/lib/node_modules/npm/lib/utils/lifecycle.js:217:16) 9 verbose stack at emitTwo (events.js:87:13) 9 verbose stack at EventEmitter.emit (events.js:172:7) 9 verbose stack at ChildProcess.<anonymous> (/usr/local/lib/node_modules/npm/lib/utils/spawn.js:24:14) 9 verbose stack at emitTwo (events.js:87:13) 9 verbose stack at ChildProcess.emit (events.js:172:7) 9 verbose stack at maybeClose (internal/child_process.js:829:16) 9 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:211:5) 10 verbose pkgid sonos-http-api@1.5.0 11 verbose cwd /home/pi/node-sonos-http-api 12 error Linux 4.4.50-v7+ 13 error argv "/usr/local/bin/node" "/usr/local/bin/npm" "start" 14 error node v4.5.0 15 error npm v2.15.9 16 error code ELIFECYCLE 17 error sonos-http-api@1.5.0 start:node server.js 17 error Exit status 1 18 error Failed at the sonos-http-api@1.5.0 start script 'node server.js'. 18 error This is most likely a problem with the sonos-http-api package, 18 error not with npm itself. 18 error Tell the author that this fails on your system: 18 error node server.js 18 error You can get information on how to open an issue for this project with: 18 error npm bugs sonos-http-api 18 error Or if that isn't available, you can get their info via: 18 error 18 error npm owner ls sonos-http-api 18 error There is likely additional logging output above. 19 verbose exit [ 1, true ]

Space on the PI good and I have a HA bridge service running on the same pi and that is not being impacted...

Any suggestions appreciated.... Thanks

jishi commented 4 years ago

You are running an old version of the api, there might be some changes in sonos that makes it crash. To get a clean stack trace without the npm noise, try running it with just node server.js

On Sat, 28 Sep 2019, 20:10 autofrank, notifications@github.com wrote:

Hi I'm running the http api on pi and it has been working for a few years now Earlier today the api started to go offline and restart itself approx every minute. I updated sonos to latest a few days ago and no other related changes

Is there somewhere I can try and debug to see why this is suddenly happening dump of npm-debug.log is below 0 info it worked if it ends with ok 1 verbose cli [ '/usr/local/bin/node', '/usr/local/bin/npm', 'start' ] 2 info using npm@2.15.9 3 info using node@v4.5.0 4 verbose run-script [ 'prestart', 'start', 'poststart' ] 5 info prestart sonos-http-api@1.5.0 6 info start sonos-http-api@1.5.0 7 verbose unsafe-perm in lifecycle true 8 info sonos-http-api@1.5.0 Failed to exec start script 9 verbose stack Error: sonos-http-api@1.5.0 start: node server.js9 verbose stack Exit status 1 9 verbose stack at EventEmitter. (/usr/local/lib/node_modules/npm/lib/utils/lifecycle.js:217:16) 9 verbose stack at emitTwo (events.js:87:13) 9 verbose stack at EventEmitter.emit (events.js:172:7) 9 verbose stack at ChildProcess. (/usr/local/lib/node_modules/npm/lib/utils/spawn.js:24:14) 9 verbose stack at emitTwo (events.js:87:13) 9 verbose stack at ChildProcess.emit (events.js:172:7) 9 verbose stack at maybeClose (internal/child_process.js:829:16) 9 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:211:5) 10 verbose pkgid sonos-http-api@1.5.0 11 verbose cwd /home/pi/node-sonos-http-api 12 error Linux 4.4.50-v7+ 13 error argv "/usr/local/bin/node" "/usr/local/bin/npm" "start" 14 error node v4.5.0 15 error npm v2.15.9 16 error code ELIFECYCLE 17 error sonos-http-api@1.5.0 start:node server.js17 error Exit status 1 18 error Failed at the sonos-http-api@1.5.0 start script 'node server.js'. 18 error This is most likely a problem with the sonos-http-api package, 18 error not with npm itself. 18 error Tell the author that this fails on your system: 18 error node server.js 18 error You can get information on how to open an issue for this project with: 18 error npm bugs sonos-http-api 18 error Or if that isn't available, you can get their info via: 18 error 18 error npm owner ls sonos-http-api 18 error There is likely additional logging output above. 19 verbose exit [ 1, true ]

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/jishi/node-sonos-http-api/issues/719?email_source=notifications&email_token=AAYE2I3QOYNCEMLFHKH2VF3QL6M2NA5CNFSM4I3PDV3KYY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4HOKMKRA, or mute the thread https://github.com/notifications/unsubscribe-auth/AAYE2I7Y5L2CMB6XBG2MBWLQL6M2NANCNFSM4I3PDV3A .

autofrank commented 4 years ago

Thanks Jimmy I installed the latest http api and also update Node/Node.Js and npm and all is back working now I had to install Node v8 as the latest release of Node ( 10.x.y) would not  permit npm to run.Sent from my Samsung Galaxy smartphone. -------- Original message --------From: Jimmy Shimizu notifications@github.com Date: 28/09/2019 19:16 (GMT+00:00) To: jishi/node-sonos-http-api node-sonos-http-api@noreply.github.com Cc: autofrank frank.tp.smith@gmail.com, Author author@noreply.github.com Subject: Re: [jishi/node-sonos-http-api] service stopping and restrarting by itself (#719) You are running an old version of the api, there might be some changes in

sonos that makes it crash. To get a clean stack trace without the npm

noise, try running it with just node server.js

On Sat, 28 Sep 2019, 20:10 autofrank, notifications@github.com wrote:

Hi

I'm running the http api on pi and it has been working for a few years now

Earlier today the api started to go offline and restart itself approx

every minute.

I updated sonos to latest a few days ago and no other related changes

Is there somewhere I can try and debug to see why this is suddenly

happening

dump of npm-debug.log is below

0 info it worked if it ends with ok 1 verbose cli [ '/usr/local/bin/node',

'/usr/local/bin/npm', 'start' ] 2 info using npm@2.15.9 3 info using

node@v4.5.0 4 verbose run-script [ 'prestart', 'start', 'poststart' ] 5

info prestart sonos-http-api@1.5.0 6 info start sonos-http-api@1.5.0 7

verbose unsafe-perm in lifecycle true 8 info sonos-http-api@1.5.0 Failed

to exec start script 9 verbose stack Error: sonos-http-api@1.5.0 start: node

server.js9 verbose stack Exit status 1 9 verbose stack at

EventEmitter.

(/usr/local/lib/node_modules/npm/lib/utils/lifecycle.js:217:16) 9 verbose

stack at emitTwo (events.js:87:13) 9 verbose stack at EventEmitter.emit

(events.js:172:7) 9 verbose stack at ChildProcess.

(/usr/local/lib/node_modules/npm/lib/utils/spawn.js:24:14) 9 verbose stack

at emitTwo (events.js:87:13) 9 verbose stack at ChildProcess.emit

(events.js:172:7) 9 verbose stack at maybeClose

(internal/child_process.js:829:16) 9 verbose stack at

Process.ChildProcess._handle.onexit (internal/child_process.js:211:5) 10

verbose pkgid sonos-http-api@1.5.0 11 verbose cwd

/home/pi/node-sonos-http-api 12 error Linux 4.4.50-v7+ 13 error argv

"/usr/local/bin/node" "/usr/local/bin/npm" "start" 14 error node v4.5.0 15

error npm v2.15.9 16 error code ELIFECYCLE 17 error sonos-http-api@1.5.0

start:node server.js17 error Exit status 1 18 error Failed at the

sonos-http-api@1.5.0 start script 'node server.js'. 18 error This is most

likely a problem with the sonos-http-api package, 18 error not with npm

itself. 18 error Tell the author that this fails on your system: 18 error

node server.js 18 error You can get information on how to open an issue for

this project with: 18 error npm bugs sonos-http-api 18 error Or if that

isn't available, you can get their info via: 18 error 18 error npm owner ls

sonos-http-api 18 error There is likely additional logging output above. 19

verbose exit [ 1, true ]

You are receiving this because you are subscribed to this thread.

Reply to this email directly, view it on GitHub

https://github.com/jishi/node-sonos-http-api/issues/719?email_source=notifications&email_token=AAYE2I3QOYNCEMLFHKH2VF3QL6M2NA5CNFSM4I3PDV3KYY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4HOKMKRA,

or mute the thread

https://github.com/notifications/unsubscribe-auth/AAYE2I7Y5L2CMB6XBG2MBWLQL6M2NANCNFSM4I3PDV3A

.

—You are receiving this because you authored the thread.Reply to this email directly, view it on GitHub, or mute the thread.

[

{

"@context": "http://schema.org",

"@type": "EmailMessage",

"potentialAction": {

"@type": "ViewAction",

"target": "https://github.com/jishi/node-sonos-http-api/issues/719?email_source=notifications\u0026email_token=AE3NARKHBGYCBS472E2JY7LQL6NQZA5CNFSM4I3PDV3KYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD727KKI#issuecomment-536212777",

"url": "https://github.com/jishi/node-sonos-http-api/issues/719?email_source=notifications\u0026email_token=AE3NARKHBGYCBS472E2JY7LQL6NQZA5CNFSM4I3PDV3KYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD727KKI#issuecomment-536212777",

"name": "View Issue"

},

"description": "View this Issue on GitHub",

"publisher": {

"@type": "Organization",

"name": "GitHub",

"url": "https://github.com"

}

}

]

autofrank commented 4 years ago

@jishi It looks like I still have an issue as the api failed again yesterday I'll take a look this evening and see if I can determine why

Thanks

autofrank commented 4 years ago

@jishi

I restarted the service using "npm start" and it is back running (for the moment) There appears to be errors though I ran a scene to exercise the TTS and it worked - (you can see this request in the excerpt below even though it says it didn't work)) I have 15 sonos zones/devices Could you take a look below and see if you can understand what may be wrong ?

`pi@raspberrypi:~ $ cd node-sonos-http-api pi@raspberrypi:~/node-sonos-http-api $ npm start

sonos-http-api@1.6.9 start /home/pi/node-sonos-http-api node server.js

2019-09-30T16:35:06.978Z INFO Presets loaded: { example: { players: [ { roomName: 'Bathroom', volume: 10 }, { roomName: 'Kitchen', volume: 10 }, { roomName: 'Office', volume: 10 }, { roomName: 'Bedroom', volume: 10 }, { roomName: 'TV Room', volume: 15 } ], playMode: { shuffle: true, repeat: 'all', crossfade: false }, pauseOthers: false } } 2019-09-30T16:35:11.025Z INFO http server listening on 0.0.0.0 port 5005 (node:2272) MaxListenersExceededWarning: Possible EventEmitter memory leak detec ted. 11 group-mute listeners added. Use emitter.setMaxListeners() to increase li mit (node:2272) MaxListenersExceededWarning: Possible EventEmitter memory leak detec ted. 11 last-change listeners added. Use emitter.setMaxListeners() to increase l imit 2019-09-30T16:35:13.531Z ERROR { error: 'action \'tts\' not found' } 2019-09-30T16:36:03.650Z INFO announce file for phrase "Welcome Home. The house is at 22.4 degrees and the time is 17:34." does not seem to exist, downloading 2019-09-30T16:36:08.281Z ERROR { error: 'action \'tts\' not found' } 2019-09-30T16:36:40.509Z ERROR { error: 'action \'tts\' not found' }

Thanks`

autofrank commented 4 years ago

resolved issue - forgot to get to to auto start

$ sudo npm install -g pm2 $ pm2 startup raspberry $ sudo env PATH=$PATH:/usr/local/bin pm2 startup raspberry -u pi $ cd /your/http-api/folder/ $ pm2 start server.js -x --name "http-api" $ pm2 dump

closing issue .....