MickMake / HomeAssistantAddons

MIT License
43 stars 26 forks source link

panic: runtime error: invalid memory address #9

Closed Ralphy140 closed 1 year ago

Ralphy140 commented 1 year ago

Hi Mick,

Been watching the progress with great interest over the last few days, seems like everything is coming together, I fired it up this morning after getting the notification that V3.0.1 was out for home assistant add-on.

I am running HA version 2022.12.6 and I can see the gosungrow sensor in the MQTT integration

Any help would be great

[23:42:47] INFO: Login to iSolarCloud using gateway https://augateway.isolarcloud.com ... Email:
Create Date: Mon Sep 26 08:13:45 CST 2022 Login Last Date: 2022-12-16 07:42:48 Login Last IP:
Login State: 1 User Account: #### User Id: ##### User Name: ##### Is Online: false Token: ###### Token File: /data/.GoSungrow/AppServicelogin.json [23:42:48] INFO: Syncing data from gateway https://augateway.isolarcloud.com ... 2022/12/15 23:42:48 Connecting to MQTT HASSIO Service... 2022/12/15 23:42:48 Connecting to SunGrow... 2022/12/15 23:42:48 Found SunGrow 2 devices 2022/12/15 23:42:48 Caching Sungrow metadata... 2022/12/15 23:42:48 Cached 232 Sungrow data points... panic: runtime error: invalid memory address or nil pointer dereference [signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0x440dd0] goroutine 1 [running]: GoSungrow/iSolarCloud/AppService/queryDeviceList.(*EndPoint).SetPvPoints(, {{, , }}, {0x40008e5410, {0x400043b277, 0x7}, {0xc0df0a1e46127e50, 0x2f76d2e1, 0x40eec60}, ...}) /Users/mick/Documents/GoLang/Solar/GoSungrow/iSolarCloud/AppService/queryDeviceList/data.go:542 +0xce0 GoSungrow/iSolarCloud/AppService/queryDeviceList.(*EndPoint).GetEnergyStorageSystem(, {0x40008e5410, {0x400043b277, 0x7}, {0xc0df0a1e46127e50, 0x2f76d2e1, 0x40eec60}, {{0x4000540200, 0x2, 0x2}}, ...}) /Users/mick/Documents/GoLang/Solar/GoSungrow/iSolarCloud/AppService/queryDeviceList/data.go:299 +0x2e0 GoSungrow/iSolarCloud/AppService/queryDeviceList.(EndPoint).GetData(_) /Users/mick/Documents/GoLang/Solar/GoSungrow/iSolarCloud/AppService/queryDeviceList/data.go:259 +0x94 GoSungrow/iSolarCloud/AppService/queryDeviceList.EndPoint.GetEndPointData(...) /Users/mick/Documents/GoLang/Solar/GoSungrow/iSolarCloud/AppService/queryDeviceList/struct.go:367 GoSungrow/iSolarCloud.(SunGrowData).CallEndpoint(, {, _}, {{0x40005fe6f0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, ...}, ...}) /Users/mick/Documents/GoLang/Solar/GoSungrow/iSolarCloud/data.go:203 +0x330 GoSungrow/iSolarCloud.(SunGrowData).getDataSinglePsIdRequired(0x40008cd520, {0x27333e8, 0x400051d880}) /Users/mick/Documents/GoLang/Solar/GoSungrow/iSolarCloud/data.go:373 +0x254 GoSungrow/iSolarCloud.(SunGrowData).GetDataSingle(0x40008cd520, {0x40005e7fc0, 0xf}) /Users/mick/Documents/GoLang/Solar/GoSungrow/iSolarCloud/data.go:328 +0x124 GoSungrow/iSolarCloud.(SunGrowData).GetData(0x40008cd520) /Users/mick/Documents/GoLang/Solar/GoSungrow/iSolarCloud/data.go:249 +0x134 GoSungrow/cmd.(CmdMqtt).Cron(0x400010aa00) /Users/mick/Documents/GoLang/Solar/GoSungrow/cmd/cmd_mqtt.go:387 +0x198 GoSungrow/cmd.(CmdMqtt).CmdMqttSync(0x400010aa00, 0x0?, {0x411f4a0, 0x0, 0x0}) /Users/mick/Documents/GoLang/Solar/GoSungrow/cmd/cmd_mqtt.go:333 +0x2a8 github.com/spf13/cobra.(Command).execute(0x40001bc000, {0x40000a6020, 0x0, 0x0}) /Users/mick/go/pkg/mod/github.com/spf13/cobra@v1.6.1/command.go:916 +0x5e0 github.com/spf13/cobra.(Command).ExecuteC(0x4000124300) /Users/mick/go/pkg/mod/github.com/spf13/cobra@v1.6.1/command.go:1044 +0x368 github.com/spf13/cobra.(Command).Execute(...) /Users/mick/go/pkg/mod/github.com/spf13/cobra@v1.6.1/command.go:968 github.com/MickMake/GoUnify/Unify.(Commands).Execute(...) /Users/mick/go/pkg/mod/github.com/!mick!make/!go!unify/!unify@v0.0.0-20221125023651-ff4a37b1928a/struct.go:258 github.com/MickMake/GoUnify/Unify.(Unify).Execute(0x4000001560) /Users/mick/go/pkg/mod/github.com/!mick!make/!go!unify/!unify@v0.0.0-20221125023651-ff4a37b1928a/struct.go:201 +0x304 GoSungrow/cmd.Execute(...) /Users/mick/Documents/GoLang/Solar/GoSungrow/cmd/commands.go:86 main.main() /Users/mick/Documents/GoLang/Solar/GoSungrow/main.go:14 +0x6c s6-rc: info: service legacy-services: stopping s6-rc: info: service legacy-services successfully stopped s6-rc: info: service legacy-cont-init: stopping s6-rc: info: service legacy-cont-init successfully stopped s6-rc: info: service fix-attrs: stopping s6-rc: info: service fix-attrs successfully stopped s6-rc: info: service s6rc-oneshot-runner: stopping s6-rc: info: service s6rc-oneshot-runner successfully stopped

MickMake commented 1 year ago

Thanks for the log. That helps greatly. Seems I'm not catching a nil pointer somewhere. I'll check it out.

MickMake commented 1 year ago

I've just released v3.0.2, which should fix your issue.

Ralphy140 commented 1 year ago

Thanks! Just fired it up, seems like a new issue now :)

[05:48:15] INFO: Setting up GoSungrow config ... /usr/local/bin/run.sh: line 52: GOSUNGROW_MQTT_HOST: unbound variable s6-rc: info: service legacy-services: stopping