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.85k stars 460 forks source link

Room name doesn't seem to match case sensitive #392

Closed autofrank closed 7 years ago

autofrank commented 7 years ago

Hi, The http api file has grown to 800 mb and has filled up my pi Can I delete, empty or what would you recommend ?

Thanks Frank

jishi commented 7 years ago

You can empty it. If you delete it, you need to restart the api to restart the logging.

However, I'm surprised that it's that big. Have you enabled trace or debug logging by setting ENV variable NODE_LOG_LEVEL?

autofrank commented 7 years ago

Thanks, I'll delete it and restart the API I haven't enabled anything other than what's in the normal install. I haven't been able to open it as it's so big. if I can I'll let you know what's filling it up. ...  -frank 

Sent from my Samsung Galaxy smartphone. -------- Original message --------From: Jimmy Shimizu notifications@github.com Date: 28/11/2016 22:47 (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] http-api file is 800 MB (#392) You can empty it. If you delete it, you need to restart the api to restart the logging. However, I'm surprised that it's that big. Have you enabled trace or debug logging by setting ENV variable NODE_LOG_LEVEL?

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

{"api_version":"1.0","publisher":{"api_key":"05dde50f1d1a384dd78767c55493e4bb","name":"GitHub"},"entity":{"external_key":"github/jishi/node-sonos-http-api","title":"jishi/node-sonos-http-api","subtitle":"GitHub repository","main_image_url":"https://cloud.githubusercontent.com/assets/143418/17495839/a5054eac-5d88-11e6-95fc-7290892c7bb5.png","avatar_image_url":"https://cloud.githubusercontent.com/assets/143418/15842166/7c72db34-2c0b-11e6-9aed-b52498112777.png","action":{"name":"Open in GitHub","url":"https://github.com/jishi/node-sonos-http-api"}},"updates":{"snippets":[{"icon":"PERSON","message":"@jishi in #392: You can empty it. If you delete it, you need to restart the api to restart the logging.\r\n\r\nHowever, I'm surprised that it's that big. Have you enabled trace or debug logging by setting ENV variable NODE_LOG_LEVEL? "}],"action":{"name":"View Issue","url":"https://github.com/jishi/node-sonos-http-api/issues/392#issuecomment-263419477"}}}

autofrank commented 7 years ago

I deleted and restarted the api, thanks

I do use Openremote that talks to your api and it is constantly polling for status on all of my 14 zones (title, volume level, zonestate, imageUri and few others). Perhaps this is what is filling up the log ?? --- I'll let the log run for a few days and pass on so you can see whats it logging.

Is there anyway we can get the limit the max size the file can grow to ?

jishi commented 7 years ago

I guess the way to go would be to introduce log-rotation, but that is an OS-feature and not something I can do within the app (since it just redirects output from the app to that logfile).

I know it will spew out a lot of errors if your system is unavailable, but when everithing works, I thought it was fairly silent.

You could disable logging altogether though, by editing the start script if you want to.

autofrank commented 7 years ago

I managed to open the logfile using UltraEdit and think I kow whats wrong It seems the zones names are case sensitive and I must have some with lower case in some places ie I'm using "dining_room" instead of "Dining_Room" The 800mb file was created from 2016-10-25T18:06:27.579Z to 2016-11-28T22:07:32.618Z ERROR which is a little over a month. The errors are from 3 zones (dining room, bed5 office, garage) but I assume that it logged so much because my open remote UI is constantly polling the api for status and other data.

I'll go through my code in boh open remote and my fibaro system to see when I have the wrong references

This is the start of the file and line 69 to 99 are essentially repeated

`2016-10-25T18:06:27.579Z INFO Presets loaded: { example: { players: [ { roomName: 'Garage', volume: 2 }, { roomName: 'Kitchen', volume: 2 }, { roomName: 'Hallway', volume: 2 }, { roomName: 'Living_Room', volume: 2 }, { roomName: 'Dining_Room', volume: 2 } ], pauseOthers: false, favorite: '4fm' }, kids_bedtime: { players: [ { roomName: 'Bed_LE', volume: 12 }, { roomName: 'Bed_Frank', volume: 12 } ], pauseOthers: false, favorite: 'Calm_Radio' }, weekday_down: { players: [ { roomName: 'Kitchen', volume: 15 }, { roomName: 'Playroom', volume: 15 } ], pauseOthers: false, favorite: '96FM' }, weekday_up: { players: [ { roomName: 'Landing', volume: 8 }, { roomName: 'Bed_MasterL', volume: 8 }, { roomName: 'Bed_LE', volume: 8 }, { roomName: 'Bed_Frank', volume: 8 } ], pauseOthers: false, favorite: '96FM' }, weekend_down: { players: [ { roomName: 'Kitchen', volume: 14 }, { roomName: 'Hallway', volume: 14 }, { roomName: 'Playroom', volume: 14 } ], pauseOthers: false, favorite: 'Heart London' }, weekend_up: { players: [ { roomName: 'Bed_MasterL', volume: 8 }, { roomName: 'Landing', volume: 8 }, { roomName: 'Bed_LE', volume: 8 }, { roomName: 'Bed_Frank', volume: 8 } ], pauseOthers: false, favorite: 'Heart London' } } 2016-10-25T18:06:27.815Z INFO http server listening on port 5005 2016-10-25T18:06:28.278Z ERROR No system has yet been discovered. Please see https://github.com/jishi/node-sonos-http-api/issues/77 if it doesn't resolve itself in a few seconds. 2016-10-25T18:06:28.308Z ERROR No system has yet been discovered. Please see https://github.com/jishi/node-sonos-http-api/issues/77 if it doesn't resolve itself in a few seconds. 2016-10-25T18:06:28.316Z ERROR No system has yet been discovered. Please see https://github.com/jishi/node-sonos-http-api/issues/77 if it doesn't resolve itself in a few seconds. 2016-10-25T18:06:28.427Z ERROR No system has yet been discovered. Please see https://github.com/jishi/node-sonos-http-api/issues/77 if it doesn't resolve itself in a few seconds. 2016-10-25T18:06:28.431Z ERROR No system has yet been discovered. Please see https://github.com/jishi/node-sonos-http-api/issues/77 if it doesn't resolve itself in a few seconds. 2016-10-25T18:06:28.434Z ERROR No system has yet been discovered. Please see https://github.com/jishi/node-sonos-http-api/issues/77 if it doesn't resolve itself in a few seconds. 2016-10-25T18:06:28.439Z ERROR No system has yet been discovered. Please see https://github.com/jishi/node-sonos-http-api/issues/77 if it doesn't resolve itself in a few seconds. 2016-10-25T18:06:28.442Z ERROR No system has yet been discovered. Please see https://github.com/jishi/node-sonos-http-api/issues/77 if it doesn't resolve itself in a few seconds. 2016-10-25T18:06:28.445Z ERROR No system has yet been discovered. Please see https://github.com/jishi/node-sonos-http-api/issues/77 if it doesn't resolve itself in a few seconds. 2016-10-25T18:06:28.448Z ERROR No system has yet been discovered. Please see https://github.com/jishi/node-sonos-http-api/issues/77 if it doesn't resolve itself in a few seconds. 2016-10-25T18:06:28.451Z ERROR No system has yet been discovered. Please see https://github.com/jishi/node-sonos-http-api/issues/77 if it doesn't resolve itself in a few seconds. 2016-10-25T18:06:28.453Z ERROR No system has yet been discovered. Please see https://github.com/jishi/node-sonos-http-api/issues/77 if it doesn't resolve itself in a few seconds. 2016-10-25T18:06:28.456Z ERROR No system has yet been discovered. Please see https://github.com/jishi/node-sonos-http-api/issues/77 if it doesn't resolve itself in a few seconds. 2016-10-25T18:06:28.459Z ERROR No system has yet been discovered. Please see https://github.com/jishi/node-sonos-http-api/issues/77 if it doesn't resolve itself in a few seconds. 2016-10-25T18:06:28.462Z ERROR No system has yet been discovered. Please see https://github.com/jishi/node-sonos-http-api/issues/77 if it doesn't resolve itself in a few seconds. 2016-10-25T18:06:28.471Z ERROR No system has yet been discovered. Please see https://github.com/jishi/node-sonos-http-api/issues/77 if it doesn't resolve itself in a few seconds. 2016-10-25T18:06:28.475Z ERROR No system has yet been discovered. Please see https://github.com/jishi/node-sonos-http-api/issues/77 if it doesn't resolve itself in a few seconds. 2016-10-25T18:06:28.478Z ERROR No system has yet been discovered. Please see https://github.com/jishi/node-sonos-http-api/issues/77 if it doesn't resolve itself in a few seconds. 2016-10-25T18:06:28.483Z ERROR No system has yet been discovered. Please see https://github.com/jishi/node-sonos-http-api/issues/77 if it doesn't resolve itself in a few seconds. 2016-10-25T18:06:28.498Z ERROR No system has yet been discovered. Please see https://github.com/jishi/node-sonos-http-api/issues/77 if it doesn't resolve itself in a few seconds. 2016-10-25T18:06:28.501Z ERROR No system has yet been discovered. Please see https://github.com/jishi/node-sonos-http-api/issues/77 if it doesn't resolve itself in a few seconds. 2016-10-25T18:06:28.504Z ERROR No system has yet been discovered. Please see https://github.com/jishi/node-sonos-http-api/issues/77 if it doesn't resolve itself in a few seconds. 2016-10-25T18:06:29.947Z ERROR { error: 'action \'dining_room\' not found' } 2016-10-25T18:06:30.046Z ERROR 2016-11-28T10:18:39.143Z ERROR { error: 'action \'dining_room\' not found' } 2016-11-28T10:18:39.155Z ERROR { error: 'action \'dining_room\' not found' } 2016-11-28T10:18:39.343Z ERROR { error: 'action \'bed5_office\' not found' } 2016-11-28T10:18:39.372Z ERROR { error: 'action \'dining_room\' not found' } 2016-11-28T10:18:39.390Z ERROR { error: 'action \'bed5_office\' not found' } 2016-11-28T10:18:39.394Z ERROR { error: 'action \'bed5_office\' not found' } 2016-11-28T10:18:39.495Z ERROR { error: 'action \'dining_room\' not found' } 2016-11-28T10:18:40.092Z ERROR { error: 'action \'bed5_office\' not found' } 2016-11-28T10:18:40.155Z ERROR { error: 'action \'dining_room\' not found' } 2016-11-28T10:18:40.171Z ERROR { error: 'action \'dining_room\' not found' } 2016-11-28T10:18:40.359Z ERROR { error: 'action \'bed5_office\' not found' } 2016-11-28T10:18:40.387Z ERROR { error: 'action \'dining_room\' not found' } 2016-11-28T10:18:40.403Z ERROR { error: 'action \'bed5_office\' not found' } 2016-11-28T10:18:41.109Z ERROR { error: 'action \'bed5_office\' not found' } 2016-11-28T10:18:41.182Z ERROR { error: 'action \'dining_room\' not found' }

`

Thanks as usual for the quick response

-frank

jishi commented 7 years ago

Hm, they shouldn't be case sensitive IIRC. I should probably look into that, thanks for noticing!

autofrank commented 7 years ago

I'll also look and see if I can identify where I'm using the lower case and see if this resolves the errors in the log 

Sent from my Samsung Galaxy smartphone. -------- Original message --------From: Jimmy Shimizu notifications@github.com Date: 29/11/2016 11:03 (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] http-api file is 800 MB (#392) Hm, they shouldn't be case sensitive IIRC. I should probably look into that, thanks for noticing!

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

{"api_version":"1.0","publisher":{"api_key":"05dde50f1d1a384dd78767c55493e4bb","name":"GitHub"},"entity":{"external_key":"github/jishi/node-sonos-http-api","title":"jishi/node-sonos-http-api","subtitle":"GitHub repository","main_image_url":"https://cloud.githubusercontent.com/assets/143418/17495839/a5054eac-5d88-11e6-95fc-7290892c7bb5.png","avatar_image_url":"https://cloud.githubusercontent.com/assets/143418/15842166/7c72db34-2c0b-11e6-9aed-b52498112777.png","action":{"name":"Open in GitHub","url":"https://github.com/jishi/node-sonos-http-api"}},"updates":{"snippets":[{"icon":"PERSON","message":"@jishi in #392: Hm, they shouldn't be case sensitive IIRC. I should probably look into that, thanks for noticing!"}],"action":{"name":"View Issue","url":"https://github.com/jishi/node-sonos-http-api/issues/392#issuecomment-263541269"}}}

autofrank commented 7 years ago

I did a quick check........ In Openremote I have mostly lowercase across all zones in the api calls In Fibaro HC2 I use a mix of lowercase (dining_room) and matching case (Dining_Room) In the presets I use mainly use matching case

I also had a closer look at the logfile and not all my zones are referenced in the error logs I also looked since i deleted the log this morning and 'dining_room' is referenced again in the new log

not sure if this helps.. -frank

jishi commented 7 years ago

I fixed the lower case matching of players in May this year. Are you sure you are running the latest version?

Use git pull or download the latest master zip: https://github.com/jishi/node-sonos-http-api/archive/master.zip and overwrite your current folder content, then run:

npm install --production

to update the dependencies.

autofrank commented 7 years ago

ThanksI'll check and update if not.. RegardsFrank 

Sent from my Samsung Galaxy smartphone. -------- Original message --------From: Jimmy Shimizu notifications@github.com Date: 29/11/2016 21:02 (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] Room name doesn't seem to match case sensitive (#392) I fixed the lower case matching of players in May this year. Are you sure you are running the latest version? Use git pull or download the latest master zip: https://github.com/jishi/node-sonos-http-api/archive/master.zip and overwrite your current folder content, then run: npm install --production to update the dependencies.

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

{"api_version":"1.0","publisher":{"api_key":"05dde50f1d1a384dd78767c55493e4bb","name":"GitHub"},"entity":{"external_key":"github/jishi/node-sonos-http-api","title":"jishi/node-sonos-http-api","subtitle":"GitHub repository","main_image_url":"https://cloud.githubusercontent.com/assets/143418/17495839/a5054eac-5d88-11e6-95fc-7290892c7bb5.png","avatar_image_url":"https://cloud.githubusercontent.com/assets/143418/15842166/7c72db34-2c0b-11e6-9aed-b52498112777.png","action":{"name":"Open in GitHub","url":"https://github.com/jishi/node-sonos-http-api"}},"updates":{"snippets":[{"icon":"PERSON","message":"@jishi in #392: I fixed the lower case matching of players in May this year. Are you sure you are running the latest version? \r\n\r\nUse git pull or download the latest master zip: https://github.com/jishi/node-sonos-http-api/archive/master.zip and overwrite your current folder content, then run:\r\n\r\nnpm install --production\r\n\r\nto update the dependencies.\r\n\r\n"}],"action":{"name":"View Issue","url":"https://github.com/jishi/node-sonos-http-api/issues/392#issuecomment-263697592"}}}

autofrank commented 7 years ago

My current version is from mid -October I'll pull the latest version and see if that solves the issue

thx

autofrank commented 7 years ago

Hi I downloaded the latest master and this issue is still happening. Is there some debug commands I could run to see what is happening ?

Thanks Frank

autofrank commented 7 years ago

a little more info my openremote controller is running on my synology NAS. I powered down the NAS and the logile is not logging the failures anymore so I must have some call that is causing the issue but that may still not explain the case sensitive issue..

jishi commented 7 years ago

do you get the same error when calling the same URLs from a browser or similar, with the same casing?

autofrank commented 7 years ago

i deleted all code relating to the dining room zone in openremote and the issue has disappeared. not sure the issue is with the api ....

thx frank

jishi commented 7 years ago

Ok, let me know if you find anything else.