Hugo crashing on "hugo server", getting "fatal error: pipe failed" (Mac)

Hi all – I’m experiencing the issue brought up in this thread. I am currently on version 0.79.0 extended. Also tested on version 0.75.1 extended with the same error. I am currently on Mac OS 10.15.7 (Catalina).

Basically when running hugo server in my project directory, I get the following error message:

                   | EN  | DE   
-------------------+-----+------
  Pages            | 391 |   6  
  Paginator pages  |  16 |   0  
  Non-page files   |   0 |   0  
  Static files     | 655 | 655  
  Processed images |   0 |   0  
  Aliases          |  26 |   0  
  Sitemaps         |   2 |   1  
  Cleaned          |   0 |   0  

Built in 118629 ms
Watching for changes in /site/{archetypes,assets,content,data,i18n,layouts,node_modules,package.json,static}
Watching for config changes in /site/config.toml
fatal error: pipe failed

goroutine 1 [running]:
runtime.throw(0x5c684bc, 0xb)
        /usr/local/go/src/runtime/panic.go:1116 +0x72 fp=0xc03d747860 sp=0xc03d747830 pc=0x4038f12
runtime.sigNoteSetup(0x6d3ebc0)
        /usr/local/go/src/runtime/os_darwin.go:98 +0xc5 fp=0xc03d747888 sp=0xc03d747860 pc=0x4035c65
os/signal.signal_enable(0xa84064a600000002)
        /usr/local/go/src/runtime/sigqueue.go:198 +0xa5 fp=0xc03d7478a8 sp=0xc03d747888 pc=0x406d7e5
os/signal.enableSignal(...)
        /usr/local/go/src/os/signal/signal_unix.go:49
os/signal.Notify.func1(0x2)
        /usr/local/go/src/os/signal/signal.go:144 +0x88 fp=0xc03d7478c8 sp=0xc03d7478a8 pc=0x55ae2e8
os/signal.Notify(0xc0410b0540, 0xc03d747ae0, 0x2, 0x2)
        /usr/local/go/src/os/signal/signal.go:164 +0x162 fp=0xc03d747940 sp=0xc03d7478c8 pc=0x55add02
github.com/gohugoio/hugo/commands.(*commandeer).serve(0xc0007fbe10, 0xc00012be80, 0xb9, 0x100)
        /root/project/hugo/commands/server.go:480 +0x625 fp=0xc03d747b60 sp=0xc03d747940 pc=0x55e69c5
github.com/gohugoio/hugo/commands.(*serverCmd).server(0xc00012be80, 0xc000338b00, 0x6d3e5d8, 0x0, 0x0, 0x0, 0x0)
        /root/project/hugo/commands/server.go:274 +0x2b6 fp=0xc03d747ca8 sp=0xc03d747b60 pc=0x55e5196
github.com/gohugoio/hugo/commands.(*serverCmd).server-fm(0xc000338b00, 0x6d3e5d8, 0x0, 0x0, 0x0, 0x0)
        /root/project/hugo/commands/server.go:131 +0x52 fp=0xc03d747cf0 sp=0xc03d747ca8 pc=0x55f5372
github.com/spf13/cobra.(*Command).execute(0xc000338b00, 0x6d3e5d8, 0x0, 0x0, 0xc000338b00, 0x6d3e5d8)
        /go/pkg/mod/github.com/spf13/cobra@v0.0.7/command.go:838 +0x47c fp=0xc03d747dc0 sp=0xc03d747cf0 pc=0x41f643c
github.com/spf13/cobra.(*Command).ExecuteC(0xc0004522c0, 0xc0006738a0, 0x8, 0xc000533a00)
        /go/pkg/mod/github.com/spf13/cobra@v0.0.7/command.go:943 +0x336 fp=0xc03d747e98 sp=0xc03d747dc0 pc=0x41f6f76
github.com/gohugoio/hugo/commands.Execute(0xc0000b0010, 0x1, 0x1, 0x40087e5, 0xc000190058, 0x0, 0x0)
        /root/project/hugo/commands/hugo.go:90 +0xb9 fp=0xc03d747f28 sp=0xc03d747e98 pc=0x55d2039
main.main()
        /root/project/hugo/main.go:23 +0x76 fp=0xc03d747f88 sp=0xc03d747f28 pc=0x55f6ab6
runtime.main()
        /usr/local/go/src/runtime/proc.go:204 +0x209 fp=0xc03d747fe0 sp=0xc03d747f88 pc=0x403b6e9
runtime.goexit()
        /usr/local/go/src/runtime/asm_amd64.s:1374 +0x1 fp=0xc03d747fe8 sp=0xc03d747fe0 pc=0x4071581

goroutine 21 [select]:
go.opencensus.io/stats/view.(*worker).start(0xc00067c050)
        /go/pkg/mod/go.opencensus.io@v0.22.0/stats/view/worker.go:154 +0x105
created by go.opencensus.io/stats/view.init.0
        /go/pkg/mod/go.opencensus.io@v0.22.0/stats/view/worker.go:32 +0x57

goroutine 747 [syscall]:
syscall.syscall6(0x4236220, 0x10, 0x0, 0x0, 0xc00019ae88, 0xa, 0x6d3e890, 0x0, 0x0, 0x0)
        /usr/local/go/src/runtime/sys_darwin.go:85 +0x2e
golang.org/x/sys/unix.kevent(0x10, 0x0, 0x0, 0xc00019ae88, 0xa, 0x6d3e890, 0x0, 0x0, 0x0)
        /go/pkg/mod/golang.org/x/sys@v0.0.0-20200501145240-bc7a7d42d5c3/unix/zsyscall_darwin_amd64.go:292 +0xa6
golang.org/x/sys/unix.Kevent(0x10, 0x0, 0x0, 0x0, 0xc00019ae88, 0xa, 0xa, 0x6d3e890, 0x0, 0x0, ...)
        /go/pkg/mod/golang.org/x/sys@v0.0.0-20200501145240-bc7a7d42d5c3/unix/syscall_bsd.go:413 +0x71
github.com/fsnotify/fsnotify.read(0x10, 0xc00019ae88, 0xa, 0xa, 0x6d3e890, 0xc00019ae88, 0x0, 0xa, 0x0, 0x0)
        /go/pkg/mod/github.com/fsnotify/fsnotify@v1.4.9/kqueue.go:511 +0x6e
github.com/fsnotify/fsnotify.(*Watcher).readEvents(0xc049600120)
        /go/pkg/mod/github.com/fsnotify/fsnotify@v1.4.9/kqueue.go:274 +0x831
created by github.com/fsnotify/fsnotify.NewWatcher
        /go/pkg/mod/github.com/fsnotify/fsnotify@v1.4.9/kqueue.go:62 +0x199

goroutine 756 [select]:
github.com/gohugoio/hugo/livereload.(*hub).run(0x6cff140)
        /root/project/hugo/livereload/hub.go:39 +0x1e9
created by github.com/gohugoio/hugo/livereload.Initialize
        /root/project/hugo/livereload/livereload.go:98 +0x45

goroutine 662 [IO wait]:
internal/poll.runtime_pollWait(0xaf666b0, 0x72, 0x60fa860)
        /usr/local/go/src/runtime/netpoll.go:220 +0x55
internal/poll.(*pollDesc).wait(0xc024948d98, 0x72, 0xc033c56600, 0x12fa, 0x12fa)
        /usr/local/go/src/internal/poll/fd_poll_runtime.go:87 +0x45
internal/poll.(*pollDesc).waitRead(...)
        /usr/local/go/src/internal/poll/fd_poll_runtime.go:92
internal/poll.(*FD).Read(0xc024948d80, 0xc033c56600, 0x12fa, 0x12fa, 0x0, 0x0, 0x0)
        /usr/local/go/src/internal/poll/fd_unix.go:159 +0x1b1
net.(*netFD).Read(0xc024948d80, 0xc033c56600, 0x12fa, 0x12fa, 0x203009, 0x42fe01b, 0xc01ac56860)
        /usr/local/go/src/net/fd_posix.go:55 +0x4f
net.(*conn).Read(0xc0350a50c8, 0xc033c56600, 0x12fa, 0x12fa, 0x0, 0x0, 0x0)
        /usr/local/go/src/net/net.go:182 +0x8e
crypto/tls.(*atLeastReader).Read(0xc026acd340, 0xc033c56600, 0x12fa, 0x12fa, 0x22, 0xb88, 0xc000c81730)
        /usr/local/go/src/crypto/tls/conn.go:779 +0x62
bytes.(*Buffer).ReadFrom(0xc01ac56980, 0x60f53e0, 0xc026acd340, 0x400db45, 0x59af280, 0x5bc3f60)
        /usr/local/go/src/bytes/buffer.go:204 +0xb1
crypto/tls.(*Conn).readFromUntil(0xc01ac56700, 0x342c1930, 0xc0350a50c8, 0x5, 0xc0350a50c8, 0x11)
        /usr/local/go/src/crypto/tls/conn.go:801 +0xf3
crypto/tls.(*Conn).readRecordOrCCS(0xc01ac56700, 0x0, 0x0, 0x11)
        /usr/local/go/src/crypto/tls/conn.go:608 +0x115
crypto/tls.(*Conn).readRecord(...)
        /usr/local/go/src/crypto/tls/conn.go:576
crypto/tls.(*Conn).Read(0xc01ac56700, 0xc02fbaf000, 0x1000, 0x1000, 0x0, 0x0, 0x0)
        /usr/local/go/src/crypto/tls/conn.go:1252 +0x15f
bufio.(*Reader).Read(0xc02fb90d80, 0xc02f89b538, 0x9, 0x9, 0x0, 0xc000c81d20, 0x43ffb94)
        /usr/local/go/src/bufio/bufio.go:227 +0x222
io.ReadAtLeast(0x60f51c0, 0xc02fb90d80, 0xc02f89b538, 0x9, 0x9, 0x9, 0xc033a8ce80, 0xc02fbae000, 0x11)
        /usr/local/go/src/io/io.go:314 +0x87
io.ReadFull(...)
        /usr/local/go/src/io/io.go:333
net/http.http2readFrameHeader(0xc02f89b538, 0x9, 0x9, 0x60f51c0, 0xc02fb90d80, 0x0, 0x0, 0x0, 0x0)
        /usr/local/go/src/net/http/h2_bundle.go:1477 +0x89
net/http.(*http2Framer).ReadFrame(0xc02f89b500, 0xc0379bcd20, 0x0, 0x0, 0x0)
        /usr/local/go/src/net/http/h2_bundle.go:1735 +0xa5
net/http.(*http2clientConnReadLoop).run(0xc000c81fa8, 0xc0001a0fa8, 0x40087e5)
        /usr/local/go/src/net/http/h2_bundle.go:8240 +0x8d
net/http.(*http2ClientConn).readLoop(0xc01d93a000)
        /usr/local/go/src/net/http/h2_bundle.go:8168 +0x6f
created by net/http.(*http2Transport).newClientConn
        /usr/local/go/src/net/http/h2_bundle.go:7173 +0x66e

goroutine 721 [select]:
github.com/gohugoio/hugo/watcher.(*Batcher).run(0xc046aa6ac0)
        /root/project/hugo/watcher/batcher.go:53 +0x174
created by github.com/gohugoio/hugo/watcher.New
        /root/project/hugo/watcher/batcher.go:42 +0x125

goroutine 802 [select]:
github.com/gohugoio/hugo/commands.(*commandeer).newWatcher.func1(0xc046aa6ac0, 0xc0007fbe10, 0xc047fde6f0, 0xc046a2fa10)
        /root/project/hugo/commands/hugo.go:873 +0xe5
created by github.com/gohugoio/hugo/commands.(*commandeer).newWatcher
        /root/project/hugo/commands/hugo.go:871 +0x2ac

The solution in the thread above was to run hugo server --watch=false, which does allow me to run the site. However, this command is very inconvenient to my workflow as I have to continually rebuild the site when making changes.

I am wondering if there is any known fix for the issue above that does not include using the --watch=false flag? This thread also had a similar issue but it doesn’t seem that there was any additional solution provided. Any help is much appreciated!

hugo server --watch-=false < the minus before the = is that in your original CLI command? because it’s wrong. I also see in your error dump some lines referring to live reload starting, watcher starting.

Run hugo with the following parameters added, they might help to bring new info to light:

--debug --path-warnings --verbose

Just updated the post – the minus sign in the command was a typo, I have been running hugo server --watch=false, thanks for catching.

I ran the command you suggested (hugo server --debug --path-warnings --verbose) and got a very similar error message as I did above – the only difference was there was a log for each page render, then I got this chunk:

                   | EN  | DE   
-------------------+-----+------
  Pages            | 391 |   6  
  Paginator pages  |  16 |   0  
  Non-page files   |   0 |   0  
  Static files     | 655 | 655  
  Processed images |   0 |   0  
  Aliases          |  26 |   0  
  Sitemaps         |   2 |   1  
  Cleaned          |   0 |   0  

Built in 132809 ms
Watching for changes in /Users/satchelsmidt/Desktop/Work_Projects/jbm-marketing-site/{archetypes,assets,content,data,i18n,layouts,node_modules,package.json,static}
Watching for config changes in /Users/satchelsmidt/Desktop/Work_Projects/jbm-marketing-site/config.toml
fatal error: pipe failed

goroutine 1 [running]:
runtime.throw(0x5d23466, 0xb)
        runtime/panic.go:1116 +0x72 fp=0xc020033858 sp=0xc020033828 pc=0x403a552
runtime.sigNoteSetup(0x6e51e20)
        runtime/os_darwin.go:98 +0xc5 fp=0xc020033880 sp=0xc020033858 pc=0x40371a5
os/signal.signal_enable(0x67eeaaa500000002)
        runtime/sigqueue.go:198 +0xa5 fp=0xc0200338a0 sp=0xc020033880 pc=0x406f0e5
os/signal.enableSignal(...)
        os/signal/signal_unix.go:49
os/signal.Notify.func1(0x2)
        os/signal/signal.go:144 +0x88 fp=0xc0200338c0 sp=0xc0200338a0 pc=0x562cfc8
os/signal.Notify(0xc03f412f00, 0xc020033ad8, 0x2, 0x2)
        os/signal/signal.go:164 +0x162 fp=0xc020033938 sp=0xc0200338c0 pc=0x562c9e2
github.com/gohugoio/hugo/commands.(*commandeer).serve(0xc000460e00, 0xc0005a1180, 0xb9, 0x100)
        github.com/gohugoio/hugo/commands/server.go:498 +0x625 fp=0xc020033b58 sp=0xc020033938 pc=0x5665ce5
github.com/gohugoio/hugo/commands.(*serverCmd).server(0xc0005a1180, 0xc0002aa580, 0xc0002b9110, 0x0, 0x3, 0x0, 0x0)
        github.com/gohugoio/hugo/commands/server.go:274 +0x2b6 fp=0xc020033ca0 sp=0xc020033b58 pc=0x56644b6
github.com/gohugoio/hugo/commands.(*serverCmd).server-fm(0xc0002aa580, 0xc0002b9110, 0x0, 0x3, 0x0, 0x0)
        github.com/gohugoio/hugo/commands/server.go:131 +0x52 fp=0xc020033ce8 sp=0xc020033ca0 pc=0x5674bb2
github.com/spf13/cobra.(*Command).execute(0xc0002aa580, 0xc0002b9080, 0x3, 0x3, 0xc0002aa580, 0xc0002b9080)
        github.com/spf13/cobra@v1.1.1/command.go:850 +0x47c fp=0xc020033dc0 sp=0xc020033ce8 pc=0x41e07fc
github.com/spf13/cobra.(*Command).ExecuteC(0xc0004382c0, 0xc0004ed930, 0x8, 0xc0001ab800)
        github.com/spf13/cobra@v1.1.1/command.go:958 +0x375 fp=0xc020033e98 sp=0xc020033dc0 pc=0x41e1375
github.com/gohugoio/hugo/commands.Execute(0xc00003c060, 0x4, 0x4, 0x4009cc5, 0xc00009c058, 0x0, 0x0)
        github.com/gohugoio/hugo/commands/hugo.go:90 +0xb9 fp=0xc020033f28 sp=0xc020033e98 pc=0x5650f39
main.main()
        github.com/gohugoio/hugo/main.go:23 +0x76 fp=0xc020033f88 sp=0xc020033f28 pc=0x56762f6
runtime.main()
        runtime/proc.go:204 +0x209 fp=0xc020033fe0 sp=0xc020033f88 pc=0x403cd09
runtime.goexit()
        runtime/asm_amd64.s:1374 +0x1 fp=0xc020033fe8 sp=0xc020033fe0 pc=0x4072e81

goroutine 8 [select]:
go.opencensus.io/stats/view.(*worker).start(0xc0006be050)
        go.opencensus.io@v0.22.0/stats/view/worker.go:154 +0x105
created by go.opencensus.io/stats/view.init.0
        go.opencensus.io@v0.22.0/stats/view/worker.go:32 +0x57

goroutine 768 [select]:
github.com/gohugoio/hugo/watcher.(*Batcher).run(0xc043eddce0)
        github.com/gohugoio/hugo/watcher/batcher.go:53 +0x15f
created by github.com/gohugoio/hugo/watcher.New
        github.com/gohugoio/hugo/watcher/batcher.go:42 +0x125

goroutine 767 [syscall]:
syscall.syscall6(0x423c600, 0x8, 0x0, 0x0, 0xc000503688, 0xa, 0x6e51a80, 0x0, 0x0, 0x0)
        runtime/sys_darwin.go:85 +0x2e
golang.org/x/sys/unix.kevent(0x8, 0x0, 0x0, 0xc000503688, 0xa, 0x6e51a80, 0x0, 0x0, 0x0)
        golang.org/x/sys@v0.0.0-20200501145240-bc7a7d42d5c3/unix/zsyscall_darwin_amd64.go:292 +0xa6
golang.org/x/sys/unix.Kevent(0x8, 0x0, 0x0, 0x0, 0xc000503688, 0xa, 0xa, 0x6e51a80, 0x0, 0x0, ...)
        golang.org/x/sys@v0.0.0-20200501145240-bc7a7d42d5c3/unix/syscall_bsd.go:413 +0x71
github.com/fsnotify/fsnotify.read(0x8, 0xc000503688, 0xa, 0xa, 0x6e51a80, 0xc000503688, 0x0, 0xa, 0x0, 0x0)
        github.com/fsnotify/fsnotify@v1.4.9/kqueue.go:511 +0x6e
github.com/fsnotify/fsnotify.(*Watcher).readEvents(0xc043dc8cc0)
        github.com/fsnotify/fsnotify@v1.4.9/kqueue.go:274 +0x831
created by github.com/fsnotify/fsnotify.NewWatcher
        github.com/fsnotify/fsnotify@v1.4.9/kqueue.go:62 +0x199

goroutine 802 [select]:
github.com/gohugoio/hugo/livereload.(*hub).run(0x6e12880)
        github.com/gohugoio/hugo/livereload/hub.go:39 +0x1e9
created by github.com/gohugoio/hugo/livereload.Initialize
        github.com/gohugoio/hugo/livereload/livereload.go:98 +0x45

goroutine 769 [select]:
github.com/gohugoio/hugo/commands.(*commandeer).newWatcher.func1(0xc043eddce0, 0xc000460e00, 0xc043dec078, 0xc043ebbfb0)
        github.com/gohugoio/hugo/commands/hugo.go:873 +0xd9
created by github.com/gohugoio/hugo/commands.(*commandeer).newWatcher
        github.com/gohugoio/hugo/commands/hugo.go:871 +0x2cc

There are few in this forum who can read a Go stack trace.

But I do have a suggestion, have you tried setting a high timeout value for your project, like:
timeout = 60000

Also from the Docs:

timeout (10000)
Timeout for generating page contents, in milliseconds (defaults to 10 seconds). Note: this is used to bail out of recursive content generation, if your pages are slow to generate (e.g., because they require large image processing or depend on remote contents) you might need to raise this limit.

Good to know – I may see if there are any Go-specific forums that I can pose some of those goroutine errors to if there isn’t a solution here.

I tried setting the timeout value like you said, in my config.toml file, but still getting the same errors unfortunately.

I’d be interested in seeing a better workaround/fix for this as well, as I have a couple of users for my theme who have been unable to serve their sites (from MacOS) with the most recent versions of Hugo. One user couldn’t serve our example site, which is neither particularly big nor has a lot of images:

Is there an open Hugo issue?

See a Mac workaround from one of my theme’s users here that removes the error: fails with hugo extended · Issue #89 · google/docsy-example · GitHub

1 Like

Ran into a very similar problem on a large site this solved it: Too many files (only on non root user) - #2 by bep