Similar issue as Upgrading to Go1.22.1 & Hugo 0.124.1 causes multiple errors but I didn’t see a real solution to my issue discussed there.
In short, I can only run hugo --renderToMemory server
. Running hugo
or hugo server
fails due to permission denied
errors.
My machine:
uname -a
Darwin LAPTOP2.lan 18.7.0 Darwin Kernel Version 18.7.0: Tue Jun 22 19:37:08 PDT 2021; root:xnu-4903.278.70~1/RELEASE_X86_64 x86_64
Hugo version: 0.125.0
hugo version
hugo v0.125.0-a32400b5f4e704daf7de19f44584baf77a4501ab+extended darwin/amd64 BuildDate=2024-04-16T15:04:41Z VendorInfo=gohugoio
Hugo configuration
cat hugo.toml
baseURL = 'https://example.org/'
languageCode = 'en-us'
title = 'My New Hugo Site'
[module]
[[module.imports]]
path = "github.com/McShelby/hugo-theme-relearn"
This works fine:
hugo --renderToMemory server
This does not work:
hugo server
Watching for changes in /Users/it-user/tmp/introduktion-till-datorer.github.io/{archetypes,assets,content,data,i18n,layouts,static}
Watching for config changes in /Users/it-user/tmp/introduktion-till-datorer.github.io/hugo.toml, /Users/it-user/tmp/introduktion-till-datorer.github.io/go.mod
Start building sites …
hugo v0.125.0-a32400b5f4e704daf7de19f44584baf77a4501ab+extended darwin/amd64 BuildDate=2024-04-16T15:04:41Z VendorInfo=gohugoio
ERROR Failed to publish Resource: open /Users/it-user/tmp/introduktion-till-datorer.github.io/public/css/theme-relearn-light.css: permission denied
ERROR Failed to publish Resource: open /Users/it-user/tmp/introduktion-till-datorer.github.io/public/css/theme-relearn-dark.css: permission denied
Built in 322 ms
Error: error building site: logged 2 error(s)
These are the permissions of the public
and public/css
directories.
tree -D -L 2 -puifd | grep public
[drwxr-xr-x it-user Apr 17 16:22] ./public
[drwxr-xr-x it-user Apr 17 16:18] ./public/categories
[drwxr-xr-x it-user Apr 17 14:31] ./public/css
[drwxr-xr-x it-user Apr 17 14:31] ./public/fonts
[drwxr-xr-x it-user Apr 17 14:31] ./public/js
[drwxr-xr-x it-user Apr 17 16:18] ./public/tags
[drwxr-xr-x it-user Apr 17 14:31] ./public/webfonts
Changing the permissions:
chmod -R a+w public
tree -D -L 2 -puifd | grep public
[drwxrwxrwx it-user Apr 17 16:22] ./public
[drwxrwxrwx it-user Apr 17 16:18] ./public/categories
[drwxrwxrwx it-user Apr 17 14:31] ./public/css
[drwxrwxrwx it-user Apr 17 14:31] ./public/fonts
[drwxrwxrwx it-user Apr 17 14:31] ./public/js
[drwxrwxrwx it-user Apr 17 16:18] ./public/tags
[drwxrwxrwx it-user Apr 17 14:31] ./public/webfonts
cd public/css
chmod a+rwx theme-relearn*
ls -l | grep theme-relearn
-rwxrwxrwx 1 it-user staff 3580 Apr 17 14:31 theme-relearn-bright.css
-rwxrwxrwx 1 it-user staff 3349 Apr 17 14:31 theme-relearn-dark.css
-rwxrwxrwx 1 it-user staff 3241 Apr 17 14:31 theme-relearn-light.css
-rwxrwxrwx 1 it-user staff 136 Apr 17 14:31 theme-relearn.css
Running hugo
again still fails with the same errors.
cd ..
cd ..
hugo
Start building sites …
hugo v0.125.0-a32400b5f4e704daf7de19f44584baf77a4501ab+extended darwin/amd64 BuildDate=2024-04-16T15:04:41Z VendorInfo=gohugoio
ERROR Failed to publish Resource: open /Users/it-user/tmp/introduktion-till-datorer.github.io/public/css/theme-relearn-light.css: permission denied
ERROR Failed to publish Resource: open /Users/it-user/tmp/introduktion-till-datorer.github.io/public/css/theme-relearn-dark.css: permission denied
Total in 1417 ms
Error: error building site: logged 2 error(s)
I would like to understand why I get these errors and what to do to get rid of them.