Skip to content

Bug: Web UI can't load files in the editor view on Windows #5945

Description

@psztt
  • sqlmesh ui starts but when a file is clicked in the editor view, the main are shows "File Not Found" instead of the editor.
  • There is an easy fix.
  • Neither the webserver console nor the browser console show any errors.
  • Probably only applies to Windows.

Browser console:

[START TIMEOUT] /api/files -> models/mymodel.sql id: 221 at 1786037258714 [index-Dj0i1-CA.js:58:49854](http://127.0.0.1:8000/assets/index-Dj0i1-CA.js)
[CLEAR TIMEOUT] /api/files -> models/mymodel.sql id: undefined at 1786037258804 [index-Dj0i1-CA.js:58:49702](http://127.0.0.1:8000/assets/index-Dj0i1-CA.js)
[REQUEST COMPLETED] /api/files -> models/mymodel.sql completed at 1786037258804

Web server console

INFO:     127.0.0.1:61391 - "GET /api/files/models/mymodel.sql HTTP/1.1" 200 OK

The data-catalog works properly.

Fix

I know that the UI is deprecated, but the fix is pretty trivial, so probably worth fixing.

  • Path: /web/server/api/endpoints/files.py
  • Funtion: get_file
file = _get_file_with_content(settings.project_path / file_path, str(file_path))

just needs to be changed to

file = _get_file_with_content(settings.project_path / file_path, file_path.as_posix())

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