Skip to content

[Bug]: Port 65536 is accepted in run configurations #4076

Description

@ShiroKSH

Steps to reproduce

  1. Save this task configuration as task.dstack.yml:
type: task
commands:
  - echo hi
ports:
  - 65536
  1. Run dstack apply -f task.dstack.yml.

The same issue occurs with a service configuration that sets port: 65536, and with port mappings such as 65536:80 and 80:65536.

Actual behaviour

The configuration is accepted. The invalid port is converted to a port mapping and reaches the run specification instead of being rejected by CLI configuration validation.

Expected behaviour

dstack apply should reject every port above 65535 before it requests an apply plan. TCP and UDP port numbers are in the range 1 through 65535.

dstack version

master at ccef71f46b8e61ce3c139d3c147911b6dd19f8a2

Server logs

Not applicable: the invalid value passes client-side configuration validation.

Additional information

The shared ValidPort constraint currently accepts 65536, so the problem affects task port lists, port mappings, and service ports.

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