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

HomeKit Bridge Error load error #12

Open
livefeed opened this issue Feb 28, 2018 · 25 comments
Open

HomeKit Bridge Error load error #12

livefeed opened this issue Feb 28, 2018 · 25 comments
Assignees
Labels
beta testing Issues that popped up during beta testing bug Something isn't working potentially resolved or non-issue Bug that cannot be reproduced and may be fixed or a one-off user problem test results pending Issue is pending the outcome of test results or special build

Comments

@livefeed
Copy link

Hi, I am getting the following error on start up;

HomeKit Bridge Error Exception in plugin.buildServerConfigurationDict line 3942: 'key apiport not found in dict'
CODE: hb["port"] = self.pluginPrefs["apiport"]

HomeKit Bridge Error Unable to build server configuration for 'HomeKit Bridge'.
HomeKit Bridge Rebuilding configuration for 'HomeKit Bridge'
HomeKit Bridge Error Exception in plugin.buildServerConfigurationDict line 3942: 'key apiport not found in dict'
CODE: hb["port"] = self.pluginPrefs["apiport"]

HomeKit Bridge Error Unable to build server configuration for 'HomeKit Bridge'.
HomeKit Bridge Attempting to start 'HomeKit Bridge'

@livefeed livefeed added bug Something isn't working help wanted Extra attention is needed beta testing Issues that popped up during beta testing labels Feb 28, 2018
@Colorado4Wheeler
Copy link
Collaborator

What version are you running? That was an issue back around beta 3-4 that got resolved. There should be a port number in the plugin preferences for HKB as pictured here, if it's not there then you are running some really old version.
screen shot 2018-02-28 at 12 10 46 pm

@livefeed
Copy link
Author

Just updated today to 0.13.1 (Beta 13 Release 1)

I do have a homebridge custom server also running so I can use view cameras, should they not both be running?

Thank you for your help.

@Colorado4Wheeler
Copy link
Collaborator

You can run HBB at the same time, it shouldn't be a problem. But do check the plugin prefs for the screenshot I posted to see what it says. The only way you should get that error is if you cancelled the initial dialog when you installed the plugin because even if that field is blank it wouldn't throw the error - the error says it's missing entirely.

@livefeed
Copy link
Author

screen shot 2018-02-28 at 2 27 33 pm

@Colorado4Wheeler
Copy link
Collaborator

This is getting stranger and stranger. I see the screenshot and given that there is no way on earth you should get the message. If that configuration saved then it should not get a message about it being missing entirely. Please restart the plugin and if it still happens then delete the prefs file from Indigo/Preferences/Plugins/ and the folder as well, both will be called com.eps.indigoplugin.homekit-bridge. Also report if those files are not there because if they aren't then you have an Indigo problem since the prefs file is created by Indigo and not by the plugin.

@livefeed
Copy link
Author

Deleted both, reloaded and...

Feb 28, 2018 at 2:55:07 PM
Reloading plugin "HomeKit Bridge 0.13.1"
Stopping plugin "HomeKit Bridge 0.13.1" (pid 11264)
Stopped plugin "HomeKit Bridge 0.13.1"
Starting plugin "HomeKit Bridge 0.13.1" (pid 11348)
Started plugin "HomeKit Bridge 0.13.1"
HomeKit Bridge Error Exception in plugin.buildServerConfigurationDict line 3942: 'key apiport not found in dict'
CODE: hb["port"] = self.pluginPrefs["apiport"]

HomeKit Bridge Error Unable to build server configuration for 'HomeKit Bridge'.
HomeKit Bridge Rebuilding configuration for 'HomeKit Bridge'
HomeKit Bridge Error Exception in plugin.buildServerConfigurationDict line 3942: 'key apiport not found in dict'
CODE: hb["port"] = self.pluginPrefs["apiport"]

HomeKit Bridge Error Unable to build server configuration for 'HomeKit Bridge'.
HomeKit Bridge Attempting to start 'HomeKit Bridge'

@Colorado4Wheeler
Copy link
Collaborator

Colorado4Wheeler commented Feb 28, 2018 via email

@livefeed
Copy link
Author

Prefs.zip

@livefeed
Copy link
Author

I am happy to let you remote in if that would help?

@Colorado4Wheeler
Copy link
Collaborator

Colorado4Wheeler commented Feb 28, 2018 via email

@livefeed
Copy link
Author

Whats the best way to have you remote in?

@Colorado4Wheeler
Copy link
Collaborator

Colorado4Wheeler commented Feb 28, 2018 via email

@Colorado4Wheeler
Copy link
Collaborator

Ok, so in the end I think there may be something wrong with the system. All I did was open prefs and save and that fixed that problem, but then the username wasn't appearing in the server config, something else that - programmatically - cannot happen. I'll keep this issue open in case it happens to someone else but I think this is a one-off issue.

@Colorado4Wheeler Colorado4Wheeler added potentially resolved or non-issue Bug that cannot be reproduced and may be fixed or a one-off user problem and removed help wanted Extra attention is needed labels Mar 3, 2018
@durosity
Copy link

durosity commented Mar 3, 2018

I'm getting something very similar. Afterwards though it seems to startup OK and basic testing so far doesn't seem to have caused any other errors:

HomeKit Bridge Error Exception in plugin.buildServerConfigurationDict line 4056: 'key apiport not found in dict'
CODE: hb["port"] = self.pluginPrefs["apiport"]

HomeKit Bridge Error Unable to build server configuration for 'HK Bridge Test'.
HomeKit Bridge Rebuilding configuration for 'HK Bridge Test'
HomeKit Bridge Error Exception in plugin.buildServerConfigurationDict line 4056: 'key apiport not found in dict'
CODE: hb["port"] = self.pluginPrefs["apiport"]

@Colorado4Wheeler
Copy link
Collaborator

Did you try what I tried and what resolved the issue? Open the plugin prefs, and S A V E? I looked over the code more times than I can count to see if there was any way that the prefs aren't getting added and it just doesn't happen unless you cancel prefs (which pops up when you first start the plugin). Maybe it has something to do with the UK version of macOS or something, I don't know. I did mean to put in code that would break the plugin if that wasn't found.

@Colorado4Wheeler
Copy link
Collaborator

Especially since, at this point, there are 20 users who have not gotten this error, so I feel pretty confident that it's not a bug.

@Colorado4Wheeler
Copy link
Collaborator

Please go to the plugin menu -> HomeKit Bridge -> Support Information and post the results, it should be something similar to this:

#####################################################################
# HomeKit Bridge                                                    #
#####################################################################
#                                                                   #
# Plugin Version      : 0.15.0                                      #
# Template Version    : 3.3.1                                       #
# Core Engine Version : 3.0.0                                       #
# Indigo Version      : 7.1.1                                       #
# Indigo API Version  : 2.0                                         #
#                                                                   #
# Alphas, Betas and Pre-Releases can be downloaded from:            #
#    https://github.com/Colorado4Wheeler                            #
#                                                                   #
# All support inquiries, questions or comments go to:               #
#    http://forums.indigodomo.com/viewforum.php?f=192               #
#                                                                   #
# Copyright (c) 2018 - Colorado4Wheeler & EPS                       #
#                                                                   #
#####################################################################

@durosity
Copy link

durosity commented Mar 3, 2018

Here you go:

`#####################################################################

HomeKit Bridge

#####################################################################

Plugin Version : 0.15.0

Template Version : 3.3.1

Core Engine Version : 3.0.0

Indigo Version : 7.1.1

Indigo API Version : 2.0

Alphas, Betas and Pre-Releases can be downloaded from:

https://github.com/Colorado4Wheeler

All support inquiries, questions or comments go to:

http://forums.indigodomo.com/viewforum.php?f=192

Copyright (c) 2018 - Colorado4Wheeler & EPS

#####################################################################
`

@Colorado4Wheeler
Copy link
Collaborator

And it still doesn't work? Even after going into prefs and saving?

@durosity
Copy link

durosity commented Mar 3, 2018

Sorry thought i'd said it seemed to be working fine without even needing to do those instructions. That said i've just happened across this when i was adding a thermostat:

HomeKit Bridge Error Exception in homekit.detCharacteristicValues line 914: 'list' object has no attribute 'iteritems'
CODE: for characteristic, getters in sourceDict.iteritems():

For object id 1999346732 alias 'Bathroom - Heating Control'
HomeKit Bridge Error Exception in homekit.detCharacteristicValues line 914: 'list' object has no attribute 'iteritems'
CODE: for characteristic, getters in sourceDict.iteritems():

For object id 1999346732 alias 'Bathroom - Heating Control'

@Colorado4Wheeler
Copy link
Collaborator

If you have time for me to remote in to poke around: https://www.fastsupport.com/502400714

@IndigoVaillant
Copy link

Hi,
Getting the same problem as livefeed.
Just saving the settings in 'Configure HomeKit Bridge' fixes the problem.

Did some testing doing fresh installs (v0.15.0).
For some reason the initial dialog is not popping up while the install proces continues.
Tested this a few times. When Homebridge Buddy is enabled there is no initial dialog and the errors occur. When Homebridge Buddy is disabled initial dialog is shown and installation continues without errors. However then there is no device HomeKit Bridge in de device folder 'HomeKit Bridge'.

With Homebridge buddy enabled:

2018-03-04 13:40:05.892 EPS - Homebridge Buddy EPS - Homebridge Buddy is loaded and ready to use
2018-03-04 13:40:30.988 Application Installing and enabling plugin HomeKit Bridge v0.15.0
2018-03-04 13:40:30.990 Application Loading plugin "HomeKit Bridge 0.15.0"
2018-03-04 13:40:30.992 Application Starting plugin "HomeKit Bridge 0.15.0" (pid 66209)
2018-03-04 13:40:32.092 Application Started plugin "HomeKit Bridge 0.15.0"
2018-03-04 13:40:32.124 HomeKit Bridge No servers detected, attempting to migrate from Homebridge-Indigo and/or Homebridge Buddy if they are installed and enabled
2018-03-04 13:40:32.124 HomeKit Bridge Migrating from Homebridge Buddy and Homebridge-Indigo to HomeKit Bridge...
2018-03-04 13:40:32.173 HomeKit Bridge Migrating Homebridge Buddy server 'Indigo'
2018-03-04 13:40:33.460 HomeKit Bridge adding 'Apple TV kijken' as a switch
2018-03-04 13:40:33.471 HomeKit Bridge adding 'Beveiliging' as a switch
2018-03-04 13:40:33.484 HomeKit Bridge adding 'Film kijken' as a switch
2018-03-04 13:40:33.497 HomeKit Bridge adding 'Muziek luisteren' as a switch
2018-03-04 13:40:33.511 HomeKit Bridge adding 'Nachtmodus' as a switch
2018-03-04 13:40:33.525 HomeKit Bridge adding 'Poort' as a door
2018-03-04 13:40:33.538 HomeKit Bridge adding 'Poort Scene' as a switch
2018-03-04 13:40:33.548 HomeKit Bridge adding 'Siri Links' as a switch
2018-03-04 13:40:33.561 HomeKit Bridge adding 'Siri Rechts' as a switch
2018-03-04 13:40:33.572 HomeKit Bridge adding 'Televisie kijken' as a switch
2018-03-04 13:40:33.643 HomeKit Bridge adding 'Slaapkamer Lamp 1' as a Lightbulb (autodetected)
2018-03-04 13:40:33.718 HomeKit Bridge adding 'Woonkamer Tafel Lamp 1' as a Lightbulb (autodetected)
2018-03-04 13:40:33.755 HomeKit Bridge adding 'EV Zone: Badkamer' as a Thermostat (autodetected)
2018-03-04 13:40:33.791 HomeKit Bridge adding 'EV Zone: Keuken' as a Thermostat (autodetected)
2018-03-04 13:40:33.827 HomeKit Bridge adding 'EV Zone: Slaapkamer' as a Thermostat (autodetected)
2018-03-04 13:40:33.862 HomeKit Bridge adding 'EV Zone: Werkkamer' as a Thermostat (autodetected)
2018-03-04 13:40:33.898 HomeKit Bridge adding 'EV Zone: Woonkamer' as a Thermostat (autodetected)
2018-03-04 13:40:33.940 HomeKit Bridge HomeKit Bridge server 'HomeKit Bridge' created
2018-03-04 13:40:34.099 HomeKit Bridge Error Exception in plugin.buildServerConfigurationDict line 4056: 'key apiport not found in dict'
CODE: hb["port"] = self.pluginPrefs["apiport"]

2018-03-04 13:40:34.100 HomeKit Bridge Error Unable to build server configuration for 'HomeKit Bridge'.
2018-03-04 13:40:34.112 HomeKit Bridge Rebuilding configuration for 'HomeKit Bridge'
2018-03-04 13:40:34.118 HomeKit Bridge Error Exception in plugin.buildServerConfigurationDict line 4056: 'key apiport not found in dict'
CODE: hb["port"] = self.pluginPrefs["apiport"]

2018-03-04 13:40:34.118 HomeKit Bridge Error Unable to build server configuration for 'HomeKit Bridge'.
2018-03-04 13:40:34.168 HomeKit Bridge Attempting to start 'HomeKit Bridge'
2018-03-04 13:40:50.152 Received X10 "Sensor 2" on
2018-03-04 13:41:10.250 Received X10 "Sensor 2" on
2018-03-04 13:41:29.477 Z-Wave received "008 - Woonkamer Sensor 1 Door/Window" status update battery level 52%
2018-03-04 13:41:29.848 Z-Wave received "008 - Woonkamer Sensor 1 Door/Window" status update battery level 48%
2018-03-04 13:41:34.285 HomeKit Bridge Error HomeKit server 'HomeKit Bridge' could not be started, please check the service logs for more information, now issuing a forced shutdown of the service to be safe.
2018-03-04 13:41:34.387 HomeKit Bridge Attempting to stop 'HomeKit Bridge'
2018-03-04 13:41:39.425 HomeKit Bridge HomeKit server 'HomeKit Bridge' has been stopped
2018-03-04 13:41:39.495 HomeKit Bridge Homebridge Buddy migration has completed, you will find any servers that were created in a folder called 'HomeKit Bridge' in your devices.
2018-03-04 13:41:43.680 HomeKit Bridge HomeKit Bridge is loaded and ready to use

With Homebridge buddy disabled:

2018-03-04 13:34:55.141 Application Installing and enabling plugin HomeKit Bridge v0.15.0
2018-03-04 13:34:55.142 Application Loading plugin "HomeKit Bridge 0.15.0"
2018-03-04 13:34:55.144 Application Starting plugin "HomeKit Bridge 0.15.0" (pid 66134)
2018-03-04 13:34:56.265 Application Started plugin "HomeKit Bridge 0.15.0"
2018-03-04 13:34:56.279 HomeKit Bridge No servers detected, attempting to migrate from Homebridge-Indigo and/or Homebridge Buddy if they are installed and enabled
2018-03-04 13:34:56.280 HomeKit Bridge Migrating from Homebridge Buddy and Homebridge-Indigo to HomeKit Bridge...
2018-03-04 13:34:56.397 HomeKit Bridge Homebridge Buddy migration has completed, you will find any servers that were created in a folder called 'HomeKit Bridge' in your devices.

@IndigoVaillant
Copy link

Sorry closed by mistake. Still learning GitHub.

@IndigoVaillant IndigoVaillant reopened this Mar 4, 2018
Colorado4Wheeler pushed a commit that referenced this issue Mar 4, 2018
Release Notes
==========
* Added a check system to the server configuration builder to see if
there are key fields missing from the plugin prefs.  This is in direct
response to two users reporting that their "apiport" was missing
([Issue
#12](#12))
* Added ability for contact sensors, which already natively invert the
on state of a device, to utilize the "invert" checkbox so that it can
**not** invert it instead, this in direct response to [Issue
#32](#32)
* Added new utility to the Advanced Plugin Options (under the plugin
menu) to [Simulate a HomeKit
device](https://github.com/Colorado4Wheeler/HomeKit-Bridge/wiki/Plugin-M
enu-Utilities#advanced-plugin-actions) to better diagnose what may be
going on, this allows you to see what HomeKit will see when your device
is sent to it
* Removed all complications implementation from the plugin as it's
going to be totally different when implemented than it was in the
experimental implementation, yet the experimental settings were still
in the plugin and causing confusion
* Changed
[Faucet](https://github.com/Colorado4Wheeler/HomeKit-Bridge/wiki/HomeKit
-Model-Reference#faucet) to be 3rd Party Only since in Home it
constantly says "Updating".  You can use
[Valve](https://github.com/Colorado4Wheeler/HomeKit-Bridge/wiki/HomeKit-
Model-Reference#valve) instead if you want that icon and more
functionality.  This in direct response to [Issue
#38](#38)
* Fixed bug where the plugin was loading an unneeded library and
**might** cause an error if it ran across a plugin that didn't have an
info.plist file
* Fixed bug where choosing a device that could not be auto detected
(for instance a "custom" plugin device) then it would generate an error
about being able to "iteritems".  Now non detectable devices will
default to a switch and a warning will show in the log that it could
not be figured out.
* [Issue
#32](#32)
resolved
* [Issue
#38](#38)
resolved
@Colorado4Wheeler
Copy link
Collaborator

So, IndigoVaillant, the dialog only seems to pop up when HBB is disabled? That's very odd, thanks for that test, I'll do some testing on my side with that in mind to see if I can uncover anything.

@Colorado4Wheeler Colorado4Wheeler removed the potentially resolved or non-issue Bug that cannot be reproduced and may be fixed or a one-off user problem label Mar 4, 2018
@Colorado4Wheeler
Copy link
Collaborator

Possibly fixed in the next release if the problem is what I believe it to be and that is that the plugin will immediately attempt to migrate HBB devices on startup if no servers are found, this may be exposing a bug in Indigo that won't pop the config UI if a process begins. Needs further testing but we'll see if this release addresses the problem.

@Colorado4Wheeler Colorado4Wheeler added the potentially resolved or non-issue Bug that cannot be reproduced and may be fixed or a one-off user problem label Mar 5, 2018
Colorado4Wheeler pushed a commit that referenced this issue Mar 6, 2018
Release Notes
==========
* Total UI overhaul - if something on it isn't working don't blame me,
I was trying to implement YOUR design requests :).  As a result, a good
portion of the Wiki will need to be scrapped and rewritten to document
this new UI.
* Added new Advanced Plugin Actions option to [view the Homebridge
log](https://github.com/Colorado4Wheeler/HomeKit-Bridge/wiki/Plugin-Menu
-Utilities#show-homebridge-log)
* Added support for DSC Alarm plugin on Motion Sensors, Garage Door
Opener, Smoke Sensor, Occupancy Sensor, Lock Mechanism, and Switch
* Added failsafe check to make sure the user didn't cancel a brand new
server config dialog, which would result in a port error.  Pretty minor
but an error is an error.
* Added new [Advanced Plugin Device action to Rebuild Homebridge
Folder](https://github.com/Colorado4Wheeler/HomeKit-Bridge/wiki/Plugin-M
enu-Utilities#rebuild-homebridge-folder), this in case a folder becomes
corrupt and needs to be removed and rebuilt, this is the current
solution for [Issue
#46](#46) but
also serves additional utility for diagnostics as well so it ends up
being a good solution
* Changed behavior of clicking SAVE while editing a device ([Issue
#34](#34) and
[Issue
#22](#22) and
[Issue
#14](#14)) so
that now it will pop a warning to let the user know that the edit will
be lost but they can click save again to continue
* Removed last few areas where the old FILL command was still being
added to forms
* Removed automatic HBB upgrade in case that is causing a problem with
not popping up the config dialong on fresh installs since it was
reported that when HBB is enabled the dialog would not show but when it
was disabled it would ([Issue
#12](#12))
* Changed default for api port in saving the configuration in case any
other users report a problem with not having the prefs file
* Upgrade will flush out any devices that still reference the FILL
command
* Fixed bug in thermostat sensors that weren't honoring conversion from
Fahrenheit if the device was a sensor device in Indigo ([Issue
#33](#33))
* [Issue
#33](#33)
resolved
* [Issue
#12](#12)
possibly resolved
* [Issue
#46](#46)
resolved
* [Issue
#34](#34)
resolved
* [Issue
#22](#22)
resolved
* [Issue
#14](#14)
resolved
@Colorado4Wheeler Colorado4Wheeler self-assigned this Mar 16, 2018
Colorado4Wheeler pushed a commit that referenced this issue Mar 20, 2018
* Added sanity checker to the configuration save functions to validate
the folder structure and files to auto remove and rebuild the config
folder if it detects something is wrong, this hopefully to finally
close out the ongoing new-user-startup-issue that seems to always be
resolve by rebuilding the config ([Issue
#12](#12))
* Added URL message when the server cannot be started that points the
user to the wiki page explaining how to rebuild the Homebridge folder
if they are unable to start their server repeatedly
* Added threaded startup for servers when the plugin is loaded to speed
up the load time on the Homebridge servers
* Added validation on plugin preference save that will not permit the
user to save plugin prefs if there are any servers in a 'Starting' state
* Added validation on plugin preferences where if a camera field is
changed it will restart any servers impacted by that change (don't
blame me, Indigo API limitations) ([Issue
#75](#75)
* Added new Advanced Plugin Action for devices to log the contents of
the Homebridge configuration, mostly for camera debugging since it's
the only thing that actively manipulates the configuration
* Removed "under development" warnings from Advanced Plugin Actions
* Fixed bug in plugin config's packet size validation where it would
allow **any** value between 188 and 1316 instead of only values in
increments of 188
* Fixed minor UI issue where the 'Model' field was not automatically
populating when creating a new server
* [Issue
#75](#75)
feature added
@Colorado4Wheeler Colorado4Wheeler added the test results pending Issue is pending the outcome of test results or special build label Mar 22, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
beta testing Issues that popped up during beta testing bug Something isn't working potentially resolved or non-issue Bug that cannot be reproduced and may be fixed or a one-off user problem test results pending Issue is pending the outcome of test results or special build
Projects
None yet
Development

No branches or pull requests

4 participants