From 1f716cb85daa40fc29d8731fcf22410f546a0de6 Mon Sep 17 00:00:00 2001 From: zhengkunwang <31820853+zhengkunwang223@users.noreply.github.com> Date: Wed, 26 Feb 2025 14:04:23 +0800 Subject: [PATCH] Fix issue with runtime environment restart failure (#8008) --- agent/app/service/container_compose.go | 2 +- agent/app/service/runtime_utils.go | 4 ++-- frontend/src/lang/modules/en.ts | 1 + frontend/src/lang/modules/ja.ts | 1 + frontend/src/lang/modules/ko.ts | 1 + frontend/src/lang/modules/ms.ts | 1 + frontend/src/lang/modules/pt-br.ts | 1 + frontend/src/lang/modules/ru.ts | 1 + frontend/src/lang/modules/tw.ts | 1 + frontend/src/lang/modules/zh.ts | 1 + 10 files changed, 11 insertions(+), 3 deletions(-) diff --git a/agent/app/service/container_compose.go b/agent/app/service/container_compose.go index edcf15e52..19e4d1b93 100644 --- a/agent/app/service/container_compose.go +++ b/agent/app/service/container_compose.go @@ -201,7 +201,7 @@ func (u *ContainerService) CreateCompose(req dto.ComposeCreate) error { } go func() { taskItem.AddSubTask(i18n.GetMsgByKey("ComposeCreate"), func(t *task.Task) error { - cmd := exec.Command("docker-compose", "-f", req.Path, "up", "-d") + cmd := exec.Command("docker", "compose", "-f", req.Path, "up", "-d") out, err := cmd.CombinedOutput() taskItem.Log(i18n.GetWithName("ComposeCreateRes", string(out))) if err != nil { diff --git a/agent/app/service/runtime_utils.go b/agent/app/service/runtime_utils.go index 85ca88363..7c297eeaf 100644 --- a/agent/app/service/runtime_utils.go +++ b/agent/app/service/runtime_utils.go @@ -150,7 +150,7 @@ func runComposeCmdWithLog(operate string, composePath string, logPath string) er err = cmd.Run() if err != nil { - return errors.New(buserr.New("ErrRuntimeStart").Error() + ":" + err.Error()) + return errors.New(buserr.New("ErrRuntimeStart").Error() + ":" + stderrBuf.String()) } return nil } @@ -263,7 +263,7 @@ func buildRuntime(runtime *model.Runtime, oldImageID string, oldEnv string, rebu ctx, cancel := context.WithTimeout(context.Background(), 1*time.Hour) defer cancel() - cmd := exec.CommandContext(ctx, "docker-compose", "-f", composePath, "build") + cmd := exec.CommandContext(ctx, "docker", "compose", "-f", composePath, "build") cmd.Stdout = logFile var stderrBuf bytes.Buffer multiWriterStderr := io.MultiWriter(&stderrBuf, logFile) diff --git a/frontend/src/lang/modules/en.ts b/frontend/src/lang/modules/en.ts index 307cca4bf..c2db8d7e6 100644 --- a/frontend/src/lang/modules/en.ts +++ b/frontend/src/lang/modules/en.ts @@ -306,6 +306,7 @@ const message = { installerr: 'Installation failed', applyerror: 'Apply failed', systemrestart: 'Interrupted', + starterr: 'Startup failed', }, units: { second: 'Second', diff --git a/frontend/src/lang/modules/ja.ts b/frontend/src/lang/modules/ja.ts index 804bbe7c5..54fa46477 100644 --- a/frontend/src/lang/modules/ja.ts +++ b/frontend/src/lang/modules/ja.ts @@ -300,6 +300,7 @@ const message = { installerr: 'インストールに失敗しました', applyerror: '適用に失敗しました', systemrestart: '中断', + starterr: '起動に失敗しました', }, units: { second: '2番目|2番目|秒', diff --git a/frontend/src/lang/modules/ko.ts b/frontend/src/lang/modules/ko.ts index 82c304e68..a27713df1 100644 --- a/frontend/src/lang/modules/ko.ts +++ b/frontend/src/lang/modules/ko.ts @@ -301,6 +301,7 @@ const message = { installerr: '설치 실패', applyerror: '적용 실패', systemrestart: '중단됨', + starterr: '시작 실패', }, units: { second: '초 | 초 | 초', diff --git a/frontend/src/lang/modules/ms.ts b/frontend/src/lang/modules/ms.ts index 63f5ba26c..78bdbc186 100644 --- a/frontend/src/lang/modules/ms.ts +++ b/frontend/src/lang/modules/ms.ts @@ -307,6 +307,7 @@ const message = { installerr: 'Pemasangan gagal', applyerror: 'Permohonan gagal', systemrestart: 'Dihentikan', + starterr: 'Permulaan gagal', }, units: { second: 'saat | saat | saat', diff --git a/frontend/src/lang/modules/pt-br.ts b/frontend/src/lang/modules/pt-br.ts index 23a871a77..6a966d5dc 100644 --- a/frontend/src/lang/modules/pt-br.ts +++ b/frontend/src/lang/modules/pt-br.ts @@ -305,6 +305,7 @@ const message = { installerr: 'Falha na instalação', applyerror: 'Falha na aplicação', systemrestart: 'Interrompido', + starterr: 'Falha na inicialização', }, units: { second: 'segundo | segundos | segundos', diff --git a/frontend/src/lang/modules/ru.ts b/frontend/src/lang/modules/ru.ts index a823bbd4d..f98c3610e 100644 --- a/frontend/src/lang/modules/ru.ts +++ b/frontend/src/lang/modules/ru.ts @@ -301,6 +301,7 @@ const message = { installerr: 'Ошибка установки', applyerror: 'Ошибка применения', systemrestart: 'Прервано', + starterr: 'Ошибка запуска', }, units: { second: ' секунда | секунда | секунд', diff --git a/frontend/src/lang/modules/tw.ts b/frontend/src/lang/modules/tw.ts index 75239f022..6e2bdb688 100644 --- a/frontend/src/lang/modules/tw.ts +++ b/frontend/src/lang/modules/tw.ts @@ -300,6 +300,7 @@ const message = { installerr: '安裝失敗', applyerror: '申請失敗', systemrestart: '中斷', + starterr: '啟動失敗', }, units: { second: '秒', diff --git a/frontend/src/lang/modules/zh.ts b/frontend/src/lang/modules/zh.ts index 207e3e73f..5620d0da6 100644 --- a/frontend/src/lang/modules/zh.ts +++ b/frontend/src/lang/modules/zh.ts @@ -298,6 +298,7 @@ const message = { installerr: '安装失败', applyerror: '申请失败', systemrestart: '中断', + starterr: '启动失败', }, units: { second: '秒',