Google cloud Appengine standard environment deployment using Admin API: “Cant find import” Error

38 views
Skip to first unread message

Subra R

unread,
Sep 5, 2018, 1:46:46 PM9/5/18
to Google App Engine

I am trying to deploy a simple "hello world" application in Appengine standard - Go environment via the Admin API. There is one source file hello.go with one import "google.golang.org/appengine"

I followed the documentation here for deployment. But I got "can't find import: google.golang.org/appengine" error when I checked the status of the deployment.

So I uploaded the google.golang.org library folder to Cloud Storage, but documentation seems to only show how to include single files individually from GCS buckets using the FileInfo type, which is not feasible for big imported libraries.

I know all this will work with "gcloud app deploy", but I have to use the Admin API and standard environment.

  • Is there a way to tell Appengine to "go get" imported libraries?
  • Is there a way to include folders (not single files) from GCS bucket in deployment config files?

edgaral...@google.com

unread,
Sep 10, 2018, 1:56:16 PM9/10/18
to Google App Engine
1) In order to deploy a whole directory and not a single file as seen here:

ie from documentation:
"deployment": {
   
"files": {
     
"example-resource-file1": {
       
"sourceUrl": "https://storage.googleapis.com/[MY_BUCKET_ID]/example-application/example-resource-file1"
     
},

You would type the folder as follows:
"deployment": {
   
"files": {
     
"example-resource-file1": {
       
"sourceUrl": "https://storage.googleapis.com/[MY_BUCKET_ID]/example-application/[LIBRARY_FOLDER]"
     
},

Note that there is no forward slash at the end. If you put one it will throw an error.


2) If you upload the libraries along your application, you should be able to call the libraries by importing them in the code as follow:

Let me know if this helps.
Reply all
Reply to author
Forward
0 new messages