Closed lbatalha closed 4 years ago
Error appears in console or in browser?
I changed README, please try to install with steps provided there.
Running the pre-built version doesnt work at all, I had to build it myself from master, which at least gets me to the error response.
Can you try setting up a new application?
Also the URL you have does not appear to be correct (but it does redirect to the correct one) The current one seems to be https://developer.spotify.com/dashboard/applications
Actually I tried and it worked for me, it looks that our environment differs somehow. Which release did you download, and how it didn't work?
Setup: MacOS High Sierra (latest update)
Steps:
~/bin
(In my PATH) and set +x
spotify-cli
-- Add redirect URL
-- Get Client ID and secret
which spotify-cli
-> '/Users/myuser/bin/spotify-cli'
SPOTIFY_CLIENT_ID=762*** SPOTIFY_SECRET=e46*** spotify-cli
Okay
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x8 pc=0x13cb6b5]
goroutine 1 [running]: main.main() /Users/jedrzejszczepaniak/go/src/github.com/jedruniu/spotify-cli/main.go:100 +0x555 zsh: exit 2 SPOTIFY_CLIENT_ID=76** SPOTIFY_SECRET= spotify-cl
With app built from `master`, I get the original error in the first post.
Also, how does your app save state, if I run the source built one with same tokens it just gives me invalid token
How come you have my surname and name in traceback? `/Users/jedrzejszczepaniak/go
It's not in the code
About state it is regenerated each time application starts
I don't know why that error message has your local FS stuff, I'd assume its something Go does when building.
Based on the error messages, this is basically issue #1.
@snippins @lbatalha If you want to correct the bug - I will be glad to accept merge request.
Same issue on macOS 10.14.4
$ go version
go version go1.12.4 darwin/amd64
and I get a log result that looks like this:
server.go:2979: http: panic serving [::1]:58356: runtime error: invalid memory address or nil pointer dereference
goroutine 20 [running]:
net/http.(*conn).serve.func1(0xc0000b4f00)
/usr/local/Cellar/go/1.11.1/libexec/src/net/http/server.go:1746 +0xd0
panic(0x1445980, 0x182f2b0)
/usr/local/Cellar/go/1.11.1/libexec/src/runtime/panic.go:513 +0x1b9
html/template.(*Template).escape(0x0, 0x0, 0x0)
/usr/local/Cellar/go/1.11.1/libexec/src/html/template/template.go:95 +0x2e
html/template.(*Template).Execute(0x0, 0x1532980, 0xc000dcd030, 0x1455120, 0xc000b48a00, 0xc0000bdc60, 0x1)
/usr/local/Cellar/go/1.11.1/libexec/src/html/template/template.go:119 +0x2f
main.insertTokenToTemplateImpl(0xc000ec6480, 0xb6, 0x1532de0, 0x0, 0x1533400, 0xc000713fb0, 0x0, 0x9)
/Users/jedrzejszczepaniak/go/src/github.com/jedruniu/spotify-cli/auth.go:191 +0xbc
main.(*appState).authCallback(0xc0000874a0, 0x1536c00, 0xc00016a0e0, 0xc0000c4200)
/Users/jedrzejszczepaniak/go/src/github.com/jedruniu/spotify-cli/auth.go:99 +0x2d2
main.(*appState).authCallback-fm(0x1536c00, 0xc00016a0e0, 0xc0000c4200)
/Users/jedrzejszczepaniak/go/src/github.com/jedruniu/spotify-cli/auth.go:72 +0x48
net/http.HandlerFunc.ServeHTTP(0xc0000830a0, 0x1536c00, 0xc00016a0e0, 0xc0000c4200)
/usr/local/Cellar/go/1.11.1/libexec/src/net/http/server.go:1964 +0x44
net/http.(*ServeMux).ServeHTTP(0xc0000874d0, 0x1536c00, 0xc00016a0e0, 0xc0000c4200)
/usr/local/Cellar/go/1.11.1/libexec/src/net/http/server.go:2361 +0x127
net/http.serverHandler.ServeHTTP(0xc00016c000, 0x1536c00, 0xc00016a0e0, 0xc0000c4200)
/usr/local/Cellar/go/1.11.1/libexec/src/net/http/server.go:2741 +0xab
net/http.(*conn).serve(0xc0000b4f00, 0x1537040, 0xc00008e380)
/usr/local/Cellar/go/1.11.1/libexec/src/net/http/server.go:1847 +0x646
created by net/http.(*Server).Serve
/usr/local/Cellar/go/1.11.1/libexec/src/net/http/server.go:2851 +0x2f5
auth.go:90: Could not get token, error: oauth2: cannot fetch token: 400 Bad Request
Response: {"error":"invalid_grant","error_description":"Invalid authorization code"}
EDIT: Manually rebuilding from source following the instructions in the README allows spotify to work properly. I'm wondering if something is just going wrong when you're building the go-binary for release? I don't know enough about how go builds things, or why it's hardcoding them in.
I fixed problems reported by users and released new versions Please consider using this one, also remember about requirements for running the project. I am closing this issue, if running newest release will be still problematic for you - feel free to reopen the issue.
When authenticating for the first time the end result is: