Iwark/spreadsheet

Panic: runtime error: invalid memory address or nil pointer dereference

Opened this issue · 4 comments

I use version from master and v2, and i got the same error:

http: panic serving [::1]:60992: runtime error: invalid memory address or nil pointer dereference
goroutine 41 [running]:
net/http.(*conn).serve.func1(0xc0000f8e60)
        /usr/local/go/src/net/http/server.go:1801 +0x147
panic(0x1632640, 0x1b18ef0)
        /usr/local/go/src/runtime/panic.go:975 +0x3e9
net/http.(*Client).deadline(0x0, 0x0, 0x30, 0x16534c0)
        /usr/local/go/src/net/http/client.go:189 +0x22
net/http.(*Client).do(0x0, 0xc00015e000, 0x0, 0x0, 0x0)
        /usr/local/go/src/net/http/client.go:604 +0x2bd
net/http.(*Client).Do(...)
        /usr/local/go/src/net/http/client.go:586
net/http.(*Client).Post(0x0, 0xc00032c0e0, 0x66, 0x16f60d0, 0x10, 0x17a5640, 0xc000702600, 0xc000490040, 0x9b9c9d0, 0x100ff38)
        /usr/local/go/src/net/http/client.go:846 +0x195
github.com/Iwark/spreadsheet.(*Service).post(0xc000613928, 0xc000484000, 0x46, 0xc000702150, 0xc0005aa868, 0xc000484000, 0x46, 0x0)
        /Users/maciejgurgul/go/src/github.com/Iwark/spreadsheet/service.go:278 +0x17a
github.com/Iwark/spreadsheet.(*updateRequest).Do(0xc0002096a0, 0xc0002a0000, 0xc0002096a0)
        /Users/maciejgurgul/go/src/github.com/Iwark/spreadsheet/update_request.go:38 +0x29b
github.com/Iwark/spreadsheet.(*Service).SyncSheet(0xc000613928, 0xc0002a0000, 0x0, 0x16f0e76)
        /Users/maciejgurgul/go/src/github.com/Iwark/spreadsheet/service.go:206 +0x1d3
github.com/Iwark/spreadsheet.(*Sheet).Synchronize(...)
        /Users/maciejgurgul/go/src/github.com/Iwark/spreadsheet/sheet.go:155
main.updateGoogleSheet()
        /Users/maciejgurgul/Projects/copy-reports-bash/main.go:360 +0x307
main.testConnextion(0x17b0740, 0xc0002e0460, 0xc00015e500)
        /Users/maciejgurgul/Projects/copy-reports-bash/main.go:85 +0x94
net/http.HandlerFunc.ServeHTTP(0x171c558, 0x17b0740, 0xc0002e0460, 0xc00015e500)
        /usr/local/go/src/net/http/server.go:2042 +0x44
github.com/gorilla/mux.(*Router).ServeHTTP(0xc00019a180, 0x17b0740, 0xc0002e0460, 0xc00015e300)
        /Users/maciejgurgul/go/src/github.com/gorilla/mux/mux.go:210 +0xd3
net/http.serverHandler.ServeHTTP(0xc0002e0000, 0x17b0740, 0xc0002e0460, 0xc00015e300)
        /usr/local/go/src/net/http/server.go:2843 +0xa3
net/http.(*conn).serve(0xc0000f8e60, 0x17b1e80, 0xc00002eec0)
        /usr/local/go/src/net/http/server.go:1925 +0x8ad
created by net/http.(*Server).Serve
        /usr/local/go/src/net/http/server.go:2969 +0x36c

I try update cell. I did it exacly, like on example. Could you fix it?

I've got this same issue. It started recently. We had an old-ish product that we released probably a year ago using this lib and it worked great. We had a completely unrelated feature we were implementing and it works great, but the CI busted on this error right here. We hadn't touched this part of the code, but have upgraded to go 1.15.5 so maybe that has something to do with it?
This is a blocker for us! I'm happy to help in debugging it however I can, but not really sure what's up... whenever I run it in the debugger it works properly.

So I just revered my local go 1.13 and it seems to have fixed... so if you need a temp workaround you can build with go 1.13.x ... hopefully this will help to fix this going forward!

Hello,
any news about a fix that works on last go versions?

After banging my head against this all day, I found the following:
https://stackoverflow.com/questions/62433283/this-operation-is-not-supported-for-this-document-at-gaxios-nodejs-spreadshe

Make sure you're trying to hit a sheet that's saved in Google Sheets format, not XLSX.