GVKun编程网logo

npm install 报错(npm ERR! errno -4048,Error: EPERM: operation not permitted,)解决方法

13

针对npminstall报错和npmERR!errno-4048,Error:EPERM:operationnotpermitted,解决方法这两个问题,本篇文章进行了详细的解答,同时本文还将给你拓展

针对npm install 报错npm ERR! errno -4048,Error: EPERM: operation not permitted,解决方法这两个问题,本篇文章进行了详细的解答,同时本文还将给你拓展cephfs:报错 librados: client.admin authentication error (1) Operation not permitted、cephfs:报错librados: client.bootstrap-osd authentication error (1) Operation not permitted、Could not install packages due to an Environment Error: [Errno 13] Permission denied 解决方案、docker strace ptrace 报错 Operation not permitted 解决方法等相关知识,希望可以帮助到你。

本文目录一览:

npm install 报错(npm ERR! errno -4048,Error: EPERM: operation not permitted,)解决方法

npm install 报错(npm ERR! errno -4048,Error: EPERM: operation not permitted,)解决方法

npm ERR! path E:\SouthernPowerGridProject\web_project\AutoOPS\autoops\node_modules\fsevents\node_modules\dashdash\node_modules
npm ERR! code EPERM
npm ERR! errno -4048
npm ERR! syscall scandir
npm ERR! Error: EPERM: operation not permitted, scandir ''E:\SouthernPowerGridProject\web_project\AutoOPS\autoops\node_modules\fsevents\node_modules\dashdash\node_modules''
npm ERR!  { Error: EPERM: operation not permitted, scandir ''E:\SouthernPowerGridProject\web_project\AutoOPS\autoops\node_modules\fsevents\node_modules\dashdash\node_modules''
npm ERR!   stack: ''Error: EPERM: operation not permitted, scandir \''E:\\SouthernPowerGridProject\\web_project\\AutoOPS\\autoops\\node_modules\\fsevents\\node_modules\\dashdash\\node_modules\'''',
npm ERR!   errno: -4048,
npm ERR!   code: ''EPERM'',
npm ERR!   syscall: ''scandir'',
npm ERR!   path: ''E:\\SouthernPowerGridProject\\web_project\\AutoOPS\\autoops\\node_modules\\fsevents\\node_modules\\dashdash\\node_modules'' }
npm ERR!
npm ERR! Please try running this command again as root/Administrator.


npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\ThinkT420\AppData\Roaming\npm-cache\_logs\2017-10-30T06_50_38_610Z-debug.log



之前有时报这个,以为还真是权限不够,感觉有点奇怪,用管理员权限执行,有时还真有用,不过后面查了下,时缓存的问题,清理下缓存就行,不用管理员权限。

方法1、

 

需要删除npmrc文件。

强调:不是nodejs安装目录npm模块下的那个npmrc文件

而是在C:\Users\{账户}\下的.npmrc文件..

方法2、

或者直接用命令清理就行,控制台输入:

npm cache clean --force



added 114 packages in 42.369s
E:\SouthernPowerGridProject\web_project\AutoOPS\autoops>npm cache clean --force
npm WARN using --force I sure hope you know what you are doing.


E:\SouthernPowerGridProject\web_project\AutoOPS\autoops>npm install
npm notice created a lockfile as package-lock.json. You should commit this file.
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.1.2 (node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.1.2: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})


added 114 packages in 42.369s

成功了

cephfs:报错 librados: client.admin authentication error (1) Operation not permitted

cephfs:报错 librados: client.admin authentication error (1) Operation not permitted

执行:ceph -s
2019-10-08 13:52:46.535872 7fb77dc6e700  0 librados: client.admin authentication error (1) Operation not permitted
Error connecting to cluster: PermissionError
[root@node2 ceph]# ceph -s
2019-10-08 15:40:25.631076 7f5f2158c700  0 librados: client.admin authentication error (13) Permission denied
Error connecting to cluster: PermissionDeniedError
[root@node2 ceph]#

 

》(1)ceph -s 的完整命令是:
ceph -s --conf /etc/ceph/ceph.conf --name client.admin --keyring /etc/ceph/ceph.client.admin.keyring
说明此时 client.admin 使用的 key 跟 monitor 记录的 key 不同。
此时可用 monitor 查询 ceph -s,命令如下:
ceph -s --name mon. --keyring /var/lib/ceph/mon/ceph-node2/keyring  

(2)在 montor 上查询 key:

ceph -s --name mon. --keyring /var/lib/ceph/mon/ceph-node2/keyring  #查询 monitor 的 key
ceph auth get client.admin --name mon. --keyring /var/lib/ceph/mon/ceph-node2/keyring   #查询 client 的 key
[root@node2 ceph]# ceph auth get client.admin --name mon. --keyring /var/lib/ceph/mon/ceph-node2/keyring
exported keyring for client.admin
[client.admin]
        key = AQCSJJxdFjCEORAAMv2j2dtkqswcW1BYfh2H2A==
[root@node2 ceph]#

(3) 将查询到的 client 命令写入:/etc/ceph/ceph.client.admin.keyring 文件,并增加 "r" 权限:

[root@node2 ceph]# cat /etc/ceph/ceph.client.admin.keyring 
[client.admin]
        key = AQCSJJxdFjCEORAAMv2j2dtkqswcW1BYfh2H2A==
        caps mds = "allow *"
        caps mon = "allow *"
        caps osd = "allow *"
[root@node2 ceph]# 
[root@node2 ceph]# ll /etc/ceph/ceph.client.admin.keyring  
-rw-r--r-- 1 root root 129 Oct  8 14:58 /etc/ceph/ceph.client.admin.keyring
[root@node2 ceph]# 

(4) 执行 ceph -s,若还报错,则使用 mon 用户会 client 增加权限:

ceph -n mon. --keyring /var/lib/ceph/mon/ceph-node2/keyring auth caps client.admin mds ''allow *'' osd ''allow *'' mon ''allow *''
 
(5) 此操作后,数据会丢失
[root@node2 ceph]# ceph -s
    cluster 4c137c64-9e09-410e-aee4-c04b0f46294e
     health HEALTH_ERR
            64 pgs are stuck inactive for more than 300 seconds
            64 pgs stuck inactive
            64 pgs stuck unclean
            no osds
     monmap e3: 1 mons at {node2=172.16.18.22:6789/0}
            election epoch 28, quorum 0 node2
     osdmap e1: 0 osds: 0 up, 0 in
            flags sortbitwise,require_jewel_osds
      pgmap v2: 64 pgs, 1 pools, 0 bytes data, 0 objects
            0 kB used, 0 kB / 0 kB avail
                  64 creating
[root@node2 ceph]# 
[root@node2 ceph]# 
[root@node2 ceph]# ceph osd tree
ID WEIGHT TYPE NAME    UP/DOWN REWEIGHT PRIMARY-AFFINITY 
-1      0 root default                                   
[root@node2 ceph]# 

 

 

cephfs:报错librados: client.bootstrap-osd authentication error (1) Operation not permitted

cephfs:报错librados: client.bootstrap-osd authentication error (1) Operation not permitted

 

激活osd时(ceph-deploy osd activate node1:/dev/sdm1)报错

[node1][WARNIN] command: Running command: /usr/bin/ceph --cluster ceph --name client.bootstrap-osd --keyring /var/lib/ceph/bootstrap-osd/ceph.keyring osd create --concise cf831c2a-aa3d-477a-bdea-5925dbf5acf3
[node1][WARNIN] mount_activate: Failed to activate
[node1][WARNIN] unmount: Unmounting /var/lib/ceph/tmp/mnt.qH1Byn
[node1][WARNIN] command_check_call: Running command: /bin/umount -- /var/lib/ceph/tmp/mnt.qH1Byn
[node1][WARNIN] Traceback (most recent call last):
[node1][WARNIN]   File "/usr/sbin/ceph-disk", line 9, in <module>
[node1][WARNIN]     load_entry_point(''ceph-disk==1.0.0'', ''console_scripts'', ''ceph-disk'')()
[node1][WARNIN]   File "/usr/lib/python2.7/site-packages/ceph_disk/main.py", line 5361, in run
[node1][WARNIN]     main(sys.argv[1:])
[node1][WARNIN]   File "/usr/lib/python2.7/site-packages/ceph_disk/main.py", line 5312, in main
[node1][WARNIN]     args.func(args)
[node1][WARNIN]   File "/usr/lib/python2.7/site-packages/ceph_disk/main.py", line 3435, in main_activate
[node1][WARNIN]     reactivate=args.reactivate,
[node1][WARNIN]   File "/usr/lib/python2.7/site-packages/ceph_disk/main.py", line 3192, in mount_activate
[node1][WARNIN]     (osd_id, cluster) = activate(path, activate_key_template, init)
[node1][WARNIN]   File "/usr/lib/python2.7/site-packages/ceph_disk/main.py", line 3355, in activate
[node1][WARNIN]     keyring=keyring,
[node1][WARNIN]   File "/usr/lib/python2.7/site-packages/ceph_disk/main.py", line 1018, in allocate_osd_id
[node1][WARNIN]     raise Error(''ceph osd create failed'', e, e.output)
[node1][WARNIN] ceph_disk.main.Error: Error: ceph osd create failed: Command ''/usr/bin/ceph'' returned non-zero exit status 1: 2019-10-09 16:26:13.892829 7fe600bed700  0 librados: client.bootstrap-osd authentication error (1) Operation not permitted
[node1][WARNIN] Error connecting to cluster: PermissionError
[node1][WARNIN] 
[node1][ERROR ] RuntimeError: command returned non-zero exit status: 1
[ceph_deploy][ERROR ] RuntimeError: Failed to execute command: /usr/sbin/ceph-disk -v activate --mark-init systemd --mount /dev/sdm1

》1.

[root@node2 ceph-cluster]# ceph auth get client.bootstrap-osd --name mon. --keyring /var/lib/ceph/mon/ceph-node2/keyring
exported keyring for client.bootstrap-osd
[client.bootstrap-osd]
        key = AQAnVp1dBC6mKhAAzw0817xQOHZhnz0jPzwxEQ==
        caps mds = "allow *"
        caps mon = "allow *"
        caps osd = "allow *"
[root@node2 ceph-cluster]#

2、修改对应server上的/var/lib/ceph/bootstrap-osd/ceph.keyring文件为上面查到的内容

3、重新激活osd

 

Could not install packages due to an Environment Error: [Errno 13] Permission denied 解决方案

Could not install packages due to an Environment Error: [Errno 13] Permission denied 解决方案

执行 pip install 报错如下:

Could not install packages due to an Environment Error: [Errno 13] Permission denied: ''/usr/local/lib/python3.5/dist-packages/kiwisolver.cpython-35m-x86_64-linux-gnu.so'' Consider using the `--user` option or check the permissions.

 

解决方案:

Linux / macOS

From your terminal, you can install the package for your user only, like this:

pip install <package> --user

OR

You can use su or sudo from your terminal, to install the package as root:

sudo pip install <package>

Windows

From the Command Prompt, you can install the package for your user only, like this:

pip install <package> --user

OR

You can install the package as Administrator, by following these steps:

  1. Right click on the Command Prompt icon.
  2. Select the option Run This Program As An Administrator.
  3. Run the command pip install <package>

 

docker strace ptrace 报错 Operation not permitted 解决方法

docker strace ptrace 报错 Operation not permitted 解决方法

docker中gdb在进行进程debug时,会报错:

(gdb) attach 30721
Attaching to process 30721

ptrace: Operation not permitted.

原因就是因为ptrace被Docker默认禁止的问题。考虑到应用分析的需要,可以有以下几种方法解决:

1、关闭seccomp

docker run --security-opt seccomp=unconfined 

2、采用超级权限模式

docker run --privileged

3、仅开放ptrace限制

docker run --cap-add sys_ptrace 

当然从安全角度考虑,如只是想使用gdb进行debug的话,建议使用第三种。

安全计算模式(secure computing mode,seccomp)是 Linux 内核功能,可以使用它来限制容器内可用的操作。

Docker 的默认 seccomp 配置文件是一个白名单,它指定了允许的调用。

下表列出了由于不在白名单而被有效阻止的重要(但不是全部)系统调用。该表包含每个系统调用被阻止的原因。

Syscall Description
acct Accounting syscall which Could let containers disable their own resource limits or process accounting. Also gated by CAP_SYS_PACCT.
add_key Prevent containers from using the kernel keyring,which is not namespaced.
adjtimex Similar to clock_settime and settimeofday,time/date is not namespaced. Also gated by CAP_SYS_TIME.
bpf Deny loading potentially persistent bpf programs into kernel,already gated by CAP_SYS_ADMIN.
clock_adjtime Time/date is not namespaced. Also gated by CAP_SYS_TIME.
clock_settime Time/date is not namespaced. Also gated by CAP_SYS_TIME.
clone Deny cloning new namespaces. Also gated by CAP_SYS_ADMIN for CLONE_* flags,except CLONE_USERNS.
create_module Deny manipulation and functions on kernel modules. Obsolete. Also gated by CAP_SYS_MODULE.
delete_module Deny manipulation and functions on kernel modules. Also gated by CAP_SYS_MODULE.
finit_module Deny manipulation and functions on kernel modules. Also gated by CAP_SYS_MODULE.
get_kernel_syms Deny retrieval of exported kernel and module symbols. Obsolete.
get_mempolicy Syscall that modifies kernel memory and NUMA settings. Already gated by CAP_SYS_NICE.
init_module Deny manipulation and functions on kernel modules. Also gated by CAP_SYS_MODULE.
ioperm Prevent containers from modifying kernel I/O privilege levels. Already gated by CAP_SYS_RAWIO.
iopl Prevent containers from modifying kernel I/O privilege levels. Already gated by CAP_SYS_RAWIO.
kcmp Restrict process inspection capabilities,already blocked by dropping CAP_PTRACE.
kexec_file_load Sister syscall of kexec_load that does the same thing,slightly different arguments. Also gated by CAP_SYS_BOOT.
kexec_load Deny loading a new kernel for later execution. Also gated by CAP_SYS_BOOT.
keyctl Prevent containers from using the kernel keyring,which is not namespaced.
lookup_dcookie Tracing/profiling syscall,which Could leak a lot of information on the host. Also gated by CAP_SYS_ADMIN.
mbind Syscall that modifies kernel memory and NUMA settings. Already gated by CAP_SYS_NICE.
mount Deny mounting,already gated by CAP_SYS_ADMIN.
move_pages Syscall that modifies kernel memory and NUMA settings.
name_to_handle_at Sister syscall to open_by_handle_at. Already gated by CAP_SYS_NICE.
nfsservctl Deny interaction with the kernel nfs daemon. Obsolete since Linux 3.1.
open_by_handle_at Cause of an old container breakout. Also gated by CAP_DAC_READ_SEARCH.
perf_event_open Tracing/profiling syscall,which Could leak a lot of information on the host.
personality Prevent container from enabling BSD emulation. Not inherently dangerous,but poorly tested,potential for a lot of kernel vulns.
pivot_root Deny pivot_root,should be privileged operation.
process_vm_readv Restrict process inspection capabilities,already blocked by dropping CAP_PTRACE.
process_vm_writev Restrict process inspection capabilities,already blocked by dropping CAP_PTRACE.
ptrace Tracing/profiling syscall,which Could leak a lot of information on the host. Already blocked by dropping CAP_PTRACE.
query_module Deny manipulation and functions on kernel modules. Obsolete.
quotactl Quota syscall which Could let containers disable their own resource limits or process accounting. Also gated by CAP_SYS_ADMIN.
reboot Don’t let containers reboot the host. Also gated by CAP_SYS_BOOT.
request_key Prevent containers from using the kernel keyring,which is not namespaced.
set_mempolicy Syscall that modifies kernel memory and NUMA settings. Already gated by CAP_SYS_NICE.
setns Deny associating a thread with a namespace. Also gated by CAP_SYS_ADMIN.
settimeofday Time/date is not namespaced. Also gated by CAP_SYS_TIME.
socket,socketcall Used to send or receive packets and for other socket operations. All socket and socketcall calls are blocked except communication domains AF_UNIX,AF_INET,AF_INET6,AF_NETLINK,and AF_PACKET.
stime Time/date is not namespaced. Also gated by CAP_SYS_TIME.
swapon Deny start/stop swapping to file/device. Also gated by CAP_SYS_ADMIN.
swapoff Deny start/stop swapping to file/device. Also gated by CAP_SYS_ADMIN.
sysfs Obsolete syscall.
_sysctl Obsolete,replaced by /proc/sys.
umount Should be a privileged operation. Also gated by CAP_SYS_ADMIN.
umount2 Should be a privileged operation. Also gated by CAP_SYS_ADMIN.
unshare Deny cloning new namespaces for processes. Also gated by CAP_SYS_ADMIN,with the exception of unshare –user.
uselib Older syscall related to shared libraries,unused for a long time.
userfaultfd Userspace page fault handling,largely needed for process migration.
ustat Obsolete syscall.
vm86 In kernel x86 real mode virtual machine. Also gated by CAP_SYS_ADMIN.
vm86old In kernel x86 real mode virtual machine. Also gated by CAP_SYS_ADMIN.

关于npm install 报错npm ERR! errno -4048,Error: EPERM: operation not permitted,解决方法的介绍现已完结,谢谢您的耐心阅读,如果想了解更多关于cephfs:报错 librados: client.admin authentication error (1) Operation not permitted、cephfs:报错librados: client.bootstrap-osd authentication error (1) Operation not permitted、Could not install packages due to an Environment Error: [Errno 13] Permission denied 解决方案、docker strace ptrace 报错 Operation not permitted 解决方法的相关知识,请在本站寻找。

本文标签: