The error message is "Failed to move to new namespace: PID namespaces supported. Network namespace supported, but failed: errno = Operation not permitted"

Solutions

Just choose one of the solutions below.


For Docker

Add --cap-add SYS_ADMIN for docker run to gain the permission

For example:

$ docker run -it \  
             --cap-add=SYS_ADMIN \  
             -e PYTHONPATH=$(container_work_dir)  
             -p $(site_port_mapping)  
             -p $(admin_port_mapping)  
             -p $(https_port_mapping)  
             -w $(container_work_dir)  
             --name $(project_name)`  

For Selenium

Add --no-sandbox while launching Chrome driver

For example:

from selenium import webdriver  

chrome_options = webdriver.ChromeOptions()  
chrome_options.add_argument('--no-sandbox')  
chrome = webdriver.Chrome(chrome_options=chrome_options)  

References


Share


Donation

如果覺得這篇文章對你有幫助, 除了留言讓我知道外, 或許也可以考慮請我喝杯咖啡, 不論金額多寡我都會非常感激且能鼓勵我繼續寫出對你有幫助的文章。

If this blog post happens to be helpful to you, besides of leaving a reply, you may consider buy me a cup of coffee to support me. It would help me write more articles helpful to you in the future and I would really appreciate it.


Related Posts