Quickstart for Go App Engine Standard Environment is not mood enhancing on Windows

367 views
Skip to first unread message

Kees Varekamp

unread,
Aug 23, 2018, 9:52:04 PM8/23/18
to google-appengine-go
Hi there,

I'm trying to follow the Quickstart from https://cloud.google.com/appengine/docs/standard/go/quickstart on Windows but it's not very mood enhancing. Perhaps someone knows what I should try next?

* I've got the cloud SDK installed:
C:\Users\kees\gae\helloworld>gcloud components list

Your current Cloud SDK version is: 213.0.0
The latest available version is: 213.0.0

+-------------------------------------------------------------------------------------------------------------+
| Components |
+---------------+------------------------------------------------------+--------------------------+-----------+
| Status | Name | ID | Size |
+---------------+------------------------------------------------------+--------------------------+-----------+
...
| Installed | App Engine Go Extensions | app-engine-go | 154.5 MiB |
| Installed | BigQuery Command Line Tool | bq | < 1 MiB |
| Installed | Cloud Datastore Emulator | cloud-datastore-emulator | 17.4 MiB |
| Installed | Cloud SDK Core Libraries | core | 8.3 MiB |
| Installed | Cloud Storage Command Line Tool | gsutil | 3.6 MiB |
| Installed | gcloud app Python Extensions | app-engine-python | 6.2 MiB |
+---------------+------------------------------------------------------+--------------------------+-----------+

* I put the Hello World sample in %HOMEPATH%\gae\helloworld.

* The Quickstart tutorial next instructs me to run:
dev_appserver.py app.yaml.

*This doesn't work on Windows, so I modified it to:
c:\Python27\python.exe C:%HOMEPATH%\AppData\Local\Google\Cloud" "SDK\google-cloud-sdk\platform\google_appengine\dev_appserver.py app.yaml

* That version of the command runs, but the build fails:
ERROR    2018-08-24 13:35:08,111 instance_factory.py:229] Failed to build Go application: (Executed command: C:\Users\kees\AppData\Local\Google\Cloud SDK\google-cloud-sdk\platform\google_appengine\goroot-1.9\bin\go-app-builder.exe -app_base C:\Users\kees\gae\helloworld -api_version go1 -arch 6 -dynamic -goroot C:\Users\kees\AppData\Local\Google\Cloud SDK\google-cloud-sdk\platform\google_appengine\goroot-1.9 -nobuild_files ^^$ -incremental_rebuild -unsafe -binary_name _go_app -extra_imports appengine_internal/init -work_dir c:\users\kees\appdata\local\temp\tmpvpzy1nappengine-go-bin -gcflags -I,C:\\Users\\kees\\AppData\\Local\\Google\\Cloud SDK\\google-cloud-sdk\\platform\\google_appengine\\goroot-1.9\\pkg\\windows_amd64_appengine -ldflags -L,C:\\Users\\kees\\AppData\\Local\\Google\\Cloud SDK\\google-cloud-sdk\\platform\\google_appengine\\goroot-1.9\\pkg\\windows_amd64_appengine hello.go)
c:\users\kees\appdata\local\temp\tmpvpzy1nappengine-go-bin\hello.go:11:2: can't find import: "google.golang.org/appengine"

* Found a suggestion to replace  "google.golang.org/appengine" with "appengine" somewhere, but no luck:
ERROR    2018-08-24 13:41:27,938 instance_factory.py:229] Failed to build Go application: (Executed command: C:\Users\kees\AppData\Local\Google\Cloud SDK\google-cloud-sdk\platform\google_appengine\goroot-1.9\bin\go-app-builder.exe -app_base C:\Users\kees\gae\helloworld -api_version go1 -arch 6 -dynamic -goroot C:\Users\kees\AppData\Local\Google\Cloud SDK\google-cloud-sdk\platform\google_appengine\goroot-1.9 -nobuild_files ^^$ -incremental_rebuild -unsafe -binary_name _go_app -extra_imports appengine_internal/init -work_dir c:\users\kees\appdata\local\temp\tmpwspdkiappengine-go-bin -gcflags -I,C:\\Users\\kees\\AppData\\Local\\Google\\Cloud SDK\\google-cloud-sdk\\platform\\google_appengine\\goroot-1.9\\pkg\\windows_amd64_appengine -ldflags -L,C:\\Users\\kees\\AppData\\Local\\Google\\Cloud SDK\\google-cloud-sdk\\platform\\google_appengine\\goroot-1.9\\pkg\\windows_amd64_appengine hello.go)
c:\users\kees\appdata\local\temp\tmpwspdkiappengine-go-bin\hello.go:16:2: undefined: appengine.Main

* Also found a suggestion to use goapp serve instead of dev_appserver.py, but that one has a path escape problem it seems:
python: can't open file 'C:\Users\kees\AppData\Local\Google\Cloud': [Errno 2] No such file or directory

Thanks,

Kees

RVJ Callanan

unread,
Aug 26, 2018, 6:43:53 AM8/26/18
to google-appengine-go
Hi Kees,

I have discovered exactly the same problem after returning to the Appengine Go runtime following a six-month hiatus. 
And, like you, I have followed the instructions to the letter.

These problems simply should not get through the official build process.
At the very least, an SDK release candidate should be downloaded and tested on a clean PC with no developer artefacts.

I hope this and other issues will resolved soon so we can settle down to a less chaotic development environment.
As things stand, I have to refactor my build automation tools on existing projects with alarming frequency.

Cheers,
Roger

RVJ Callanan

unread,
Aug 27, 2018, 3:01:19 AM8/27/18
to google-appengine-go
Ok, here is the solution.

Avoid online examples/tutorials which are often hopelessly out of date.
Use the Go demos packaged in SDK at:

<install-root>\google-cloud-sdk\platform\google_appengine\demos\go

Also beware that there are two versions of dev_appserver in SDK.
Always use the platform-specific version, in this case:

<install-root>\google-cloud-sdk\platform\google_appengine\dev_appserver.py

Steven Buss

unread,
Sep 12, 2018, 5:27:34 PM9/12/18
to RVJ Callanan, google-appengine-go
It looks like you have a version mismatch between the core appengine component and the app-engine-go component. Does this problem persist after you run `gcloud components update`?

--
You received this message because you are subscribed to the Google Groups "google-appengine-go" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-appengin...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-appengine-go/155ea5aa-007e-459d-ad18-ccaa059f1cd0%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Constantin Konstantinidis

unread,
Sep 13, 2018, 2:45:37 PM9/13/18
to google-appengine-go
I don't know how far you got but I investigated the issue to update my sandbox on Google Cloud.
A working configuration for hello world style is here https://github.com/iWdGo/testinghello.
c:\users\kees\appdata\local\temp\tmpvpzy1nappengine-go-bin\hello.go:11:2: can't find import: "google.golang.org/appengine"
Normally, go get appengine has no use. Reference has to use google.golang/org prefix if you work with a recent version of Go.
If failing, your GOROOT/GOPATH might have to be fixed.

I didn't see a trace of Go version that you use. Go 1.11 is best unless you have specific issues.
I understand that the code is very simple but the yaml file is not shown; Depending on flex/std usage, the set up has variations.
 
Reply all
Reply to author
Forward
0 new messages