2017-05-29 10 views
0

サンプルgo webプログラムをBluemixにデプロイできません。サーバーは、エラーを発生させずに起動し、最後にクラッシュしています。ファイルを変更する必要がある場合はお知らせください。サーバをBluemixにデプロイした後にサーバを起動できない

View Our Code In GitHub

Build Log:- 

Preparing to start the job... 
Downloading build artifacts... 
Target: https://api.ng.bluemix.net 
Using manifest file /home/pipeline/4095d817-6887-4f7e-b317-c58c97c5afd7/manifest.yml 

Creating app JoinSplit-20170529103009108 in org Subhadeep/space dev as [email protected] 
OK 

Creating route joinsplit-20170529103009108-anecdotal-menorah.mybluemix.net... 
OK 

Binding joinsplit-20170529103009108-anecdotal-menorah.mybluemix.net to JoinSplit-20170529103009108... 
OK 

Uploading JoinSplit-20170529103009108... 
Uploading app files from: /home/pipeline/4095d817-6887-4f7e-b317-c58c97c5afd7 
Uploading 165.2K, 34 files 


Done uploading 
OK 

Starting app JoinSplit-20170529103009108 in org Subhadeep/space dev as [email protected] 
Creating container 
Successfully created container 
Downloaded app package (437.8K) 
-----> Download go 1.8.3 
-----> Checking Godeps/Godeps.json file 
-----> Installing godep v79 
     Download [https://buildpacks.cloudfoundry.org/dependencies/godep/godep-v79-linux-x64-9e37ce0f.tgz] 
-----> Installing glide v0.12.3 
     Download [https://buildpacks.cloudfoundry.org/dependencies/glide/glide-v0.12.3-linux-x64-aa256363.tgz] 
-----> Installing go 1.8.3 
     Download [https://buildpacks.cloudfoundry.org/dependencies/go/go1.8.3.linux-amd64-32ec5ac6.tar.gz] 
-----> Running go build finalize 
     [31;1m**WARNING**[0m vendor/ directory does not exist. 
     [31;1m**WARNING**[0m Installing package '.' (default) 
-----> Running: go install -tags cloudfoundry -buildmode pie . 
Exit status 0 
Staging complete 
Uploading droplet, build artifacts cache... 
Uploading build artifacts cache... 
Uploading droplet... 
Uploaded build artifacts cache (194B) 
Uploaded droplet (2.7M) 
Uploading complete 
Successfully destroyed container 

0 of 1 instances running, 1 starting 
0 of 1 instances running, 1 starting 
0 of 1 instances running, 1 starting 
0 of 1 instances running, 1 starting 
0 of 1 instances running, 1 starting 
0 of 1 instances running, 1 starting 
0 of 1 instances running, 1 starting 
0 of 1 instances running, 1 starting 
0 of 1 instances running, 1 starting 
0 of 1 instances running, 1 starting 
0 of 1 instances running, 1 starting 
0 of 1 instances running, 1 starting 
0 of 1 instances running, 1 starting 
0 of 1 instances running, 1 starting 
0 of 1 instances running, 1 starting 
0 of 1 instances running, 1 starting 
0 of 1 instances running, 1 starting 
0 of 1 instances running, 1 starting 
0 of 1 instances running, 1 starting 
0 of 1 instances running, 1 starting 
0 of 1 instances running, 1 starting 
0 of 1 instances running, 1 starting 
0 of 1 instances running, 1 starting 
0 of 1 instances running, 1 starting 
0 of 1 instances running, 1 starting 
0 of 1 instances running, 1 starting 
0 of 1 instances running, 1 starting 
0 of 1 instances running, 1 starting 
0 of 1 instances running, 1 crashed 
FAILED 
Error restarting application: Start unsuccessful 

TIP: use 'cf logs JoinSplit-20170529103009108 --recent' for more information 

Finished: FAILED 

答えて

3

あなたのコードは、ハードコードポートで待機しています"8081"、Bluemix/Cloud Foundry環境で提供されているものではありません。あなたのMain関数で次のようなものを試してみてください:

err := http.ListenAndServe(":"+os.Getenv("PORT"), nil) 
+0

ありがとう。出来た –

関連する問題