I have two instances of Ubuntu 20.04, one on my desktop PC and one on a server instance:
lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 20.04.4 LTS
Release: 20.04
Codename: focal
On both I installed hugo using the .deb package provided for download. On both systems, install seemed to be successful:
hugo version
hugo v0.92.2-CDF6A0D6+extended linux/amd64 BuildDate=2022-02-11T14:17:39Z VendorInfo=gohugoio
On my desktop PC, I can create and server a new hugo site without problems.
On the server, however, I get a panic when doing so:
hugo new site test
cd test
hugo serve
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x50 pc=0x1612532]
goroutine 1 [running]:
github.com/gohugoio/hugo/hugolib.newHugoSites({{0x25ffb10, 0xc000513b30}, 0xc0001a49c0, 0x0, {0x0, 0x0}, {0x25fb050, 0xc000099310}, {0x0, 0x0, ...}, ...}, ...)
/root/project/hugo/hugolib/hugo_sites.go:398 +0x832
github.com/gohugoio/hugo/hugolib.NewHugoSites({{0x25ffb10, 0xc000513b30}, 0xc0001a49c0, 0x0, {0x0, 0x0}, {0x25fb050, 0xc000099310}, {0x0, 0x0, ...}, ...})
/root/project/hugo/hugolib/hugo_sites.go:527 +0x11d
github.com/gohugoio/hugo/commands.(*commandeer).loadConfig.func3()
/root/project/hugo/commands/commandeer.go:419 +0x4f8
sync.(*Once).doSlow(0xc000099310, 0x21167e0)
/usr/local/go/src/sync/once.go:68 +0xd2
sync.(*Once).Do(...)
/usr/local/go/src/sync/once.go:59
github.com/gohugoio/hugo/commands.(*commandeer).loadConfig(0xc00032c0f0)
/root/project/hugo/commands/commandeer.go:377 +0x8a5
github.com/gohugoio/hugo/commands.newCommandeer(0x1, 0x1, 0x1, 0xc0004e7420, {0x25a9be0, 0xc00036b640}, 0xc00003c5e0, {0x0, 0x0, 0x0})
/root/project/hugo/commands/commandeer.go:195 +0x310
github.com/gohugoio/hugo/commands.initializeConfig(0x92, 0x48, 0x51, 0x211c0eb, {0x25a9be0, 0xc00036b640}, 0xc0005ffc88)
/root/project/hugo/commands/hugo.go:125 +0x31
github.com/gohugoio/hugo/commands.(*serverCmd).server(0xc00036b640, 0xc00038e000, {0xc0005ffcf0, 0x0, 0x0})
/root/project/hugo/commands/server.go:242 +0x1ce
github.com/spf13/cobra.(*Command).execute(0xc00038e000, {0x35fe038, 0x0, 0x0})
/go/pkg/mod/github.com/spf13/cobra@v1.2.1/command.go:856 +0x60e
github.com/spf13/cobra.(*Command).ExecuteC(0xc000518a00)
/go/pkg/mod/github.com/spf13/cobra@v1.2.1/command.go:974 +0x3bc
github.com/gohugoio/hugo/commands.Execute({0xc0000b2010, 0x1, 0x1})
/root/project/hugo/commands/hugo.go:92 +0xb4
main.main()
/root/project/hugo/main.go:23 +0x58
Any idea what’s going on here and why systems behave differently?