+
Skip to content

feature: Limit "Failed to create symlink to 'meltano.exe'" warning on Windows #9039

@iamlorax

Description

@iamlorax

Feature scope

CLI (options, error messages, logging, etc.)

Description

Any time a non-administrator user runs any meltano command on Windows, the warning below appears.

2025-01-21T17:44:43.696439Z [warning ] Failed to create symlink to 'meltano.exe': administrator privilege required

try:
# check if running on Windows
if os.name == "nt":
executable = Path(sys.executable).parent / "meltano.exe"
# Admin privileges are required to create symlinks on Windows
if ctypes.windll.shell32.IsUserAnAdmin(): # type: ignore[attr-defined]
if executable.is_file():
project.run_dir().joinpath("bin").symlink_to(executable)
else:
logger.warning(
"Could not create symlink: meltano.exe not " # noqa: G004
f"present in {Path(sys.executable).parent!s}",
)
else:
logger.warning(
"Failed to create symlink to 'meltano.exe': "
"administrator privilege required",
)

In my experience, the inability to create the symlink does not affect the users ability to use the meltano CLI. It would be nice to limit how this is shown because it implies there are a serious issue but provides no resolution steps.

Possible solutions:

  • Set it to log at DEBUG instead of WARNING
  • Provide a config to suppress the warning that is referenced in the warning
  • Other?

Metadata

Metadata

Assignees

No one assigned

    Type

    Projects

    Status

    To Discuss

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      点击 这是indexloc提供的php浏览器服务,不要输入任何密码和下载