I am trying to get back to some module creation for NS8.
I started the build of the LogitechMediaServer, but that is almost 1 year ago already.
So i decided to go through the New module tutorial to refresh the basics.
So i followed the steps and create a mymodule1 out of the ns8-kickstart template.
Building works fine as well as pushing the image to ghcr.io after creating a Person Access Token.
Now when i want to instantiate on my test host: add-module ghcr.io/epetersen-lab/mymodule1:latest 1
First of all i do not understand why authentication is required as everything in this repo should be publicly available.
I then did a buildah login ghcr.io, but still no change.
What could i possibly have missed?
Full traceback:
root@ns8-test1:~# add-module ghcr.io/epetersen-lab/mymodule1:latest 1
<7>podman-pull-missing ghcr.io/epetersen-lab/mymodule1:latest
Trying to pull ghcr.io/epetersen-lab/mymodule1:latest...
Error: initializing source docker://ghcr.io/epetersen-lab/mymodule1:latest: unable to retrieve auth token: invalid username/password: unauthorized
Traceback (most recent call last):
File "/usr/local/agent/bin/podman-pull-missing", line 35, in <module>
subprocess.run(['podman', 'pull', image_url]).check_returncode()
File "/usr/lib/python3.11/subprocess.py", line 502, in check_returncode
raise CalledProcessError(self.returncode, self.args, self.stdout,
subprocess.CalledProcessError: Command '['podman', 'pull', 'ghcr.io/epetersen-lab/mymodule1:latest']' returned non-zero exit status 125.
Traceback (most recent call last):
File "/var/lib/nethserver/cluster/actions/add-module/50update", line 64, in <module>
agent.run_helper('podman-pull-missing', image_url, progress_callback=agent.get_progress_callback(0,33)).check_returncode()
File "/usr/lib/python3.11/subprocess.py", line 502, in check_returncode
raise CalledProcessError(self.returncode, self.args, self.stdout,
subprocess.CalledProcessError: Command '('podman-pull-missing', 'ghcr.io/epetersen-lab/mymodule1:latest')' returned non-zero exit status 1.
Your are right, indeed i did not pay enough attention to that part.
What a stupid mistake, thanks for the pointer.
However, after starting from scratch this time with a valid name i still get that error. I then tried to pull the image directly with podman and then run the add-module command then i works.
Hmm… i did not touch any files in the .github directory. Not sure if that is required to make the automatic stuff going.
So far i did not look into workflows, that is why i published the image manually with ghcr.io/epetersen-lab/testmodule docker://ghcr.io/epetersen-lab/testmodule:latest.
As you noticed the package could not be created by the workflow actions.
Inspecting the raw log showed an authentication error, which sounds a bit weird as everything is happening on the remote side.
Anyhow, that made me check my PAT token. Turns out i had 2 tokens, both valid. I removed the older one and then it seems everything works.
When publishing images from a local build host, the write:packages scope is required.
Tried to reproduce the issue by creating an additional token, but still everything worked as expected.