~ac2/slactuaries.net#14: 
Fix System Compatibility

When trying to access either /fm or /p, a server connection reset page is displayed, and the following is logged in the terminal:

macpro@Macs-Mac-Pro slactuaries.net % ./http
2023/11/29 19:34:19 Starting server on :4005
2023/11/29 19:34:28 http: panic serving 127.0.0.1:57270: runtime error: invalid memory address or nil pointer dereference
goroutine 6 [running]:
net/http.(*conn).serve.func1()
	/usr/local/go/src/net/http/server.go:1854 +0xbf
panic({0x13654e0, 0x1663990})
	/usr/local/go/src/runtime/panic.go:890 +0x263
slactuaries.net/pkgs/direr.makePaths(0x0, {0xc000098164, 0x3}, 0x1)
	/Users/macpro/Documents/slactuaries.net/pkgs/direr/generate.go:90 +0x4e
slactuaries.net/pkgs/direr.GenerateTree({0xc00009c0a8?, 0xc00008c180?}, {0x13b9cce?, 0x4?}, {0xc000098164, 0x3})
	/Users/macpro/Documents/slactuaries.net/pkgs/direr/generate.go:17 +0x67
main.topicHandler({0x144aaa0, 0xc000318000}, 0xc00008e100)
	/Users/macpro/Documents/slactuaries.net/cmd/http/handlers.go:150 +0x485
net/http.HandlerFunc.ServeHTTP(0x1018d11?, {0x144aaa0?, 0xc000318000?}, 0x100d5e8?)
	/usr/local/go/src/net/http/server.go:2122 +0x2f
net/http.(*ServeMux).ServeHTTP(0x17983c8?, {0x144aaa0, 0xc000318000}, 0xc00008e100)
	/usr/local/go/src/net/http/server.go:2500 +0x149
main.redirectWWW.func1({0x144aaa0?, 0xc000318000?}, 0xc000115a70?)
	/Users/macpro/Documents/slactuaries.net/cmd/http/middle.go:41 +0xe2
net/http.HandlerFunc.ServeHTTP(0x1390520?, {0x144aaa0?, 0xc000318000?}, 0x10?)
	/usr/local/go/src/net/http/server.go:2122 +0x2f
main.gzipHandler.func1({0x144aa10, 0xc0000a60e0}, 0xc00008e100)
	/Users/macpro/Documents/slactuaries.net/cmd/http/middle.go:30 +0x202
net/http.HandlerFunc.ServeHTTP(0x0?, {0x144aa10?, 0xc0000a60e0?}, 0x1063fee?)
	/usr/local/go/src/net/http/server.go:2122 +0x2f
net/http.serverHandler.ServeHTTP({0xc000075260?}, {0x144aa10, 0xc0000a60e0}, 0xc00008e100)
	/usr/local/go/src/net/http/server.go:2936 +0x316
net/http.(*conn).serve(0xc00013e000, {0x144acc8, 0xc000075170})
	/usr/local/go/src/net/http/server.go:1995 +0x612
created by net/http.(*Server).Serve
	/usr/local/go/src/net/http/server.go:3089 +0x5ed
Status
REPORTED
Submitter
~ascerba
Assigned to
No-one
Submitted
1 year, 5 months ago
Updated
1 year, 5 months ago
Labels
backend bug

~acsqdotme 1 year, 5 months ago

error starts with a nil pointer dereference in the makePaths func in pkg/direr/generate.go...

~acsqdotme 1 year, 5 months ago

I see exactly what you mean. Did a shallow git clone in /tmp and got the same errors. It's cause the html files aren't generated yet.

I gotta do some error handling for making bare make work from first clone, but you should just need to run make html to get it working for now.

~ascerba 1 year, 5 months ago

Running make html solves it.

Register here or Log in to comment, or comment via email.