i've been a happy user for pydev, eclipse and gae.
Now i've changed my computer and reinstalled the latest jee eclipse, pydev and gae. As usual, I configure my pydev gae project (I use App Engine Modules), have it launched by the eclipse debugger.
The issue is that as soon as I launch a cron task through the admin interface (localhost:8000/cron), every thread terminates and the dev_appserver ends (exit value : 137)
Everything run smooth when launching dev_appserver.py by hand and with pycharm (i'd like to keep using pydev!)
versions
Google Cloud SDK 0.9.33
app-engine-python 1.9.12
eclipse 4.4.1
pydev 3.8.0.201425
Debug windows content
<terminated>xxxx xxxx (1) [PyDev Google App Run]
<terminated>dev_appserver.py
dev_appserver.py
dev_appserver.py
dev_appserver.py
<terminated, exit value: 137>dev_appserver.py
console ouput
pydev debugger: starting (pid: 20240)
INFO 2014-10-15 10:27:19,522 api_server.py:171] Starting API server at: http://localhost:34966
INFO 2014-10-15 10:27:19,523 dispatcher.py:174] Starting dispatcher running at: http://localhost:8080
INFO 2014-10-15 10:27:19,553 dispatcher.py:186] Starting module "default" running at: http://localhost:8081
INFO 2014-10-15 10:27:19,586 dispatcher.py:186] Starting module "static-backend" running at: http://localhost:8082
INFO 2014-10-15 10:27:19,589 admin_server.py:117] Starting admin server at: http://localhost:8000
pydev debugger: starting (pid: 20264)
Related
Writing this issue as I have no idea how to investigate it.
We're having problems in deploying an app engine flexible application.
The problem is, that the only error we get is the following:
GCLOUD: ERROR: (gcloud.app.deploy) Error Response: [4] Timed out waiting for the app infrastructure to become healthy.
I tried already the following:
Try a simple helloWorld app, to make sure it's not an application issue
Check quota settings -> All green
Check activity stream for warnings or errors
Check logs for warngings or errors
Grant owner role to service account which is deploying the app
App.yaml:
service: test-service # Id of the service
env: flex # Flex environment
runtime: java # Java runtime
runtime_config:
jdk: openjdk8 # use OpenJDK 8
resources:
cpu: 1
memory_gb: 2.8
gcloud version
Google Cloud SDK 214.0.0 alpha 2018.08.24
app-engine-java 1.9.64
app-engine-python 1.9.74 beta 2018.08.24 bq 2.0.34
cloud-datastore-emulator 2.0.2
core 2018.08.24
gsutil 4.33
kubectl 2018.08.24
pubsub-emulator 2018.08.24
After contacting the google technical support, we found out, that the default app engine service account didn't have the Editor role. After assigning the editor role the deployment worked again.
This error is often reported when your application has reached the quota limit for "In-use IP addresses". Similar error was reported on this Google Cloud Platform issue link. The default value for the in-use addresses is '8', and this quota value can be increased clicking the 'Edit' button in the Cloud Console — Ensure you are editing the value for In-use IP addresses.
The Google engineer confirmed that there is a planned improvement to the quota error details to be implemented in one of the next versions of gcloud SDK. You can track updates on the CloudSDK within this Google Group link
I started using Google App Engine today, so hopefully the answer will be obvious to someone with experience. After simply following this method to get App Engine interfacing with Cloud SQL, I'm having a frustrating issue: goapp deploy succeeds but goapp serve fails (using the cloud shell).
Here's the error:
XXXX#cloudshell:~/src/XXXX/app-engine (XXXX)$ goapp serve app.yaml
INFO 2018-06-21 07:29:08,115 devappserver2.py:764] Skipping SDK update check.
INFO 2018-06-21 07:29:08,235 api_server.py:268] Starting API server at: http://0.0.0.0:60628
INFO 2018-06-21 07:29:08,305 dispatcher.py:199] Starting module "default" running at: http://0.0.0.0:8080
INFO 2018-06-21 07:29:08,306 admin_server.py:116] Starting admin server at: http://0.0.0.0:8000
ERROR 2018-06-21 07:29:12,254 go_runtime.py:181] Failed to build Go application: (Executed command: /google/go_appengine/goroot/bin/go-app-builder -app_base /home/XXX/app-engine -arch 6 -dynamic -goroot /google/go_appengine/goroot -gopath /home/XXX/gopath:/google/gopath -nobuild_files ^^$ -incremental_re
build -unsafe -binary_name _go_app -extra_imports appengine_internal/init -work_dir /tmp/tmpT1RTRMappengine-go-bin -gcflags -I,/google/go_appengine/goroot/pkg/linux_amd64_appengine -l
dflags -L,/google/go_appengine/goroot/pkg/linux_amd64_appengine hello.go)
/home/XXX/gopath/src/github.com/go-sql-driver/mysql/connection.go:12: can't find import: "context"
2018/06/21 07:29:09 Can't find package "context" in $GOPATH: cannot find package "context" in any of:
/google/go_appengine/goroot/src/context (from $GOROOT)
/home/XXX/gopath/src/context (from $GOPATH)
/google/gopath/src/context
2018/06/21 07:29:12 go-app-builder: build timing: 0×skip (3ms total), 9×compile (2.731s total), 0×link (0 total)
2018/06/21 07:29:12 go-app-builder: failed running compile: exit status 2
I'm suspicious that the version of go being used is wrong. The stated version is 1.6.3 but as I understand "context" requires 1.7. Here's the relevant cloud shell output for that:
XXXX#cloudshell:~ (XXX)$ goapp version
go version go1.6.3 (appengine-1.9.48) linux/amd64
XXXX#cloudshell:~ (XXX)$ go version
go version go1.10 linux/amd64
However, despite my best efforts I have been unable to find any resources on how to manipulate the "goapp" go version.
My app.yaml includes:
runtime: go
api_version: go1.8
And goapp get yields this:
XXXX#cloudshell:~/src/XXX/app-engine (XXX)$ goapp get
package context: unrecognized import path "context" (import path does not begin with hostname)
The go file itself is an exact copy of the demo from the linked above.
As confirmed on a comment on the question the solution was using dev_appserver.py, instead of goapp serve.
goapp is the old tool to handle GAE tasks. Now it's recommended to use dev_appserver.py for the local development, and gcloud app commands for tasks in the cloud (e.g. gcloud app deploy instead of goapp deploy).
Note that goapp is not deprecated, but dev_appserver.py provides more flexibility on local dev, while gcloud app uses the properly documented and quite useful App Engine Admin API (unlike the older tools), making debugging a lot easier in case something goes wrong with your deployment.
In Google App Engine, if you need to get a context, you should probably use google.golang.org/appengine.NewContext() for a context during an HTTP request, or google.golang.org/appengine.BackgroundContext() if it's outside a request. Both return context.Context, which is the same that you would get by creating a context through the context package, but with a context prepared to be used within GAE.
This does not tell you why the imports are not working (other than goapp looks to be using 1.6), but will just work around the issue avoiding you to import any context package.
I'm trying to run the latest Go SDK of Google App Engine on Windows Subsystem for Linux. I want to bind it to port 8080 but the system keeps trying to bind to port 80, and failing.
$ dev_appserver.py --port 8080 .
INFO 2018-06-08 02:48:56,648 devappserver2.py:120] Skipping SDK update check.
INFO 2018-06-08 02:48:56,786 api_server.py:274] Starting API server at: http://localhost:53314
INFO 2018-06-08 02:48:56,791 dispatcher.py:270] Starting module "default" running at: http://localhost:8080
INFO 2018-06-08 02:48:56,792 admin_server.py:152] Starting admin server at: http://localhost:8000
ERROR 2018-06-08 02:48:58,427 http_runtime.py:396] bad runtime process port ['2018.0608.0248.5842 listen tcp :80: bind: permission denied\n']
I found the problem. I am porting this code from non-appengine Go code, and I had left "http.ListenAndServe(":80", nil)" in the code.
I found the problem. I am porting this code from non-appengine Go code, and I had left "http.ListenAndServe(":80", nil)" in the code.
My app.yaml
runtime: custom
vm: true
api_version: 1
health_check:
enable_health_check: False
Dockerfile
# Use the official go docker image built on debian.
FROM golang:1.5.1
# Grab the source code and add it to the workspace.
ADD . /go/
# Install revel and the revel CLI.
RUN go get github.com/revel/revel
RUN go get github.com/revel/cmd/revel
# Use the revel CLI to start up our application.
ENTRYPOINT revel run 4quorum-appengine dev 8080
# Open up the port where the app is running.
EXPOSE 8080
I was working through this article
http://jbeckwith.com/2015/05/08/docker-revel-appengine/
Preview
I am trying to preview it:
gcloud preview app run app.yaml --custom-entrypoint "revel run 4quorum-appengine dev 8080"
WARNING: The `app run` command is deprecated and will soon be removed.
Please use dev_appserver.py (in the same directory as the `gcloud` command) instead.
Module [default] found in file [/Users/802619/Projects/src/4quorum_root/app.yaml]
INFO: Looking for the Dockerfile in /Users/802619/Projects/src/4quorum_root
INFO: Using Dockerfile found in /Users/802619/Projects/src/4quorum_root
INFO 2015-11-06 18:03:44,226 application_configuration.py:399] No version specified. Generated version id: 20151106t180344
INFO 2015-11-06 18:03:44,226 devappserver2.py:763] Skipping SDK update check.
INFO 2015-11-06 18:03:44,266 api_server.py:205] Starting API server at: http://localhost:62780
INFO 2015-11-06 18:03:44,272 dispatcher.py:197] Starting module "default" running at: http://localhost:8080
INFO 2015-11-06 18:03:44,277 admin_server.py:116] Starting admin server at: http://localhost:8000
ERROR 2015-11-06 18:03:44,282 instance.py:280] [Errno 2] No such file or directory
The same thing if trying dev_appserver.py
Deploy
Deploy also doesn't work. Fails because of timeout.
gcloud preview app deploy ./app.yaml
WARNING: Soon, deployments will set the deployed version to receive all traffic by
default.
To keep the current behavior (where new deployments do not receive any traffic),
use the `--no-promote` flag or run the following command:
$ gcloud config set app/promote_by_default false
To adopt the new behavior early, use the `--promote` flag or run the following
command:
$ gcloud config set app/promote_by_default true
Either passing one of the new flags or setting one of these properties will
silence this message.
You are about to deploy the following modules:
- vaulted-gift-112113/default (from [/Users/802619/Projects/src/4quorum_root/app.yaml])
Deployed URL: [https://20151106t204027-dot-vaulted-gift- 112113.appspot.com]
(add --promote if you also want to make this module available from
[https://vaulted-gift-112113.appspot.com])
Beginning deployment...
Verifying that Managed VMs are enabled and ready.
Provisioning remote build service.
Copying certificates for secure access. You may be prompted to create an SSH keypair.
Building and pushing image for module [default]
Saving [.dockerignore] to [/Users/802619/Projects/src/4quorum_root].
----------------------------- DOCKER BUILD OUTPUT ------------------------------
Step 0 : FROM golang:1.5.1
---> f6271e8f3723
Step 1 : ADD . /go/
---> 94fafc5e8a30
Removing intermediate container cfbe197f6e93
Step 2 : RUN go get github.com/revel/revel
---> Running in d7ad8c923144
---> b65877cf3049
Removing intermediate container d7ad8c923144
Step 3 : RUN go get github.com/revel/cmd/revel
---> Running in 2a9b3320ce47
---> 428defd008f3
Removing intermediate container 2a9b3320ce47
Step 4 : ENTRYPOINT revel run 4quorum-appengine dev 8080
---> Running in 8b9e38ec69ec
---> 3749ee8a6636
Removing intermediate container 8b9e38ec69ec
Step 5 : EXPOSE 8080
---> Running in a0e6c66b56c8
---> dafff62b9643
Removing intermediate container a0e6c66b56c8
Successfully built dafff62b9643
--------------------------------------------------------------------------------
Copying files to Google Cloud Storage...
Synchronizing files to [gs://staging.vaulted-gift-112113.appspot.com/].
Updating module [default]...|Deleted [https://www.googleapis.com/compute/v1/projects/vaulted-gift- 112113/zones/us-central1-f/instances/gae-builder-vm-20151106t204027].
Updating module [default]...failed.
ERROR: (gcloud.preview.app.deploy) Error Response: [4] Timed out creating VMs.
About to drop this.
Moved to heroku. Google App Engine is not ready yet.
I successfully launched an app locally on the local host
When I deployed to the appengine I got an error.
com.google.appengine.tools.admin.HttpIoException: Error posting to URL: https://appengine.google.com/api/appversion/create?app_id=my_id&version=1&
404 Not Found
This application does not exist (app_id=u'my_id').
For some reason the ID given in the error has u and a space appended in the beginning
I doubled checked the application exists and succesfuly uploaded the app from another computer
All the solutions I can find (like "This application does not exist (app_id=xxx)", or "GAE - Deployment Error: “AttributeError: can't set attribute”") mention running appcfg.py with the --no_cookies
C:\Program Files (x86)\Google\google_appengine\appcfg.py
appcfg.py --no_cookies update my-app-folder\
# or (2-steps verificatio enabled)
appcfg.py --oauth2 --no_cookies update my-app-folder\
If the project contains Java7 classes, you need to add the --use_java7 option, as shown in the question "Failed to deploy to Google App Engine because --use_java7 flag has not been set".
While you can run appcfg from the GAE installation path, the page "Using the Google Plugin for Eclipse" mentions (at the bottom of the page):
Some features of the App Engine Java SDK tools are only available by running the tools directly from the command line. If you have installed the SDK using Eclipse, you can run these tools from the Eclipse plugin installation directory.
The SDK is located in your Eclipse installation directory, under plugins/com.google.appengine.eclipse.sdkbundle_VERSION/, where VERSION is a version identifier for the SDK.
In this directory is the appengine-java-sdk/bin/ subdirectory containing the tools.