Skip to content

bug: moving an HTTP route only creates a copy, does not delete the old route #8014

@lubu0

Description

@lubu0

Describe the bug

When moving (renaming the path of) an existing HTTP route via the Windmill web UI and then syncing with wmill sync pull or a Git sync pipeline, the old route file is not deleted from the local/git filesystem. This results in duplicate HTTP trigger definitions.

Pushing back to Windmill (via wmill sync push or a CI/CD pipeline) then fails with an ApiError because the original route still exists:

Bad request: A route already exists with this path

Example error from our pipeline

Creating new http trigger: f/endpoints/example_route
Bad request: A route already exists with this path
Server failed. Bad Request: Bad request: A route already exists with this path
file:///usr/local/lib/node_modules/windmill-cli/esm/gen/core/request.js:249
        throw new ApiError(options, result, error);
              ^
ApiError: Bad Request
    at catchErrorCodes (file:///usr/local/lib/node_modules/windmill-cli/esm/gen/core/request.js:249:15)
    at file:///usr/local/lib/node_modules/windmill-cli/esm/gen/core/request.js:297:17
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5) {
  url: 'https://xxx/api/w/xxx/http_triggers/create',
  status: 400,
  statusText: 'Bad Request',
  body: 'Bad request: A route already exists with this path',
  request: {
    method: 'POST',
    url: '/w/{workspace}/http_triggers/create',
    path: { workspace: 'xxx' },
    body: {
      summary: '',
      description: '',
      authentication_method: 'api_key',
      authentication_resource_path: 'f/endpoints',
      email: 'xxx',
      http_method: 'post',
      is_flow: false,
      is_static_website: false,
      mode: 'enabled',
      raw_string: false,
      request_type: 'sync',
      route_path: 'connection_test',
      route_path_key: 'connection_test',
      script_path: 'u/tests/test_connection',
      static_asset_config: null,
      workspaced_route: false,
      wrap_body: false,
      path: 'f/endpoints/example_route'
    },
    mediaType: 'application/json'
  }
}
Node.js v20.20.0

To reproduce

Prerequisite: Have an existing HTTP route configured in Windmill.

  1. Navigate to Custom HTTP Routes in the Windmill frontend.
  2. Change the path of a route (i.e. move the http_trigger.yaml to a new location) and save.
  3. Run wmill sync pull or trigger a Git sync — observe that both the old and the new http_trigger.yaml files now exist locally/in Git.
  4. Push back to Windmill via wmill sync push or a CI/CD pipeline, the sync fails with ApiError: Bad request: A route already exists with this path.

Expected behavior

When a route is moved/renamed in the web UI, the old HTTP trigger definition should be deleted so that a subsequent sync pull only contains the new route, and a round-trip push does not produce duplicates.

Screenshots

No response

Browser information

No response

Application version

Windmill EE v1.634.3

Additional Context

No response

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions