Application droplet can be started with a different stack than the buildpack used to produce the droplet supports
维护者通常 2 天内回复
还没有人认领这个 Issue。
评估
调研方向
跟踪 v3 构建流程、app 与 current_droplet 的关系,以及复现步骤中描述的 app 重启操作。检查 app 生命周期栈和 droplet 栈的比较方式,然后确定相关的回归测试入口点。在 app 启动前拒绝不匹配的栈,并覆盖 API 路径,即表示完成。
由索引模型根据 Issue 内容生成。
描述
Issue
Using the CF APIs it is possible to launch an application droplet with a CF stack which is different than the stack supported by the buildpack used to produce the droplet.
Steps to Reproduce
Prerequisite is a CF offering two different stacks. E.g. cflinuxfs3 and cflinuxfs4. For the steps below we want to switch an application from the cflinuxfs3 to cflinuxfs4 stack.
- Get the app latest package guid with:
cf curl "/v3/packages?app_guids=<app-guid>&order_by=-created_at&states=READY" - Create a new droplet with the
cflinuxfs4stack and the corresponding buildpack supporting thecflinuxfs4stack:
curl curl "/v3/builds" \
-X POST \
-H "Content-type: application/json" \
-d '{
"package": {
"guid": "[package-guid]"
},
lifecycle: {
type: "buildpack",
data: { buildpacks: [<cflinuxfs4-buildpack>], stack: cflinuxfs4}
}
}'
- Wait until the build is done and get the new droplet guid with:
cf curl "/v3/builds/<build-guid>" - Stop the app with:
cf curl "/v3/apps/<guid>/actions/stop" -X POST" - Set the app's current droplet:
cf curl "/v3/apps/[guid]/relationships/current_droplet" \
-X PATCH \
-H "Content-type: application/json" \
-d '{ "data": { "guid": "[<droplet_guid>]" } }'
- Restart the app:
cf curl "/v3/apps/[guid]/actions/restart" -X POST"
Expected result
CF restart request fails because the current stack of the application configured in its lifecycle is cflinuxfs3 but the current droplet is built for the cflinuxfs4 stack.
Current result
The application is restarted with its configured stack which is cflinuxfs3 and e.g. node apps are crashing with strange errors like:
[APP/PROC/WEB/0] STDERR node: /lib/x86_64-linux-gnu/libm.so.6: version `GLIBC_2.29' not found (required by node)
[APP/PROC/WEB/0] STDERR node: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.34' not found (required by node)
[APP/PROC/WEB/0] STDERR node: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.32' not found (required by node)
[APP/PROC/WEB/0] STDERR node: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.28' not found (required by node)
[APP/PROC/WEB/0] STDERR node: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.33' not found (required by node)
[APP/PROC/WEB/0] STDERR node: /usr/lib/x86_64-linux-gnu/libstdc++.so.6: version `GLIBCXX_3.4.30' not found (required by node)
[APP/PROC/WEB/0] STDERR node: /usr/lib/x86_64-linux-gnu/libstdc++.so.6: version `GLIBCXX_3.4.29' not found (required by node)
[APP/PROC/WEB/0] STDERR node: /usr/lib/x86_64-linux-gnu/libstdc++.so.6: version `GLIBCXX_3.4.26' not found (required by node)
This is happening because the droplet has dependencies to the CF stack and they can't be resolved.
Possible Fix
Possible fix could be to reject such a start/restart request when the droplet stack is different than the app lifecycle stack. Such an error is happening when you try to push an app with a buildpack which doesn't support the current lifecycle stack of the app:
[STG/0] OUT **ERROR** Stack not supported by buildpack: required stack cflinuxfs3 was not found
[STG/0] ERR Failed to compile droplet: Failed to run all supply scripts: exit status 11
- 主要语言
- Ruby
- 星标
- 207
- 派生
- 374
- 平均合并
- 2 天 19 小时
- 30 天内合并 PR
- 68
环境准备
在浏览器里用你自己的 GitHub 账号启动这个项目的开发容器。
- 提供 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
cloudfoundry/cloud_controller_ng 的其他 Issue
-
难度 1/5 1 小时以内 新手友好度 72/100
cloudfoundry/cloud_controller_ng#5255 · 1 条评论 ·
维护者通常 2 天内回复
-
难度 5/5 一周以上 新手友好度 35/100
cloudfoundry/cloud_controller_ng#5347 · 2 条评论 ·
维护者通常 2 天内回复
-
难度 5/5 一周以上 新手友好度 35/100
cloudfoundry/cloud_controller_ng#5313 ·
维护者通常 2 天内回复
-
难度 4/5 3-5 天 新手友好度 50/100
cloudfoundry/cloud_controller_ng#5285 ·
维护者通常 2 天内回复
-
难度 5/5 一周以上 新手友好度 30/100
cloudfoundry/cloud_controller_ng#5246 ·
维护者通常 2 天内回复
查看 cloudfoundry/cloud_controller_ng 的全部 Issue
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 78/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 78/100
-
ds-drift
难度 1/5 1 小时以内 新手友好度 76/100
we-promise/sure#4120 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 72/100
维护者通常 4 天内回复
-
难度 2/5 1-3 小时 新手友好度 84/100
scanaislop/aislop#476 ·
维护者通常 1 天内回复