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

Error enabling community addon in MicroK8s 1.30.1 #4574

Closed
JosePedro90 opened this issue Jul 16, 2024 · 5 comments · Fixed by #4714
Closed

Error enabling community addon in MicroK8s 1.30.1 #4574

JosePedro90 opened this issue Jul 16, 2024 · 5 comments · Fixed by #4714

Comments

@JosePedro90
Copy link

Summary

I encountered an error when trying to enable the community addon in MicroK8s version 1.30.1. The error message suggests an issue with repository ownership and permissions. This issue did not occur in MicroK8s version 1.29, where the same command worked fine.

What Should Happen Instead?

The community addon should be enabled without any errors, as it did in version 1.29.

Reproduction Steps

  1. Install MicroK8s version 1.30.1
  2. Run the command microk8s enable community

Error Log

Infer repository core for addon community
Cloning into '/var/snap/microk8s/common/addons/community'...
fatal: detected dubious ownership in repository at '/snap/microk8s/current/addons/community/.git'
To add an exception for this directory, call:

git config --global --add safe.directory /snap/microk8s/current/addons/community/.git

fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.
Traceback (most recent call last):
File "/snap/microk8s/6876/scripts/wrappers/addons.py", line 351, in <module>
addons(prog_name="microk8s addons")
File "/snap/microk8s/6876/usr/lib/python3/dist-packages/click/core.py", line 764, in **call**
return self.main(*args, **kwargs)
File "/snap/microk8s/6876/usr/lib/python3/dist-packages/click/core.py", line 717, in main
rv = self.invoke(ctx)
File "/snap/microk8s/6876/usr/lib/python3/dist-packages/click/core.py", line 1137, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File "/snap/microk8s/6876/usr/lib/python3/dist-packages/click/core.py", line 1137, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File "/snap/microk8s/6876/usr/lib/python3/dist-packages/click/core.py", line 956, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "/snap/microk8s/6876/usr/lib/python3/dist-packages/click/core.py", line 555, in invoke
return callback(*args, **kwargs)
File "/snap/microk8s/6876/scripts/wrappers/addons.py", line 207, in add
subprocess.check_call(cmd)
File "/snap/microk8s/6876/usr/lib/python3.8/subprocess.py", line 364, in check_call
raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['/snap/microk8s/6876/git.wrapper', 'clone', '/snap/microk8s/current/addons/community', PosixPath('/var/snap/microk8s/common/addons/community')]' returned non-zero exit status 128.

Thank you 😊

@ktsakalozos
Copy link
Member

Thank you for reporting this @JosePedro90 . While we are working on a fix, can you try sudo microk8s enable community ?

@JosePedro90
Copy link
Author

I tried using sudo and the issue remained

@tdeckers
Copy link

tdeckers commented Jul 30, 2024

Got the same error. Running the suggested command fixes the problem:

git config --global --add safe.directory /snap/microk8s/current/addons/community/.git

@mutekinootoko
Copy link

Got the same error. Running the suggested command fixes the problem:

git config --global --add safe.directory /snap/microk8s/current/addons/community/.git

works for me

@JosePedro90
Copy link
Author

That worked for me as well, though I had to install Git this time, which wasn’t necessary before.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants