IBM / go-sdk-core

The go-sdk-core repository contains core functionality required by Go code generated by the IBM OpenAPI SDK Generator.
Apache License 2.0
30 stars 24 forks source link

Failed to deploy to IBM Cloud #42

Closed victorshinya closed 4 years ago

victorshinya commented 4 years ago

I built a new application in Golang, using Go Modules, and I've been trying to deploy to IBM Cloud but I've faced the same issue (logs below). I am not sure if this is something I did or something I built wrongly but since this is happening to me in a couple of other accounts (same application in other IBM Cloud accounts), maybe there are other developers who are facing the same stuff.

Service -> (Public) Cloud Foundry, Golang buildpack. App -> https://github.com/victorshinya/natural-language-understanding-demo

ERROR -> build github.com/victorshinya/natural-language-understanding-demo: cannot load github.com/IBM/go-sdk-core/core: open /tmp/app/vendor/github.com/IBM/go-sdk-core/core: no such file or directory

go.mod

module github.com/victorshinya/natural-language-understanding-demo

go 1.12

require (
    github.com/IBM/go-sdk-core v1.1.0
    github.com/go-openapi/strfmt v0.19.3 // indirect
    github.com/go-playground/universal-translator v0.17.0 // indirect
    github.com/gorilla/mux v1.7.3
    github.com/joho/godotenv v1.3.0
    github.com/onsi/ginkgo v1.10.3 // indirect
    github.com/onsi/gomega v1.7.1 // indirect
    github.com/rs/cors v1.7.0
    github.com/watson-developer-cloud/go-sdk v1.0.0
    golang.org/x/net v0.0.0-20191125084936-ffdde1057850 // indirect
    golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e // indirect
    golang.org/x/sys v0.0.0-20191126131656-8a8471f7e56d // indirect
    gopkg.in/go-playground/validator.v9 v9.30.2 // indirect
    gopkg.in/yaml.v2 v2.2.7 // indirect
)

Logs

Updating app knowledge-studio-demo...
Mapping routes...
Comparing local files to remote cache...
Packaging files to upload...
Uploading files...
 186.19 KiB / 186.19 KiB [===========================================================================================================================================================================================] 100.00% 2s

Waiting for API to complete processing files...

Staging app and tracing logs...
   Downloading go_buildpack...
   Downloaded go_buildpack
   Cell 87626c63-eae1-42ff-a4fb-785ef79934bd creating container for instance 5a085dfb-cef3-433d-b74b-f2dee91cadc4
   Cell 87626c63-eae1-42ff-a4fb-785ef79934bd successfully created container for instance 5a085dfb-cef3-433d-b74b-f2dee91cadc4
   Downloading app package...
   Downloaded app package (1.2M)
   -----> Go Buildpack version 1.8.42
          **WARNING** [DEPRECATION WARNING]:
          **WARNING** Please use AppDynamics extension buildpack for Golang Application instrumentation
          **WARNING** for more details: https://docs.pivotal.io/partners/appdynamics/multibuildpack.html
   -----> Installing godep 80
          Download [https://buildpacks.cloudfoundry.org/dependencies/godep/godep-v80-linux-x64-cflinuxfs3-b60ac947.tgz]
   -----> Installing glide 0.13.3
          Download [https://buildpacks.cloudfoundry.org/dependencies/glide/glide-v0.13.3-linux-x64-cflinuxfs3-ef07acb5.tgz]
   -----> Installing dep 0.5.4
          Download [https://buildpacks.cloudfoundry.org/dependencies/dep/dep-v0.5.4-linux-x64-cflinuxfs3-79b3ab9e.tgz]
   -----> Installing go 1.12.7
          Download [https://buildpacks.cloudfoundry.org/dependencies/go/go1.12.7.linux-amd64-cflinuxfs3-040d6b6f.tar.gz]
          **WARNING** Installing package '.' (default)
   -----> Running: go install -tags cloudfoundry -buildmode pie .
   build github.com/victorshinya/natural-language-understanding-demo: cannot load github.com/IBM/go-sdk-core/core: open /tmp/app/vendor/github.com/IBM/go-sdk-core/core: no such file or directory
          **ERROR** Unable to compile application: exit status 1
   Failed to compile droplet: Failed to run finalize script: exit status 12
   Exit status 223
   Cell 87626c63-eae1-42ff-a4fb-785ef79934bd stopping instance 5a085dfb-cef3-433d-b74b-f2dee91cadc4
   Cell 87626c63-eae1-42ff-a4fb-785ef79934bd destroying container for instance 5a085dfb-cef3-433d-b74b-f2dee91cadc4
   Cell 87626c63-eae1-42ff-a4fb-785ef79934bd successfully destroyed container for instance 5a085dfb-cef3-433d-b74b-f2dee91cadc4
Error staging application: App staging failed in the buildpack compile phase
FAILED
ehdsouza commented 4 years ago

@victorshinya did you try building go build .. There seems to be some confusion on the path as it seems to be looking into vendor directory.

victorshinya commented 4 years ago

I ran go install -tags cloudfoundry -buildmode pie . locally and it worked. In this case, when you deploy an application using public Cloud Foundry on IBM Cloud, you don't need to build the app before you deploy (like Java). it should build and start automatically.

victorshinya commented 4 years ago

I am closing the issue since I figured out that I need to deploy the vendor/ folder to the IBM Cloud so Cloud Foundry can use all vendor package to build the app. Probably it will be solved in another Cloud Foundry's Go buildpack.