"hugo server" (v0.15) returns runtime error on armhf

I tried to run hugo v0.15 on my CubieBoard running debian wheezy armhf but the hugo server returns a runtime error. I installed hugo using the github releases armhf deb file.

txt@Cubian:~$ hugo new site website
txt@Cubian:~$ cd website
txt@Cubian:~/website$ hugo new about.md
/home/txt/website/content/about.md created
txt@Cubian:~/website$ echo -e "# about\nabout what?" >> content/about.md                                                                       
txt@Cubian:~/website$ hugo --buildDrafts
1 of 1 draft rendered
0 future content
1 pages created
0 paginator pages created
0 tags created
0 categories created
in 252 ms
txt@Cubian:~/website$ hugo server
panic: runtime error: invalid memory address or nil pointer dereference
[signal 0xb code=0x1 addr=0x4 pc=0x26fe50]

goroutine 1 [running]:
sync/atomic.storeUint64(0x10c27214, 0x0, 0x0)
        /usr/local/Cellar/go/1.5.1/libexec/src/sync/atomic/64bit_arm.go:20 +0x40
github.com/spf13/afero.(*InMemoryFile).Open(0x10c271d0, 0x0, 0x0)
        /Users/spf13/gopath/src/github.com/spf13/afero/memfile.go:55 +0x8c
github.com/spf13/afero.(*MemMapFs).lockfreeOpen(0x10b26b40, 0x10c1c5d0, 0x1, 0x0, 0x0, 0x0, 0x0)
        /Users/spf13/gopath/src/github.com/spf13/afero/memmap.go:222 +0x128
github.com/spf13/afero.(*MemMapFs).findParent(0x10b26b40, 0xb6e00918, 0x10c271d0, 0x0, 0x0)
        /Users/spf13/gopath/src/github.com/spf13/afero/memmap.go:117 +0x8c
github.com/spf13/afero.(*MemMapFs).registerWithParent(0x10b26b40, 0xb6e00918, 0x10c271d0)
        /Users/spf13/gopath/src/github.com/spf13/afero/memmap.go:128 +0x38
github.com/spf13/afero.(*MemMapFs).Mkdir(0x10b26b40, 0x10c1c5d0, 0x1, 0x1ff, 0x0, 0x0)
        /Users/spf13/gopath/src/github.com/spf13/afero/memmap.go:192 +0x414
github.com/spf13/afero.(*MemMapFs).MkdirAll(0x10b26b40, 0x10c1c5d0, 0x1, 0x1ff, 0x0, 0x0)
        /Users/spf13/gopath/src/github.com/spf13/afero/memmap.go:199 +0x40
github.com/spf13/hugo/helpers.WriteToDisk(0x10c1c5d0, 0xb, 0xb6e00858, 0x10c22a80, 0xb6e00308, 0x10b26b40, 0x0, 0x0)
        /Users/spf13/gopath/src/github.com/spf13/hugo/helpers/path.go:535 +0xa8
github.com/spf13/hugo/target.(*PagePub).Publish(0x10bc4f00, 0x6099a8, 0x1, 0xb6e00858, 0x10c22a80, 0x0, 0x0)
        /Users/spf13/gopath/src/github.com/spf13/hugo/target/page.go:31 +0x9c
github.com/spf13/hugo/hugolib.(*Site).WriteDestPage(0x10b72a00, 0x6099a8, 0x1, 0xb6e00858, 0x10c22a80, 0x0, 0x0)
        /Users/spf13/gopath/src/github.com/spf13/hugo/hugolib/site.go:1572 +0x17c
github.com/spf13/hugo/hugolib.(*Site).renderAndWritePage(0x10b72a00, 0x63c8e8, 0x8, 0x6099a8, 0x1, 0x5ef018, 0x10b5a640, 0x10c1c2f0, 0x2, 0x2, 
...)
        /Users/spf13/gopath/src/github.com/spf13/hugo/hugolib/site.go:1482 +0x4fc
github.com/spf13/hugo/hugolib.(*Site).RenderHomePage(0x10b72a00, 0x0, 0x0)
        /Users/spf13/gopath/src/github.com/spf13/hugo/hugolib/site.go:1262 +0x11c
github.com/spf13/hugo/hugolib.(*Site).Render(0x10b72a00, 0x0, 0x0)
        /Users/spf13/gopath/src/github.com/spf13/hugo/hugolib/site.go:403 +0x164
github.com/spf13/hugo/hugolib.(*Site).Build(0x10b72a00, 0x0, 0x0)
        /Users/spf13/gopath/src/github.com/spf13/hugo/hugolib/site.go:246 +0x5c
github.com/spf13/hugo/commands.buildSite(0x10ba3be4, 0x1, 0x1, 0x0, 0x0)
        /Users/spf13/gopath/src/github.com/spf13/hugo/commands/hugo.go:458 +0xb4
github.com/spf13/hugo/commands.build(0x10ba3cbc, 0x1, 0x1)
        /Users/spf13/gopath/src/github.com/spf13/hugo/commands/hugo.go:348 +0x2e8
github.com/spf13/hugo/commands.server(0x8fbcb8, 0x913c9c, 0x0, 0x0)
        /Users/spf13/gopath/src/github.com/spf13/hugo/commands/server.go:149 +0x5c4
github.com/spf13/cobra.(*Command).execute(0x8fbcb8, 0x913c9c, 0x0, 0x0, 0x0, 0x0)
        /Users/spf13/gopath/src/github.com/spf13/cobra/command.go:572 +0x664
github.com/spf13/cobra.(*Command).ExecuteC(0x8fb308, 0x8fbcb8, 0x0, 0x0)
        /Users/spf13/gopath/src/github.com/spf13/cobra/command.go:662 +0x424
github.com/spf13/cobra.(*Command).Execute(0x8fb308, 0x0, 0x0)
        /Users/spf13/gopath/src/github.com/spf13/cobra/command.go:618 +0x28
github.com/spf13/hugo/commands.Execute()
        /Users/spf13/gopath/src/github.com/spf13/hugo/commands/hugo.go:72 +0x3c
main.main()
        /Users/spf13/gopath/src/github.com/spf13/hugo/main.go:24 +0x28

goroutine 7 [chan receive]:
github.com/spf13/viper.(*Viper).WatchConfig.func1(0x10b9bd50)
        /Users/spf13/gopath/src/github.com/spf13/viper/viper.go:268 +0x194
created by github.com/spf13/viper.(*Viper).WatchConfig
        /Users/spf13/gopath/src/github.com/spf13/viper/viper.go:269 +0x2c

goroutine 8 [syscall]:
syscall.Syscall6(0xfc, 0x7, 0x10c41dac, 0x7, 0xffffffff, 0x0, 0x0, 0x0, 0x0, 0x0)
        /usr/local/Cellar/go/1.5.1/libexec/src/syscall/asm_linux_arm.s:48 +0x8
syscall.EpollWait(0x7, 0x10c41dac, 0x7, 0x7, 0xffffffff, 0x0, 0x0, 0x0)
        /usr/local/Cellar/go/1.5.1/libexec/src/syscall/zsyscall_linux_arm.go:365 +0x90
gopkg.in/fsnotify%2ev1.(*fdPoller).wait(0x10c0b4b0, 0x74a600, 0x0, 0x0)
        /Users/spf13/gopath/src/gopkg.in/fsnotify.v1/inotify_poller.go:85 +0x84
gopkg.in/fsnotify%2ev1.(*Watcher).readEvents(0x10b15740)
        /Users/spf13/gopath/src/gopkg.in/fsnotify.v1/inotify.go:179 +0x1e8
created by gopkg.in/fsnotify%2ev1.NewWatcher
        /Users/spf13/gopath/src/gopkg.in/fsnotify.v1/inotify.go:58 +0x2c8

goroutine 9 [select]:
github.com/spf13/viper.(*Viper).WatchConfig.func1.1(0x10b15740, 0x10b9bd50)
        /Users/spf13/gopath/src/github.com/spf13/viper/viper.go:243 +0x3a0
created by github.com/spf13/viper.(*Viper).WatchConfig.func1
        /Users/spf13/gopath/src/github.com/spf13/viper/viper.go:256 +0x144
txt@Cubian:~/website$ hugo version
Hugo Static Site Generator v0.15 BuildDate: 2015-11-25T15:36:29+01:00
txt@Cubian:~/website$ 

Version 0.14 installed via github release deb file is working fine.

It looks like a problem with Hugo 0.15’s new “render to memory” feature when running in “server” mode. As a work-around, run:

hugo --buildDrafts --renderToDisk

Cc: @spf13

I just realized that we already fixed this bug in 0.16-DEV. The issue affects both x86-32 and ARM. Here’s the original issue reported on Github:

See also Issue #1716 on GitHub.

Hello,

I do get the same error when using the 386 Version of Hugo. Not sure how to solve this?! How can i see my rendered page in the built in web Server without getting the error message?
I did create a blank site with no theme jsut to test as my earlier attempts with theme failed.

best regards,
Thomas

PS F:\20 DWR Re Design\Hugo\Sites\dwr> hugo server
panic: runtime error: invalid memory address or nil pointer dereference
[signal 0xc0000005 code=0x0 addr=0x0 pc=0x62ba2b]

PS F:\20 DWR Re Design\Hugo\Sites\dwr> hugo version
Hugo Static Site Generator v0.15 BuildDate: 2016-05-31T19:41:22+02:00

Try the --renderToDisk flag.

Didn’t work but donwloading the 64bit Version was working :slight_smile: sry didn’t see the info on the Website…

Hugo v0.16 released on 2016-06-06 should be working fine now on armhf.