Git Product home page Git Product logo

Comments (11)

alex-phillips avatar alex-phillips commented on June 18, 2024 1

Great! Thanks again for the great project.

from gonic.

sentriz avatar sentriz commented on June 18, 2024

well that is very strange. can you show the output of
curl -LD - "http://your.gonic/rest/getPlaylist.view"
also to compare the output of a presumably working endpoint:
curl -LD - "http://your.gonic/rest/ping.view"

from gonic.

alex-phillips avatar alex-phillips commented on June 18, 2024

@sentriz so it's not a CORS issue after all, but that getPlaylist is returning a 502 Bad Gateway for some reason....

$ curl -LD - "https://gonic.example.com/rest/ping.view?f=json&c=CLIENT&v=1.15&u=USERNAME&s=S&t=TOKEN"
HTTP/2 200 
server: nginx/1.16.1
date: Thu, 09 Apr 2020 16:47:12 GMT
content-type: application/json
content-length: 94
access-control-allow-headers: Accept, Content-Type, Content-Length, Accept-Encoding, X-CSRF-Token, Authorization
access-control-allow-methods: POST, GET, OPTIONS, PUT, DELETE
access-control-allow-origin: *

{"subsonic-response":{"status":"ok","version":"1.9.0","type":"gonic","gonicVersion":"v0.8.4"}}

and

$ curl -LD - "https://gonic.example.com/rest/getPlaylist.view?f=json&c=CLIENT&v=1.15&u=USERNAME&s=S&t=TOKEN&id=23"
HTTP/2 502 
server: nginx/1.16.1
date: Thu, 09 Apr 2020 16:47:57 GMT
content-type: text/html
content-length: 157

<html>
<head><title>502 Bad Gateway</title></head>
<body>
<center><h1>502 Bad Gateway</h1></center>
<hr><center>nginx/1.16.1</center>
</body>
</html>

from gonic.

alex-phillips avatar alex-phillips commented on June 18, 2024

Update:

Error outputted fro m502 endpoint:

2020/04/09 16:49:07 http: panic serving 172.18.0.39:43586: runtime error: invalid memory address or nil pointer dereference
goroutine 29036 [running]:
net/http.(*conn).serve.func1(0xc0001dc0a0)
	/usr/local/go/src/net/http/server.go:1772 +0x139
panic(0x9ef660, 0xf14e30)
	/usr/local/go/src/runtime/panic.go:973 +0x3e3
go.senan.xyz/gonic/server/ctrlsubsonic/spec.NewTCTrackByFolder(0xc000715860, 0x0, 0xc000715860)
	/src/server/ctrlsubsonic/spec/construct_by_folder.go:49 +0xae
go.senan.xyz/gonic/server/ctrlsubsonic.(*Controller).ServeGetPlaylist(0xc000425c80, 0xc000175400, 0xc00010e480)
	/src/server/ctrlsubsonic/handlers_common.go:168 +0x763
go.senan.xyz/gonic/server/ctrlsubsonic.(*Controller).H.func1(0xb709a0, 0xc0001bc0a0, 0xc000175400)
	/src/server/ctrlsubsonic/ctrl.go:93 +0x33
net/http.HandlerFunc.ServeHTTP(0xc000421890, 0xb709a0, 0xc0001bc0a0, 0xc000175400)
	/usr/local/go/src/net/http/server.go:2012 +0x44
go.senan.xyz/gonic/server/ctrlsubsonic.(*Controller).WithUser.func1(0xb709a0, 0xc0001bc0a0, 0xc000174c00)
	/src/server/ctrlsubsonic/middleware.go:88 +0x513
net/http.HandlerFunc.ServeHTTP(0xc0001bc000, 0xb709a0, 0xc0001bc0a0, 0xc000174c00)
	/usr/local/go/src/net/http/server.go:2012 +0x44
go.senan.xyz/gonic/server/ctrlsubsonic.(*Controller).WithRequiredParams.func1(0xb709a0, 0xc0001bc0a0, 0xc000174c00)
	/src/server/ctrlsubsonic/middleware.go:52 +0x121
net/http.HandlerFunc.ServeHTTP(0xc00026a210, 0xb709a0, 0xc0001bc0a0, 0xc000174c00)
	/usr/local/go/src/net/http/server.go:2012 +0x44
go.senan.xyz/gonic/server/ctrlsubsonic.(*Controller).WithParams.func1(0xb709a0, 0xc0001bc0a0, 0xc000174700)
	/src/server/ctrlsubsonic/middleware.go:33 +0x17c
net/http.HandlerFunc.ServeHTTP(0xc0001bc020, 0xb709a0, 0xc0001bc0a0, 0xc000174700)
	/usr/local/go/src/net/http/server.go:2012 +0x44
go.senan.xyz/gonic/server/ctrlbase.(*Controller).WithCORS.func1(0xb709a0, 0xc0001bc0a0, 0xc000174700)
	/src/server/ctrlbase/ctrl.go:82 +0x300
net/http.HandlerFunc.ServeHTTP(0xc0001bc060, 0xb709a0, 0xc0001bc0a0, 0xc000174700)
	/usr/local/go/src/net/http/server.go:2012 +0x44
go.senan.xyz/gonic/server/ctrlbase.(*Controller).WithLogging.func1(0xb70ce0, 0xc00026c000, 0xc000174700)
	/src/server/ctrlbase/ctrl.go:65 +0x9d
net/http.HandlerFunc.ServeHTTP(0xc0001bc080, 0xb70ce0, 0xc00026c000, 0xc000174700)
	/usr/local/go/src/net/http/server.go:2012 +0x44
github.com/gorilla/mux.(*Router).ServeHTTP(0xc00002c0c0, 0xb70ce0, 0xc00026c000, 0xc000174000)
	/go/pkg/mod/github.com/gorilla/[email protected]/mux.go:212 +0xe2
net/http.serverHandler.ServeHTTP(0xc0004fe000, 0xb70ce0, 0xc00026c000, 0xc000174000)
	/usr/local/go/src/net/http/server.go:2807 +0xa3
net/http.(*conn).serve(0xc0001dc0a0, 0xb72260, 0xc000300200)
	/usr/local/go/src/net/http/server.go:1895 +0x86c
created by net/http.(*Server).Serve
	/usr/local/go/src/net/http/server.go:2933 +0x35c

from gonic.

sentriz avatar sentriz commented on June 18, 2024

ouch. thanks for finding that. having a look now

from gonic.

alex-phillips avatar alex-phillips commented on June 18, 2024

@sentriz I think it's because my playlists might be showing 0 as the song count. Not sure why, I'll try re-importing. But that might help narrow it down?

from gonic.

alex-phillips avatar alex-phillips commented on June 18, 2024

@sentriz Ok, so my playlists are all populated now and it's working fine. Not sure how they got cleared out, but no more 502s.

from gonic.

sentriz avatar sentriz commented on June 18, 2024

good to hear :) still trying to reproduce locally. if i do i'll push a fix for the future

from gonic.

alex-phillips avatar alex-phillips commented on June 18, 2024

@sentriz Just a thought - this could happen if a playlist includes a track filepath that may no longer exist in the library anymore. I.e., if I had MP3 of a track and it was on a playlist but I replaced that album with a FLAC version. Might be related?

from gonic.

sentriz avatar sentriz commented on June 18, 2024

yeah just had a look. airsonic store full paths for playlists in their db. probably for good reason, like yours

from gonic.

djl avatar djl commented on June 18, 2024

I might be running into this, too.

[... a few hundred folders here...]
2022/03/13 15:18:49 processing folder `/media/music/Alex Cameron/Oxy Music`
2022/03/13 15:18:49 finished scan in 4.91389s, +0/5376 tracks (0 err)
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0x821c75]
goroutine 32 [running]:
go.senan.xyz/gonic/server/scanner.populateTrack(0xc0007fda60, 0xc00012fa40, 0xc0006b8600, {0xcc5ef0, 0xc00069fab0}, {0xc000783ba8, 0x15}, 0x1b4c8b3)
        /src/server/scanner/scanner.go:298 +0x175
go.senan.xyz/gonic/server/scanner.(*Scanner).populateTrackAndAlbumArtists(0xc000075680, 0xc0007fda60, 0xc0004ce000, 0x3, 0xc00012fa40, 0xc00012fa40, {0xc000783ba8, 0x15}, {0xc0003c5080, 0x39})
        /src/server/scanner/scanner.go:234 +0x705
go.senan.xyz/gonic/server/scanner.(*Scanner).scanDir(0xb81a06, 0xc0007fda60, 0xc0004ce000, {0xc00002c011, 0xc}, {0xc00044d860, 0x23})
        /src/server/scanner/scanner.go:185 +0x58a
go.senan.xyz/gonic/server/scanner.(*Scanner).scanCallback(0xc000075680, 0xc0004ce000, {0xc00002c011, 0xc00044d830}, {0xc00044d860, 0x1a}, {0xcb7928, 0xc00086cd80}, {0x0, 0x0})
        /src/server/scanner/scanner.go:134 +0x27e
go.senan.xyz/gonic/server/scanner.(*Scanner).ScanAndClean.func2({0xc00044d860, 0x23}, {0xcb7928, 0xc00086cd80}, {0x0, 0x0})
        /src/server/scanner/scanner.go:79 +0x6c
path/filepath.walkDir({0xc00044d860, 0x23}, {0xcb7928, 0xc00086cd80}, 0xc0007fdf40)
        /usr/local/go/src/path/filepath/path.go:386 +0x63
path/filepath.walkDir({0xc000481b00, 0x19}, {0xcb7928, 0xc0004fcbc0}, 0xc0007fdf40)
        /usr/local/go/src/path/filepath/path.go:405 +0x232
path/filepath.walkDir({0xc00002c011, 0xc}, {0xcb7960, 0xc000020010}, 0xc0007fdf40)
        /usr/local/go/src/path/filepath/path.go:405 +0x232
path/filepath.WalkDir({0xc00002c011, 0xc}, 0xc0004e7f40)
        /usr/local/go/src/path/filepath/path.go:469 +0xb0
go.senan.xyz/gonic/server/scanner.(*Scanner).ScanAndClean(0xc000075680, {0x0})
        /src/server/scanner/scanner.go:78 +0x838
go.senan.xyz/gonic/server/ctrlsubsonic.(*Controller).ServeStartScan.func1()
        /src/server/ctrlsubsonic/handlers_common.go:85 +0x28
created by go.senan.xyz/gonic/server/ctrlsubsonic.(*Controller).ServeStartScan
        /src/server/ctrlsubsonic/handlers_common.go:84 +0x65

If I move the directory out of the way, the scan will continue until it hits another problematic directory.

Unfortunately moving it back and restarting the scan doesn't fix the issue so I need to wipe the SQLite DB and restart from scratch. Not the worst thing in the world but with ~180,000 files, it's not a quick process 😄

from gonic.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.