Skip to content

[Bug]: Unexpected error: status code 405 when requesting https://<url>/api/project/<project>/fleets/apply #2580

@un-def

Description

@un-def

Steps to reproduce

Server: 0.19.5 or lower
Client: 7e41dec

type: fleet
name: fleet-aws
nodes: 1
backends: [aws]
resources:
  cpu: 2..
  gpu: 0
  memory: 1GB..
  disk: 1GB..
DSTACK_CLI_LOG_LEVEL=DEBUG dstack apply -f fleet-aws.dstack.yml

Actual behaviour

[09:28:34] DEBUG    dstack.api.server:122 POST /api/project/un-def/fleets/apply
           DEBUG    dstack.api.server:135 Error requesting https://sky-stage.dstack.ai/api/project/un-def/fleets/apply. Status: 405. Headers:
                    {'Date': 'Tue, 29 Apr 2025 09:28:34 GMT', 'Content-Type': 'application/json', 'Content-Length': '31', 'Connection':
                    'keep-alive', 'server': 'uvicorn'}. Body: b'{"detail":"Method Not Allowed"}'
Unexpected error: status code 405 when requesting https://sky-stage.dstack.ai/api/project/un-def/fleets/apply. Check server logs or run with
DSTACK_CLI_LOG_LEVEL=DEBUG to see more details
           DEBUG    dstack._internal.cli.main:90 Unexpected error: status code 405 when requesting
                    https://sky-stage.dstack.ai/api/project/un-def/fleets/apply. Check server logs or run with DSTACK_CLI_LOG_LEVEL=DEBUG to
                    see more details
                    Traceback (most recent call last):
                      File "/home/def/dev/dstack/src/dstack/_internal/cli/main.py", line 87, in main
                        args.func(args)
                        ~~~~~~~~~^^^^^^
                      File "/home/def/dev/dstack/src/dstack/_internal/cli/commands/apply.py", line 128, in _command
                        configurator.apply_configuration(
                        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
                            conf=configuration,
                            ^^^^^^^^^^^^^^^^^^^
                        ...<4 lines>...
                            repo=repo,
                            ^^^^^^^^^^
                        )
                        ^
                      File "/home/def/dev/dstack/src/dstack/_internal/cli/services/configurators/fleet.py", line 121, in apply_configuration
                        fleet = _apply_plan(self.api, plan)
                      File "/home/def/dev/dstack/src/dstack/_internal/cli/services/configurators/fleet.py", line 366, in _apply_plan
                        return api.client.fleets.apply_plan(
                               ~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
                            project_name=api.project,
                            ^^^^^^^^^^^^^^^^^^^^^^^^^
                            plan=plan,
                            ^^^^^^^^^^
                        )
                        ^
                      File "/home/def/dev/dstack/src/dstack/api/server/_fleets.py", line 49, in apply_plan
                        resp = self._request(f"/api/project/{project_name}/fleets/apply", body=body_json)
                      File "/home/def/dev/dstack/src/dstack/api/server/__init__.py", line 160, in _request
                        raise ClientError(
                        ...<3 lines>...
                        )
                    dstack._internal.core.errors.ClientError: Unexpected error: status code 405 when requesting
                    https://sky-stage.dstack.ai/api/project/un-def/fleets/apply. Check server logs or run with DSTACK_CLI_LOG_LEVEL=DEBUG to
                    see more details

Expected behaviour

No response

dstack version

7e41dec

Server logs

Additional information

No response

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingfleets

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions