question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

wandb 10.x creates symlinks, which require administrator privileges on Windows

See original GitHub issue

wandb version: 10.7 Python version: 3.8.5 OS: Win 10

Problem

Since the upgrade to wandb10.x it started to create symlinks. This is inconvenient for Windows users, as requires to run my IDE (VS Code) with administrator privileges – few more clicks to do so.

Traceback

wandb: WARNING Symlinked 0 file into the W&B run directory, call wandb.save again to sync new files.
Traceback (most recent call last):
  File "c:/Users/Asus/Desktop/Garment-Pattern-Estimation/nn/train.py", line 129, in <module>
    trainer.fit(model)  # Magic happens here
  File "c:\Users\Asus\Desktop\Garment-Pattern-Estimation\nn\trainer.py", line 88, in fit
    start_epoch = self._start_experiment(model)
  File "c:\Users\Asus\Desktop\Garment-Pattern-Estimation\nn\trainer.py", line 154, in _start_experiment
    self.experiment.init_run(self.setup)
  File "c:\Users\Asus\Desktop\Garment-Pattern-Estimation\nn\experiment.py", line 48, in init_run
    wb.save(os.path.join(wb.run.dir, '*.json'))
  File "C:\Users\Asus\anaconda3\envs\Garments\lib\site-packages\wandb\sdk\wandb_run.py", line 919, in save
    os.symlink(abs_path, wandb_path)
OSError: [WinError 1314] A required privilege is not held by the client: 'C:\\Users\\Asus\\Desktop\\Garment-Pattern-Estimation\\wandb\\run-20201016_172608-2v7x9f8u\\files\\wandb-metadata.json' -> 'wandb\\run-20201016_172608-2v7x9f8u\\files\\wandb\\run-20201016_172608-2v7x9f8u\\files\\wandb-metadata.json'

Additional comment

I’m not entirely sure, but I have a suspicion that those symlinks are related to another issue – there is a strange subdirectory in the run directory files with a path like this MyProject/wandb/<rundirname>/files/wandb/<rundirname>/files (duplicate path??). This is also visible in the traceback final paths.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:15 (4 by maintainers)

github_iconTop GitHub Comments

3reactions
vanpeltcommented, Oct 16, 2020

A quick fix is to write the file a file directly into wandb.run.dir and then call save which will bypass the symlink. In a future release we’ll switch to copying instead of symlinking.

2reactions
ballochcommented, May 19, 2022

I am encountering this problem on linux, so its defintely not windows specific. This shouldn’t be closed, definitely still a bug. Occurs when code and logs are on a mounted drive:

Traceback (most recent call last):
  File "/datadrive/code/EngineLearning/rl_training.py", line 889, in <module>
    main(config_args)
  File "/datadrive/code/EngineLearning/rl_training.py", line 877, in main
    imagination_training(forward_model=forward_model,
  File "/datadrive/code/EngineLearning/rl_training.py", line 666, in imagination_training
    continue_training_real = collect_real_rollouts(
  File "/datadrive/code/EngineLearning/rl_training.py", line 452, in collect_real_rollouts
    if callback.on_step() is False:
  File "/home/balloch/miniconda3/envs/engine_env/lib/python3.8/site-packages/stable_baselines3/common/callbacks.py", line 88, in on_step
    return self._on_step()
  File "/home/balloch/miniconda3/envs/engine_env/lib/python3.8/site-packages/stable_baselines3/common/callbacks.py", line 192, in _on_step
    continue_training = callback.on_step() and continue_training
  File "/home/balloch/miniconda3/envs/engine_env/lib/python3.8/site-packages/stable_baselines3/common/callbacks.py", line 88, in on_step
    return self._on_step()
  File "/home/balloch/miniconda3/envs/engine_env/lib/python3.8/site-packages/wandb/integration/sb3/sb3.py", line 117, in _on_step
    self.save_model()
  File "/home/balloch/miniconda3/envs/engine_env/lib/python3.8/site-packages/wandb/integration/sb3/sb3.py", line 126, in save_model
    wandb.save(self.path, base_path=self.model_save_path)
  File "/home/balloch/miniconda3/envs/engine_env/lib/python3.8/site-packages/wandb/sdk/wandb_run.py", line 1422, in save
    os.symlink(abs_path, wandb_path)
PermissionError: [Errno 1] Operation not permitted: '/datadrive/wandb_tmp/model.zip' -> './logs/wandb/run-20220519_024813-1m4f5zi2/files/model.zip'

Read more comments on GitHub >

github_iconTop Results From Across the Web

wandb 10.x creates symlinks, which require administrator ...
This is inconvenient for Windows users, as requires to run my IDE (VS Code) with administrator privileges -- few more clicks to do...
Read more >
Privlege error trying to create symlink using python on ...
To create a symbolic link, you need to create the process using your ... Do this by right-clicking and selecting "Run as administrator"....
Read more >
enable Windows user to create symbolic links
A Windows user may not have permissions to create symbolic (soft) links, and Python >= 3.8 may be required.
Read more >
6 Ways to Fix A Required Privilege Is Not Held By The Client ...
Method 1: Run the Program as Administrator · Run the application with Administrative privelegs · Method 2: Use Command Prompt to copy the...
Read more >
Enabling Symlinks on Windows - Perforce
Enabling Symlinks on Windows when using Helix Core clients. ... The user must be given the "Create Symbolic Links" privilege or be in...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found