gpt4 book ai didi

Go worker 应用程序未在 Cloud Foundry 中启动

转载 作者:IT王子 更新时间:2023-10-29 01:59:17 26 4
gpt4 key购买 nike

我正在尝试在 Cloud Foundry 中运行一个 go worker 应用程序(不绑定(bind)到路由)。我可以在本地启动 Go 二进制文件,它运行良好。

当应用程序尝试在 Cloud Foundry 中启动时,出现以下错误。

2015-10-08T12:23:50.49-0400 [STG/127]    OUT -----> Downloaded app package (1.1M)
2015-10-08T12:23:53.48-0400 [STG/127] OUT -----> Downloaded app buildpack cache (75M)
2015-10-08T12:23:55.45-0400 [STG/0] ERR Cloning into '/tmp/buildpacks/go-buildpack'...
2015-10-08T12:23:57.48-0400 [STG/0] OUT Submodule 'compile-extensions' (https://github.com/cloudfoundry/compile-extensions.git) registered for path 'compile-extensions'
2015-10-08T12:23:57.53-0400 [STG/0] ERR Cloning into 'compile-extensions'...
2015-10-08T12:23:58.51-0400 [STG/0] OUT Submodule path 'compile-extensions': checked out 'b5e0cf7be729718d162d56709ec7f27d34e68c7c'
2015-10-08T12:23:58.58-0400 [STG/0] OUT -------> Buildpack version 1.6.2
2015-10-08T12:23:58.65-0400 [STG/0] OUT -----> Checking Godeps/Godeps.json file.
2015-10-08T12:23:58.69-0400 [STG/0] OUT -----> Using go1.5.1
2015-10-08T12:23:58.73-0400 [STG/0] OUT -----> Running: godep go install -tags cloudfoundry ./...
2015-10-08T12:24:01.01-0400 [STG/127] OUT -----> Uploading droplet (1.8M)
2015-10-08T12:24:23.98-0400 [DEA/127] OUT Starting app instance (index 0) with guid 8b427c83-67b7-463e-99cd-53a4ad4154ac
2015-10-08T12:24:37.04-0400 [API/1] OUT App instance exited with guid 8b427c83-67b7-463e-99cd-53a4ad4154ac payload: {"cc_partition"=>"default", "droplet"=>"8b427c83-67b7-463e-99cd-53a4ad4154ac", "version"=>"9f5da0a0-1b4c-4907-a92a-40b4ce6d5669", "instance"=>"73b999f6770949098d59bef51e81d31d", "index"=>0, "reason"=>"CRASHED", "exit_status"=>126, "exit_description"=>"failed to start", "crash_timestamp"=>1444321477}
2015-10-08T12:24:37.04-0400 [API/8] OUT App instance exited with guid 8b427c83-67b7-463e-99cd-53a4ad4154ac payload: {"cc_partition"=>"default", "droplet"=>"8b427c83-67b7-463e-99cd-53a4ad4154ac", "version"=>"9f5da0a0-1b4c-4907-a92a-40b4ce6d5669", "instance"=>"73b999f6770949098d59bef51e81d31d", "index"=>0, "reason"=>"CRASHED", "exit_status"=>126, "exit_description"=>"app instance exited", "crash_timestamp"=>1444321477}

下面是我的Procfile

worker: ./slack-disable-2fa

下面是我的 manifest.yml 文件。

applications:
- path: .
memory: 512MB
instances: 1
domain: mybluemix.net
name: myapp
host: myapp
no-route: true
disk_quota: 1024M
command: ./slack-disable-2fa
buildpack: https://github.com/cloudfoundry/go-buildpack.git

来自 go 应用程序的片段 (slack-disable-2fa.go)

package main

import (
"fmt"
"time"
)


func main() {

for {
fmt.Printf("hello\n")
fmt.Printf("Running again in 24 hours...\n")
time.Sleep(time.Hour * 1)
}

}

最佳答案

从 Procfile 中删除“./”前缀。

它应该只包含命令名称。

worker: slack-disable-2fa

同时从 manifest.yml 中删除“./”前缀。

  command: slack-disable-2fa

关于Go worker 应用程序未在 Cloud Foundry 中启动,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33021094/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com