influxdata / influxdb1-client

The old clientv2 for InfluxDB 1.x
MIT License
191 stars 112 forks source link

Invalid memory address- Raspberry #33

Open pepisp opened 4 years ago

pepisp commented 4 years ago

I wrote some code with Influxdb client and it works fine on x64 but when I run the code on RaspberryPi 4 arm7 it fails to run with error:

panic: runtime error: invalid memory address or nil pointer dereference [signal SIGSEGV: segmentation violation code=0x1 addr=0xc pc=0x1de378]

goroutine 1 [running]: github.com/influxdata/influxdb1-client/v2.(*Response).Error(0x0, 0x1, 0x1) /home/pi/go/pkg/mod/github.com/influxdata/influxdb1-client@v0.0.0-20191209144304-8bf82d3c094d/v2/client.go:477 +0x14

Tested on go version 1.11 and 1.14

I even made some simple code just getting number of points in measurement (code here is sanitized from some lines ):

queryString := fmt.Sprintf("SELECT Count(*) FROM %s", "location_dev")
      q := client.NewQuery(queryString, "testdb", "")
        if response, err := dbClient.Query(q); err == nil && response.Error() == nil {
                if len(response.Results[0].Series) != 0 {
                        totalPoints, _ := response.Results[0].Series[0].Values[0][1].(json.Number).Int64()
                } else 
                        return
                }
        } else {
                fmt.Println(err)
                fmt.Println(response.Error())

        }
}

And it still fails to run. What is strange is that there should be some points in db but it seems that the code go to last line fmt.Println(response.Error()) like there has been some error. It always panics in 477 line of client.go

Has any one got the same error, do you have any solution?

russorat commented 4 years ago

@pepisp thanks for opening this. I'm not sure if we have anyone that can help here, but I will leave this open in case someone in the community wants to chime in.

wxmeng04 commented 1 year ago

I'm using influxdb1 client to write into influxdb 1.8.10. It causes the following error:

panic: runtime error: invalid memory address or nil pointer dereference
[signal 0xc0000005 code=0x0 addr=0x38 pc=0xdb3ccc]