Unable to create new posts: panic: mkdir /public: read-only file system

Hi!

I’m unable to create new posts anymore.

Running this version, updated via homebrew:
hugo v0.101.0+extended darwin/arm64

Getting this error message:

❯ hugo new content/posts/test.md
panic: mkdir /public: read-only file system

goroutine 1 [running]:
github.com/gohugoio/hugo/hugofs.newFs({0x104ba0b28, 0x105c56460}, {0x104ba0b28?, 0x105c56460}, {0x104ba10b8, 0x140002d5d10})
        github.com/gohugoio/hugo/hugofs/fs.go:108 +0x474
github.com/gohugoio/hugo/hugofs.NewFromSourceAndDestination(...)
        github.com/gohugoio/hugo/hugofs/fs.go:89
github.com/gohugoio/hugo/commands.(*commandeer).loadConfig.func3()
        github.com/gohugoio/hugo/commands/commandeer.go:423 +0x6c
sync.(*Once).doSlow(0x104ba10b8?, 0x10420bd40?)
        sync/once.go:68 +0x10c
sync.(*Once).Do(...)
        sync/once.go:59
github.com/gohugoio/hugo/commands.(*commandeer).loadConfig(0x1400037a5a0)
        github.com/gohugoio/hugo/commands/commandeer.go:421 +0x820
github.com/gohugoio/hugo/commands.newCommandeer(0x1, 0x1, 0x0, 0x1400037a4b0, {0x104b8ae18?, 0x140005b3ec0}, 0x1400000e4b0, {0x1049ede20?, 0x1?, 0x140008c7ce0?})
        github.com/gohugoio/hugo/commands/commandeer.go:226 +0x2a0
github.com/gohugoio/hugo/commands.initializeConfig(0x60?, 0xc4?, 0x4c?, 0x2e?, {0x104b8ae18?, 0x140005b3ec0?}, 0x140008c7cf8?)
        github.com/gohugoio/hugo/commands/hugo.go:125 +0x34
github.com/gohugoio/hugo/commands.(*newCmd).newContent(0x140005b3ec0, 0x140000ecc80, {0x14000454110, 0x1, 0x0?})
        github.com/gohugoio/hugo/commands/new.go:74 +0xb0
github.com/spf13/cobra.(*Command).execute(0x140000ecc80, {0x140004540e0, 0x1, 0x1})
        github.com/spf13/cobra@v1.4.0/command.go:856 +0x4c4
github.com/spf13/cobra.(*Command).ExecuteC(0x140004c4f00)
        github.com/spf13/cobra@v1.4.0/command.go:974 +0x354
github.com/gohugoio/hugo/commands.Execute({0x140001960a0, 0x2, 0x2})
        github.com/gohugoio/hugo/commands/hugo.go:92 +0x98
main.main()
        github.com/gohugoio/hugo/main.go:23 +0x54

Link to my repo: https://github.com/ctrl-digital/ctrl-web-public

set publishDir to public (without slash prefix)

  • /public is absolute path
  • public is relative path to project/currendt directory hugo executed

Thank you so much! Problem solved :white_check_mark:

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.