IBM Cloud Developer Tool:idt build/bx dev 构建导致错误(OCI runtime exec failed ...)

IBM Cloud Developer Tool: idt build/bx dev build causing error (OCI runtime exec failed ...)

我的 Node.js 项目文件夹中出现错误 运行 bx dev build,具体而言:

[hafiz@Ubuntu ~/FSFTM/code/TaskListApp] $ sudo bx dev build
Getting service credentials for the project.
OK
OK
Deleting the container named 'tasklistapp-express-tools' ...
Creating image tasklistapp-express-tools based on Dockerfile-tools...
OK                    
Creating a container named 'tasklistapp-express-tools' from that image...
OK
Starting the 'tasklistapp-express-tools' container...
OK
Building the project in the current directory started at Fri Dec 22 22:03:35 2017
FAILED                
Failed to build the project.

Dumping output from the command: 
OCI runtime exec failed: exec failed: container_linux.go:295: starting container process caused "process_linux.go:86: executing setns process caused \"exit status 22\"": unknown

在这些之前,我运行bx login --ssobx target --cf。无法确定问题到底是什么,我怀疑它与 Docker 有关。我是 运行 这个 Ubuntu 16.04。 运行 curl -sL https://ibm.biz/idt-installer | bash 安装了 idt。这是 bx 的版本:

[hafiz@Ubuntu ~/FSFTM/code/TaskListApp] $ bx -v
bx version 0.6.4+41cb1aa-2017-12-19T03:46:07+00:00

不太确定我还应该包括什么,我有点难过。该项目通过 运行 npm installnpm run buildnpm run start 构建良好。如果我知道什么有用,我会提供更多信息!任何人都知道错误的真正含义或者我是否遗漏了什么?

应乔的要求,跟踪如下:

[hafiz@Ubuntu ~/FSFTM/code/TaskListApp] $ bx dev build --trace
Getting service credentials for the project.
[http] 2017/12/25 15:15:52 gorequest.go:1049: HTTP Request: GET /scaffolder/api/generator/02810082-65bd-471d-8a1d-e2cb60dca916/status HTTP/1.1
Host: mobileprojectscaffolder.ng.bluemix.net
Content-Type: application/json

[http] 2017/12/25 15:15:53 gorequest.go:1078: HTTP Response: HTTP/1.1 200 OK
Connection: close
Transfer-Encoding: chunked
Cache-Control: no-cache, no-store, must-revalidate
Content-Language: en-US
Content-Type: application/json
Date: Mon, 25 Dec 2017 07:16:07 GMT
Expires: 0
Pragma: no-cache
X-Backside-Transport: OK OK
X-Global-Transaction-Id: 868943159
X-Powered-By: Servlet/3.0

28
{"status":"NONEXISTENT","messages":null}
0

FAILED
An error occurred while getting the service credentials for the project.
Error: Remote files for this project no longer exist. A new project will have to be generated.

FAILED
An error occurred while getting the service credentials for the project.
Error: Remote files for this project no longer exist. A new project will have to be generated.
Using these variable values:
01: ContainerName string = 
02: ContainerNameRun string = tasklistapp-express-run
03: ContainerNameTools string = tasklistapp-express-tools
04: HostPathRun string = .
05: HostPathTools string = .
06: ContainerPathRun string = /app
07: ContainerPathTools string = /app
08: BuildCmdRun string = npm install
09: BuildCmdDebug string = npm install
10: TestCmd string = npm run test
11: DebugCmd string = npm run debug
12: RunCmd string = 
13: ContainerPortMap string = 3000:3000
14: ContainerPortMapDebug string = 5858:5858
15: ImageNameTools string = tasklistapp-express-tools
16: ImageNameRun string = tasklistapp-express-run
17: DockerfileRun string = Dockerfile
18: DockerfileTools string = Dockerfile-tools
19: ContainerMountsRun []map[string]string = [map[./node_modules_linux:/app/node_modules]]
20: ContainerMountsTools []map[string]string = [map[./node_modules_linux:/app/node_modules]]
21: IsDebug bool = false
22: IsTrace bool = true
23: Version string = 0.0.3
24: DeployTarget string = buildpack
25: IsForce bool = false
26: Language string = 
27: IbmCluster string = 
28: ChartPath string = chart/tasklistapp
29: DockerRegistry string = 
30: GeneratedID string = 02810082-65bd-471d-8a1d-e2cb60dca916
31: CredsFilepath string = server/localdev-config.json, vcap-local.js, credentials.json, localdev-config.json
32: NoOpen bool = false
33: WebAppRoot string = 
34: ContainerShell string = /bin/sh
35: ContainerShellTarget string = tools
Deleting the container named 'tasklistapp-express-tools' ...
Creating image tasklistapp-express-tools based on Dockerfile-tools...
Image will have user hafiz with id 1000 added
Step 1/12 : FROM ibmcom/ibmnode

 ---> 9db33a417145
Step 2/12 : ENV PORT 3000

 ---> Using cache
 ---> 882e62064ece
Step 3/12 : WORKDIR "/app"

 ---> Using cache
 ---> c0584b52956d
Step 4/12 : COPY . /app

 ---> Using cache
 ---> aad43758bec8
Step 5/12 : COPY run-dev /bin

 ---> Using cache
 ---> 742251038857
Step 6/12 : EXPOSE 3000

 ---> Using cache
 ---> 0d2790971939
Step 7/12 : CMD ["/bin/bash"]

 ---> Using cache
 ---> b8774ff51b14
Step 8/12 : ARG bx_dev_user=root

 ---> Using cache
 ---> 151098ec1756
Step 9/12 : ARG bx_dev_userid=1000

 ---> Using cache
 ---> 118442698498
Step 10/12 : RUN BX_DEV_USER=$bx_dev_user

 ---> Using cache
 ---> b697f05b3ff3
Step 11/12 : RUN BX_DEV_USERID=$bx_dev_userid

 ---> Using cache
 ---> 25c4ed895b04
Step 12/12 : RUN if [ $bx_dev_user != "root" ]; then useradd -ms /bin/bash -u $bx_dev_userid $bx_dev_user; fi

 ---> Using cache
 ---> ee1461ba1f16
Successfully built ee1461ba1f16
Successfully tagged tasklistapp-express-tools:latest
OK
Creating a container named 'tasklistapp-express-tools' from that image...
OK
Starting the 'tasklistapp-express-tools' container...
OK
Building the project in the current directory started at Mon Dec 25 15:15:56 2017
Executing command 'cd /app; npm install' on container tasklistapp-express-tools using user hafiz
OCI runtime exec failed: exec failed: container_linux.go:295: starting container process caused "process_linux.go:86: executing setns process caused \"exit status 22\"": unknown
FAILED
Failed to build the project.

FAILED
Failed to build the project.
Stopping the 'tasklistapp-express-tools' container...
OK

仅供参考,服务凭证失败对构建无害。

我看到你在上次 build 中没有使用 sudo,这很好。要进一步调试它,您是否尝试过为另一种语言构建项目?例如 Java 或 Swift?到目前为止,我无法重现故障。

谢谢

您尝试使用 sudo 运行 bx dev build 有什么原因吗?你也在sudo下运行bx dev create吗?这听起来像是权限问题。

错误消息实际上来自 Docker,而不是 IBM Developer Tools 可执行文件的内部: OCI runtime exec failed: exec failed: container_linux.go:295: starting container process caused "process_linux.go:86: executing setns process caused \"exit status 22\"": unknown

通过一些研究,开源 container_linux.go 中报告问题的第 295 行似乎与用户文件权限有关。根据您的描述,您的系统可能有一些属于 root 的文件,当您使用自己的用户帐户 运行 命令时,这些文件现在无法访问(如您提供的日志所示)。我怀疑一些 chown 会让你的建筑很好。

仅供参考