在Cloud Foundry中,Go worker应用程序无法启动。

huangapple go评论88阅读模式
英文:

Go worker app not starting in Cloud Foundry

问题

我正在尝试在Cloud Foundry中运行一个Go worker应用程序(不绑定到路由)。我可以在本地启动Go二进制文件,并且可以正常工作。

当应用程序尝试在Cloud Foundry中启动时,我收到以下错误信息。

2015-10-08T12:23:50.49-0400 [STG/127] OUT -----> 下载应用程序包(1.1M)
2015-10-08T12:23:53.48-0400 [STG/127] OUT -----> 下载应用程序构建包缓存(75M)
2015-10-08T12:23:55.45-0400 [STG/0] ERR 克隆到'/tmp/buildpacks/go-buildpack'...
2015-10-08T12:23:57.48-0400 [STG/0] OUT 子模块'compile-extensions'(https://github.com/cloudfoundry/compile-extensions.git)已注册到路径'compile-extensions'
2015-10-08T12:23:57.53-0400 [STG/0] ERR 克隆到'compile-extensions'...
2015-10-08T12:23:58.51-0400 [STG/0] OUT 子模块路径'compile-extensions':检出'b5e0cf7be729718d162d56709ec7f27d34e68c7c'
2015-10-08T12:23:58.58-0400 [STG/0] OUT -------> Buildpack 版本 1.6.2
2015-10-08T12:23:58.65-0400 [STG/0] OUT -----> 检查 Godeps/Godeps.json 文件。
2015-10-08T12:23:58.69-0400 [STG/0] OUT -----> 使用 go1.5.1
2015-10-08T12:23:58.73-0400 [STG/0] OUT -----> 运行:godep go install -tags cloudfoundry ./...
2015-10-08T12:24:01.01-0400 [STG/127] OUT -----> 上传 droplet(1.8M)
2015-10-08T12:24:23.98-0400 [DEA/127] OUT 使用 guid 8b427c83-67b7-463e-99cd-53a4ad4154ac 启动应用程序实例(索引 0)
2015-10-08T12:24:37.04-0400 [API/1] OUT 应用程序实例退出,使用 guid 8b427c83-67b7-463e-99cd-53a4ad4154ac 载荷:{"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 应用程序实例退出,使用 guid 8b427c83-67b7-463e-99cd-53a4ad4154ac 载荷:{"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:

来自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)
}

}

英文:

I am trying to run a go worker app (no binding to a route) in Cloud Foundry. I can start the Go binary locally and it works fine.

When the app tries to start in Cloud Foundry I get the following error.

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}

Below is my Procfile.

worker: ./slack-disable-2fa

Below is my manifest.yml file.

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

Snippet from the go app (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)
    }

}

答案1

得分: 3

从 Procfile 中删除 './' 前缀。

它应该只包含命令名称。

worker: slack-disable-2fa

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

command: slack-disable-2fa
英文:

Remove the './' prefix from the Procfile.

It should only contain the command name.

worker: slack-disable-2fa

Also Remove the './' prefix from the manifest.yml.

  command: slack-disable-2fa

huangapple
  • 本文由 发表于 2015年10月9日 00:21:30
  • 转载请务必保留本文链接:https://go.coder-hub.com/33021094.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定