Clarification about weird permissions error

Hello I am new to Hugo. I had cloned a git repo and was trying to run it using hugo serve command.
I ran into an error related to the permissions of a svg file in public folder.

Error: error copying static files: open /Users/website/public/icons/carly.svg: permission denied

When I checked the permissions of all the files in that folder, I got:

total 80
-r--r--r--@ 1 me  staff   943 Mar 24 21:21 carly.svg
-r--r--r--@ 1 me  staff   358 Mar 24 21:21 check.svg
-r--r--r--@ 1 me  staff  1535 Mar 24 21:21 copy.svg
-r--r--r--@ 1 me  staff  1132 Mar 24 21:21 expand.svg
-r--r--r--@ 1 me  staff   419 Mar 24 21:21 info.svg
-r--r--r--@ 1 me  staff  1164 Mar 24 21:21 link.svg
-r--r--r--@ 1 me  staff   536 Mar 24 20:09 moon.svg
-r--r--r--@ 1 me  staff  1074 Mar 24 20:09 next.svg
-r--r--r--@ 1 me  staff   556 Mar 24 21:21 order.svg
-r--r--r--@ 1 me  staff   863 Mar 24 20:09 sun.svg

I gave the carly.svg file write permissions for Owner (chmod 644 carly.svg) and the project ran successfully withhugo serve command.

Final permissions:

total 80
-rw-r--r--@ 1 me  staff   943 Mar 24 21:21 carly.svg
-r--r--r--@ 1 me  staff   358 Mar 24 21:21 check.svg
-r--r--r--@ 1 me  staff  1535 Mar 24 21:21 copy.svg
-r--r--r--@ 1 me  staff  1132 Mar 24 21:21 expand.svg
-r--r--r--@ 1 me  staff   419 Mar 24 21:21 info.svg
-r--r--r--@ 1 me  staff  1164 Mar 24 21:21 link.svg
-r--r--r--@ 1 me  staff   536 Mar 24 20:09 moon.svg
-r--r--r--@ 1 me  staff  1074 Mar 24 20:09 next.svg
-r--r--r--@ 1 me  staff   556 Mar 24 21:21 order.svg
-r--r--r--@ 1 me  staff   863 Mar 24 20:09 sun.svg

Now I have two questions:

  1. Why does only the carly.svg requires write permissions and not the other files? I can’t make sense of that.
  2. What are these files? And how are they generated. Are they related to the theme used in the website?

Thank you.

You need to learn (somewhere else, I am afraid) about file rights. What you did (before this problem came up) is not “normal”. Basically I assume the file rights further UP the folder tree are not permissive for the user your hugo command is running on.

644 = owner (me) can read and write carly.svg, group (staff) can read, all can red.

hugo is not me, so it has no rights to write. You don’t show the folder public’s permissions, THERE hugo needs rights to write. If hugo CAN’T READ /Users/website/public then it can’t write (create files) in subsequent folders.

I think you should do the following (ONLY if you DO NOT HAVE anything important saved in that folder. If you against the defaults have files that need to be kept inside of the public folder then I stop here and give up.):

delete EVERYTHING inside of public. chmod public to 0644, run hugo. see what happens.

  1. maybe only carly.svg is used. maybe only carly.svg needs to be copied to public
  2. probably. without knowing your theme it’s hard to say. normally those files are images (static vector graphics)… probably icons.

I had cloned the code from a github repository and run directly.
And these were the permissions initially of public folder:

drwxr-xr-x@ 21 me  staff    672 Mar 26 05:34 public

So I don’t believe it was due to permissions problem of public folder.

As for theme I am using GitHub - onweru/compose: A Hugo theme for documentation sites. .

with unix theres a umask serting for filepermissions of new files. maybe its set to readonly.

twice usually means there’s a duplicate publish within the templates. --printPathWarnings may help

but no indication for that within the theme

I think it is strange that you are in group staff instead of your own group. Perhaps though that is because I hardly ever use groups at all. You can be in your own group and also in group staff if needed.