Skip to content

aetest fails with gcloud 468.0.0 or later #350

Closed
@sg0hsmt

Description

@sg0hsmt

aetest always seems to fail if gcloud is 468.0.0 or higher.

The latest version of dev_appserver.py does not support for runtimes that reached end of support 1.
However, I think aetest is failing because it specifies go111 as the runtime 2.

reproduction code (Go 1.21).

go.mod:

module github.com/sg0hsmt/aetest

go 1.21

require google.golang.org/appengine/v2 v2.0.5

require (
	github.com/golang/protobuf v1.5.0 // indirect
	google.golang.org/protobuf v1.30.0 // indirect
)

main.go:

package main

import (
	"google.golang.org/appengine/v2"
)

func main() {
	appengine.Main()
}

main_test.go:

package main

import (
	"testing"

	"google.golang.org/appengine/v2/aetest"
)

func TestInstance(t *testing.T) {
	inst, err := aetest.NewInstance(nil)
	if err != nil {
		t.Fatal(err)
	}
	t.Cleanup(func() { inst.Close() })
}
aetest with gcloud 467.0.0 (success).
vscode ➜ /workspaces/aetest (master) $ gcloud version
Google Cloud SDK 467.0.0
app-engine-go 1.9.76
app-engine-python 1.9.109
bq 2.0.101
bundled-python3-unix 3.11.8
cloud-datastore-emulator 2.3.1
core 2024.02.29
gcloud-crc32c 1.0.0
gsutil 5.27
vscode ➜ /workspaces/aetest (master) $ go version
go version go1.21.8 linux/amd64
vscode ➜ /workspaces/aetest (master) $ go test -v ./...
=== RUN   TestInstance
INFO     2024-03-24 10:27:28,641 devappserver2.py:321] Skipping SDK update check.
WARNING  2024-03-24 10:27:28,641 devappserver2.py:337] DEFAULT_VERSION_HOSTNAME will not be set correctly with --port=0
WARNING  2024-03-24 10:27:28,724 simple_search_stub.py:1196] Could not read search indexes from /tmp/appengine.testapp.vscode/search_indexes
INFO     2024-03-24 10:27:28,725 <string>:400] Starting API server at: http://localhost:41951
INFO     2024-03-24 10:27:28,730 dispatcher.py:276] Starting module "default" running at: http://localhost:40805
INFO     2024-03-24 10:27:28,731 admin_server.py:70] Starting admin server at: http://localhost:39805
INFO     2024-03-24 10:27:29,733 stub_util.py:374] Applying all pending transactions and saving the datastore
INFO     2024-03-24 10:27:29,734 stub_util.py:377] Saving search indexes
ERROR    2024-03-24 10:27:29,752 instance_factory.py:249] Failed to build Go application: (Executed command: go build -o /tmp/tmpcM_kGiappengine-go-bin/_ah_exe .)


go: go.mod file not found in current directory or any parent directory; see 'go help modules'

--- PASS: TestInstance (2.08s)
PASS
ok      github.com/sg0hsmt/aetest       2.086s
vscode ➜ /workspaces/aetest (master) $ 
aetest with gcloud 468.0.0 (failed).
vscode ➜ /workspaces/aetest (master) $ gcloud version
Google Cloud SDK 468.0.0
app-engine-go 1.9.76
app-engine-python 1.9.110
bq 2.0.101
bundled-python3-unix 3.11.8
cloud-datastore-emulator 2.3.1
core 2024.03.08
gcloud-crc32c 1.0.0
gsutil 5.27
vscode ➜ /workspaces/aetest (master) $ go version
go version go1.21.8 linux/amd64
vscode ➜ /workspaces/aetest (master) $ go test -v ./...
=== RUN   TestInstance
INFO     2024-03-24 10:35:56,879 <string>:321] Skipping SDK update check.
WARNING  2024-03-24 10:35:56,879 <string>:330] The default encoding of your local Python interpreter is set to 'utf-8' while App Engine's production environment uses 'ascii'; as a result your code may behave differently when deployed.
<string>:337: DeprecationWarning: The 'warn' function is deprecated, use 'warning' instead
WARNING  2024-03-24 10:35:56,879 <string>:337] DEFAULT_VERSION_HOSTNAME will not be set correctly with --port=0
WARNING  2024-03-24 10:35:56,952 _default.py:296] Authentication failed using Compute Engine authentication due to unavailable metadata server.
WARNING  2024-03-24 10:35:56,952 app_identity_stub.py:71] An exception has been encountered when attempting to use Application Default Credentials: Your default credentials were not found. To set up Application Default Credentials, see https://cloud.google.com/docs/authentication/external/set-up-adc for more information.. Falling back on dummy AppIdentityServiceStub.
WARNING  2024-03-24 10:35:56,997 simple_search_stub.py:1206] Could not read search indexes from /tmp/appengine.testapp.vscode/search_indexes
INFO     2024-03-24 10:35:57,005 <string>:392] Starting API server at: http://localhost:39363
INFO     2024-03-24 10:35:57,008 stub_util.py:374] Applying all pending transactions and saving the datastore
INFO     2024-03-24 10:35:57,008 stub_util.py:377] Saving search indexes
Traceback (most recent call last):
  File "/home/vscode/google-cloud-sdk/platform/google_appengine/dev_appserver.py", line 103, in <module>
    _run_file(__file__, globals())
  File "/home/vscode/google-cloud-sdk/platform/google_appengine/dev_appserver.py", line 99, in _run_file
    _execfile(_PATHS.script_file(script_name), globals_)
  File "/home/vscode/google-cloud-sdk/platform/google_appengine/dev_appserver.py", line 81, in _execfile
    exec(open(fn).read(), scope)
  File "<string>", line 643, in <module>
  File "<string>", line 631, in main
  File "<string>", line 404, in start
  File "/home/vscode/google-cloud-sdk/platform/google_appengine/google/appengine/tools/devappserver2/dispatcher.py", line 267, in start
    _service = self._create_module(module_configuration, service_port,
  File "/home/vscode/google-cloud-sdk/platform/google_appengine/google/appengine/tools/devappserver2/dispatcher.py", line 377, in _create_module
    module_instance = module_class(
  File "/home/vscode/google-cloud-sdk/platform/google_appengine/google/appengine/tools/devappserver2/module.py", line 1320, in __init__
    super(AutoScalingModule, self).__init__(**kwargs)
  File "/home/vscode/google-cloud-sdk/platform/google_appengine/google/appengine/tools/devappserver2/module.py", line 589, in __init__
    self._instance_factory = self._create_instance_factory(
  File "/home/vscode/google-cloud-sdk/platform/google_appengine/google/appengine/tools/devappserver2/module.py", line 232, in _create_instance_factory
    raise RuntimeError(
RuntimeError: Unknown runtime 'go111'; supported runtimes are 'go119', 'go120', 'go121', 'go122', 'php81', 'php82', 'python310', 'python311', 'python312', 'python38', 'python39'.
    main_test.go:12: unable to find admin server URL
--- FAIL: TestInstance (5.27s)
FAIL
FAIL    github.com/sg0hsmt/aetest       5.280s
FAIL
vscode ➜ /workspaces/aetest (master) $ 

Footnotes

  1. https://cloud.google.com/appengine/docs/standard/go/release-notes#March_12_2024

  2. https://github.com/golang/appengine/blob/v2.0.5/aetest/instance_vm.go#L278

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions