Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: Since the update to node.js 16 playing radio stations via script does not work #124

Closed
meistermopper opened this issue Jun 20, 2022 · 59 comments
Labels

Comments

@meistermopper
Copy link

meistermopper commented Jun 20, 2022

Contact Details

No response

What happened?

Actually i deleted the adapter and the object tree, but it did nothing.

Adapter Version

2.3.1

JS-Controller Version

4.0.23

Node JS Version

16.15.1

NPM Version

8.11.0

Operating System

Debian

Relevant log output

chromecast.0 	2022-06-20 15:56:20.789	error	Büro - Cannot play file "https://dispatcher.rndfnk.com/hr/hr1/live/mp3/high": TypeError: Cannot use 'in' operator to search for 'content-type' in undefined
chromecast.0 	2022-06-20 15:56:20.789	error	Büro - Error playing playlist - TypeError: Cannot use 'in' operator to search for 'content-type' in undefined at MediaInfo._parseIcyHeaderPromise (/opt/iobroker/node_modules/castv2-player/lib/mediaInfo.js:143:26) at /opt/iobroker/node_modules/castv2-player/lib/mediaInfo.js:47:43 at processTicksAndRejections (node:internal/process/task_queues:96:5) at async Promise.all (index 1)
chromecast.0 	2022-06-20 15:56:20.788	info	Büro - Closing mediaInfo
chromecast.0 	2022-06-20 15:56:20.739	info	Büro - Player joint
chromecast.0 	2022-06-20 15:56:20.738	info	Büro - Connected player
chromecast.0 	2022-06-20 15:56:20.738	info	Büro - Default player lauched
chromecast.0 	2022-06-20 15:56:20.738	info	Büro - Connected player
chromecast.0	2022-06-20 15:56:20.737	info	Büro - Try to join player
chromecast.0	2022-06-20 15:56:20.709	info	Büro - Detected redirection (302) to https://f111.rndfnk.com/ard/hr/hr1/live/mp3/128/stream.mp3?sid=2AqNuq61lHCqV7iDkFNIpfOj64M&token=KeQegklbD60inl89eTSTmqoo2H4fKC4kJgWYEKMkBoQ&tvf=7jzw42Fs-hZmMTExLnJuZGZuay5jb20
chromecast.0	2022-06-20 15:56:20.660	info	Büro - Try to launch default player
chromecast.0	2022-06-20 15:56:20.654	info	Büro - Try to play url - https://dispatcher.rndfnk.com/hr/hr1/live/mp3/high
chromecast.0	2022-06-20 15:56:20.156	error	Büro - Sorry, update for Büro.media.contentId not supported!
javascript.0	2022-06-20 15:56:20.155	warn	Read-only state "chromecast.0.Büro.media.contentId" has been written without ack-flag with value "https://dispatcher.rndfnk.com/hr/hr1/live/mp3/high"

Anything else?

No response

@Apollon77
Copy link
Member

Good question ... seems that no connection to the device could be established and thats why noheraders exist ... and the used lib is not checking that correctly

@meistermopper
Copy link
Author

meistermopper commented Jun 21, 2022

Could perhaps the update to NodeJs 16 and NPM 8 be the cause of this phenomenon, I am at a loss?
Or is there another approach?
The adapter is responsive because the voice output via SayIt works flawlessly.

@meistermopper
Copy link
Author

Ok, I was able to reprod it by going back to nodeJs 14. Cause with that it works again, so I guess that's what it is.

I hope you can do something with it and find a solution. Until then I will stay with NodeJs 14.

@Apollon77
Copy link
Member

A debug log would been very helpfull ... I do not have a Chromecast, so I can not test myself

@meistermopper
Copy link
Author

meistermopper commented Jun 22, 2022

The log above is a debug log ¯\ (ツ)/¯

@meistermopper
Copy link
Author

meistermopper commented Jun 27, 2022

In fact, i'm back to NodeJS 14 and pushed de chromecast to a slave with NodeJS 16.x and NPM 8.x.
It also does not work with this constellation. I get in the log this:

2022-06-27 18:35:24.762  - warn: host.rpizigbee startInstance cannot find adapter "chromecast@2.3.1". Try to install it... 1 attempt
2022-06-27 18:35:39.731  - error: host.rpizigbee iobroker npm-install: host.rpizigbee Cannot install iobroker.chromecast@2.3.1: 217
2022-06-27 18:35:41.765  - warn: host.rpizigbee startInstance cannot find adapter "chromecast@2.3.1". Try to install it... 2 attempt
2022-06-27 18:35:53.957  - error: host.rpizigbee iobroker npm-install: host.rpizigbee Cannot install iobroker.chromecast@2.3.1: 217
2022-06-27 18:35:56.013  - warn: host.rpizigbee startInstance cannot find adapter "chromecast@2.3.1". Try to install it... 3 attempt
2022-06-27 18:36:08.706  - error: host.rpizigbee iobroker npm-install: host.rpizigbee Cannot install iobroker.chromecast@2.3.1: 217
2022-06-27 18:36:10.740  - warn: host.rpizigbee startInstance cannot find adapter "chromecast@2.3.1". Try to install it... 4 attempt
2022-06-27 18:36:23.129  - error: host.rpizigbee iobroker npm-install: host.rpizigbee Cannot install iobroker.chromecast@2.3.1: 217
2022-06-27 18:36:25.160  - error: host.rpizigbee Cannot download and install adapter "chromecast@2.3.1". To retry it disable/enable the adapter or restart host. Also check the error messages in the log!```

If I slide the adapter back onto the master, it works again.

@Apollon77
Copy link
Member

But this is an installation error ... run "iob install chromecast@2.3.1 --debug" on that host in cli and you will see the real npm error

@JackDaniel007
Copy link

hier genau das gleiche im debug log :(

`chromecast.0 | 2022-06-30 08:06:22.677 | error | Badezimmer - Cannot play file "http://live.antenne.at/ak.mp3": TypeError: Cannot use 'in' operator to search for 'content-type' in undefined

chromecast.0 | 2022-06-30 08:06:22.677 | error | Badezimmer - Error playing playlist - TypeError: Cannot use 'in' operator to search for 'content-type' in undefined at MediaInfo._parseIcyHeaderPromise (/opt/iobroker/node_modules/castv2-player/lib/mediaInfo.js:143:26) at /opt/iobroker/node_modules/castv2-player/lib/mediaInfo.js:47:43 at processTicksAndRejections (node:internal/process/task_queues:96:5) at async Promise.all (index 1)

chromecast.0 | 2022-06-30 08:06:22.676 | info | Badezimmer - Closing mediaInfo
chromecast.0 | 2022-06-30 08:06:22.569 | info | Badezimmer - set volume to 40
chromecast.0 | 2022-06-30 08:06:22.568 | info | Update client status: Badezimmer
chromecast.0 | 2022-06-30 08:06:22.565 | info | Badezimmer - Try to launch default player
chromecast.0 | 2022-06-30 08:06:22.558 | info | Badezimmer - Try to play url - http://live.antenne.at/ak.mp3
`

@Apollon77 Apollon77 changed the title [Bug]: Since the update to npm 8.11.0 playing radio stations via script does not work [Bug]: Since the update to node.js 16 playing radio stations via script does not work Jun 30, 2022
@meistermopper
Copy link
Author

meistermopper commented Jul 1, 2022

Now the four logs for every scenario, hope someone could help me:

  1. I installed NodeJS 16
  2. deletet chromecast adapter

3. installed chromecast adapter from cli

thomas@iobroker:~$ iob install chromecast@2.3.1 --debug
NPM version: 8.11.0
Installing iobroker.chromecast@2.3.1... (System call)
npm WARN deprecated source-map-url@0.4.1: See https://github.com/lydell/source-map-url#deprecated
npm WARN deprecated source-map-resolve@0.5.3: See https://github.com/lydell/source-map-resolve#deprecated
npm WARN deprecated urix@0.1.0: Please see https://github.com/lydell/urix#deprecated
npm WARN deprecated resolve-url@0.2.1: https://github.com/lydell/resolve-url#deprecated
npm WARN deprecated xmldom@0.1.16: Deprecated due to CVE-2021-21366 resolved in 0.5.0

added 212 packages, removed 4 packages, and changed 3 packages in 13s

151 packages are looking for funding
run npm fund for details
host.iobroker install adapter chromecast@2.3.1
upload [3] chromecast.admin /opt/iobroker/node_modules/iobroker.chromecast/admin/chromecast.png chromecast.png image/png
upload [2] chromecast.admin /opt/iobroker/node_modules/iobroker.chromecast/admin/home.png home.png image/png
upload [1] chromecast.admin /opt/iobroker/node_modules/iobroker.chromecast/admin/index_m.html index_m.html text/html
upload [0] chromecast.admin /opt/iobroker/node_modules/iobroker.chromecast/admin/words.js words.js application/javascript
Adapter "system.adapter.vis.0" restarted.
host.iobroker object system.adapter.chromecast created/updated

4. installed an instance

chromecast.0 2022-07-01 14:45:29.284 warn This object will not be created in future versions. Please report this to the developer.
chromecast.0 2022-07-01 14:45:29.284 warn Object chromecast.0.Küche.player.repeatMode is invalid: Default value has to be type "number" but received type "string"
chromecast.0 2022-07-01 14:45:29.284 warn This object will not be created in future versions. Please report this to the developer.
chromecast.0 2022-07-01 14:45:29.284 warn Object chromecast.0.Küche.playlist.currentItemId is invalid: Default value has to be type "number" but received type "object"
chromecast.0 2022-07-01 14:45:29.284 warn This object will not be created in future versions. Please report this to the developer.
chromecast.0 2022-07-01 14:45:29.284 warn Object chromecast.0.Küche.playlist.list is invalid: Default value has to be stringified but received type "object"
chromecast.0 2022-07-01 14:45:29.284 warn This object will not be created in future versions. Please report this to the developer.
chromecast.0 2022-07-01 14:45:29.284 warn Object chromecast.0.Küche.player.state is invalid: Default value has to be type "number" but received type "string"
chromecast.0 2022-07-01 14:45:29.268 warn This object will not be created in future versions. Please report this to the developer.
chromecast.0 2022-07-01 14:45:29.268 warn Object chromecast.0.Google_Mini_Wohnzimmer.player.shuffleMode is invalid: Default value has to be type "boolean" but received type "string"
chromecast.0 2022-07-01 14:45:29.268 warn This object will not be created in future versions. Please report this to the developer.
chromecast.0 2022-07-01 14:45:29.268 warn Object chromecast.0.Google_Mini_Wohnzimmer.player.repeatMode is invalid: Default value has to be type "number" but received type "string"
chromecast.0 2022-07-01 14:45:29.268 warn This object will not be created in future versions. Please report this to the developer.
chromecast.0 2022-07-01 14:45:29.268 warn Object chromecast.0.Google_Mini_Wohnzimmer.playlist.currentItemId is invalid: Default value has to be type "number" but received type "object"
chromecast.0 2022-07-01 14:45:29.268 warn This object will not be created in future versions. Please report this to the developer.
chromecast.0 2022-07-01 14:45:29.268 warn Object chromecast.0.Google_Mini_Wohnzimmer.playlist.list is invalid: Default value has to be stringified but received type "object"
chromecast.0 2022-07-01 14:45:29.267 warn This object will not be created in future versions. Please report this to the developer.
chromecast.0 2022-07-01 14:45:29.267 warn Object chromecast.0.Google_Mini_Wohnzimmer.player.state is invalid: Default value has to be type "number" but received type "string"
chromecast.0 2022-07-01 14:45:29.241 warn This object will not be created in future versions. Please report this to the developer.
chromecast.0 2022-07-01 14:45:29.241 warn Object chromecast.0.Schlafzimmer.player.shuffleMode is invalid: Default value has to be type "boolean" but received type "string"
chromecast.0 2022-07-01 14:45:29.240 warn This object will not be created in future versions. Please report this to the developer.
chromecast.0 2022-07-01 14:45:29.240 warn Object chromecast.0.Schlafzimmer.player.repeatMode is invalid: Default value has to be type "number" but received type "string"
chromecast.0 2022-07-01 14:45:29.240 warn This object will not be created in future versions. Please report this to the developer.
chromecast.0 2022-07-01 14:45:29.240 warn Object chromecast.0.Schlafzimmer.playlist.currentItemId is invalid: Default value has to be type "number" but received type "object"
chromecast.0 2022-07-01 14:45:29.240 warn This object will not be created in future versions. Please report this to the developer.
chromecast.0 2022-07-01 14:45:29.240 warn Object chromecast.0.Schlafzimmer.playlist.list is invalid: Default value has to be stringified but received type "object"
chromecast.0 2022-07-01 14:45:29.240 warn This object will not be created in future versions. Please report this to the developer.
chromecast.0 2022-07-01 14:45:29.240 warn Object chromecast.0.Schlafzimmer.player.state is invalid: Default value has to be type "number" but received type "string"
chromecast.0 2022-07-01 14:45:29.226 warn This object will not be created in future versions. Please report this to the developer.
chromecast.0 2022-07-01 14:45:29.226 warn Object chromecast.0.Wohnzimmer.player.shuffleMode is invalid: Default value has to be type "boolean" but received type "string"
chromecast.0 2022-07-01 14:45:29.226 warn This object will not be created in future versions. Please report this to the developer.
chromecast.0 2022-07-01 14:45:29.226 warn Object chromecast.0.Wohnzimmer.player.repeatMode is invalid: Default value has to be type "number" but received type "string"
chromecast.0 2022-07-01 14:45:29.226 warn This object will not be created in future versions. Please report this to the developer.
chromecast.0 2022-07-01 14:45:29.226 warn Object chromecast.0.Wohnzimmer.playlist.currentItemId is invalid: Default value has to be type "number" but received type "object"
chromecast.0 2022-07-01 14:45:29.226 warn This object will not be created in future versions. Please report this to the developer.
chromecast.0 2022-07-01 14:45:29.226 warn Object chromecast.0.Wohnzimmer.playlist.list is invalid: Default value has to be stringified but received type "object"
chromecast.0 2022-07-01 14:45:29.225 warn This object will not be created in future versions. Please report this to the developer.
chromecast.0 2022-07-01 14:45:29.225 warn Object chromecast.0.Wohnzimmer.player.state is invalid: Default value has to be type "number" but received type "string"
chromecast.0 2022-07-01 14:45:29.215 info State value to set for "chromecast.0.Außenbereich.port" has to be type "string" but received type "number"
chromecast.0 2022-07-01 14:45:29.204 info State value to set for "chromecast.0.Büro.port" has to be type "string" but received type "number"
chromecast.0 2022-07-01 14:45:28.963 warn This object will not be created in future versions. Please report this to the developer.
chromecast.0 2022-07-01 14:45:28.962 warn Object chromecast.0.Außenbereich.player.shuffleMode is invalid: Default value has to be type "boolean" but received type "string"
chromecast.0 2022-07-01 14:45:28.962 warn This object will not be created in future versions. Please report this to the developer.
chromecast.0 2022-07-01 14:45:28.962 warn Object chromecast.0.Außenbereich.player.repeatMode is invalid: Default value has to be type "number" but received type "string"
chromecast.0 2022-07-01 14:45:28.962 warn This object will not be created in future versions. Please report this to the developer.
chromecast.0 2022-07-01 14:45:28.962 warn Object chromecast.0.Außenbereich.playlist.currentItemId is invalid: Default value has to be type "number" but received type "object"
chromecast.0 2022-07-01 14:45:28.962 warn This object will not be created in future versions. Please report this to the developer.
chromecast.0 2022-07-01 14:45:28.962 warn Object chromecast.0.Außenbereich.playlist.list is invalid: Default value has to be stringified but received type "object"
chromecast.0 2022-07-01 14:45:28.961 warn This object will not be created in future versions. Please report this to the developer.
chromecast.0 2022-07-01 14:45:28.961 warn Object chromecast.0.Außenbereich.player.state is invalid: Default value has to be type "number" but received type "string"
chromecast.0 2022-07-01 14:45:28.958 warn This object will not be created in future versions. Please report this to the developer.
chromecast.0 2022-07-01 14:45:28.957 warn Object chromecast.0.Büro.player.shuffleMode is invalid: Default value has to be type "boolean" but received type "string"
chromecast.0 2022-07-01 14:45:28.957 warn This object will not be created in future versions. Please report this to the developer.
chromecast.0 2022-07-01 14:45:28.957 warn Object chromecast.0.Büro.player.repeatMode is invalid: Default value has to be type "number" but received type "string"
chromecast.0 2022-07-01 14:45:28.957 warn This object will not be created in future versions. Please report this to the developer.
chromecast.0 2022-07-01 14:45:28.957 warn Object chromecast.0.Büro.playlist.currentItemId is invalid: Default value has to be type "number" but received type "object"
chromecast.0 2022-07-01 14:45:28.957 warn This object will not be created in future versions. Please report this to the developer.
chromecast.0 2022-07-01 14:45:28.956 warn Object chromecast.0.Büro.playlist.list is invalid: Default value has to be stringified but received type "object"
chromecast.0 2022-07-01 14:45:28.956 warn This object will not be created in future versions. Please report this to the developer.
chromecast.0 2022-07-01 14:45:28.955 warn Object chromecast.0.Büro.player.state is invalid: Default value has to be type "number" but received type "string"
chromecast.0 2022-07-01 14:45:28.723 info starting. Version 2.3.1 in /opt/iobroker/node_modules/iobroker.chromecast, node: v16.15.1, js-controller: 4.0.23
chromecast.0 2022-07-01 14:45:24.756 error Cannot read properties of undefined (reading 'getVolume')
chromecast.0 2022-07-01 14:45:24.756 error TypeError: Cannot read properties of undefined (reading 'getVolume') at ChromecastDevice._updateClientStatus (/opt/iobroker/node_modules/iobroker.chromecast/lib/chromecastDevice.js:622:80) at MediaPlayer.emit (node:events:527:28) at PersistentClient.emit (node:events:539:35) at PersistentClient._updateStatus (/opt/iobroker/node_modules/castv2-player/lib/persistentClient.js:338:12) at /opt/iobroker/node_modules/castv2-player/lib/persistentClient.js:266:20 at /opt/iobroker/node_modules/castv2-client/lib/controllers/receiver.js:31:5 at fn.onmessage (/opt/iobroker/node_modules/castv2-client/lib/controllers/request-response.js:27:7) at fn.emit (node:events:539:35) at Channel.onmessage (/opt/iobroker/node_modules/castv2-client/lib/controllers/controller.js:16:10) at Channel.emit (node:events:527:28)
chromecast.0 2022-07-01 14:45:24.755 error uncaught exception: Cannot read properties of undefined (reading 'getVolume')
chromecast.0 2022-07-01 14:45:24.753 error Cannot read properties of undefined (reading 'getVolume')
chromecast.0 2022-07-01 14:45:24.753 error TypeError: Cannot read properties of undefined (reading 'getVolume') at ChromecastDevice._updateClientStatus (/opt/iobroker/node_modules/iobroker.chromecast/lib/chromecastDevice.js:622:80) at MediaPlayer.emit (node:events:527:28) at PersistentClient.emit (node:events:539:35) at PersistentClient._updateStatus (/opt/iobroker/node_modules/castv2-player/lib/persistentClient.js:338:12) at /opt/iobroker/node_modules/castv2-player/lib/persistentClient.js:266:20 at /opt/iobroker/node_modules/castv2-client/lib/controllers/receiver.js:31:5 at fn.onmessage (/opt/iobroker/node_modules/castv2-client/lib/controllers/request-response.js:27:7) at fn.emit (node:events:539:35) at Channel.onmessage (/opt/iobroker/node_modules/castv2-client/lib/controllers/controller.js:16:10) at Channel.emit (node:events:527:28)
chromecast.0 2022-07-01 14:45:24.753 error uncaught exception: Cannot read properties of undefined (reading 'getVolume')
chromecast.0 2022-07-01 14:45:24.717 error Cannot read properties of undefined (reading 'getVolume')
chromecast.0 2022-07-01 14:45:24.717 error TypeError: Cannot read properties of undefined (reading 'getVolume') at ChromecastDevice._updateClientStatus (/opt/iobroker/node_modules/iobroker.chromecast/lib/chromecastDevice.js:622:80) at MediaPlayer.emit (node:events:527:28) at PersistentClient.emit (node:events:539:35) at PersistentClient._updateStatus (/opt/iobroker/node_modules/castv2-player/lib/persistentClient.js:338:12) at /opt/iobroker/node_modules/castv2-player/lib/persistentClient.js:266:20 at /opt/iobroker/node_modules/castv2-client/lib/controllers/receiver.js:31:5 at fn.onmessage (/opt/iobroker/node_modules/castv2-client/lib/controllers/request-response.js:27:7) at fn.emit (node:events:539:35) at Channel.onmessage (/opt/iobroker/node_modules/castv2-client/lib/controllers/controller.js:16:10) at Channel.emit (node:events:527:28)
chromecast.0 2022-07-01 14:45:24.717 error uncaught exception: Cannot read properties of undefined (reading 'getVolume')
chromecast.0 2022-07-01 14:45:24.712 error Cannot read properties of undefined (reading 'getVolume')
chromecast.0 2022-07-01 14:45:24.712 error TypeError: Cannot read properties of undefined (reading 'getVolume') at ChromecastDevice._updateClientStatus (/opt/iobroker/node_modules/iobroker.chromecast/lib/chromecastDevice.js:622:80) at MediaPlayer.emit (node:events:527:28) at PersistentClient.emit (node:events:539:35) at PersistentClient._updateStatus (/opt/iobroker/node_modules/castv2-player/lib/persistentClient.js:338:12) at /opt/iobroker/node_modules/castv2-player/lib/persistentClient.js:266:20 at /opt/iobroker/node_modules/castv2-client/lib/controllers/receiver.js:31:5 at fn.onmessage (/opt/iobroker/node_modules/castv2-client/lib/controllers/request-response.js:27:7) at fn.emit (node:events:539:35) at Channel.onmessage (/opt/iobroker/node_modules/castv2-client/lib/controllers/controller.js:16:10) at Channel.emit (node:events:527:28)
chromecast.0 2022-07-01 14:45:24.712 error uncaught exception: Cannot read properties of undefined (reading 'getVolume')
chromecast.0 2022-07-01 14:45:24.709 error Cannot read properties of undefined (reading 'getVolume')
chromecast.0 2022-07-01 14:45:24.709 error TypeError: Cannot read properties of undefined (reading 'getVolume') at ChromecastDevice._updateClientStatus (/opt/iobroker/node_modules/iobroker.chromecast/lib/chromecastDevice.js:622:80) at MediaPlayer.emit (node:events:527:28) at PersistentClient.emit (node:events:539:35) at PersistentClient._updateStatus (/opt/iobroker/node_modules/castv2-player/lib/persistentClient.js:338:12) at /opt/iobroker/node_modules/castv2-player/lib/persistentClient.js:266:20 at /opt/iobroker/node_modules/castv2-client/lib/controllers/receiver.js:31:5 at fn.onmessage (/opt/iobroker/node_modules/castv2-client/lib/controllers/request-response.js:27:7) at fn.emit (node:events:539:35) at Channel.onmessage (/opt/iobroker/node_modules/castv2-client/lib/controllers/controller.js:16:10) at Channel.emit (node:events:527:28)
chromecast.0 2022-07-01 14:45:24.708 error uncaught exception: Cannot read properties of undefined (reading 'getVolume')
chromecast.0 2022-07-01 14:45:24.699 error Cannot read properties of undefined (reading 'getVolume')
chromecast.0 2022-07-01 14:45:24.699 error TypeError: Cannot read properties of undefined (reading 'getVolume') at ChromecastDevice._updateClientStatus (/opt/iobroker/node_modules/iobroker.chromecast/lib/chromecastDevice.js:622:80) at MediaPlayer.emit (node:events:527:28) at PersistentClient.emit (node:events:539:35) at PersistentClient._updateStatus (/opt/iobroker/node_modules/castv2-player/lib/persistentClient.js:338:12) at /opt/iobroker/node_modules/castv2-player/lib/persistentClient.js:266:20 at /opt/iobroker/node_modules/castv2-client/lib/controllers/receiver.js:31:5 at fn.onmessage (/opt/iobroker/node_modules/castv2-client/lib/controllers/request-response.js:27:7) at fn.emit (node:events:539:35) at Channel.onmessage (/opt/iobroker/node_modules/castv2-client/lib/controllers/controller.js:16:10) at Channel.emit (node:events:527:28)
chromecast.0 2022-07-01 14:45:24.699 error uncaught exception: Cannot read properties of undefined (reading 'getVolume')
chromecast.0 2022-07-01 14:45:24.698 info Wohnzimmer - Connected client
chromecast.0 2022-07-01 14:45:24.691 info Büro - Connected client
chromecast.0 2022-07-01 14:45:24.690 info Außenbereich - Connected client
chromecast.0 2022-07-01 14:45:24.651 info Küche - Connected client
chromecast.0 2022-07-01 14:45:24.650 info Schlafzimmer - Connected client
chromecast.0 2022-07-01 14:45:24.649 info Google Mini Wohnzimmer - Connected client
chromecast.0 2022-07-01 14:45:24.595 info Terminated (ADAPTER_REQUESTED_TERMINATION): Without reason
chromecast.0 2022-07-01 14:45:24.595 info terminating
chromecast.0 2022-07-01 14:45:24.595 info Unload completed sucesfully
chromecast.0 2022-07-01 14:45:24.595 info Küche - client disconnected
chromecast.0 2022-07-01 14:45:24.594 info Wohnzimmer - client disconnected
chromecast.0 2022-07-01 14:45:24.594 info Wohnzimmer - Detached player
chromecast.0 2022-07-01 14:45:24.594 info Wohnzimmer - Detached player
chromecast.0 2022-07-01 14:45:24.593 info Google Mini Wohnzimmer - client disconnected
chromecast.0 2022-07-01 14:45:24.593 info Schlafzimmer - client disconnected
chromecast.0 2022-07-01 14:45:24.593 info Außenbereich - client disconnected
chromecast.0 2022-07-01 14:45:24.593 info Büro - client disconnected
chromecast.0 2022-07-01 14:45:24.592 info Destroying chromecast scanner
chromecast.0 2022-07-01 14:45:24.592 info Unload triggered
chromecast.0 2022-07-01 14:45:24.591 info Got terminate signal TERMINATE_YOURSELF
chromecast.0 2022-07-01 14:45:17.582 info State value to set for "chromecast.0.Küche.player.shuffleMode" has to be type "boolean" but received type "string"
chromecast.0 2022-07-01 14:45:17.582 info State value to set for "chromecast.0.Küche.player.repeatMode" has to be type "number" but received type "string"
chromecast.0 2022-07-01 14:45:17.581 info State value to set for "chromecast.0.Küche.playlist.list" has to be stringified but received type "object"
chromecast.0 2022-07-01 14:45:17.574 info State value to set for "chromecast.0.Wohnzimmer.player.shuffleMode" has to be type "boolean" but received type "string"
chromecast.0 2022-07-01 14:45:17.559 info State value to set for "chromecast.0.Wohnzimmer.player.repeatMode" has to be type "number" but received type "string"
chromecast.0 2022-07-01 14:45:17.554 info State value to set for "chromecast.0.Wohnzimmer.playlist.list" has to be stringified but received type "object"
chromecast.0 2022-07-01 14:45:17.283 info State value to set for "chromecast.0.Google_Mini_Wohnzimmer.player.shuffleMode" has to be type "boolean" but received type "string"
chromecast.0 2022-07-01 14:45:17.283 info State value to set for "chromecast.0.Google_Mini_Wohnzimmer.player.repeatMode" has to be type "number" but received type "string"
chromecast.0 2022-07-01 14:45:17.282 info State value to set for "chromecast.0.Google_Mini_Wohnzimmer.playlist.list" has to be stringified but received type "object"
chromecast.0 2022-07-01 14:45:17.281 info State value to set for "chromecast.0.Google_Mini_Wohnzimmer.player.state" has to be type "number" but received type "string"
chromecast.0 2022-07-01 14:45:17.263 info State value to set for "chromecast.0.Schlafzimmer.player.shuffleMode" has to be type "boolean" but received type "string"
chromecast.0 2022-07-01 14:45:17.263 info State value to set for "chromecast.0.Schlafzimmer.player.repeatMode" has to be type "number" but received type "string"
chromecast.0 2022-07-01 14:45:17.262 info State value to set for "chromecast.0.Schlafzimmer.playlist.list" has to be stringified but received type "object"
chromecast.0 2022-07-01 14:45:17.261 info State value to set for "chromecast.0.Schlafzimmer.player.state" has to be type "number" but received type "string"
chromecast.0 2022-07-01 14:45:16.925 info State value to set for "chromecast.0.Außenbereich.player.shuffleMode" has to be type "boolean" but received type "string"
chromecast.0 2022-07-01 14:45:16.925 info State value to set for "chromecast.0.Außenbereich.player.repeatMode" has to be type "number" but received type "string"
chromecast.0 2022-07-01 14:45:16.925 info State value to set for "chromecast.0.Außenbereich.playlist.list" has to be stringified but received type "object"
chromecast.0 2022-07-01 14:45:16.906 info State value to set for "chromecast.0.Büro.player.shuffleMode" has to be type "boolean" but received type "string"
chromecast.0 2022-07-01 14:45:16.906 info State value to set for "chromecast.0.Büro.player.repeatMode" has to be type "number" but received type "string"
chromecast.0 2022-07-01 14:45:16.906 info State value to set for "chromecast.0.Büro.playlist.list" has to be stringified but received type "object"
chromecast.0 2022-07-01 14:45:16.905 info State value to set for "chromecast.0.Büro.player.state" has to be type "number" but received type "string"
chromecast.0 2022-07-01 14:45:16.263 info Wohnzimmer - Player joint
chromecast.0 2022-07-01 14:45:16.256 info Wohnzimmer - Connected player
chromecast.0 2022-07-01 14:45:16.238 info Wohnzimmer - Try to join player
chromecast.0 2022-07-01 14:45:16.135 info Küche - Connected client
chromecast.0 2022-07-01 14:45:16.134 info Wohnzimmer - Connected client
chromecast.0 2022-07-01 14:45:16.133 info Google Mini Wohnzimmer - Connected client
chromecast.0 2022-07-01 14:45:16.132 info Schlafzimmer - Connected client
chromecast.0 2022-07-01 14:45:16.020 warn State "chromecast.0.Küche.status.playing" has no existing object, this might lead to an error in future versions
chromecast.0 2022-07-01 14:45:16.020 warn State "chromecast.0.Küche.status.connected" has no existing object, this might lead to an error in future versions
chromecast.0 2022-07-01 14:45:16.019 warn State "chromecast.0.Küche.port" has no existing object, this might lead to an error in future versions
chromecast.0 2022-07-01 14:45:16.006 warn State "chromecast.0.Küche.address" has no existing object, this might lead to an error in future versions
chromecast.0 2022-07-01 14:45:16.005 warn State "chromecast.0.Wohnzimmer.status.playing" has no existing object, this might lead to an error in future versions
chromecast.0 2022-07-01 14:45:16.004 warn State "chromecast.0.Wohnzimmer.status.connected" has no existing object, this might lead to an error in future versions
chromecast.0 2022-07-01 14:45:15.986 warn State "chromecast.0.Wohnzimmer.port" has no existing object, this might lead to an error in future versions
chromecast.0 2022-07-01 14:45:15.983 warn State "chromecast.0.Wohnzimmer.address" has no existing object, this might lead to an error in future versions
chromecast.0 2022-07-01 14:45:15.955 info Außenbereich - Connected client
chromecast.0 2022-07-01 14:45:15.948 info Büro - Connected client
chromecast.0 2022-07-01 14:45:15.816 warn State "chromecast.0.Google_Mini_Wohnzimmer.status.playing" has no existing object, this might lead to an error in future versions
chromecast.0 2022-07-01 14:45:15.813 warn State "chromecast.0.Google_Mini_Wohnzimmer.status.connected" has no existing object, this might lead to an error in future versions
chromecast.0 2022-07-01 14:45:15.812 warn State "chromecast.0.Google_Mini_Wohnzimmer.port" has no existing object, this might lead to an error in future versions
chromecast.0 2022-07-1 14:45:15.809 warn State "chromecast.0.Google_Mini_Wohnzimmer.address" has no existing object, this might lead to an error in future versions
chromecast.0 2022-07-01 14:45:15.808 warn State "chromecast.0.Schlafzimmer.status.playing" has no existing object, this might lead to an error in future versions
chromecast.0 2022-07-01 14:45:15.805 warn State "chromecast.0.Schlafzimmer.status.connected" has no existing object, this might lead to an error in future versions
chromecast.0 2022-07-01 14:45:15.804 warn State "chromecast.0.Schlafzimmer.port" has no existing object, this might lead to an error in future versions
chromecast.0 2022-07-01 14:45:15.803 warn State "chromecast.0.Schlafzimmer.address" has no existing object, this might lead to an error in future versions
chromecast.0 2022-07-01 14:45:15.391 warn This object will not be created in future versions. Please report this to the developer.
chromecast.0 2022-07-01 14:45:15.391 warn This object will not be created in future versions. Please report this to the developer.
chromecast.0 2022-07-01 14:45:15.391 warn Object chromecast.0.Küche.player.repeatMode is invalid: Default value has to be type "number" but received type "string"
chromecast.0 2022-07-01 14:45:15.391 warn Object chromecast.0.Küche.player.shuffleMode is invalid: D

5. I played radio station via script

chromecast.0 2022-07-01 14:57:52.111 info Büro - getStatus
chromecast.0 2022-07-01 14:57:22.068 info Büro - getStatus
chromecast.0 2022-07-01 14:57:22.064 info Büro - getStatus
chromecast.0 2022-07-01 14:57:21.945 info Büro - Player joint
chromecast.0 2022-07-01 14:57:21.945 info Büro - Connected player
chromecast.0 2022-07-01 14:57:21.944 info Büro - Default player lauched
chromecast.0 2022-07-01 14:57:21.944 info Büro - Connected player
chromecast.0 2022-07-01 14:57:21.943 info Büro - Try to join player
chromecast.0 2022-07-01 14:57:21.758 error Büro - Cannot play file "http://edge.live.mp3.mdn.newmedia.nacamar.net/ps-dieneue_rock/livestream_hi.mp3": Error: Error: getaddrinfo ENOTFOUND edge.live.mp3.mdn.newmedia.nacamar.net
chromecast.0 2022-07-01 14:57:21.757 error Büro - Error playing playlist - Error: Error: getaddrinfo ENOTFOUND edge.live.mp3.mdn.newmedia.nacamar.net at ClientRequest. (/opt/iobroker/node_modules/castv2-player/lib/mediaInfo.js:80:98) at ClientRequest.emit (node:events:527:28) at Socket.socketErrorListener (node:_http_client:454:9) at Socket.emit (node:events:527:28) at emitErrorNT (node:internal/streams/destroy:157:8) at emitErrorCloseNT (node:internal/streams/destroy:122:3) at processTicksAndRejections (node:internal/process/task_queues:83:21)

6. I put the radiostation in state chromecast.0.device.player.url2play

chromecast.0	2022-07-01 15:07:11.697	error	Büro - Error playing playlist - TypeError: Cannot use 'in' operator to search for 'content-type' in undefined at MediaInfo._parseIcyHeaderPromise (/opt/iobroker/node_modules/castv2-player/lib/mediaInfo.js:143:26) at /opt/iobroker/node_modules/castv2-player/lib/mediaInfo.js:47:43 at runMicrotasks (<anonymous>) at processTicksAndRejections (node:internal/process/task_queues:96:5) at async Promise.all (index 1)
chromecast.0	2022-07-01 15:07:11.697	info	Büro - Closing mediaInfo
chromecast.0	2022-07-01 15:07:11.395	info	Büro - Detected redirection (302) to http://s5-webradio.antenne.de/80er-kulthits
chromecast.0	2022-07-01 15:07:11.359	info	Büro - Try to play url - http://mp3channels.webradio.antenne.de/80er-kulthits
chromecast.0	2022-07-01 15:06:25.948	error	Büro - Cannot play file "http://webradio.89.0rtl.de/livestream128.m3u": Error: queueLoad failed
chromecast.0	2022-07-01 15:06:25.948	error	Büro - Error playing playlist - Error: queueLoad failed at /opt/iobroker/node_modules/castv2-client/lib/controllers/media.js:149:23 at fn.onmessage (/opt/iobroker/node_modules/castv2-client/lib/controllers/request-response.js:27:7) at fn.emit (node:events:539:35) at Channel.onmessage (/opt/iobroker/node_modules/castv2-client/lib/controllers/controller.js:16:10) at Channel.emit (node:events:527:28) at Client.onmessage (/opt/iobroker/node_modules/castv2/lib/channel.js:23:10) at Client.emit (node:events:539:35) at PacketStreamWrapper.onpacket (/opt/iobroker/node_modules/castv2/lib/client.js:81:10) at PacketStreamWrapper.emit (node:events:527:28) at TLSSocket.<anonymous> (/opt/iobroker/node_modules/castv2/lib/packet-stream-wrapper.js:28:16)```

@Apollon77
Copy link
Member

getaddrinfo ENOTFOUND edge.live.mp3.mdn.newmedia.nacamar.net
means that the DNS lookup was not possible fr the given domain name ... is DNS working? Please do a manual "ping edge.live.mp3.mdn.newmedia.nacamar.net" or "dig edge.live.mp3.mdn.newmedia.nacamar.net"

@aortmannm
Copy link

aortmannm commented Jul 2, 2022

Hi, I think this is a duplicate/same issue I have created.

I made a local fix for me so if you want a quickfix you can change just one file on your PI.

Just go into this file with vi/nano or something you are using to edit files (/opt/iobroker/node_modules/castv2-player/lib/mediaInfo.js):

Line 143:
from:

if ("content-type" in res.headers)

to:

if (res.headers && "content-type" in res.headers)

Line 174:
from:

if ("icy-name" in res.headers)

to:

if (res.headers && "icy-name" in res.headers)

I posted this in the facebook group too.

I think the http API or the "in" operator changed with the new node Version.

@meistermopper
Copy link
Author

Great, it made my day. This fix is working.

Unfortunately, I am not a programmer. Maybe a developer can put this into a new adapter version.

@aortmannm
Copy link

I was not sure if this should just be a "quickfix" for me because I think there should be headers in the response so someone from the creaters or contributors that knows exactly the code and what is expected should maintain it.

I just did it for me because I don't wanna downgrade the node version again :D

@meistermopper
Copy link
Author

Unfortunately, the last radio station is now also played when there was a voice output on this device.

A better fix is clearly needed

@aortmannm
Copy link

But that is the same behaviour as before.

Radio is running, voice command comes in and than radio starts again. For me that is an expected and wanted behaviour.

This was with node 14 the same.

@Apollon77
Copy link
Member

Yes but this is not the real fix ... wenn "res.headers" nicht da ist dann stimmt irgendwas nicht mit der Antwort ... geht denn sonst alles?

@aortmannm
Copy link

aortmannm commented Jul 2, 2022

As I said it's just a quickfix for me. I think there are changes in the http api? The response headers are there when I debug it in the browser.

I just use sayIt and url2play but this works right now with my local changes.

image

@aortmannm
Copy link

After reading some code in castv2-player etc I think it's related to this nodejs/node#35281

@meistermopper
Copy link
Author

Ok, after restarting the device, the last station is no longer loaded. So the fix works after all.

@Apollon77
Copy link
Member

@aortmannm can you adjust the code and log the headers completely?

@aortmannm
Copy link

Code

log.info("Debugging: " + res.headers);

Log

chromecast.0 | 2022-07-03 15:31:27.347 | info | Debugging: undefined

res.headers is undefined. I can't output the hole response object, than it's just [Object object]. With JSON.stringify it's crashing.

Right now I don't know how to start a debug session for an ioBroker Adapter.

@aortmannm
Copy link

Ok, I used now util.inspect(res)

Debugging: Reader { _readableState: ReadableState { objectMode: false, highWaterMark: 16384, buffer: BufferList { head: null, tail: null, length: 0 }, length: 0, pipes: [], flowing: null, ended: false, endEmitted: false, reading: false, constructed: true, sync: false, needReadable: false, emittedReadable: false, readableListening: false, resumeScheduled: false, errorEmitted: false, emitClose: true, autoDestroy: true, destroyed: false, errored: null, closed: false, closeEmitted: false, defaultEncoding: 'utf8', awaitDrainWriters: null, multiAwaitDrain: false, readingMore: false, dataEmitted: false, decoder: null, encoding: null, [Symbol(kPaused)]: null }, _events: [Object: null prototype] { prefinish: [Function: prefinish], unpipe: [Function: onunpipe], error: [Function: onerror], close: [Function: bound onceWrapper] { listener: [Function: onclose] }, finish: [Function: bound onceWrapper] { listener: [Function: onfinish] } }, _eventsCount: 5, _maxListeners: 100, _writableState: WritableState { objectMode: false, highWaterMark: 16384, finalCalled: false, needDrain: false, ending: false, ended: false, finished: false, destroyed: false, decodeStrings: true, defaultEncoding: 'utf8', length: 0, writing: false, corked: 0, sync: true, bufferProcessing: false, onwrite: [Function: bound onwrite], writecb: null, writelen: 0, afterWriteTickInfo: null, buffered: [], bufferedIndex: 0, allBuffers: true, allNoop: true, pendingcb: 0, constructed: true, prefinished: false, errorEmitted: false, emitClose: true, autoDestroy: true, errored: null, closed: false, closeEmitted: false, [Symbol(kOnFinished)]: [] }, allowHalfOpen: true, metaint: 16384, _parserBytesLeft: 16384, _parserBuffers: [], _parserBuffered: 0, _parserState: 2, _parserCallback: [Function (anonymous)], _parserOutput: [Function: bound ], _parserInit: true, res: <ref *1> IncomingMessage { _readableState: ReadableState { objectMode: false, highWaterMark: 16384, buffer: BufferList { head: null, tail: null, length: 0 }, length: 0, pipes: [Array], flowing: true, ended: false, endEmitted: false, reading: false, constructed: true, sync: true, needReadable: false, emittedReadable: false, readableListening: false, resumeScheduled: true, errorEmitted: false, emitClose: true, autoDestroy: true, destroyed: false, errored: null, closed: false, closeEmitted: false, defaultEncoding: 'utf8', awaitDrainWriters: null, multiAwaitDrain: false, readingMore: true, dataEmitted: false, decoder: null, encoding: null, [Symbol(kPaused)]: false }, _events: [Object: null prototype] { end: [Array], data: [Function: ondata] }, _eventsCount: 2, _maxListeners: 100, socket: TLSSocket { _tlsOptions: [Object], _secureEstablished: true, _securePending: false, _newSessionPending: false, _controlReleased: true, secureConnecting: false, _SNICallback: null, servername: 'd141.rndfnk.com', alpnProtocol: false, authorized: true, authorizationError: null, encrypted: true, _events: [Object: null prototype], _eventsCount: 11, connecting: false, _hadError: false, _parent: null, _host: 'd141.rndfnk.com', _readableState: [ReadableState], _maxListeners: 100, _writableState: [WritableState], allowHalfOpen: false, _sockname: null, _pendingData: null, _pendingEncoding: '', server: undefined, _server: null, ssl: [TLSWrap], _requestCert: true, _rejectUnauthorized: true, parser: [HTTPParser], _httpMessage: [ClientRequest], _wasIcy: false, [Symbol(res)]: [TLSWrap], [Symbol(verified)]: true, [Symbol(pendingSession)]: null, [Symbol(async_id_symbol)]: 1884, [Symbol(kHandle)]: [TLSWrap], [Symbol(lastWriteQueueSize)]: 0, [Symbol(timeout)]: null, [Symbol(kBuffer)]: null, [Symbol(kBufferCb)]: null, [Symbol(kBufferGen)]: null, [Symbol(kCapture)]: false, [Symbol(kSetNoDelay)]: false, [Symbol(kSetKeepAlive)]: false, [Symbol(kSetKeepAliveInitialDelay)]: 0, [Symbol(kBytesRead)]: 0, [Symbol(kBytesWritten)]: 0, [Symbol(connect-options)]: [Object], [Symbol(RequestTimeout)]: undefined }, httpVersionMajor: 1, httpVersionMinor: 1, httpVersion: '1.1', complete: false, rawHeaders: [ 'Content-Type', 'audio/mpeg', 'icy-metaint', '16384', 'icy-br', '128', 'ice-audio-info', 'ice-samplerate=44100;ice-bitrate=128;ice-channels=2', 'icy-description', 'DASDING', 'icy-genre', 'Pop Music', 'icy-name', 'Das Ding MP3 128', 'icy-pub', '0', 'icy-samplerate', '48000', 'icy-url', 'https://www.dasding.de', 'Server', 'rocketstreamingserver', 'Cache-Control', 'max-age=0, no-cache, no-store', 'Pragma', 'no-cache', 'Date', 'Sun, 3 Jul 2022 13:40:17 GMT', 'Expires', 'Sun, 3 Jul 2022 13:40:17 GMT', 'Accept-Ranges', 'none', 'Access-Control-Allow-Origin', '*', 'Access-Control-Expose-Headers', 'Content-Type, icy-metaint, icy-br, ice-audio-info, icy-description, icy-genre, icy-name, icy-samplerate, icy-url', 'Connection', 'Close' ], rawTrailers: [], aborted: false, upgrade: false, url: '', method: null, statusCode: 200, statusMessage: 'OK', client: TLSSocket { _tlsOptions: [Object], _secureEstablished: true, _securePending: false, _newSessionPending: false, _controlReleased: true, secureConnecting: false, _SNICallback: null, servername: 'd141.rndfnk.com', alpnProtocol: false, authorized: true, authorizationError: null, encrypted: true, _events: [Object: null prototype], _eventsCount: 11, connecting: false, _hadError: false, _parent: null, _host: 'd141.rndfnk.com', _readableState: [ReadableState], _maxListeners: 100, _writableState: [WritableState], allowHalfOpen: false, _sockname: null, _pendingData: null, _pendingEncoding: '', server: undefined, _server: null, ssl: [TLSWrap], _requestCert: true, _rejectUnauthorized: true, parser: [HTTPParser], _httpMessage: [ClientRequest], _wasIcy: false, [Symbol(res)]: [TLSWrap], [Symbol(verified)]: true, [Symbol(pendingSession)]: null, [Symbol(async_id_symbol)]: 1884, [Symbol(kHandle)]: [TLSWrap], [Symbol(lastWriteQueueSize)]: 0, [Symbol(timeout)]: null, [Symbol(kBuffer)]: null, [Symbol(kBufferCb)]: null, [Symbol(kBufferGen)]: null, [Symbol(kCapture)]: false, [Symbol(kSetNoDelay)]: false, [Symbol(kSetKeepAlive)]: false, [Symbol(kSetKeepAliveInitialDelay)]: 0, [Symbol(kBytesRead)]: 0, [Symbol(kBytesWritten)]: 0, [Symbol(connect-options)]: [Object], [Symbol(RequestTimeout)]: undefined }, _consuming: false, _dumped: false, req: ClientRequest { _events: [Object: null prototype], _eventsCount: 2, _maxListeners: 100, outputData: [], outputSize: 0, writable: true, destroyed: false, _last: true, chunkedEncoding: false, shouldKeepAlive: false, maxRequestsOnConnectionReached: false, _defaultKeepAlive: true, useChunkedEncodingByDefault: false, sendDate: false, _removedConnection: false, _removedContLen: false, _removedTE: false, _contentLength: 0, _hasBody: true, _trailer: '', finished: true, _headerSent: true, _closed: false, socket: [TLSSocket], _header: 'GET /ard/swr/dasding/live/mp3/128/stream.mp3?aggregator=web&sid=2BR4ZOGU9ifErLlzHOzGpSzj4EO&token=kmGJszrPSuSOo-FfkI3BZ_Z6vJq8lTOcmoNZp1Eoe9k&tvf=EW-m8Axp_hZkMTQxLnJuZGZuay5jb20 HTTP/1.1\r\n' + 'User-Agent: ChromecastPlayer\r\n' + 'Host: d141.rndfnk.com\r\n' + 'Icy-MetaData: 1\r\n' + 'Connection: close\r\n' + '\r\n', _keepAliveTimeout: 0, _onPendingData: [Function: nop], agent: [Agent], socketPath: undefined, method: 'GET', maxHeaderSize: undefined, insecureHTTPParser: undefined, path: '/ard/swr/dasding/live/mp3/128/stream.mp3?aggregator=web&sid=2BR4ZOGU9ifErLlzHOzGpSzj4EO&token=kmGJszrPSuSOo-FfkI3BZ_Z6vJq8lTOcmoNZp1Eoe9k&tvf=EW-m8Axp_hZkMTQxLnJuZGZuay5jb20', _ended: false, res: [Circular *1], aborted: false, timeoutCb: null, upgradeOrConnect: false, parser: [HTTPParser], maxHeadersCount: null, reusedSocket: false, host: 'd141.rndfnk.com', protocol: 'https:', [Symbol(kCapture)]: false, [Symbol(kNeedDrain)]: false, [Symbol(corked)]: 0, [Symbol(kOutHeaders)]: [Object: null prototype] }, [Symbol(kCapture)]: false, [Symbol(kHeaders)]: { 'content-type': 'audio/mpeg', 'icy-metaint': '16384', 'icy-br': '128', 'ice-audio-info': 'ice-samplerate=44100;ice-bitrate=128;ice-channels=2', 'icy-description': 'DASDING', 'icy-genre': 'Pop Music', 'icy-name': 'Das Ding MP3 128', 'icy-pub': '0', 'icy-samplerate': '48000', 'icy-url': 'https://www.dasding.de', server: 'rocketstreamingserver', 'cache-control': 'max-age=0, no-cache, no-store', pragma: 'no-cache', date: 'Sun, 3 Jul 2022 13:40:17 GMT', expires: 'Sun, 3 Jul 2022 13:40:17 GMT', 'accept-ranges': 'none', 'access-control-allow-origin': '*', 'access-control-expose-headers': 'Content-Type, icy-metaint, icy-br, ice-audio-info, icy-description, icy-genre, icy-name, icy-samplerate, icy-url', connection: 'Close' }, [Symbol(kHeadersCount)]: 38, [Symbol(kTrailers)]: null, [Symbol(kTrailersCount)]: 0, [Symbol(RequestTimeout)]: undefined }, socket: [Getter/Setter], httpVersionMajor: [Getter/Setter], httpVersionMinor: [Getter/Setter], httpVersion: [Getter/Setter], complete: [Getter/Setter], rawHeaders: [Getter/Setter], rawTrailers: [Getter/Setter], aborted: [Getter/Setter], upgrade: [Getter/Setter], url: [Getter/Setter], method: [Getter/Setter], statusCode: [Getter/Setter], statusMessage: [Getter/Setter], client: [Getter/Setter], req: [Getter/Setter], [Symbol(kCapture)]: false, [Symbol(kCallback)]: null }

There is a property rawHeaders...probably this could be used.

@Apollon77
Copy link
Member

I personally think more that the "forwarding res" like https://github.com/iobroker-community-adapters/castv2-player/blob/1192bebe66b39bf7c4840f6579a848435dff4fea/lib/mediaInfo.js#L77 does breaks that "lazy evaluation of headers somehow. Can you please try to find this on your system and log res.headers here too? I assume it works there ...

if it is this my proposed fiy owould be to get headers there and pass that instead of res ...

@aortmannm
Copy link

aortmannm commented Jul 3, 2022

My log was added in this function before the resolve of the Promise is called. Or what do you mean? You can also open a chat in facebook if this helps.

image

@Apollon77
Copy link
Member

Aahh I thought you added the log there where the exception occurs.

The interetsing thing is that the line here "that._url = res.headers.location" can access a res.headers field without any issues, but in the other method not. And also you "log of res.headers" did not worked ... So yes sit seems to be all caused by that "headers is somehow build lazy in Node.js 16 with getters which causes effects

@Apollon77
Copy link
Member

PS: Please try to log "res.headers['content-type']" ... does that work?

@aortmannm
Copy link

@aortmannm
Copy link

aortmannm commented Jul 4, 2022

image

Apollon the changes in line 74 are not corredct. The adapter crashes with the line:

res.res.headers.location

I juse now:

res.headers.location

So we need to update the code again.

@Apollon77

@aortmannm
Copy link

aortmannm commented Jul 4, 2022

Yes but I see now it's still not working. To play a online radio it's working but when using the sayIt adapters it crashes now ;/.

So it seems like we have two different uses of the res object or how we get them from the differen node modules ;/ .

image

A second ago I added this code:

            that._icyConnection = icy.get(con, function (res) {
              res.headers = res.headers ? res.headers : res.res.headers;
              if (res.statusCode >= 300 && res.statusCode < 400) {
                log.info("%s - Detected redirection (%d) to %s",that._name, res.statusCode, res.headers.location);
                that._url = res.headers.location;
                connect();
              } else {
                resolve([that._url, res]);
              }
            });

I think we become two different types of res objects, one from the icy npm module and one of another one.

I will check if this works the next few days for me.

Seems to work for both but mh I'm not sure if it's the way we should go.

@Apollon77
Copy link
Member

Ok, dann versuch mal

Zeile 77 ändern von

            resolve([that._url, res.res]);

in

            resolve([that._url, res.res ? res.res : res]);

@aortmannm
Copy link

I updated my comment above. I did something like this before the if statement because there we also need the right headers.

@Apollon77
Copy link
Member

Apollon77 commented Jul 4, 2022

Ok, also an idea. In fact modifying the object in that way can lead to any other issues in later versions of node.hjs but if it works we can do it that way. You tell what works best

@aortmannm
Copy link

Ok, so seems to work well the last days. So you can take the Codeblock of my last comment.

@marlan99
Copy link

just upgraded to node.js 16 and had the same issue. works now with the changed code block (beginning at line 71 of mediaInfo.js ) mentioned above

            that._icyConnection = icy.get(con, function (res) {
              res.headers = res.headers ? res.headers : res.res.headers;
              if (res.statusCode >= 300 && res.statusCode < 400) {
                log.info("%s - Detected redirection (%d) to %s",that._name, res.statusCode, res.headers.location);
                that._url = res.headers.location;
                connect();
              } else {
                resolve([that._url, res]);
              }
            });

@aortmannm
Copy link

DOn't know why it;s not released right now @Apollon77

@meistermopper
Copy link
Author

@Apollon77

Yes, I'm interested in that too.

I would like to install this improvement in a stable version and I apologize for the urgency.

@Apollon77
Copy link
Member

As soon ad I find time I will adjust it officially. Will happen in the next days.

@meistermopper
Copy link
Author

I know you are one of the busiest and just wanted to make sure it wasn't forgotten.

Again, I apologize for my actions.

And yes, I am aware that I am already cutting into your time again with this statement, sorry.

@rockthenet
Copy link

Hi Guys, any planes to publish / deploy this quick fix during the next days? Cant wait to get my chromecast speaker working again... plz @Apollon77

@Apollon77
Copy link
Member

Yes it is on the "before myvacation list" ... lets see

@Apollon77
Copy link
Member

Ok, I now updated the library and prepared also an update here on GitHub ... so please try GitHub version and report please

@marlan99
Copy link

upgraded from version 2.3.1 to 3.0.0. with github but instance is not running anymore. i always get the error message "net-tools" not found but it is installed.
Downgrade also did not work anymore with the same error. i deleted the whole adapter and installed again the version 2.3.1 and now it is running again.
tried it twice with the same result:

`

host.iobroker 2022-08-19 17:00:29.320 info instance system.adapter.vis.0 terminated while should be started once
vis.0 2022-08-19 17:00:28.754 info Terminated (NO_ERROR): Without reason
host.iobroker 2022-08-19 17:00:28.405 error startInstance system.adapter.chromecast.0 Adapter dependency not fulfilled on any host: required adapter "net-tools" not found!
vis.0 2022-08-19 17:00:27.429 info vis license is OK.
vis.0 2022-08-19 17:00:27.211 info starting. Version 1.4.15 in /opt/iobroker/node_modules/iobroker.vis, node: v16.16.0, js-controller: 4.0.23
host.iobroker 2022-08-19 17:00:26.329 info iobroker exit 0
host.iobroker 2022-08-19 17:00:25.950 info instance system.adapter.chromecast.0 terminated with code 11 (ADAPTER_REQUESTED_TERMINATION)
chromecast.0 2022-08-19 17:00:25.683 error Cannot read properties of undefined (reading 'getVolume')
chromecast.0 2022-08-19 17:00:25.683 error TypeError: Cannot read properties of undefined (reading 'getVolume') at ChromecastDevice._updateClientStatus (/opt/iobroker/node_modules/iobroker.chromecast/lib/chromecastDevice.js:622:80) at MediaPlayer.emit (node:events:527:28) at PersistentClient.emit (node:events:539:35) at PersistentClient._updateStatus (/opt/iobroker/node_modules/castv2-player/lib/persistentClient.js:338:12) at /opt/iobroker/node_modules/castv2-player/lib/persistentClient.js:266:20 at /opt/iobroker/node_modules/castv2-client/lib/controllers/receiver.js:31:5 at fn.onmessage (/opt/iobroker/node_modules/castv2-client/lib/controllers/request-response.js:27:7) at fn.emit (node:events:539:35) at Channel.onmessage (/opt/iobroker/node_modules/castv2-client/lib/controllers/controller.js:16:10) at Channel.emit (node:events:527:28)
chromecast.0 2022-08-19 17:00:25.682 error uncaught exception: Cannot read properties of undefined (reading 'getVolume')
chromecast.0 2022-08-19 17:00:25.674 error Cannot read properties of undefined (reading 'getVolume')
chromecast.0 2022-08-19 17:00:25.673 error TypeError: Cannot read properties of undefined (reading 'getVolume') at ChromecastDevice._updateClientStatus (/opt/iobroker/node_modules/iobroker.chromecast/lib/chromecastDevice.js:622:80) at MediaPlayer.emit (node:events:527:28) at PersistentClient.emit (node:events:539:35) at PersistentClient._updateStatus (/opt/iobroker/node_modules/castv2-player/lib/persistentClient.js:338:12) at /opt/iobroker/node_modules/castv2-player/lib/persistentClient.js:266:20 at /opt/iobroker/node_modules/castv2-client/lib/controllers/receiver.js:31:5 at fn.onmessage (/opt/iobroker/node_modules/castv2-client/lib/controllers/request-response.js:27:7) at fn.emit (node:events:539:35) at Channel.onmessage (/opt/iobroker/node_modules/castv2-client/lib/controllers/controller.js:16:10) at Channel.emit (node:events:527:28)
chromecast.0 2022-08-19 17:00:25.672 error uncaught exception: Cannot read properties of undefined (reading 'getVolume')
chromecast.0 2022-08-19 17:00:25.618 info Wohnzimmer - Connected client
chromecast.0 2022-08-19 17:00:25.612 info Wintergarten - Connected client
chromecast.0 2022-08-19 17:00:25.481 error Cannot read properties of undefined (reading 'getVolume')
chromecast.0 2022-08-19 17:00:25.480 error TypeError: Cannot read properties of undefined (reading 'getVolume') at ChromecastDevice._updateClientStatus (/opt/iobroker/node_modules/iobroker.chromecast/lib/chromecastDevice.js:622:80) at MediaPlayer.emit (node:events:527:28) at PersistentClient.emit (node:events:539:35) at PersistentClient._updateStatus (/opt/iobroker/node_modules/castv2-player/lib/persistentClient.js:338:12) at /opt/iobroker/node_modules/castv2-player/lib/persistentClient.js:266:20 at /opt/iobroker/node_modules/castv2-client/lib/controllers/receiver.js:31:5 at fn.onmessage (/opt/iobroker/node_modules/castv2-client/lib/controllers/request-response.js:27:7) at fn.emit (node:events:539:35) at Channel.onmessage (/opt/iobroker/node_modules/castv2-client/lib/controllers/controller.js:16:10) at Channel.emit (node:events:527:28)
chromecast.0 2022-08-19 17:00:25.479 error uncaught exception: Cannot read properties of undefined (reading 'getVolume')
chromecast.0 2022-08-19 17:00:25.473 error Cannot read properties of undefined (reading 'getVolume')
chromecast.0 2022-08-19 17:00:25.472 error TypeError: Cannot read properties of undefined (reading 'getVolume') at ChromecastDevice._updateClientStatus (/opt/iobroker/node_modules/iobroker.chromecast/lib/chromecastDevice.js:622:80) at MediaPlayer.emit (node:events:527:28) at PersistentClient.emit (node:events:539:35) at PersistentClient._updateStatus (/opt/iobroker/node_modules/castv2-player/lib/persistentClient.js:338:12) at /opt/iobroker/node_modules/castv2-player/lib/persistentClient.js:266:20 at /opt/iobroker/node_modules/castv2-client/lib/controllers/receiver.js:31:5 at fn.onmessage (/opt/iobroker/node_modules/castv2-client/lib/controllers/request-response.js:27:7) at fn.emit (node:events:539:35) at Channel.onmessage (/opt/iobroker/node_modules/castv2-client/lib/controllers/controller.js:16:10) at Channel.emit (node:events:527:28)
chromecast.0 2022-08-19 17:00:25.470 error uncaught exception: Cannot read properties of undefined (reading 'getVolume')
chromecast.0 2022-08-19 17:00:25.468 error Cannot read properties of undefined (reading 'getVolume')
chromecast.0 2022-08-19 17:00:25.467 error TypeError: Cannot read properties of undefined (reading 'getVolume') at ChromecastDevice._updateClientStatus (/opt/iobroker/node_modules/iobroker.chromecast/lib/chromecastDevice.js:622:80) at MediaPlayer.emit (node:events:527:28) at PersistentClient.emit (node:events:539:35) at PersistentClient._updateStatus (/opt/iobroker/node_modules/castv2-player/lib/persistentClient.js:338:12) at /opt/iobroker/node_modules/castv2-player/lib/persistentClient.js:266:20 at /opt/iobroker/node_modules/castv2-client/lib/controllers/receiver.js:31:5 at fn.onmessage (/opt/iobroker/node_modules/castv2-client/lib/controllers/request-response.js:27:7) at fn.emit (node:events:539:35) at Channel.onmessage (/opt/iobroker/node_modules/castv2-client/lib/controllers/controller.js:16:10) at Channel.emit (node:events:527:28)
chromecast.0 2022-08-19 17:00:25.466 error uncaught exception: Cannot read properties of undefined (reading 'getVolume')
chromecast.0 2022-08-19 17:00:25.460 error Cannot read properties of undefined (reading 'getVolume')
chromecast.0 2022-08-19 17:00:25.459 error TypeError: Cannot read properties of undefined (reading 'getVolume') at ChromecastDevice._updateClientStatus (/opt/iobroker/node_modules/iobroker.chromecast/lib/chromecastDevice.js:622:80) at MediaPlayer.emit (node:events:527:28) at PersistentClient.emit (node:events:539:35) at PersistentClient._updateStatus (/opt/iobroker/node_modules/castv2-player/lib/persistentClient.js:338:12) at /opt/iobroker/node_modules/castv2-player/lib/persistentClient.js:266:20 at /opt/iobroker/node_modules/castv2-client/lib/controllers/receiver.js:31:5 at fn.onmessage (/opt/iobroker/node_modules/castv2-client/lib/controllers/request-response.js:27:7) at fn.emit (node:events:539:35) at Channel.onmessage (/opt/iobroker/node_modules/castv2-client/lib/controllers/controller.js:16:10) at Channel.emit (node:events:527:28)
chromecast.0 2022-08-19 17:00:25.458 error uncaught exception: Cannot read properties of undefined (reading 'getVolume')

`

@Apollon77
Copy link
Member

i always get the error message "net-tools" not found but it is installed.

Can you show that please too?

@Apollon77
Copy link
Member

Hm ... and are you sure that te error came after the update? Inthe GitHub version line 622 is something else ... Please check again that the update was installed and adapter restarted afterwards

@meistermopper
Copy link
Author

When I install from github, I get version 3.0.1, but that is something completely different from 2.3.1.

Two more adapters are needed and the objects must be deleted before the update, because now the devices are found by their mac addresses.

In addition, all scripts have to be adapted, which I actually wanted to avoid until now.

@aortmannm
Copy link

Ok, I don't have problems with the 3.0.1 sayIt and Playing Radio stations works for me

@Apollon77
Copy link
Member

@aortmannm with the new 3.0.1 from guthib or with the manually adjusted version? If manually: please reinstall from github to verify it still works :-)

@meistermopper All good, will be next official version ...so changes will come

@aortmannm
Copy link

@Apollon77 with github Version 3.0.1 :)

@Apollon77
Copy link
Member

@aortmannm then I wait if anyone more of the "mee too" guys from above find time to check snd will release tomorrow or such

@marlan99
Copy link

i always get the error message "net-tools" not found but it is installed.

Can you show that please too?

just installed the adapter from github on ioBroker without any previous version and get the following error message when trying to install a new instance:
Bildschirmfoto 2022-08-25 um 11 53 15
then i deactivate the expert mode and the instance will be installed but does not start with following errors in the logfile:
`

admin.0 2022-08-25 15:21:06.635 info <== Disconnect system.user.admin from ::ffff:192.168.1.135
host.iobroker-test 2022-08-25 15:21:06.398 error startInstance system.adapter.chromecast.0 Adapter dependency not fulfilled on any host: required adapter "net-tools" not found!
admin.0 2022-08-25 15:21:02.849 info ==> Connected system.user.admin from ::ffff:192.168.1.135
host.iobroker-test 2022-08-25 15:21:01.024 error startInstance system.adapter.chromecast.0 Adapter dependency not fulfilled on any host: required adapter "net-tools" not found!
`

when i do the same with version 2.3.1 in the expert mode i get the same error message and its not possible to install an instance of the adapter. without expert mode then the instance will be installed and is running fine without any errors.

@Juicytronic
Copy link

i always get the error message "net-tools" not found but it is installed.

Can you show that please too?

just installed the adapter from github on ioBroker without any previous version and get the following error message when trying to install a new instance:

Bildschirmfoto 2022-08-25 um 11 53 15

then i deactivate the expert mode and the instance will be installed but does not start with following errors in the logfile:

`

admin.0 | 2022-08-25 15:21:06.635 | info | <== Disconnect system.user.admin from ::ffff:192.168.1.135

-- | -- | -- | --

host.iobroker-test | 2022-08-25 15:21:06.398 | error | startInstance system.adapter.chromecast.0 Adapter dependency not fulfilled on any host: required adapter "net-tools" not found!

admin.0 | 2022-08-25 15:21:02.849 | info | ==> Connected system.user.admin from ::ffff:192.168.1.135

host.iobroker-test | 2022-08-25 15:21:01.024 | error | startInstance system.adapter.chromecast.0 Adapter dependency not fulfilled on any host: required adapter "net-tools" not found!

`

when i do the same with version 2.3.1 in the expert mode i get the same error message and its not possible to install an instance of the adapter. without expert mode then the instance will be installed and is running fine without any errors.

You Need to install the "net-tools" Adapter before you can create a chromecast instance since V3.0.0 .

@marlan99
Copy link

but why do i have the error message only in the expert mode ?

and net-tools seems to be installed already:

sudo apt install net-tools
Paketlisten werden gelesen... Fertig
Abhängigkeitsbaum wird aufgebaut.       
Statusinformationen werden eingelesen.... Fertig
net-tools ist schon die neueste Version (1.60+git20180626.aebd88e-1).
0 aktualisiert, 0 neu installiert, 0 zu entfernen und 0 nicht aktualisiert.

@aortmannm
Copy link

net-tools is an ioBroker Adapter

@marlan99
Copy link

ok was not clear to me and could not find a hint to it.
but for this case i can confirm: "works as designed" :-)

a lot of warnings in the logs about wrong type and "This object will not be created in future versions. Please report this to the developer."
but it is running.

thanks to all

@Apollon77
Copy link
Member

Can I please get the full list of these "the object ..." errors as a debug log please as own issue?

Then I can look into it.

@Apollon77
Copy link
Member

then lets release it ... will be funny for sure :-) 3.0.3 on it's way to beta

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

7 participants