Zplug: Operation Not permitted, when installing zplug plugins on windows subsystem for linux (WSL)

Created on 25 Apr 2017  路  5Comments  路  Source: zplug/zplug

  • Type:

    • [x] Bug

    • [ ] Enhancement

    • [ ] Feature Request

    • [ ] Question


  • zplug --version: 2.4.1
  • zsh --version: zsh 5.1.1 (x86_64-ubuntu-linux-gnu)
  • uname -a: Linux DESKTOP-A4D1L39 4.4.0-43-Microsoft #1-Microsoft Wed Dec 31 14:42:53 PST 2014 x86_64 x86_64 x86_64 GNU/Linux

Minimal zshrc (with less than 30 lines)

My clean .zshrc (this works)

export ZSH_DIR="${XDG_CONFIG_HOME}/zsh"                                                                      

if [[ ! -d ~/.zplug ]]; then                              
  git clone https://github.com/zplug/zplug ~/.zplug       
fi

source ~/.zplug/init.zsh                                  

#zplug 'zplug/zplug', hook-build:'zplug --self-manage'    
#zplug "rupa/z", use:z.sh

if zplug check --verbose || zplug install; then           
  zplug load --verbose                                    
fi                                                        

output when running zsh

shawn@DESKTOP-A4D1L39:~/.config/zsh$ zsh
[zplug] Loaded from cache (/home/shawn/.zplug/cache)
[zplug] Run compinit

Step to reproduce

simply uncomment the rupa/z repo, though this triggers with any plugin i have tried.

shawn@DESKTOP-A4D1L39:~/.config/zsh$ zsh
__load__:47: nice(5) failed: operation not permitted
 Load "~/.zplug/repos/rupa/z/z.sh" (rupa/z)
[zplug] Run compinit
_z_precmd:1: nice(5) failed: operation not permitted

when loading multiple plugins, typically more than 3 at a time, it just stalls after the first operation not permitted. If I ctrl-c out of it, the terminal is broken with no history. exiting, and running zsh again will have the same issues. if i only have a few plugins it will go through to the zsh shell. It seems to actually download the plugins until it stalls.

here is the last handful of lines in my ~/.zplug/log/trace.log

{"pid":6212,"shlvl":2,"level":"INFO","dir":"/home/shawn/.config/zsh","message":"turn monitor on","trace":["__zplug::log::write::info:2","__zplug::job::polling::periodic:9","zsh:1"],"date":"2017-04-21T20:24:43-0700"}
{"pid":8473,"shlvl":2,"level":"INFO","dir":"/home/shawn/.config/zsh","message":"ZPLUG_LOADFILE is not found","trace":["__zplug::log::write::info:2","__zplug::io::file::load:3","/home/shawn/.zplug/init.zsh:33","sourceMe:1","/home/shawn/.config/zsh/zplug_init.zsh:5","sourceMe:1","/home/shawn/.zshrc:15","zsh:0"],"date":"2017-04-21T21:04:03-0700"}
{"pid":8473,"shlvl":2,"level":"ERROR","dir":"/home/shawn/.zplug/repos/robbyrussell/oh-my-zsh","message":"error: Unable to open .git/HEAD.lock for writing","trace":["__zplug::log::capture::error:8","__zplug::utils::git::checkout:45","__zplug::core::cache::plugins:10","__load__:52","__zplug::core::core::run_interfaces:14","zplug:12","/home/shawn/.zshrc:29","zsh:0"],"date":"2017-04-21T21:04:15-0700"}
{"pid":8473,"shlvl":2,"level":"ERROR","dir":"/home/shawn/.zplug/repos/robbyrussell/oh-my-zsh","message":"fatal: Unable to create '/home/shawn/.zplug/repos/robbyrussell/oh-my-zsh/.git/index.lock': File exists.\n\nIf no other git process is currently running, this probably means a\ngit process crashed in this repository earlier. Make sure no other git\nprocess is running and remove the file manually to continue.","trace":["__zplug::log::capture::error:8","__zplug::utils::git::checkout:45","__zplug::core::cache::plugins:10","__load__:52","__zplug::core::core::run_interfaces:14","zplug:12","/home/shawn/.zshrc:29","zsh:0"],"date":"2017-04-21T21:04:15-0700"}
{"pid":8473,"shlvl":2,"level":"ERROR","dir":"/home/shawn/.zplug/repos/robbyrussell/oh-my-zsh","message":"fatal: Unable to create '/home/shawn/.zplug/repos/robbyrussell/oh-my-zsh/.git/index.lock': File exists.\n\nIf no other git process is currently running, this probably means a\ngit process crashed in this repository earlier. Make sure no other git\nprocess is running and remove the file manually to continue.","trace":["__zplug::log::capture::error:8","__zplug::utils::git::checkout:45","__zplug::core::cache::plugins:10","__load__:52","__zplug::core::core::run_interfaces:14","zplug:12","/home/shawn/.zshrc:29","zsh:0"],"date":"2017-04-21T21:04:15-0700"}
{"pid":8473,"shlvl":2,"level":"INFO","dir":"/home/shawn/.config/zsh","message":"turn monitor on","trace":["__zplug::log::write::info:2","__zplug::job::polling::periodic:9","zsh:1"],"date":"2017-04-21T22:15:32-0700"}
{"pid":10537,"shlvl":2,"level":"INFO","dir":"/home/shawn/.config/zsh","message":"ZPLUG_LOADFILE is not found","trace":["__zplug::log::write::info:2","__zplug::io::file::load:3","/home/shawn/.zplug/init.zsh:33","sourceMe:1","/home/shawn/.config/zsh/zplug_init.zsh:5","sourceMe:1","/home/shawn/.zshrc:15","zsh:0"],"date":"2017-04-21T22:15:42-0700"}
{"pid":10537,"shlvl":2,"level":"ERROR","dir":"/home/shawn/.zplug/repos/robbyrussell/oh-my-zsh","message":"error: Unable to open .git/HEAD.lock for writing","trace":["__zplug::log::capture::error:8","__zplug::utils::git::checkout:45","__zplug::core::cache::plugins:10","__load__:52","__zplug::core::core::run_interfaces:14","zplug:12","/home/shawn/.zshrc:29","zsh:0"],"date":"2017-04-21T22:15:48-0700"}
{"pid":10537,"shlvl":2,"level":"INFO","dir":"/home/shawn/.config/zsh","message":"turn monitor on","trace":["__zplug::log::write::info:2","__zplug::job::polling::periodic:9","zsh:1"],"date":"2017-04-21T22:16:37-0700"}
{"pid":12304,"shlvl":2,"level":"INFO","dir":"/mnt/c/Users/smcelroy","message":"ZPLUG_LOADFILE is not found","trace":["__zplug::log::write::info:2","__zplug::io::file::load:3","/home/shawn/.zplug/init.zsh:33","sourceMe:1","/home/shawn/.config/zsh/zplug_init.zsh:5","sourceMe:1","/home/shawn/.zshrc:15","zsh:0"],"date":"2017-04-21T22:16:47-0700"}
{"pid":12304,"shlvl":2,"level":"ERROR","dir":"/home/shawn/.zplug/repos/robbyrussell/oh-my-zsh","message":"fatal: Unable to create '/home/shawn/.zplug/repos/robbyrussell/oh-my-zsh/.git/index.lock': File exists.\n\nIf no other git process is currently running, this probably means a\ngit process crashed in this repository earlier. Make sure no other git\nprocess is running and remove the file manually to continue.","trace":["__zplug::log::capture::error:8","__zplug::utils::git::checkout:45","__zplug::core::cache::plugins:10","__load__:52","__zplug::core::core::run_interfaces:14","zplug:12","/home/shawn/.zshrc:29","zsh:0"],"date":"2017-04-21T22:16:53-0700"}
{"pid":12304,"shlvl":2,"level":"INFO","dir":"/mnt/c/Users/smcelroy","message":"turn monitor on","trace":["__zplug::log::write::info:2","__zplug::job::polling::periodic:9","zsh:1"],"date":"2017-04-22T23:56:13-0700"}
{"pid":24,"shlvl":2,"level":"INFO","dir":"/mnt/c/Users/smcelroy","message":"ZPLUG_LOADFILE is not found","trace":["__zplug::log::write::info:2","__zplug::io::file::load:3","/home/shawn/.zplug/init.zsh:33","sourceMe:1","/home/shawn/.config/zsh/zplug_init.zsh:5","sourceMe:1","/home/shawn/.zshrc:15","zsh:0"],"date":"2017-04-25T08:22:26-0700"}
{"pid":24,"shlvl":2,"level":"ERROR","dir":"/home/shawn/.zplug/repos/robbyrussell/oh-my-zsh","message":"fatal: Unable to create '/home/shawn/.zplug/repos/robbyrussell/oh-my-zsh/.git/index.lock': File exists.\n\nIf no other git process is currently running, this probably means a\ngit process crashed in this repository earlier. Make sure no other git\nprocess is running and remove the file manually to continue.","trace":["__zplug::log::capture::error:8","__zplug::utils::git::checkout:45","__zplug::core::cache::plugins:10","__load__:52","__zplug::core::core::run_interfaces:14","zplug:12","/home/shawn/.zshrc:29","zsh:0"],"date":"2017-04-25T08:22:32-0700"}
{"pid":24,"shlvl":2,"level":"ERROR","dir":"/home/shawn/.zplug/repos/robbyrussell/oh-my-zsh","message":"fatal: Unable to create '/home/shawn/.zplug/repos/robbyrussell/oh-my-zsh/.git/index.lock': File exists.\n\nIf no other git process is currently running, this probably means a\ngit process crashed in this repository earlier. Make sure no other git\nprocess is running and remove the file manually to continue.","trace":["__zplug::log::capture::error:8","__zplug::utils::git::checkout:45","__zplug::core::cache::plugins:10","__load__:52","__zplug::core::core::run_interfaces:14","zplug:12","/home/shawn/.zshrc:29","zsh:0"],"date":"2017-04-25T08:22:32-0700"}
{"pid":24,"shlvl":2,"level":"ERROR","dir":"/home/shawn/.zplug/repos/robbyrussell/oh-my-zsh","message":"fatal: Unable to create '/home/shawn/.zplug/repos/robbyrussell/oh-my-zsh/.git/index.lock': File exists.\n\nIf no other git process is currently running, this probably means a\ngit process crashed in this repository earlier. Make sure no other git\nprocess is running and remove the file manually to continue.","trace":["__zplug::log::capture::error:8","__zplug::utils::git::checkout:45","__zplug::core::cache::plugins:10","__load__:52","__zplug::core::core::run_interfaces:14","zplug:12","/home/shawn/.zshrc:29","zsh:0"],"date":"2017-04-25T08:22:32-0700"}
{"pid":24,"shlvl":2,"level":"ERROR","dir":"/home/shawn/.zplug/repos/robbyrussell/oh-my-zsh","message":"fatal: Unable to create '/home/shawn/.zplug/repos/robbyrussell/oh-my-zsh/.git/index.lock': File exists.\n\nIf no other git process is currently running, this probably means a\ngit process crashed in this repository earlier. Make sure no other git\nprocess is running and remove the file manually to continue.","trace":["__zplug::log::capture::error:8","__zplug::utils::git::checkout:45","__zplug::core::cache::plugins:10","__load__:52","__zplug::core::core::run_interfaces:14","zplug:12","/home/shawn/.zshrc:29","zsh:0"],"date":"2017-04-25T08:22:32-0700"}
{"pid":24,"shlvl":2,"level":"INFO","dir":"/mnt/c/Users/smcelroy","message":"turn monitor on","trace":["__zplug::log::write::info:2","__zplug::job::polling::periodic:9","zsh:1"],"date":"2017-04-25T08:25:49-0700"}
{"pid":1774,"shlvl":2,"level":"INFO","dir":"/mnt/c/Users/smcelroy","message":"ZPLUG_LOADFILE is not found","trace":["__zplug::log::write::info:2","__zplug::io::file::load:3","/home/shawn/.zplug/init.zsh:33","sourceMe:1","/home/shawn/.config/zsh/zplug_init.zsh:5","sourceMe:1","/home/shawn/.zshrc:15","zsh:0"],"date":"2017-04-25T08:26:04-0700"}
{"pid":1774,"shlvl":2,"level":"INFO","dir":"/mnt/c/Users/smcelroy","message":"turn monitor on","trace":["__zplug::log::write::info:2","__zplug::job::polling::periodic:9","zsh:1"],"date":"2017-04-25T08:26:08-0700"}
{"pid":495,"shlvl":2,"level":"INFO","dir":"/home/shawn/.config/zsh","message":"ZPLUG_LOADFILE is not found","trace":["__zplug::log::write::info:2","__zplug::io::file::load:3","/home/shawn/.zplug/init.zsh:33","sourceMe:1","/home/shawn/.config/zsh/zplug_init.zsh:8","sourceMe:1","/home/shawn/.zshrc:15","zsh:0"],"date":"2017-04-25T08:48:04-0700"}
{"pid":495,"shlvl":2,"level":"INFO","dir":"/home/shawn/.config/zsh","message":"turn monitor on","trace":["__zplug::log::write::info:2","__zplug::job::polling::periodic:9","zsh:1"],"date":"2017-04-25T08:48:06-0700"}
{"pid":601,"shlvl":2,"level":"INFO","dir":"/home/shawn/.config/zsh","message":"ZPLUG_LOADFILE is not found","trace":["__zplug::log::write::info:2","__zplug::io::file::load:3","/home/shawn/.zplug/init.zsh:33","/home/shawn/.zshrc:22","zsh:0"],"date":"2017-04-25T08:55:10-0700"}
{"pid":601,"shlvl":2,"level":"INFO","dir":"/home/shawn/.config/zsh","message":"turn monitor on","trace":["__zplug::log::write::info:2","__zplug::job::polling::periodic:9","zsh:1"],"date":"2017-04-25T08:55:11-0700"}
{"pid":677,"shlvl":2,"level":"INFO","dir":"/home/shawn/.config/zsh","message":"ZPLUG_LOADFILE is not found","trace":["__zplug::log::write::info:2","__zplug::io::file::load:3","/home/shawn/.zplug/init.zsh:33","/home/shawn/.zshrc:22","zsh:0"],"date":"2017-04-25T08:58:11-0700"}
{"pid":677,"shlvl":2,"level":"INFO","dir":"/home/shawn/.config/zsh","message":"turn monitor on","trace":["__zplug::log::write::info:2","__zplug::job::polling::periodic:9","zsh:1"],"date":"2017-04-25T08:58:13-0700"}

I see there is a ZPLUG_LOADFILE error but it seems to exist. I am also not sure why it is trying to access files on the host windows machines mount at /mnt/c/Users/smcelroy/.... My zsh and .config directories are not links in the wsl image. they are full copies.

Most helpful comment

Create ~/.zshenv or edit /etc/zsh/zshenv and add the lines below:

# See https://github.com/Microsoft/BashOnWindows/issues/1887
unsetopt BG_NICE

All 5 comments

Ok so i have found the issue. It is actually a bug on the WSL. I am keeping this issue in tact in case others search for it. wasnt an easy issue to track down.

Found it here:
https://github.com/rupa/z/pull/200

which links to the main WSL issue, here
https://github.com/Microsoft/BashOnWindows/issues/1887

Create ~/.zshenv or edit /etc/zsh/zshenv and add the lines below:

# See https://github.com/Microsoft/BashOnWindows/issues/1887
unsetopt BG_NICE

@simnalamburt that seems to have rectified the error, but for me has not solved the problem, only made install fail less verbosely.

@autoferrit Am I grokking this correctly: there basically is no support for remote/github package installation via zplug on Ubuntu Bash for Windows?

also having this problem!

+1

Was this page helpful?
0 / 5 - 0 ratings

Related issues

tangkunyin picture tangkunyin  路  10Comments

grexe picture grexe  路  3Comments

jottr picture jottr  路  6Comments

bootleq picture bootleq  路  3Comments

asymmetric picture asymmetric  路  11Comments