摘要:源自小伙伴的求助,雖然沒能定位到最終的原因,調(diào)試的過程也比較有意思緣起小伙伴求助我,同一個鏡像在測試機器上可以運行,在阿里云上運行提示用戶不存在。
源自小伙伴的求助,雖然沒能定位到最終的原因,調(diào)試的過程也比較有意思緣起
小伙伴求助我,同一個docker鏡像在測試機器上可以運行,在阿里云上運行提示用戶不存在。
在阿里云上運行提示如下:
# docker run --rm -it image:tag docker: Error response from daemon: linux spec user: unable to find user www-data: no matching entries in passwd file. ERRO[0000] error waiting for container: context canceled
鏡像名稱統(tǒng)一使用image:tag代替,其實錯誤和鏡像的關系不大
從錯誤描述看:應該是在/etc/passwd中未能找到www-data這個用戶,判斷用戶不存在
調(diào)試過程換成用root啟動,依然提示找不到用戶
# docker run --rm -it --user root image:tag docker: Error response from daemon: linux spec user: unable to find user root: no matching entries in passwd file.
看來root也要在/etc/passwd里面找
換一種方式啟動,錯誤提示變了
# docker run --rm -it --user $(id -u) image:tag docker: Error response from daemon: OCI runtime create failed: container_linux.go:348: starting container process caused "exec: "docker-php-entrypoint": executable file not found in $PATH": unknown.
看來鏡像設置有entrypoint
但是為什么找不到entrypoint
換一個entrypoint試試看
# docker run --rm -it --user $(id -u) --entrypoint "ls" image:tag docker: Error response from daemon: OCI runtime create failed: container_linux.go:348: starting container process caused "exec: "ls": executable file not found in $PATH": unknown.
ls也找不到?那用/bin/ls試試看
# docker run --rm -it --user $(id -u) --entrypoint "/bin/ls" image:tag docker: Error response from daemon: OCI runtime create failed: container_linux.go:348: starting container process caused "exec: "/bin/ls": stat /bin/ls: no such file or directory": unknown.
這次錯誤提示換了,找不到/bin/ls
懷疑是文件系統(tǒng)錯誤,整個/下的文件都找不到
把/bin/ls掛載到容器內(nèi)試試
# docker run --rm -it --user $(id -u) -v "/bin/ls":"/bin/ls" --entrypoint "/bin/ls" image:tag standard_init_linux.go:190: exec user process caused "no such file or directory"
基本可以確定是docker內(nèi)文件系統(tǒng)掛了
山窮水盡暫時沒找到辦法進一步的追蹤。通過docker inspect和docker history均看不出鏡像的異常。
通過docker logs也看不到容器啟動中的其他錯誤。
柳暗花明別的小伙伴幫忙找到了這個issue: Error response from daemon: OCI runtime create failed - when running a Node.js Docker image
雖然錯誤類型不太一致,發(fā)現(xiàn)我一直忘記查看docker daemon的日志!?。?!
通過journalctl -fu docker.service查看錯誤日志,發(fā)現(xiàn)和issue中的錯誤一致。
... level=error msg="stream copy error: reading from a closed fifo"
可能是docker的一個未修復的BUG。
TODO為何--user root時會查找passwd文件,--user $(id -u)可以跳過passwd文件
文章版權(quán)歸作者所有,未經(jīng)允許請勿轉(zhuǎn)載,若此文章存在違規(guī)行為,您可以聯(lián)系管理員刪除。
轉(zhuǎn)載請注明本文地址:http://m.hztianpu.com/yun/27778.html
摘要:關于無輸出錯誤最近接入支付寶支付時遇到一個問題,在做支付回調(diào)函數(shù)的時候我先是寫了一個用來記錄回調(diào)時的支付寶請求參數(shù),但發(fā)現(xiàn)無論如何日志都沒有任何記錄,而且回調(diào)函數(shù)里面的東西也沒用執(zhí)行,于是我自己請求該回調(diào)地址,發(fā)現(xiàn)服務器上狀態(tài)碼為但是沒有 關于LUMEN無輸出500錯誤 最近接入支付寶支付時遇到一個問題,在做支付回調(diào)函數(shù)的時候我先是寫了一個 Log::info(alipay_notif...
摘要:然而實際上,這個結(jié)果反而是正確的。結(jié)論我認為出現(xiàn)這種詭異的結(jié)果應該算是的,同時,這也說明了此種問題不太容易被發(fā)現(xiàn)和暴露,這要求我們平常寫代碼的時候盡量使用常用的語法,和精干的語句,讓代碼和邏輯達到最佳的平衡點。 前言 之前我在面試的時候,遇到許多年輕人都聲稱自己精通php,有過許多項目經(jīng)驗等等。然而,當真正筆試的時候,我問到 $result=1; if(-1){ $result=2;...
閱讀 911·2023-04-26 02:08
閱讀 3107·2021-11-18 10:02
閱讀 3618·2021-11-11 16:55
閱讀 2482·2021-08-17 10:13
閱讀 3030·2019-08-30 15:53
閱讀 814·2019-08-30 15:44
閱讀 2703·2019-08-30 11:10
閱讀 1892·2019-08-29 16:57