vapor-ware / synse-sdk

SDK for Synse Plugins in Go
https://synse.readthedocs.io/en/latest/sdk/intro/
GNU General Public License v3.0
3 stars 4 forks source link

When we can't find a device prototype, we quit registering devices. #178

Closed MatthewHink closed 6 years ago

MatthewHink commented 6 years ago

This is not that big of a deal since the configuration is invalid since there is no prototype for a configured device.

The break below quits registering devices. Perhaps it should be changed to continue? https://github.com/vapor-ware/synse-sdk/blob/1c4085d8338563f9856964fefff7acdf77b56039/sdk/utils.go#L54

See the trace: Did not find prototype matching instance for lock-RCI3525

log snippet:

time="2018-05-15T14:05:49Z" level=info msg="Line 0000: # One entry for each I2C device on the synse instance on a VEC on a chamber wedge."
time="2018-05-15T14:05:49Z" level=info msg="Line 0001: version: 1.0"
time="2018-05-15T14:05:49Z" level=info msg="Line 0002: locations:"
time="2018-05-15T14:05:49Z" level=info msg="Line 0003:   rack-vec:"
time="2018-05-15T14:05:49Z" level=info msg="Line 0004:     rack:"
time="2018-05-15T14:05:49Z" level=info msg="Line 0005:       from_env: NODE_NAME"
time="2018-05-15T14:05:49Z" level=info msg="Line 0006:     board: vec"
time="2018-05-15T14:05:49Z" level=info msg="Line 0007: devices:"
time="2018-05-15T14:05:49Z" level=info msg="Line 0008:   - type: led"
time="2018-05-15T14:05:49Z" level=info msg="Line 0009:     model: PCA9632"
time="2018-05-15T14:05:49Z" level=info msg="Line 0010:     instances:"
time="2018-05-15T14:05:49Z" level=info msg="Line 0011:       # LED controller on each wedge."
time="2018-05-15T14:05:49Z" level=info msg="Line 0012:       - channel: \"0014\""
time="2018-05-15T14:05:49Z" level=info msg="Line 0013:         location: rack-vec"
time="2018-05-15T14:05:49Z" level=info msg="Line 0014:         info: Chamber LED"
time="2018-05-15T14:05:49Z" level=info msg="Line 0015:   - type: lock"
time="2018-05-15T14:05:49Z" level=info msg="Line 0016:     model: RCI3525"
time="2018-05-15T14:05:49Z" level=info msg="Line 0017:     instances:"
time="2018-05-15T14:05:49Z" level=info msg="Line 0018:       - channel: \"0003\""
time="2018-05-15T14:05:49Z" level=info msg="Line 0019:         location: rack-vec"
time="2018-05-15T14:05:49Z" level=info msg="Line 0020:         info: Door Lock"
time="2018-05-15T14:05:49Z" level=info msg="Line 0021:   - type: temperature"
time="2018-05-15T14:05:49Z" level=info msg="Line 0022:     model: MAX11610"
time="2018-05-15T14:05:49Z" level=info msg="Line 0023:     instances:"
time="2018-05-15T14:05:49Z" level=info msg="Line 0024:       # Thermistors on each wedge."
time="2018-05-15T14:05:49Z" level=info msg="Line 0025:       - channel: \"0000\""
time="2018-05-15T14:05:49Z" level=info msg="Line 0026:         location: rack-vec"
time="2018-05-15T14:05:49Z" level=info msg="Line 0027:         info: Rack Temperature 0 Top Left"
time="2018-05-15T14:05:49Z" level=info msg="Line 0028:       - channel: \"0001\""
time="2018-05-15T14:05:49Z" level=info msg="Line 0029:         location: rack-vec"
time="2018-05-15T14:05:49Z" level=info msg="Line 0030:         info: Rack Temperature 1 Middle Left"
time="2018-05-15T14:05:49Z" level=info msg="Line 0031:       - channel: \"0002\""
time="2018-05-15T14:05:49Z" level=info msg="Line 0032:         location: rack-vec"
time="2018-05-15T14:05:49Z" level=info msg="Line 0033:         info: Rack Temperature 2 Bottom Left"
time="2018-05-15T14:05:49Z" level=info msg="Line 0034:       - channel: \"0003\""
time="2018-05-15T14:05:49Z" level=info msg="Line 0035:         location: rack-vec"
time="2018-05-15T14:05:49Z" level=info msg="Line 0036:         info: Rack Temperature 3 Spare"
time="2018-05-15T14:05:49Z" level=info msg="Line 0037:       - channel: \"0004\""
time="2018-05-15T14:05:49Z" level=info msg="Line 0038:         location: rack-vec"
time="2018-05-15T14:05:49Z" level=info msg="Line 0039:         info: Rack Temperature 4 Top Rear"
time="2018-05-15T14:05:49Z" level=info msg="Line 0040:       - channel: \"0005\""
time="2018-05-15T14:05:49Z" level=info msg="Line 0041:         location: rack-vec"
time="2018-05-15T14:05:49Z" level=info msg="Line 0042:         info: Rack Temperature 5 Middle Rear"
time="2018-05-15T14:05:49Z" level=info msg="Line 0043:       - channel: \"0006\""
time="2018-05-15T14:05:49Z" level=info msg="Line 0044:         location: rack-vec"
time="2018-05-15T14:05:49Z" level=info msg="Line 0045:         info: Rack Temperature 6 Bottom Rear"
time="2018-05-15T14:05:49Z" level=info msg="Line 0046:       - channel: \"0007\""
time="2018-05-15T14:05:49Z" level=info msg="Line 0047:         location: rack-vec"
time="2018-05-15T14:05:49Z" level=info msg="Line 0048:         info: Rack Temperature 7 Spare"
time="2018-05-15T14:05:49Z" level=info msg="Line 0049:       - channel: \"0008\""
time="2018-05-15T14:05:49Z" level=info msg="Line 0050:         location: rack-vec"
time="2018-05-15T14:05:49Z" level=info msg="Line 0051:         info: Rack Temperature 8 Top Right"
time="2018-05-15T14:05:49Z" level=info msg="Line 0052:       - channel: \"0009\""
time="2018-05-15T14:05:49Z" level=info msg="Line 0053:         location: rack-vec"
time="2018-05-15T14:05:49Z" level=info msg="Line 0054:         info: Rack Temperature 9 Middle Right"
time="2018-05-15T14:05:49Z" level=info msg="Line 0055:       - channel: \"000a\""
time="2018-05-15T14:05:49Z" level=info msg="Line 0056:         location: rack-vec"
time="2018-05-15T14:05:49Z" level=info msg="Line 0057:         info: Rack Temperature 10 Bottom Right"
time="2018-05-15T14:05:49Z" level=info msg="Line 0058:       - channel: \"000b\""
time="2018-05-15T14:05:49Z" level=info msg="Line 0059:         location: rack-vec"
time="2018-05-15T14:05:49Z" level=info msg="Line 0060:         info: Rack Temperature 11 Spare"
time="2018-05-15T14:05:49Z" level=info msg="Line 0061:   - type: pressure"
time="2018-05-15T14:05:49Z" level=info msg="Line 0062:     model: SDP610"
time="2018-05-15T14:05:49Z" level=info msg="Line 0063:     instances:"
time="2018-05-15T14:05:49Z" level=info msg="Line 0064:       # Differential pressure sensors on each wedge."
time="2018-05-15T14:05:49Z" level=info msg="Line 0065:       - channel: \"0001\""
time="2018-05-15T14:05:49Z" level=info msg="Line 0066:         location: rack-vec"
time="2018-05-15T14:05:49Z" level=info msg="Line 0067:         info: Rack Differential Pressure Bottom"
time="2018-05-15T14:05:49Z" level=info msg="Line 0068:       - channel: \"0002\""
time="2018-05-15T14:05:49Z" level=info msg="Line 0069:         location: rack-vec"
time="2018-05-15T14:05:49Z" level=info msg="Line 0070:         info: Rack Differential Pressure Middle"
time="2018-05-15T14:05:49Z" level=info msg="Line 0071:       - channel: \"0004\""
time="2018-05-15T14:05:49Z" level=info msg="Line 0072:         location: rack-vec"
time="2018-05-15T14:05:49Z" level=info msg="Line 0073:         info: Rack Differential Pressure Top"
time="2018-05-15T14:05:49Z" level=info msg="Line 0074: "
time="2018-05-15T14:05:49Z" level=debug msg="Location.Rack is a map[interface{}]interface{}"
time="2018-05-15T14:05:49Z" level=debug msg="processDeviceConfig adding cfg: {Version:1.0 Type:led Model:PCA9632 Location:{Rack:map[from_env:NODE_NAME] Board:vec rack:vec8} Data:map[info:Chamber LED channel:0014 location:rack-vec]}"
time="2018-05-15T14:05:49Z" level=debug msg="Location.Rack is a map[interface{}]interface{}"
time="2018-05-15T14:05:49Z" level=debug msg="processDeviceConfig adding cfg: {Version:1.0 Type:lock Model:RCI3525 Location:{Rack:map[from_env:NODE_NAME] Board:vec rack:vec8} Data:map[info:Door Lock channel:0003 location:rack-vec]}"
time="2018-05-15T14:05:49Z" level=debug msg="Location.Rack is a map[interface{}]interface{}"
time="2018-05-15T14:05:49Z" level=debug msg="processDeviceConfig adding cfg: {Version:1.0 Type:temperature Model:MAX11610 Location:{Rack:map[from_env:NODE_NAME] Board:vec rack:vec8} Data:map[channel:0000 location:rack-vec info:Rack Temperature 0 Top Left]}"
time="2018-05-15T14:05:49Z" level=debug msg="Location.Rack is a map[interface{}]interface{}"
time="2018-05-15T14:05:49Z" level=debug msg="processDeviceConfig adding cfg: {Version:1.0 Type:temperature Model:MAX11610 Location:{Rack:map[from_env:NODE_NAME] Board:vec rack:vec8} Data:map[channel:0001 location:rack-vec info:Rack Temperature 1 Middle Left]}"
time="2018-05-15T14:05:49Z" level=debug msg="Location.Rack is a map[interface{}]interface{}"
time="2018-05-15T14:05:49Z" level=debug msg="processDeviceConfig adding cfg: {Version:1.0 Type:temperature Model:MAX11610 Location:{Rack:map[from_env:NODE_NAME] Board:vec rack:vec8} Data:map[channel:0002 location:rack-vec info:Rack Temperature 2 Bottom Left]}"
time="2018-05-15T14:05:49Z" level=debug msg="Location.Rack is a map[interface{}]interface{}"
time="2018-05-15T14:05:49Z" level=debug msg="processDeviceConfig adding cfg: {Version:1.0 Type:temperature Model:MAX11610 Location:{Rack:map[from_env:NODE_NAME] Board:vec rack:vec8} Data:map[channel:0003 location:rack-vec info:Rack Temperature 3 Spare]}"
time="2018-05-15T14:05:49Z" level=debug msg="Location.Rack is a map[interface{}]interface{}"
time="2018-05-15T14:05:49Z" level=debug msg="processDeviceConfig adding cfg: {Version:1.0 Type:temperature Model:MAX11610 Location:{Rack:map[from_env:NODE_NAME] Board:vec rack:vec8} Data:map[channel:0004 location:rack-vec info:Rack Temperature 4 Top Rear]}"
time="2018-05-15T14:05:49Z" level=debug msg="Location.Rack is a map[interface{}]interface{}"
time="2018-05-15T14:05:49Z" level=debug msg="processDeviceConfig adding cfg: {Version:1.0 Type:temperature Model:MAX11610 Location:{Rack:map[from_env:NODE_NAME] Board:vec rack:vec8} Data:map[channel:0005 location:rack-vec info:Rack Temperature 5 Middle Rear]}"
time="2018-05-15T14:05:49Z" level=debug msg="Location.Rack is a map[interface{}]interface{}"
time="2018-05-15T14:05:49Z" level=debug msg="processDeviceConfig adding cfg: {Version:1.0 Type:temperature Model:MAX11610 Location:{Rack:map[from_env:NODE_NAME] Board:vec rack:vec8} Data:map[channel:0006 location:rack-vec info:Rack Temperature 6 Bottom Rear]}"
time="2018-05-15T14:05:49Z" level=debug msg="Location.Rack is a map[interface{}]interface{}"
time="2018-05-15T14:05:49Z" level=debug msg="processDeviceConfig adding cfg: {Version:1.0 Type:temperature Model:MAX11610 Location:{Rack:map[from_env:NODE_NAME] Board:vec rack:vec8} Data:map[channel:0007 location:rack-vec info:Rack Temperature 7 Spare]}"
time="2018-05-15T14:05:49Z" level=debug msg="Location.Rack is a map[interface{}]interface{}"
time="2018-05-15T14:05:49Z" level=debug msg="processDeviceConfig adding cfg: {Version:1.0 Type:temperature Model:MAX11610 Location:{Rack:map[from_env:NODE_NAME] Board:vec rack:vec8} Data:map[channel:0008 location:rack-vec info:Rack Temperature 8 Top Right]}"
time="2018-05-15T14:05:49Z" level=debug msg="Location.Rack is a map[interface{}]interface{}"
time="2018-05-15T14:05:49Z" level=debug msg="processDeviceConfig adding cfg: {Version:1.0 Type:temperature Model:MAX11610 Location:{Rack:map[from_env:NODE_NAME] Board:vec rack:vec8} Data:map[channel:0009 location:rack-vec info:Rack Temperature 9 Middle Right]}"
time="2018-05-15T14:05:49Z" level=debug msg="Location.Rack is a map[interface{}]interface{}"
time="2018-05-15T14:05:49Z" level=debug msg="processDeviceConfig adding cfg: {Version:1.0 Type:temperature Model:MAX11610 Location:{Rack:map[from_env:NODE_NAME] Board:vec rack:vec8} Data:map[channel:000a location:rack-vec info:Rack Temperature 10 Bottom Right]}"
time="2018-05-15T14:05:49Z" level=debug msg="Location.Rack is a map[interface{}]interface{}"
time="2018-05-15T14:05:49Z" level=debug msg="processDeviceConfig adding cfg: {Version:1.0 Type:temperature Model:MAX11610 Location:{Rack:map[from_env:NODE_NAME] Board:vec rack:vec8} Data:map[channel:000b location:rack-vec info:Rack Temperature 11 Spare]}"
time="2018-05-15T14:05:49Z" level=debug msg="Location.Rack is a map[interface{}]interface{}"
time="2018-05-15T14:05:49Z" level=debug msg="processDeviceConfig adding cfg: {Version:1.0 Type:pressure Model:SDP610 Location:{Rack:map[from_env:NODE_NAME] Board:vec rack:vec8} Data:map[channel:0001 location:rack-vec info:Rack Differential Pressure Bottom]}"
time="2018-05-15T14:05:49Z" level=debug msg="Location.Rack is a map[interface{}]interface{}"
time="2018-05-15T14:05:49Z" level=debug msg="processDeviceConfig adding cfg: {Version:1.0 Type:pressure Model:SDP610 Location:{Rack:map[from_env:NODE_NAME] Board:vec rack:vec8} Data:map[channel:0002 location:rack-vec info:Rack Differential Pressure Middle]}"
time="2018-05-15T14:05:49Z" level=debug msg="Location.Rack is a map[interface{}]interface{}"
time="2018-05-15T14:05:49Z" level=debug msg="processDeviceConfig adding cfg: {Version:1.0 Type:pressure Model:SDP610 Location:{Rack:map[from_env:NODE_NAME] Board:vec rack:vec8} Data:map[info:Rack Differential Pressure Top channel:0004 location:rack-vec]}"
time="2018-05-15T14:05:49Z" level=debug msg="processDeviceConfig (scheme version 1) returning: [0xc4201c5a40 0xc4201c5b20 0xc4201c5c00 0xc4201c5ce0 0xc4201c5dc0 0xc4201c5ea0 0xc4201c5f80 0xc4201da070 0xc4201da150 0xc4201da230 0xc4201da310 0xc4201da3f0 0xc4201da4d0 0xc4201da5b0 0xc4201da690 0xc4201da770 0xc4201da850]"
time="2018-05-15T14:05:49Z" level=debug msg="Successfully processed device configuration in /plugin/config/device/devices.yml"
time="2018-05-15T14:05:49Z" level=debug msg="Finished parsing device configurations: [0xc4201c5a40 0xc4201c5b20 0xc4201c5c00 0xc4201c5ce0 0xc4201c5dc0 0xc4201c5ea0 0xc4201c5f80 0xc4201da070 0xc4201da150 0xc4201da230 0xc4201da310 0xc4201da3f0 0xc4201da4d0 0xc4201da5b0 0xc4201da690 0xc4201da770 0xc4201da850]"
time="2018-05-15T14:05:49Z" level=debug msg="device configs from auto-enumeration: []"
time="2018-05-15T14:05:49Z" level=debug msg="registering devices with the plugin"
time="2018-05-15T14:05:49Z" level=debug msg="ParsePrototypeConfig start"
time="2018-05-15T14:05:49Z" level=debug msg="Searching /plugin/config/proto for prototype configurations."
time="2018-05-15T14:05:49Z" level=debug msg="Found prototype configuration files: [max11608_thermistor.yaml max11610_thermistor.yaml pca9632_led.yaml sdp610_pressure.yaml]"
time="2018-05-15T14:05:49Z" level=debug msg="Reading file: /plugin/config/proto/max11608_thermistor.yaml"
time="2018-05-15T14:05:49Z" level=debug msg="Got prototype configuration file version: 1.0"
time="2018-05-15T14:05:49Z" level=debug msg="Got prototype configuration handler: &{}"
time="2018-05-15T14:05:49Z" level=debug msg="Successfully processed prototype configuration in /plugin/config/proto/max11608_thermistor.yaml"
time="2018-05-15T14:05:49Z" level=debug msg="Reading file: /plugin/config/proto/max11610_thermistor.yaml"
time="2018-05-15T14:05:49Z" level=debug msg="Got prototype configuration file version: 1.0"
time="2018-05-15T14:05:49Z" level=debug msg="Got prototype configuration handler: &{}"
time="2018-05-15T14:05:49Z" level=debug msg="Successfully processed prototype configuration in /plugin/config/proto/max11610_thermistor.yaml"
time="2018-05-15T14:05:49Z" level=debug msg="Reading file: /plugin/config/proto/pca9632_led.yaml"
time="2018-05-15T14:05:49Z" level=debug msg="Got prototype configuration file version: 1.0"
time="2018-05-15T14:05:49Z" level=debug msg="Got prototype configuration handler: &{}"
time="2018-05-15T14:05:49Z" level=debug msg="Successfully processed prototype configuration in /plugin/config/proto/pca9632_led.yaml"
time="2018-05-15T14:05:49Z" level=debug msg="Reading file: /plugin/config/proto/sdp610_pressure.yaml"
time="2018-05-15T14:05:49Z" level=debug msg="Got prototype configuration file version: 1.0"
time="2018-05-15T14:05:49Z" level=debug msg="Got prototype configuration handler: &{}"
time="2018-05-15T14:05:49Z" level=debug msg="Successfully processed prototype configuration in /plugin/config/proto/sdp610_pressure.yaml"
time="2018-05-15T14:05:49Z" level=debug msg="Finised parsing prototype configurations: [0xc4201e69a0 0xc4201eea80 0xc4201f2070 0xc4201f8150]"
time="2018-05-15T14:05:49Z" level=debug msg="makeDevices start"
time="2018-05-15T14:05:49Z" level=debug msg="Found prototype matching instance config for led PCA9632"
time="2018-05-15T14:05:49Z" level=warning msg="Did not find prototype matching instance for lock-RCI3525"
time="2018-05-15T14:05:49Z" level=debug msg="finished making devices: [0xc4200d6300]"
time="2018-05-15T14:05:49Z" level=debug msg="finished registering devices"
time="2018-05-15T14:05:49Z" level=info msg="Plugin Info:"
time="2018-05-15T14:05:49Z" level=info msg=" Name:        i2c"
time="2018-05-15T14:05:49Z" level=info msg=" Version:     1.0"
time="2018-05-15T14:05:49Z" level=info msg=" SDK Version: 0.5.0"
time="2018-05-15T14:05:49Z" level=info msg=" Git Commit:  -"
time="2018-05-15T14:05:49Z" level=info msg=" Git Tag:     -"
time="2018-05-15T14:05:49Z" level=info msg=" Go Version:  go1.9.4"
time="2018-05-15T14:05:49Z" level=info msg=" Build Date:  2018-05-14T17:36:35"
time="2018-05-15T14:05:49Z" level=info msg=" OS:          linux"
time="2018-05-15T14:05:49Z" level=info msg=" Arch:        amd64"
time="2018-05-15T14:05:49Z" level=info msg="Plugin Config:"
time="2018-05-15T14:05:49Z" level=info msg="Line 0000: {"
time="2018-05-15T14:05:49Z" level=info msg="Line 0001:   \"Name\": \"i2c\","
time="2018-05-15T14:05:49Z" level=info msg="Line 0002:   \"Version\": \"1\","
time="2018-05-15T14:05:49Z" level=info msg="Line 0003:   \"Debug\": true,"
time="2018-05-15T14:05:49Z" level=info msg="Line 0004:   \"Settings\": {"
time="2018-05-15T14:05:49Z" level=info msg="Line 0005:     \"Mode\": \"serial\","
time="2018-05-15T14:05:49Z" level=info msg="Line 0006:     \"Read\": {"
time="2018-05-15T14:05:49Z" level=info msg="Line 0007:       \"Enabled\": true,"
time="2018-05-15T14:05:49Z" level=info msg="Line 0008:       \"Interval\": \"1s\","
time="2018-05-15T14:05:49Z" level=info msg="Line 0009:       \"Buffer\": 100"
time="2018-05-15T14:05:49Z" level=info msg="Line 0010:     },"
time="2018-05-15T14:05:49Z" level=info msg="Line 0011:     \"Write\": {"
time="2018-05-15T14:05:49Z" level=info msg="Line 0012:       \"Enabled\": true,"
time="2018-05-15T14:05:49Z" level=info msg="Line 0013:       \"Interval\": \"1s\","
time="2018-05-15T14:05:49Z" level=info msg="Line 0014:       \"Buffer\": 100,"
time="2018-05-15T14:05:49Z" level=info msg="Line 0015:       \"Max\": 100"
time="2018-05-15T14:05:49Z" level=info msg="Line 0016:     },"
time="2018-05-15T14:05:49Z" level=info msg="Line 0017:     \"Transaction\": {"
time="2018-05-15T14:05:49Z" level=info msg="Line 0018:       \"TTL\": \"5m\""
time="2018-05-15T14:05:49Z" level=info msg="Line 0019:     }"
time="2018-05-15T14:05:49Z" level=info msg="Line 0020:   },"
time="2018-05-15T14:05:49Z" level=info msg="Line 0021:   \"Network\": {"
time="2018-05-15T14:05:49Z" level=info msg="Line 0022:     \"Type\": \"tcp\","
time="2018-05-15T14:05:49Z" level=info msg="Line 0023:     \"Address\": \":5002\""
time="2018-05-15T14:05:49Z" level=info msg="Line 0024:   },"
time="2018-05-15T14:05:49Z" level=info msg="Line 0025:   \"AutoEnumerate\": [],"
time="2018-05-15T14:05:49Z" level=info msg="Line 0026:   \"Context\": {},"
time="2018-05-15T14:05:49Z" level=info msg="Line 0027:   \"Limiter\": null"
time="2018-05-15T14:05:49Z" level=info msg="Line 0028: }"
time="2018-05-15T14:05:49Z" level=info msg="Registered Devices:"
time="2018-05-15T14:05:49Z" level=info msg=" vec8-vec-4f1cd148cf0aa2dcb2dbd6f00403119c (PCA9632)"
time="2018-05-15T14:05:49Z" level=info msg=--------------------------------
MatthewHink commented 6 years ago

Issue is that the LED gets registered, then registration trips and bails on the lock, and the thermistors and differential pressure sensors don't get registered even though their configuration is valid.

edaniszewski commented 6 years ago

👍 good catch here, the change for this makes sense.