Search code examples
goibm-cloudcloud-foundry

Go application deployment in Bluemix fails


I am facing issues with pushing the sample Go applicaiton in Bluemix.

I will explain the steps I followed to push the applicaiton.

  1. Created D:/goapp2016 and set it to GOPATH.
  2. created src, pkg and bin folders in D:/goapp2016
  3. In src, created "myapp" folder and written a sample app.go file.
  4. Ran "go get" command inside GOPATH/src/myapp and that downloaded the libraries from Git in GOAPTH/src folder and mysql.a,native.a files in D:\goapp2016\pkg\windows_amd64\github.com\ziutek\mymysql. And myapp.exe is also created in GOPATH/bin after running go get command.
  5. Ran "godep save" command which created Godeps/Godeps.json and vendor/(dependent libraries) folder in GOPATH/src/myapp.
  6. To push the application to bluemix, I executed cf push command from GOPATH directory.

But, this is giving the below error.

-------> Buildpack version 1.7.5
file:///var/vcap/data/dea_next/admin_buildpacks/e57c0cd5-3b42-424d-ad32-b0bee17b
c1b0_a25a466217b64d5e4d47a6796be8ab23e7b7eeaf/dependencies/https___pivotal-build
packs.s3.amazonaws.com_concourse-binaries_godep_godep-v62-linux-x64.tgz
-----> Installing go1.6... done
Downloaded [file:///var/vcap/data/dea_next/admin_buildpacks/e57c0cd5-3b42-424d-a
d32-b0bee17bc1b0_a25a466217b64d5e4d47a6796be8ab23e7b7eeaf/dependencies/https___s
torage.googleapis.com_golang_go1.6.linux-amd64.tar.gz]
 !
 !     Error: Cloud Foundry does not support the GB package manager
 !     We currently only support the 'Godep' package manager for go apps
 !     For support please file an issue: https://github.com/cloudfoundry/go-    buildpack/issues
 !
 Staging failed: Buildpack compilation step failed

Directory Structure:

goapp2016/
    bin/
        godep.exe
        myapp.exe
    pkg/
        windows_amd64/
            github.com/
                tools/
                    godep/
                ziutek/
                    mymysql

    src/
        github.com/
            ziutek/

        myapp/  
            app.go
            Godeps/
                Godeps.json
            vendor/
                github.com/
                    ziutek/

    manifest.yml
    Procfile

Am I missing anything here?


Solution

  • The compile file for the buildpack can be seen here: https://github.com/cloudfoundry/go-buildpack/blob/master/bin/compile

    Dependency tool selection begins on line 136, as long as there is a Godeps/Godeps.json file, the buildpack should used godeps, not GB. Are you sure you are pushing from the folder than contains the Godeps folder, that in turn contains the Godeps.json file?