# Help for "Validation failed in API: PortInvalidProtocol" needed

**URL:** https://forums.suse.com/t/help-for-validation-failed-in-api-portinvalidprotocol-needed/7047
**Category:** Rancher 1.x
**Created:** [August 7, 2017, 5:53pm UTC](https://forums.suse.com/t/help-for-validation-failed-in-api-portinvalidprotocol-needed/7047 "2017-08-07T17:53:51Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![flypenguin](https://avatars.discourse-cdn.com/v4/letter/f/e480ec/32.png) [@flypenguin](https://forums.suse.com/u/flypenguin)
#### Post date: [August 7, 2017, 5:53pm UTC](https://forums.suse.com/t/help-for-validation-failed-in-api-portinvalidprotocol-needed/7047/1 "2017-08-07T17:53:51Z")

</div>

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:

```auto
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:

```auto
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"
}

```

---

<div class="post-metadata">

### Author: ![vincent](https://sea2.discourse-cdn.com/flex022/user_avatar/forums.suse.com/vincent/32/7156_2.png) [@vincent](https://forums.suse.com/u/vincent)
#### Post date: [August 8, 2017, 1:42am UTC](https://forums.suse.com/t/help-for-validation-failed-in-api-portinvalidprotocol-needed/7047/2 "2017-08-08T01:42:06Z")

</div>

> [@flypenguin](#):
>
> “ports”: [  
> “50000:1234/http”  
> ],

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](https://github.com/rancher/ui/blob/6a6e512a44d80050d25a46d7bfa169b31d73748c/app/utils/parse-port.js#L7) 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).

---

<div class="post-metadata">

### Author: ![vincent](https://sea2.discourse-cdn.com/flex022/user_avatar/forums.suse.com/vincent/32/7156_2.png) [@vincent](https://forums.suse.com/u/vincent)
#### Post date: [August 8, 2017, 1:50am UTC](https://forums.suse.com/t/help-for-validation-failed-in-api-portinvalidprotocol-needed/7047/3 "2017-08-08T01:50:36Z")

</div>

[https://github.com/vincent99/ui/commit/97472775e49d15700aa8715806275ad8836e0f1f](https://github.com/vincent99/ui/commit/97472775e49d15700aa8715806275ad8836e0f1f)

---

<div class="post-metadata">

### Author: ![flypenguin](https://avatars.discourse-cdn.com/v4/letter/f/e480ec/32.png) [@flypenguin](https://forums.suse.com/u/flypenguin)
#### Post date: [August 8, 2017, 10:33am UTC](https://forums.suse.com/t/help-for-validation-failed-in-api-portinvalidprotocol-needed/7047/4 "2017-08-08T10:33:45Z")

</div>

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.

---

<div class="post-metadata">

### Author: ![flypenguin](https://avatars.discourse-cdn.com/v4/letter/f/e480ec/32.png) [@flypenguin](https://forums.suse.com/u/flypenguin)
#### Post date: [August 8, 2017, 10:34am UTC](https://forums.suse.com/t/help-for-validation-failed-in-api-portinvalidprotocol-needed/7047/5 "2017-08-08T10:34:10Z")

</div>

And thanks a lot for your quick help 🙂
