Skip to content

Service patch fails due to non-unique port names #99

@natalian98

Description

@natalian98

Bug Description

When deploying postgresql-k8s edge, the following error occurs:

ERROR unit.postgresql-k8s/0.juju-log Kubernetes service patch failed: Service "postgresql-k8s" is invalid: spec.ports[1].name: Duplicate value: "postgresql-k8s"

See exemplary integration tests failing: postgresql-k8s CI

As pointed by @rbarry82, the issue lies in non-unique names of the patched service ports - see this conversation.

To Reproduce

juju deploy postgresql-k8s --channel edge --trust

Environment

postgresql-k8s latest/edge rev44
juju 3.1.0
microk8s 1.25-strict/stable

Relevant log output

unit-postgresql-k8s-0: 01:30:41 ERROR unit.postgresql-k8s/0.juju-log Kubernetes service patch failed: Service "postgresql-k8s" is invalid: spec.ports[1].name: Duplicate value: "postgresql-k8s"
Traceback (most recent call last):
  File "/var/lib/juju/agents/unit-postgresql-k8s-0/charm/venv/urllib3/connectionpool.py", line 703, in urlopen
    httplib_response = self._make_request(
  File "/var/lib/juju/agents/unit-postgresql-k8s-0/charm/venv/urllib3/connectionpool.py", line 386, in _make_request
    self._validate_conn(conn)
  File "/var/lib/juju/agents/unit-postgresql-k8s-0/charm/venv/urllib3/connectionpool.py", line 1042, in _validate_conn
    conn.connect()
  File "/var/lib/juju/agents/unit-postgresql-k8s-0/charm/venv/urllib3/connection.py", line 414, in connect
    self.sock = ssl_wrap_socket(
  File "/var/lib/juju/agents/unit-postgresql-k8s-0/charm/venv/urllib3/util/ssl_.py", line 449, in ssl_wrap_socket
    ssl_sock = _ssl_wrap_socket_impl(
  File "/var/lib/juju/agents/unit-postgresql-k8s-0/charm/venv/urllib3/util/ssl_.py", line 493, in _ssl_wrap_socket_impl
    return ssl_context.wrap_socket(sock, server_hostname=server_hostname)
  File "/usr/lib/python3.8/ssl.py", line 500, in wrap_socket
    return self.sslsocket_class._create(
  File "/usr/lib/python3.8/ssl.py", line 1040, in _create
    self.do_handshake()
  File "/usr/lib/python3.8/ssl.py", line 1309, in do_handshake
    self._sslobj.do_handshake()
ssl.SSLError: [SSL: WRONG_VERSION_NUMBER] wrong version number (_ssl.c:1131)

Additional context

Not sure how relevant it is, but I was able to deploy revision 44 without this error in this run, while in this one it failed. I wasn't able to relate it to any recently updated lib.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions