datawire / forge

Define and run multi-container apps in Kubernetes
http://forge.sh
Apache License 2.0
415 stars 43 forks source link

Python Requests "KeyError: 'www-authenticate'" on forge deploy #200

Closed compiaffe closed 6 years ago

compiaffe commented 6 years ago

I'm running through the installation for the reference build. My kubernetes cluster is running on GKE and my local machine is a Ubuntu 17.10 flavour (POP OS). My docker registry is a private gitlab.com registry. The dummy image from forge setup get's pushed nicely.

When I run forge deploy I run into the following error:

$ forge deploy
║ 87 tasks run, 4 errors
║   None: unexpected error
║
║     Traceback (most recent call last):
║       File "/home/rapha/.pex/install/Forge-0.4.12-py2-none-any.whl.36e12ee61069c2a9e6297054958a3021d4585eb7/Forge-0.4.12-py2-none-any.whl/forge/core.py", line 327, in root
║         service.go(name)
║       File "/home/rapha/.pex/install/Forge-0.4.12-py2-none-any.whl.36e12ee61069c2a9e6297054958a3021d4585eb7/Forge-0.4.12-py2-none-any.whl/forge/core.py", line 320, in service
║         goal(svc)
║       File "/home/rapha/.pex/install/Forge-0.4.12-py2-none-any.whl.36e12ee61069c2a9e6297054958a3021d4585eb7/Forge-0.4.12-py2-none-any.whl/forge/cli.py", line 180, in <lambda>
║         forge.execute(lambda svc: forge.deploy(*forge.build(svc), prune=prune))
║       File "/home/rapha/.pex/install/Forge-0.4.12-py2-none-any.whl.36e12ee61069c2a9e6297054958a3021d4585eb7/Forge-0.4.12-py2-none-any.whl/forge/core.py", line 253, in build
║         self.bake(service)
║       File "/home/rapha/.pex/install/Forge-0.4.12-py2-none-any.whl.36e12ee61069c2a9e6297054958a3021d4585eb7/Forge-0.4.12-py2-none-any.whl/forge/core.py", line 198, in bake
║         raw = list(cull(lambda c: not service.docker.exists(c.image, c.version), service.containers))
║       File "/home/rapha/.pex/install/Forge-0.4.12-py2-none-any.whl.36e12ee61069c2a9e6297054958a3021d4585eb7/Forge-0.4.12-py2-none-any.whl/forge/tasks.py", line 329, in cull
║         execs.append((task.go(obj), obj))
║       File "/home/rapha/.pex/install/Forge-0.4.12-py2-none-any.whl.36e12ee61069c2a9e6297054958a3021d4585eb7/Forge-0.4.12-py2-none-any.whl/forge/tasks.py", line 312, in applicator
║         return obj(*args, **kwargs)
║       File "/home/rapha/.pex/install/Forge-0.4.12-py2-none-any.whl.36e12ee61069c2a9e6297054958a3021d4585eb7/Forge-0.4.12-py2-none-any.whl/forge/core.py", line 198, in <lambda>
║         raw = list(cull(lambda c: not service.docker.exists(c.image, c.version), service.containers))
║       File "/home/rapha/.pex/install/Forge-0.4.12-py2-none-any.whl.36e12ee61069c2a9e6297054958a3021d4585eb7/Forge-0.4.12-py2-none-any.whl/forge/docker.py", line 63, in exists
║         return self.remote_exists(name, version) or self.local_exists(name, version)
║       File "/home/rapha/.pex/install/Forge-0.4.12-py2-none-any.whl.36e12ee61069c2a9e6297054958a3021d4585eb7/Forge-0.4.12-py2-none-any.whl/forge/docker.py", line 278, in remote_exists
║         response = self.repo_get(name, "manifests/%s" % version)
║       File "/home/rapha/.pex/install/Forge-0.4.12-py2-none-any.whl.36e12ee61069c2a9e6297054958a3021d4585eb7/Forge-0.4.12-py2-none-any.whl/forge/docker.py", line 269, in repo_get
║         return self.registry_get("%s/%s/%s" % (self.namespace, name, api))
║       File "/home/rapha/.pex/install/Forge-0.4.12-py2-none-any.whl.36e12ee61069c2a9e6297054958a3021d4585eb7/Forge-0.4.12-py2-none-any.whl/forge/docker.py", line 252, in registry_get
║         challenge = response.headers['Www-Authenticate']
║       File "/home/rapha/.pex/install/requests-2.18.4-py2.py3-none-any.whl.8cc7b78f7356654aee86dfc3d77c12f71ef0bb58/requests-2.18.4-py2.py3-none-any.whl/requests/structures.py", line 54, in __getitem__
║         return self._store[key.lower()][1]
║     KeyError: 'www-authenticate'
║   None: unexpected error
...

Nothing is written to my /tmp/forge-*username*-2018-05-16.log file. It appears to be raised by requests (v2.18.4) - any idea of what it could be?

compiaffe commented 6 years ago

I figured this one out. It has to do with the container names allowed by gitlab. When trying to deploy the https://github.com/datawire/hello-forge example, the service.yaml specifies name: hello-forge

Somehow Gitlab does not allow for the -. Changing the name to name: helloforge will build and deploy fine.