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 when using webhook name instead of ip address #34

Closed
mensa84 opened this issue Oct 14, 2018 · 12 comments
Closed

Error when using webhook name instead of ip address #34

mensa84 opened this issue Oct 14, 2018 · 12 comments

Comments

@mensa84
Copy link

mensa84 commented Oct 14, 2018

Hello,

when I use the DNS name (Server) instead of the ip address (192.168.1.8) in the config.json, I always get that error:

Oct 14 08:29:10 Server homebridge[16874]: /usr/lib/node_modules/homebridge-nukiio/nukibridge.js:189
Oct 14 08:29:10 Server homebridge[16874]:         throw new Error("Adding webhook failed: " + err);
Oct 14 08:29:10 Server homebridge[16874]:         ^
Oct 14 08:29:10 Server homebridge[16874]: Error: Adding webhook failed: Error: Request to Nuki bridge was not succesful.
Oct 14 08:29:10 Server homebridge[16874]:     at NukiBridge.<anonymous> (/usr/lib/node_modules/homebridge-nukiio/nukibridge.js:189:15)
Oct 14 08:29:10 Server homebridge[16874]:     at NukiBridge.<anonymous> (/usr/lib/node_modules/homebridge-nukiio/nukibridge.js:388:11)
Oct 14 08:29:10 Server homebridge[16874]:     at Request.self.callback (/usr/lib/node_modules/homebridge-nukiio/node_modules/request/request.js:373:22)
Oct 14 08:29:10 Server homebridge[16874]:     at emitTwo (events.js:126:13)
Oct 14 08:29:10 Server homebridge[16874]:     at Request.emit (events.js:214:7)
Oct 14 08:29:10 Server homebridge[16874]:     at Request.<anonymous> (/usr/lib/node_modules/homebridge-nukiio/node_modules/request/request.js:1318:14)
Oct 14 08:29:10 Server homebridge[16874]:     at emitOne (events.js:121:20)
Oct 14 08:29:10 Server homebridge[16874]:     at Request.emit (events.js:211:7)
Oct 14 08:29:10 Server homebridge[16874]:     at IncomingMessage.<anonymous> (/usr/lib/node_modules/homebridge-nukiio/node_modules/request/request.js:1266:12)
Oct 14 08:29:10 Server homebridge[16874]:     at emitNone (events.js:111:20)
Oct 14 08:29:10 Server systemd[1]: homebridge.service: Main process exited, code=exited, status=1/FAILURE
Oct 14 08:29:10 Server systemd[1]: homebridge.service: Unit entered failed state.
Oct 14 08:29:10 Server systemd[1]: homebridge.service: Failed with result 'exit-code'.

Why is this?
How can I fix it?

@benzman81
Copy link
Owner

From the machine running home bridge, can you ping the bridge using its DNS name (Server)?

@mensa84
Copy link
Author

mensa84 commented Oct 14, 2018

Yes, it is working:

root@Server:~# ping server
PING Server.WORKGROUP (127.0.1.1) 56(84) bytes of data.
64 bytes from Server.WORKGROUP (127.0.1.1): icmp_seq=1 ttl=64 time=0.047 ms

@benzman81
Copy link
Owner

benzman81 commented Oct 14, 2018

But your ping returns the ip of localhost. Thats not where the bridge is running. You need to enter the hostname/ip of the bridge.

@benzman81
Copy link
Owner

benzman81 commented Oct 14, 2018

Or wait, what configuration field are we talking about? For bridge_url you need to use the ip/name of the bridge. For webhook_server_ip_or_name you need to enter the ip/name of the server running homebridge.

@mensa84
Copy link
Author

mensa84 commented Oct 14, 2018

We are talking about configuration field "webhook_server_ip_or_name".

This works:

"webhook_server_ip_or_name": "192.168.1.8"

This brings the errors:

"webhook_server_ip_or_name": "Server"

My homebridge is running on "Server" / 192.168.1.8 and so localhost / 127.0.0.1 is also right.

The configuration field "bridge_url" works without problems with DNS name:

"bridge_url": "Nuki-Bridge:8080"

FYI: IP address of my Nuki-Bridge is: 192.168.1.74

Why do you think, that "webhook_server_ip_or_name" can't handle DNS name?

@benzman81
Copy link
Owner

When the error occurs, could you look at the log of the nuki bridge using Nuki-Bridge:8080/log?token=yourtoken
and post possible error here.

@mensa84
Copy link
Author

mensa84 commented Oct 14, 2018

I think here are no errors (I replaced nukiID, macAddr and some public IPs by XXXXXX / 1.1.1.1):

[
{"timestamp": "2018-10-14T08:27:08+00:00", "type": "HTTP-Log"},
{"timestamp": "2018-10-14T08:27:08+00:00", "type": "WLAN-SocketConnected", "connection": 0},
{"timestamp": "2018-10-14T08:26:56+00:00", "type": "WLAN-SocketDisconnected", "connection": 0},
{"timestamp": "2018-10-14T08:26:56+00:00", "type": "WLAN-SocketConnected", "connection": 0},
{"timestamp": "2018-10-14T08:26:55+00:00", "type": "WLAN-SocketDisconnected", "connection": 0},
{"timestamp": "2018-10-14T08:26:55+00:00", "type": "BLE-Disconnected", "nukiId": "XXXXXXXXX"},
{"timestamp": "2018-10-14T08:26:55+00:00", "type": "BLE-Disconnect", "nukiId": "XXXXXXXXX"},
{"timestamp": "2018-10-14T08:26:55+00:00", "type": "BLE-ReceivingMsg", "nukiId": "XXXXXXXXX", "cmdId": "000C"},
{"timestamp": "2018-10-14T08:26:54+00:00", "type": "BLE-SendingMsg", "nukiId": "XXXXXXXXX", "cmdId": "0001"},
{"timestamp": "2018-10-14T08:26:54+00:00", "type": "BLE-Connect", "handles": [24, 25]},
{"timestamp": "2018-10-14T08:26:54+00:00", "type": "BLE-Connected", "nukiId": "XXXXXXXXX"},
{"timestamp": "2018-10-14T08:26:54+00:00", "type": "BLE-Connect", "macAddr": "XXXXXXXXX"},
{"timestamp": "2018-10-14T08:26:54+00:00", "type": "BLE-Connect", "nukiId": "XXXXXXXXX"},
{"timestamp": "2018-10-14T08:26:54+00:00", "type": "HTTP-LockState", "nukiId": "XXXXXXXXX"},
{"timestamp": "2018-10-14T08:26:54+00:00", "type": "WLAN-SocketConnected", "connection": 0},
{"timestamp": "2018-10-14T08:26:54+00:00", "type": "WLAN-SocketDisconnected", "connection": 0},
{"timestamp": "2018-10-14T08:26:54+00:00", "type": "WLAN-SocketConnected", "connection": 0},
{"timestamp": "2018-10-14T08:26:49+00:00", "type": "WLAN-SocketDisconnected", "connection": 0},
{"timestamp": "2018-10-14T08:26:48+00:00", "type": "MemStat", "heapUsed": 1956},
{"timestamp": "2018-10-14T08:26:48+00:00", "type": "WLAN-TxDropped", "connection": 0, "bytes": 1489},
{"timestamp": "2018-10-14T08:26:48+00:00", "type": "HTTP-Log"},
{"timestamp": "2018-10-14T08:26:48+00:00", "type": "WLAN-SocketConnected", "connection": 0},
{"timestamp": "2018-10-14T08:26:40+00:00", "type": "WLAN-SocketDisconnected", "connection": 0},
{"timestamp": "2018-10-14T08:26:40+00:00", "type": "WLAN-SocketConnected", "connection": 0},
{"timestamp": "2018-10-14T08:26:40+00:00", "type": "WLAN-SocketDisconnected", "connection": 0},
{"timestamp": "2018-10-14T08:26:40+00:00", "type": "BLE-Disconnected", "nukiId": "XXXXXXXXX"},
{"timestamp": "2018-10-14T08:26:40+00:00", "type": "BLE-Disconnect", "nukiId": "XXXXXXXXX"},
{"timestamp": "2018-10-14T08:26:39+00:00", "type": "BLE-ReceivingMsg", "nukiId": "XXXXXXXXX", "cmdId": "000C"},
{"timestamp": "2018-10-14T08:26:39+00:00", "type": "BLE-SendingMsg", "nukiId": "XXXXXXXXX", "cmdId": "0001"},
{"timestamp": "2018-10-14T08:26:39+00:00", "type": "BLE-Connect", "handles": [24, 25]},
{"timestamp": "2018-10-14T08:26:39+00:00", "type": "BLE-Connected", "nukiId": "XXXXXXXXX"},
{"timestamp": "2018-10-14T08:26:38+00:00", "type": "BLE-Connect", "macAddr": "XXXXXXXXX"},
{"timestamp": "2018-10-14T08:26:38+00:00", "type": "BLE-Connect", "nukiId": "XXXXXXXXX"},
{"timestamp": "2018-10-14T08:26:38+00:00", "type": "HTTP-LockState", "nukiId": "XXXXXXXXX"},
{"timestamp": "2018-10-14T08:26:38+00:00", "type": "WLAN-SocketConnected", "connection": 0},
{"timestamp": "2018-10-14T08:26:38+00:00", "type": "WLAN-SocketDisconnected", "connection": 0},
{"timestamp": "2018-10-14T08:26:38+00:00", "type": "WLAN-SocketConnected", "connection": 0},
{"timestamp": "2018-10-14T08:26:28+00:00", "type": "WLAN-SocketDisconnected", "connection": 0},
{"timestamp": "2018-10-14T08:26:27+00:00", "type": "MemStat", "heapUsed": 1996},
{"timestamp": "2018-10-14T08:26:27+00:00", "type": "WLAN-TxDropped", "connection": 0, "bytes": 1518},
{"timestamp": "2018-10-14T08:26:26+00:00", "type": "HTTP-Log"},
{"timestamp": "2018-10-14T08:26:26+00:00", "type": "WLAN-SocketConnected", "connection": 0},
{"timestamp": "2018-10-14T08:26:25+00:00", "type": "WLAN-SocketDisconnected", "connection": 0},
{"timestamp": "2018-10-14T08:26:25+00:00", "type": "WLAN-SocketConnected", "connection": 0},
{"timestamp": "2018-10-14T08:26:24+00:00", "type": "WLAN-SocketDisconnected", "connection": 0},
{"timestamp": "2018-10-14T08:26:24+00:00", "type": "BLE-Disconnected", "nukiId": "XXXXXXXXX"},
{"timestamp": "2018-10-14T08:26:24+00:00", "type": "BLE-Disconnect", "nukiId": "XXXXXXXXX"},
{"timestamp": "2018-10-14T08:26:24+00:00", "type": "BLE-ReceivingMsg", "nukiId": "XXXXXXXXX", "cmdId": "000C"},
{"timestamp": "2018-10-14T08:26:23+00:00", "type": "BLE-SendingMsg", "nukiId": "XXXXXXXXX", "cmdId": "0001"},
{"timestamp": "2018-10-14T08:26:23+00:00", "type": "BLE-Connect", "handles": [24, 25]},
{"timestamp": "2018-10-14T08:26:23+00:00", "type": "BLE-Connected", "nukiId": "XXXXXXXXX"},
{"timestamp": "2018-10-14T08:26:22+00:00", "type": "BLE-Connect", "macAddr": "XXXXXXXXX"},
{"timestamp": "2018-10-14T08:26:22+00:00", "type": "BLE-Connect", "nukiId": "XXXXXXXXX"},
{"timestamp": "2018-10-14T08:26:22+00:00", "type": "HTTP-LockState", "nukiId": "XXXXXXXXX"},
{"timestamp": "2018-10-14T08:26:22+00:00", "type": "WLAN-SocketConnected", "connection": 0},
{"timestamp": "2018-10-14T08:26:22+00:00", "type": "WLAN-SocketDisconnected", "connection": 0},
{"timestamp": "2018-10-14T08:26:22+00:00", "type": "WLAN-SocketConnected", "connection": 0},
{"timestamp": "2018-10-14T08:25:43+00:00", "type": "WLAN-SocketDisconnected", "connection": 0},
{"timestamp": "2018-10-14T08:25:42+00:00", "type": "MemStat", "heapUsed": 1976},
{"timestamp": "2018-10-14T08:25:42+00:00", "type": "WLAN-TxDropped", "connection": 0, "bytes": 1489},
{"timestamp": "2018-10-14T08:25:42+00:00", "type": "HTTP-Log"},
{"timestamp": "2018-10-14T08:25:42+00:00", "type": "WLAN-SocketConnected", "connection": 0},
{"timestamp": "2018-10-14T08:25:36+00:00", "type": "WLAN-SocketDisconnected", "connection": 0},
{"timestamp": "2018-10-14T08:25:35+00:00", "type": "MemStat", "heapUsed": 1976},
{"timestamp": "2018-10-14T08:25:35+00:00", "type": "WLAN-TxDropped", "connection": 0, "bytes": 1518},
{"timestamp": "2018-10-14T08:25:35+00:00", "type": "HTTP-Log"},
{"timestamp": "2018-10-14T08:25:34+00:00", "type": "WLAN-SocketConnected", "connection": 0},
{"timestamp": "2018-10-14T08:00:36+00:00", "type": "SSE-PushNukisResponse", "error": 0},
{"timestamp": "2018-10-14T08:00:36+00:00", "type": "SSE-PushNukisRequest", "count": 1},
{"timestamp": "2018-10-14T07:00:35+00:00", "type": "SSE-PushNukisResponse", "error": 0},
{"timestamp": "2018-10-14T07:00:35+00:00", "type": "SSE-PushNukisRequest", "count": 1},
{"timestamp": "2018-10-14T06:36:19+00:00", "type": "HTTP-PostTimeout"},
{"timestamp": "2018-10-14T06:36:11+00:00", "type": "WLAN-Dns", "prefAddr": "192.168.1.2", "altAddr": "1.1.1.1"},
{"timestamp": "2018-10-14T06:36:11+00:00", "type": "WLAN-Dns", "prefAddr": "1.1.1.1", "altAddr": "1.1.1.1"},
{"timestamp": "2018-10-14T06:36:11+00:00", "type": "WLAN-DnsError", "errors": 1},
{"timestamp": "2018-10-14T06:35:59+00:00", "type": "BLE-Disconnected", "nukiId": "XXXXXXXXX"},
{"timestamp": "2018-10-14T06:35:56+00:00", "type": "WLAN-SocketDisconnected", "connection": 3},
{"timestamp": "2018-10-14T06:35:56+00:00", "type": "HTTP-PostDone", "responseCode": 404},
{"timestamp": "2018-10-14T06:35:56+00:00", "type": "HTTP-Post", "nukiId": "XXXXXXXXX", "urlId": 1},
{"timestamp": "2018-10-14T06:35:54+00:00", "type": "WLAN-SocketConnected", "connection": 3},
{"timestamp": "2018-10-14T06:35:53+00:00", "type": "BLE-Disconnect", "nukiId": "XXXXXXXXX"},
{"timestamp": "2018-10-14T06:35:53+00:00", "type": "BLE-ReceivingMsg", "nukiId": "XXXXXXXXX", "cmdId": "000E"},
{"timestamp": "2018-10-14T06:35:53+00:00", "type": "SSE-KeyturnerResponse", "nukiId": "XXXXXXXXX", "bytes": 188},
{"timestamp": "2018-10-14T06:35:53+00:00", "type": "BLE-ReceivingSSE", "bytes": 55, "auth": "00000103"},
{"timestamp": "2018-10-14T06:35:53+00:00", "type": "SSE-KeyturnerResponse", "nukiId": "XXXXXXXXX", "bytes": 256},
{"timestamp": "2018-10-14T06:35:53+00:00", "type": "BLE-ReceivingSSE", "bytes": 106, "auth": "00000103"},
{"timestamp": "2018-10-14T06:35:52+00:00", "type": "WLAN-SocketDisconnected", "connection": 3},
{"timestamp": "2018-10-14T06:35:52+00:00", "type": "HTTP-PostDone", "responseCode": 200},
{"timestamp": "2018-10-14T06:35:52+00:00", "type": "HTTP-Post", "nukiId": "XXXXXXXXX", "urlId": 0},
{"timestamp": "2018-10-14T06:35:52+00:00", "type": "BLE-SendingSSE", "bytes": 96, "auth": "00000103"},
{"timestamp": "2018-10-14T06:35:52+00:00", "type": "BLE-Connect", "handles": [24, 25]},
{"timestamp": "2018-10-14T06:35:52+00:00", "type": "BLE-Connected", "nukiId": "XXXXXXXXX"},
{"timestamp": "2018-10-14T06:35:52+00:00", "type": "BLE-Connect", "macAddr": "XXXXXXXXX"},
{"timestamp": "2018-10-14T06:35:52+00:00", "type": "BLE-Connect", "nukiId": "XXXXXXXXX"},
{"timestamp": "2018-10-14T06:35:52+00:00", "type": "SSE-KeyturnerRequest", "nukiId": "XXXXXXXXX", "bytes": 96},
{"timestamp": "2018-10-14T06:35:51+00:00", "type": "BLE-Disconnected", "nukiId": "XXXXXXXXX"},
{"timestamp": "2018-10-14T06:35:51+00:00", "type": "BLE-Disconnect", "nukiId": "XXXXXXXXX"},
{"timestamp": "2018-10-14T06:35:51+00:00", "type": "BLE-ReceivingMsg", "nukiId": "XXXXXXXXX", "cmdId": "000E"},
{"timestamp": "2018-10-14T06:35:51+00:00", "type": "SSE-KeyturnerResponse", "nukiId": "XXXXXXXXX", "bytes": 228},
{"timestamp": "2018-10-14T06:35:51+00:00", "type": "BLE-ReceivingSSE", "bytes": 86, "auth": "00000103"}
]

Do you see any problem here?
I hope I did not post any private keys or passwords with my log!?

@benzman81
Copy link
Owner

Could you post what you see when you open

http://Nuki-Bridge:8080/callback/list?token=yourtoken

with your browser?

@mensa84
Copy link
Author

mensa84 commented Oct 14, 2018

I see this:

{"callbacks": [{"id": 0, "url": "http://192.168.1.8:51827/"},{"id": 1, "url": "http://192.168.1.8:51826/"},{"id": 2, "url": "http://asdf:51827/"}]}

From where comes "asdf"?? I did not write this anywhere.

@benzman81
Copy link
Owner

maybe a test. the bridge can only handle three callback, that is why you might get the errors. Please call Could you execute http://Nuki-Bridge:8080/callback/remove?token=yourtoken&id=0
three times in a row and try homebridge start again with correct hostname/ip set.

@mensa84
Copy link
Author

mensa84 commented Oct 14, 2018

Thank you very much!
I did call:

http://Nuki-Bridge:8080/callback/remove?token=yourtoken&id=0
http://Nuki-Bridge:8080/callback/remove?token=yourtoken&id=1
http://Nuki-Bridge:8080/callback/remove?token=yourtoken&id=2

Then restarted homebridge.
Now everything is fine and "http://Nuki-Bridge:8080/callback/list?token=yourtoken" only displays this:

{"callbacks": [{"id": 0, "url": "http://Server:51827/"}]}

Perfect man, thanks a lot!!!

@benzman81
Copy link
Owner

No problem.

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

2 participants