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

Error: ERR_HTTP_INVALID_HEADER_VALUE #9

Open
suxus-zz opened this issue Jan 20, 2021 · 24 comments
Open

Error: ERR_HTTP_INVALID_HEADER_VALUE #9

suxus-zz opened this issue Jan 20, 2021 · 24 comments

Comments

@suxus-zz
Copy link

Hello

I have currently this problem when i run your plugin. I have a Unifi DreamMachine Pro and i will control my AppleTV.

[20/01/2021, 19:05:13] [UnifiMacBlocker] TypeError [ERR_HTTP_INVALID_HEADER_VALUE]: Invalid value "undefined" for header "cookie" at ClientRequest.setHeader (_http_outgoing.js:561:3) at new ClientRequest (_http_client.js:251:14) at Object.request (https.js:313:10) at HttpClient.requestRawWithCallback (/usr/local/lib/node_modules/homebridge-unifi-mac-block/node_modules/typed-rest-client/HttpClient.js:310:35) at /usr/local/lib/node_modules/homebridge-unifi-mac-block/node_modules/typed-rest-client/HttpClient.js:289:18 at new Promise (<anonymous>) at HttpClient.requestRaw (/usr/local/lib/node_modules/homebridge-unifi-mac-block/node_modules/typed-rest-client/HttpClient.js:282:16) at HttpClient.<anonymous> (/usr/local/lib/node_modules/homebridge-unifi-mac-block/node_modules/typed-rest-client/HttpClient.js:207:43) at Generator.next (<anonymous>) at /usr/local/lib/node_modules/homebridge-unifi-mac-block/node_modules/typed-rest-client/HttpClient.js:9:71 { code: 'ERR_HTTP_INVALID_HEADER_VALUE' }

My config.json looks like this
{ "platform": "UnifiMacBlocker", "base": "192.168.88.1", "username": "USER-FROM-WEBGUI", "password": "PASS-FROM-WEBGUI", "site": "default", "refreshInterval": 5, "devices": [ { "name": "AppleTV", "mac": "90:dd:5d:a5:65:3c" } ] }

Have you a idea whats my problem?

regards

@rloomans
Copy link
Contributor

This plugin needs to be updated to support the UDM, UDM Pro and the Cloudkey Gen 2 with 2.0 firmware.

My stab at doing this is in pull request #7 and you try it out as mentioned at #8 (comment)

@suxus-zz
Copy link
Author

Hello

Okay i will try out, first i must remove the current plugin and then i can install your version with

npm install git+https://github.com/rloomans/homebridge-unifi-kids-cry.git

Is this right, and i can use the same config.json settings?

@rloomans
Copy link
Contributor

rloomans commented Jan 21, 2021 via email

@suxus-zz
Copy link
Author

@rloomans

It try this but i can't see the plugin i have this output

pi@homebridge:~ $ npm install git+https://github.com/rloomans/homebridge-unifi-kids-cry.git
npm WARN saveError ENOENT: no such file or directory, open '/home/pi/package.json'
npm notice created a lockfile as package-lock.json. You should commit this file.
npm WARN enoent ENOENT: no such file or directory, open '/home/pi/package.json'
npm WARN pi No description
npm WARN pi No repository field.
npm WARN pi No README data
npm WARN pi No license field.

  • [email protected]
    added 5 packages from 5 contributors and audited 5 packages in 11.501s

1 package is looking for funding
run npm fund for details

found 0 vulnerabilities

@rloomans
Copy link
Contributor

rloomans commented Jan 21, 2021 via email

@suxus-zz
Copy link
Author

Yes i have install homebridge-config-ui-x v4.36.0 but i can't the terminal to input the command.

@rloomans
Copy link
Contributor

rloomans commented Jan 21, 2021 via email

@suxus-zz
Copy link
Author

suxus-zz commented Jan 21, 2021

I find the terminal, must actived in the conf
HOMEBRIDGE_CONFIG_UI_TERMINAL=1

but when i run the commend in the terminal then i have this output

homebridge@homebridge:/var/homebridge $ npm install git+https://github.com/rloomans/homebridge-unifi-kids-cry.git
npm WARN saveError ENOENT: no such file or directory, open '/var/homebridge/package.json'
npm notice created a lockfile as package-lock.json. You should commit this file.
npm WARN enoent ENOENT: no such file or directory, open '/var/homebridge/package.json'
npm WARN homebridge No description
npm WARN homebridge No repository field.
npm WARN homebridge No README data
npm WARN homebridge No license field.

1 package is looking for funding
run npm fund for details

I try it now with
sudo npm i -g homebridge-unifi-mac-block
and now is [email protected] installed, but i don't know is this the right version?

@suxus-zz
Copy link
Author

@rloomans have you a idea why i can't install your version from the plugin? Or is there another way to install the plugin. I think the idea of plugin is brilliant and I could really use it very well for myself, so it would be great if I could get it to work on myself.
Thank you very much

@rloomans
Copy link
Contributor

rloomans commented Jan 22, 2021 via email

@suxus-zz
Copy link
Author

I use this version
pi@homebridge:~ $ cat /etc/os-release PRETTY_NAME="Raspbian GNU/Linux 9 (stretch)" NAME="Raspbian GNU/Linux" VERSION_ID="9" VERSION="9 (stretch)" VERSION_CODENAME=stretch ID=raspbian ID_LIKE=debian HOME_URL="http://www.raspbian.org/" SUPPORT_URL="http://www.raspbian.org/RaspbianForums" BUG_REPORT_URL="http://www.raspbian.org/RaspbianBugs"

and i try yesterday (on the Web-UI Terminal and on the Terminal)

`
pi@homebridge:~ $ sudo npm install -g git+https://github.com/rloomans/homebridge-unifi-kids-cry.git
npm ERR! code 128
npm ERR! Command failed: git clone --mirror -q https://github.com/rloomans/homebridge-unifi-kids-cry.git /root/.npm/_cacache/tmp/git-clone-07c486a8/.git
npm ERR! fatal: could not create leading directories of '/root/.npm/_cacache/tmp/git-clone-07c486a8/.git'
npm ERR!

npm ERR! A complete log of this run can be found in:
npm ERR! /root/.npm/_logs/2021-01-21T16_31_05_776Z-debug.log
`

@rloomans
Copy link
Contributor

rloomans commented Jan 22, 2021 via email

@suxus-zz
Copy link
Author

suxus-zz commented Jan 22, 2021

I find a way from a few minutes, i have successfully install your version.

`
sudo su
rm -rf .npm
npm install -g --unsafe-perm git+https://github.com/rloomans/homebridge-unifi-kids-cry.git
exit

`

I think the "rm -rf .npm" was importend.

@suxus-zz
Copy link
Author

Hello, the plugin works wonderfully for me, exactly what I was looking for.
Is this a special version for UDM or does your code also come in the original code or is your code a different project and is therefore already in the master in your project?

@suxus-zz
Copy link
Author

@rloomans
Hello
Your version running on my Homebridge, but sometimes i have this errors in the log
[27/01/2021, 06:53:10] [UnifiMacBlocker] Error: { "errors": [ "Invalid username or password" ] } at RestClient.<anonymous> (/usr/local/lib/node_modules/homebridge-unifi-mac-block/node_modules/typed-rest-client/RestClient.js:202:31) at Generator.next (<anonymous>) at fulfilled (/usr/local/lib/node_modules/homebridge-unifi-mac-block/node_modules/typed-rest-client/RestClient.js:6:58) at runMicrotasks (<anonymous>) at processTicksAndRejections (internal/process/task_queues.js:93:5) { statusCode: 401, result: { errors: [ 'Invalid username or password' ] } }.
But my User/Pass it's correctly, i can login with this user/pass on my UDM Pro UI. I don't know what's the problem.

regards

@rloomans
Copy link
Contributor

rloomans commented Jan 27, 2021 via email

@suxus-zz
Copy link
Author

Interesting, I also have a UDM Pro. The effect for me was that in HomeKit the message "locked" "unlocked" can then again and again with this device.

@rloomans
Copy link
Contributor

rloomans commented Jan 27, 2021 via email

@suxus-zz
Copy link
Author

Good idea with the retry

@rloomans
Copy link
Contributor

rloomans commented Jan 27, 2021 via email

@suxus-zz
Copy link
Author

Thank you, I'll be happy to test this out. Do I have to uninstall something beforehand or can I just install the new version with?

npm install -g --unsafe-perm git+https://github.com/rloomans/homebridge-unifi-kids-cry.git#retries

@rloomans
Copy link
Contributor

rloomans commented Jan 27, 2021 via email

@albatrossflavour
Copy link

Afternoon folks, sorry to jump in. I'm trying to get this plugin working and getting the same result ( ERR_HTTP_INVALID_HEADER_VALUE ) even when using the retries branch. I've got a UDM Pro and am happy to help with any diagnostics.

@plainsane
Copy link
Owner

Sorry peeps, been away for a while.

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

No branches or pull requests

4 participants