Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

snap denials /etc/gitconfig #6226

Closed
julian-klode opened this issue Aug 15, 2019 · 7 comments · Fixed by #9619
Closed

snap denials /etc/gitconfig #6226

julian-klode opened this issue Aug 15, 2019 · 7 comments · Fixed by #9619

Comments

@julian-klode
Copy link

Running the hugo snap fails with

Building sites … ERROR 2019/08/15 19:04:04 Failed to read Git log: fatal: unknown error occured while reading the configuration files
Total in 125 ms
Error: Error building site: logged 1 error(s)

in dmesg I see:

[140780.553009] audit: type=1400 audit(1565888471.869:1669): apparmor="DENIED" operation="open" profile="snap.hugo.hugo" name="/etc/gitconfig" pid=22857 comm="git" requested_mask="r" denied_mask="r" fsuid=1000 ouid=0                                                                    
[140780.553095] audit: type=1400 audit(1565888471.869:1670): apparmor="DENIED" operation="open" profile="snap.hugo.hugo" name="/etc/gitconfig" pid=22857 comm="git" requested_mask="r" denied_mask="r" fsuid=1000 ouid=0     
@bep
Copy link
Member

bep commented Aug 15, 2019

/cc @anthonyfok

@julian-klode
Copy link
Author

You could probably simply set GIT_CONFIG_NOSYSTEM=true in the app launcher in snapcraft.yaml

@stale
Copy link

stale bot commented Dec 13, 2019

This issue has been automatically marked as stale because it has not had recent activity. The resources of the Hugo team are limited, and so we are asking for your help.
If this is a bug and you can still reproduce this error on the master branch, please reply with all of the information you have about it in order to keep the issue open.
If this is a feature request, and you feel that it is still relevant and valuable, please tell us why.
This issue will automatically be closed in the near future if no further activity occurs. Thank you for all your contributions.

@gerrywastaken
Copy link

Indeed running the server like so causes the issue to disappear:
GIT_CONFIG_NOSYSTEM=true hugo serve -D

Thanks @julian-klode !

@jmooring
Copy link
Member

jmooring commented May 1, 2021

Reproducible with snap install of v0.80.0.

sudo git config --system foo.bar "baz"
sudo chmod 644 /etc/gitconfig
git clone --single-branch -b hugo-github-issue-6226 https://github.com/jmooring/hugo-testing hugo-github-issue-6226
cd hugo-github-issue-6226
hugo server

@anthonyfok anthonyfok added this to the v0.84 milestone May 4, 2021
@anthonyfok anthonyfok added the Bug label May 4, 2021
@bep bep modified the milestones: v0.84, v0.85 Jun 18, 2021
@bep bep modified the milestones: v0.85, v0.86 Jul 5, 2021
@bep bep modified the milestones: v0.86, v0.87, v0.88 Jul 26, 2021
@bep bep modified the milestones: v0.88, v0.89 Sep 2, 2021
@bep bep modified the milestones: v0.89, v0.90 Nov 2, 2021
@bep bep modified the milestones: v0.90, v0.91.0 Dec 13, 2021
@bep bep modified the milestones: v0.91.0, v0.92.0 Dec 22, 2021
@bep bep modified the milestones: v0.98.0, v0.99.0 Apr 28, 2022
@bep bep modified the milestones: v0.99.0, v0.100.0 May 24, 2022
@bep bep modified the milestones: v0.100.0, v0.101.0 May 31, 2022
@bep bep modified the milestones: v0.101.0, v0.102.0 Jun 16, 2022
@anthonyfok
Copy link
Member

This was fixed in

Once https://forum.snapcraft.io/t/system-files-and-personal-files-request-for-hugo/30598 is approved, the Snap store will allow newer versions of Hugo that can read gitconfig to enter the Snap Store, and then this issue can be closed.

Sorry for my 12-week delay in actually filing that store request.

@anthonyfok anthonyfok linked a pull request Jun 24, 2022 that will close this issue
anthonyfok added a commit that referenced this issue Jun 24, 2022
@github-actions
Copy link

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jul 19, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants