panic: runtime error: invalid memory address or nil pointer dereference
Problem Description
I tried to build Graphviz's documentation by following the steps introduced in README. However, the following error showed up:
panic: runtime error: invalid memory address or nil pointer dereference
Steps to Reproduce
-
Install the Prerequisites
sudo apt install hugo sudo apt install golang
-
Clone the Repo and its Submodules
git clone https://gitlab.com/graphviz/graphviz.gitlab.io.git cd graphviz.gitlab.io git submodule update --init --recursive
-
Run the Hugo Command
hugo serve
Versions and Platforms
- OS version: Kubuntu 22.04
- Hugo version:
v0.92.2
- Go version:
go1.18.1
- Latest Commit: 1cca615b
Logs
Click to expand the log
hwhsu1231@vb-kubuntu:~/Repo$ git clone https://gitlab.com/graphviz/graphviz.gitlab.io.git
Cloning into 'graphviz.gitlab.io'...
remote: Enumerating objects: 12083, done.
remote: Counting objects: 100% (722/722), done.
remote: Compressing objects: 100% (315/315), done.
remote: Total 12083 (delta 406), reused 618 (delta 333), pack-reused 11361
Receiving objects: 100% (12083/12083), 171.75 MiB | 10.57 MiB/s, done.
Resolving deltas: 100% (6569/6569), done.
hwhsu1231@vb-kubuntu:~/Repo$ cd graphviz.gitlab.io
hwhsu1231@vb-kubuntu:~/Repo/graphviz.gitlab.io$ git submodule update --init --recursive
hwhsu1231@vb-kubuntu:~/Repo/graphviz.gitlab.io$ which hugo && hugo version
/usr/bin/hugo
hugo v0.92.2+extended linux/amd64 BuildDate=2023-01-31T11:11:57Z VendorInfo=ubuntu:0.92.2-1ubuntu0.1
hwhsu1231@vb-kubuntu:~/Repo/graphviz.gitlab.io$ which go && go version
/usr/bin/go
go version go1.18.1 linux/amd64
hwhsu1231@vb-kubuntu:~/Repo/graphviz.gitlab.io$ hugo serve
hugo: downloading modules …
hugo: collected modules in 34622 ms
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x40 pc=0x1b994a8]
goroutine 1 [running]:
github.com/gohugoio/hugo/commands.(*commandeer).loadConfig.func3()
github.com/gohugoio/hugo/commands/commandeer.go:426 +0x588
sync.(*Once).doSlow(0xc0000a9360?, 0x1f9a891?)
sync/once.go:68 +0xc2
sync.(*Once).Do(...)
sync/once.go:59
github.com/gohugoio/hugo/commands.(*commandeer).loadConfig(0xc000388000)
github.com/gohugoio/hugo/commands/commandeer.go:377 +0x8a6
github.com/gohugoio/hugo/commands.newCommandeer(0x1, 0x1, 0x1, 0xc000535420, {0x247e500?, 0xc0004b1100}, 0xc0002c1500, {0x0, 0x0, 0x0})
github.com/gohugoio/hugo/commands/commandeer.go:195 +0x310
github.com/gohugoio/hugo/commands.initializeConfig(0x52?, 0x1a?, 0x45?, 0x1fa045a?, {0x247e500?, 0xc0004b1100?}, 0xc0007ffc70?)
github.com/gohugoio/hugo/commands/hugo.go:125 +0x31
github.com/gohugoio/hugo/commands.(*serverCmd).server(0xc0004b1100, 0xc0003a2c80, {0xc0007ffcd8?, 0x0?, 0x0?})
github.com/gohugoio/hugo/commands/server.go:242 +0x1cd
github.com/spf13/cobra.(*Command).execute(0xc0003a2c80, {0x3370d48, 0x0, 0x0})
github.com/spf13/cobra/command.go:856 +0x67c
github.com/spf13/cobra.(*Command).ExecuteC(0xc000824280)
github.com/spf13/cobra/command.go:974 +0x3b4
github.com/gohugoio/hugo/commands.Execute({0xc00003c050, 0x1, 0x1})
github.com/gohugoio/hugo/commands/hugo.go:92 +0xb4
main.main()
github.com/gohugoio/hugo/main.go:23 +0x57
hwhsu1231@vb-kubuntu:~/Repo/graphviz.gitlab.io$
Edited by Haowei Hsu