Help for "Validation failed in API: PortInvalidProtocol" needed

I have a service which I try to upgrade using the Rancher UI. When I hit on “upgrade” I get this error message without further explanation:

Validation failed in API: PortInvalidProtocol

Any idas here? Because I have no clue. A fresh deployment of the stack works.

Happens with R1.6.5 and R1.5.9.

Thanks!
Axel.

Audit log:

REQUEST (INTERNAL_DOMAIN_HUB is our internal docker hub, which I substituted in this post here :)
{
  "inServiceStrategy": {
    "intervalMillis": 2000,
    "batchSize": 1,
    "launchConfig": {
      "instanceTriggeredStop": "stop",
      "kind": "container",
      "networkMode": "managed",
      "privileged": false,
      "publishAllPorts": false,
      "readOnly": false,
      "startOnCreate": true,
      "stdinOpen": false,
      "tty": false,
      "vcpu": 1,
      "environment": {
        "AUTHENTICATION_USERS": "asdf",
        "HOST_LOGIN": "asdf"
      },
      "imageUuid": "docker:INTERNAL_DOMAIN_HUB:5000/cars/glass-test-case-frontend:latest",
      "labels": {
        "rancon.name": "cars-glass-uat",
        "rancon.tag": "webui_external",
        "io.rancher.container.pull_image": "always",
        "io.rancher.container.hostname_override": "container_name"
      },
      "logConfig": {
        "driver": null,
        "config": {}
      },
      "ports": [
        "50000:1234/http"
      ],
      "secrets": [],
      "dataVolumes": [],
      "dataVolumesFrom": [],
      "hostname": null,
      "dns": [],
      "dnsSearch": [],
      "capAdd": [],
      "capDrop": [],
      "devices": [],
      "dataVolumesFromLaunchConfigs": [],
      "blkioWeight": null,
      "cgroupParent": null,
      "count": null,
      "cpuCount": null,
      "cpuPercent": null,
      "cpuPeriod": null,
      "cpuQuota": null,
      "cpuSet": null,
      "cpuSetMems": null,
      "cpuShares": null,
      "description": null,
      "diskQuota": null,
      "domainName": null,
      "healthInterval": null,
      "healthRetries": null,
      "healthTimeout": null,
      "ioMaximumBandwidth": null,
      "ioMaximumIOps": null,
      "ip": null,
      "ip6": null,
      "ipcMode": null,
      "isolation": null,
      "kernelMemory": null,
      "memory": null,
      "memoryMb": null,
      "memoryReservation": null,
      "memorySwap": null,
      "memorySwappiness": null,
      "milliCpuReservation": null,
      "oomScoreAdj": null,
      "pidMode": null,
      "pidsLimit": null,
      "requestedIpAddress": null,
      "shmSize": null,
      "stopSignal": null,
      "user": null,
      "userdata": null,
      "usernsMode": null,
      "uts": null,
      "volumeDriver": null,
      "workingDir": null,
      "networkLaunchConfig": null,
      "system": false,
      "version": "7816ca83-ca31-4ebd-b96f-5c2a1d981189"
    },
    "secondaryLaunchConfigs": [],
    "previousLaunchConfig": {
      "environment": {
        "AUTHENTICATION_USERS": "ce:S2sdfsafdfasdsafha8Ya sv:dsrsdfasdfasdfasdf1VKM adm:y3KcU35JtJhrzIxzK",
        "HOST_LOGIN": "https://SOME_DOMAIN/v1/login"
      },
      "imageUuid": "docker:INTERNAL_DOMAIN_HUB:5000/cars/glass-test-case-frontend:latest",
      "labels": {
        "io.rancher.container.hostname_override": "container_name",
        "io.rancher.container.pull_image": "always",
        "io.rancher.service.hash": "d890791329a0b055477268b9a374d19ad8e53cf8",
        "rancon.name": "cars-glass-uat",
        "rancon.tag": "webui_external"
      },
      "logConfig": {},
      "networkMode": "managed",
      "ports": [
        "1234:1234"
      ],
      "startOnCreate": true,
      "instanceTriggeredStop": "stop",
      "kind": "container",
      "privileged": false,
      "publishAllPorts": false,
      "readOnly": false,
      "stdinOpen": false,
      "system": false,
      "tty": false,
      "version": "dfb2dc14-ff7c-40e2-b897-ff71a1d6cdc8",
      "vcpu": 1
    },
    "previousSecondaryLaunchConfigs": [],
    "startFirst": false,
    "fullUpgrade": true
  },
  "toServiceStrategy": null
}

RESPONSE
{
  "id": "98f9c44f-ee64-4d3f-b7ac-7df0e50bbe09",
  "type": "error",
  "links": {},
  "actions": {},
  "status": 422,
  "code": "PortInvalidProtocol",
  "message": "PortInvalidProtocol",
  "detail": null,
  "baseType": "error"
}

As the error says, http is not a valid protocol. Ports are tcp, udp, or nothing (which is tcp)

It appears there is some case where the string is saved with no protocol (50000:1234) and then when the UI parses it the parser defaults to http instead of tcp (because this is also used for parsing balancer rules, where http is valid).

I’m guessing that’s when you create the service through compose with no protocol, rather than from the UI (which always sets it).

https://github.com/vincent99/ui/commit/97472775e49d15700aa8715806275ad8836e0f1f

I also found the trigger of the error. In our docker-compose.yml there was a “network” defined. If you remove that network it works.

And thanks a lot for your quick help :slight_smile: