问题:跟往常一样执行docker-compos exec redis sh时出现如下错误,而容器是运行状态中。

# docker-compose exec redis sh
rpc error: code = desc = oci runtime error: exec failed: container_linux.go:: starting container process caused "process_linux.go:75: starting setns process caused \"fork/exec /proc/self/exe: no such file or directory\""

解决办法:

1、获取容器ID

# docker ps | grep arcs_redis_1
ac248a3c5c0e redis:alpine "docker-entrypoint..." years ago Up minutes /tcp arcs_redis_1

2、通过容器ID获取容器的PID

# ps -ef|grep libcontainerd | grep ac248a3c5c0e
root : ? :: docker-containerd-shim ac248a3c5c0e3f6405c35e186b5d095aeb7af72b0f52bb08303baded251cdb61 /var/run/docker/libcontainerd/ac248a3c5c0e3f6405c35e186b5d095aeb7af72b0f52bb08303baded251cdb61 docker-runc 注:第二个字段为容器的PID

3、获取容器的mount位置

# grep "path" /var/run/docker/libcontainerd/ac248a3c5c0e3f6405c35e186b5d095aeb7af72b0f52bb08303baded251cdb61/config.json

注:mount的路径:{"path":"/var/lib/docker/devicemapper/mnt/cc2ff9576cdf7736acca50ffdaadef471e01a8ffe9acb039c1d423edd941bd38/rootfs"},此路径用于第6步挂载时使用。

4、用nsenter进入容器的namespace

# nsenter -m -t  bash
注: 6650是容器的PID

5、查看容器的DeviceName

# docker inspect --format='{{.GraphDriver.Data.DeviceName}}' ac248a3c5c0e       ####ac248a3c5c0e是容器ID
docker-252:0-9700888-cc2ff9576cdf7736acca50ffdaadef471e01a8ffe9acb039c1d423edd941bd38

6、手动挂载

# mount /dev/mapper/docker-\:--cc2ff9576cdf7736acca50ffdaadef471e01a8ffe9acb039c1d423edd941bd38 -o rw,relatime,nouuid,attr2,inode64,sunit=,swidth=,noquota -t xfs /var/lib/docker/devicemapper/mnt/cc2ff9576cdf7736acca50ffdaadef471e01a8ffe9acb039c1d423edd941bd38

7、退出

#exit

8、再次执行docker-compose exec redis sh 无报错。

说明:此报错是由于mount挂载点丢失,具体原因目前还未知晓,若有知晓者欢迎告知!

docker-compose exec时 出现"fork/exec /proc/self/exe: no such file or directory" 报错的更多相关文章

  1. tar (child): bzip2: Cannot exec: No such file or directory报错

    [root@hejianlai-jenkins ~]# file android-ndk-r8-linux-x86.tar.bz2 android-ndk-r8-linux-x86.tar.bz2: ...

  2. docker jenkins 前端node项目 自动化部署异常 env: ‘node’: No such file or directory

    出现问题是docker jenkins 里面没有自动安装node导致找不到这个Node命令 解决方案:手动安装nodejs # 进入jenkins对应容器中 # docker exec -it [对应 ...

  3. (ubuntu) pip install scandir 时出现错误 fatal error: Python.h: No such file or directory

    安装 jupyter时遇到这个问题,在这里查到了解决方法,特记录一下. 解决方式为: 先安装 python-dev: $ sudo apt-get install python-dev 然后再安装需要 ...

  4. 执行shell脚本时提示/bin/sh^M: bad interpreter: No such file or directory

    执行脚本时提示解释器有问题,错误提示如下: 这种提示一般是脚本在windows系统之通过记事本写的,记事本修改过的文本,会默认在文本前面加上一些看不到的标记,导致shell脚本不能被shell解释器识 ...

  5. artTemplate--使用artTemplate时,由于json对象属性有数字命名格式 导致调用报错 syntax error

    案例 今天在使用artTemplate做开发时,遇到一个比较奇葩的问题,就是使用json对象去获取值得时候,报如下错误: Template Error <temp> function an ...

  6. linux下编译时遇到fatal error: openssl/sha.h: No such file or directory怎么办?

    答:安装ssl开发库 ubuntu下的安装方法为: sudo apt-get install libssl-dev -y

  7. 使用layer的弹窗时,出现layer引入成功,触发成功,控制台无报错,但是页面无变化或者仅出现遮罩层的问题的解决思路

    ------------------------------------------20180410补充------------------------------------------------ ...

  8. Python 3.6版本中实现 HTMLTestRunner输出时”fp=file(filename,'wb')“报错

    原错误代码: if __name__=='__main__': suite=unittest.makeSuite(WidgetTestCase) filename='D:\\myreport.html ...

  9. win8/win7中使用Git Extensions PuTTy模式提交时 git-credential-winstore.exe": No such file or directory 错误解决方案

    参考:http://www.cnblogs.com/hlizard/p/3627792.html 报错类似以下错误 \"F:/GitExtensions/GitCredentialWinSt ...

随机推荐

  1. C++得到当前进程所占用的内存

    原文地址:C++得到当前进程所占用的内存作者:雪碧狗 使用SDK的PSAPI (Process Status Helper)中的BOOL GetProcessMemoryInfo(  HANDLE P ...

  2. 《C标准库》阅读笔记

    <assert.h>的断言函数适合于用来调试,实际产品中难以使用. #define NDEBUG 可禁用断言. #undef NDEBUG 可打开断言. 我自己写的一个例子: #inclu ...

  3. 算法之--字符串包含【python实现】

    题目描述 给定两个分别由字母组成的字符串A和字符串B,字符串B的长度比字符串A短.请问,如何最快地判断字符串B中所有字母是否都在字符串A里? 为了简单起见,我们规定输入的字符串只包含大写英文字母,请实 ...

  4. mysql练习(一)

    练习一 创建表,并插入相关数据 CREATE TABLE email ( ID INT NOT NULL PRIMARY KEY, Email VARCHAR() ) INSERT INTO emai ...

  5. Android签名打包

    生成正式的签名APK文件 1.使用AndroidStudio生成: 点击导航栏上的Build-->Generate Signed APK,弹出创建签名APK对话框(首次点击可能会提示输入操作系统 ...

  6. 在Azure中新建Linux

    开始学习Linux,这里开个系列用来记录Linux的学习笔记,这些是在实验楼:https://www.shiyanlou.com/的学习笔记. 这一篇是在Azure中新建一个Ubuntu的服务器用于练 ...

  7. 教你如何快速使用Github

    以前看过几篇github的使用教程,感觉还是不是很清晰,自从看到了这篇,通俗易懂,也学会基本的使用了,在此为大家推荐.(转自知乎,为了能让更多的人看到,请允许我使用 “原创”,如果侵权请联系.) Gi ...

  8. [机器学习]SVM原理

    SVM是机器学习中神一般的存在,虽然自深度学习以来有被拉下神坛的趋势,但不得不说SVM在这个领域有着举足轻重的地位.本文从Hard SVM 到 Dual Hard SVM再引进Kernel Trick ...

  9. C++ Builder 控件的卸载

    控件卸载: 1.选择   BCB   菜单   File→Close   All   (关闭所有文件)     选择BCB   菜单:   Project→Options→Packages   在   ...

  10. C语言实现常用排序算法——基数排序

    #include<stdio.h> #include<math.h> #define SIZE 10 #define C_SIZE 20 /*行数稳定=10,切记!列数务必搞的 ...