Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dbt deps - symlink fails on windows (symbolic link privilege not held) #766

Closed
drewbanin opened this issue May 10, 2018 · 2 comments
Closed
Labels
bug Something isn't working

Comments

@drewbanin
Copy link
Contributor

drewbanin commented May 10, 2018

Via slack:

2018-05-09 15:52:04,681: Tracking: do not track
2018-05-09 15:52:04,692: Installing ../
2018-05-09 15:52:04,693:   Creating symlink to local dependency.
2018-05-09 15:52:04,693: Encountered an error:
2018-05-09 15:52:04,693: symbolic link privilege not held
2018-05-09 15:52:04,695: Traceback (most recent call last):
  File "c:\users\bene\appdata\local\programs\python\python36-32\lib\site-packages\dbt\main.py", line 41, in main
    results, succeeded = handle_and_check(args)
  File "c:\users\bene\appdata\local\programs\python\python36-32\lib\site-packages\dbt\main.py", line 85, in handle_and_check
    task, res = run_from_args(parsed)
  File "c:\users\bene\appdata\local\programs\python\python36-32\lib\site-packages\dbt\main.py", line 139, in run_from_args
    results = run_from_task(task, proj, parsed)
  File "c:\users\bene\appdata\local\programs\python\python36-32\lib\site-packages\dbt\main.py", line 147, in run_from_task
    result = task.run()
  File "c:\users\bene\appdata\local\programs\python\python36-32\lib\site-packages\dbt\task\deps.py", line 424, in run
    package.install(self.project)
  File "c:\users\bene\appdata\local\programs\python\python36-32\lib\site-packages\dbt\task\deps.py", line 272, in install
    dbt.clients.system.make_symlink(src_path, dest_path)
  File "c:\users\bene\appdata\local\programs\python\python36-32\lib\site-packages\dbt\clients\system.py", line 106, in make_symlink
    return os.symlink(source, link_path)
OSError: symbolic link privilege not held
  • Windows 10 Pro (developer mode enabled, can call mklink without elevated privileges)
  • Using powershell
  • dbt 10.0.0
  • It works in an admin shell

We should either fix this, or add an option to not create a symlink

@drewbanin drewbanin changed the title symlink fails on windows (symbolic link privilege not held) dbt deps - symlink fails on windows (symbolic link privilege not held) May 10, 2018
@drewbanin drewbanin added the bug Something isn't working label May 10, 2018
@drewbanin
Copy link
Contributor Author

Via Ben Edwards in Slack:

some other research that I have done, python's os.symlink will never work in windows unless run by an elevated user, even if the regular user can create symlinks (by enabling developer mode). The check in system.py only checks if the os supports symlink, which windows does, you just cant use it. A possible workaround I've seen is to detect windows, start a shell and call mklink from there.

@drewbanin
Copy link
Contributor Author

Merging with #778

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant