Receiving Emails in Google Cloud Environment

1,519 views
Skip to first unread message

Dave Greenly

unread,
Aug 22, 2015, 1:44:33 PM8/22/15
to Google App Engine
I would like to set up an App Engine, or Compute engine that has the ability to receive an email.  From the receipt of this email, I would want to start up a compute engine that would process some data.

Can anyone point me to some documentation, or samples where this has been done?

Thanks
Dave

Alex Martelli

unread,
Aug 22, 2015, 2:32:44 PM8/22/15
to google-a...@googlegroups.com
To receive email in app engine, see e.g https://cloud.google.com/appengine/docs/python/mail/receivingmail (there are similar docs for other app engine languages like Java and Go if you prefer those to Python).



Alex


--
You received this message because you are subscribed to the Google Groups "Google App Engine" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-appengi...@googlegroups.com.
To post to this group, send email to google-a...@googlegroups.com.
Visit this group at http://groups.google.com/group/google-appengine.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-appengine/0a9c85a6-b737-43ab-bd35-f27f977a28b1%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Dave Greenly

unread,
Aug 25, 2015, 1:04:55 PM8/25/15
to Google App Engine
I am currently using GO to catch an email on my AppEngine which has  been working, but I am having trouble getting the compute engine started utilizing my own persistent disk.

I was starting to prototype calling a Python script and attempted to deploy my GO application to the AppEngine using the "goapp deploy" command.

I received a goapp command not found error. (Which has worked in the past perfectly)

So I was confused, and went looking for the command and it does not seem to exist in the google-cloud-sdk/bin directory anymore?

Then being really confused, I tried to reinstall it using the following commands, only to find out that it was no longer distributed?  

I am a bit lost, can anyone please provide some insight on how I am "officially" supposed to be deploying apps?

There seems to be plenty of info out there still about the "goapp deploy" command, but I can't find anything on starting a compute engine using GO instead of Python.

sudo gcloud components update gae-goWARNING: Component [gae-go] no longer exists.WARNING: The standalone App Engine SDKs are no longer distributed through the Cloud SDK(however, the appcfg and dev_appserver commands remain the official andsupported way of using App Engine from the command line). If you want tocontinue using these tools, they are available for download from the officialApp Engine download page here: https://cloud.google.com/appengine/downloads
Thanks
Dave

Alex Martelli

unread,
Aug 25, 2015, 2:20:19 PM8/25/15
to google-a...@googlegroups.com
gcloud doesn't come with the language-specific deployment tools any more, as the message says just visit https://cloud.google.com/appengine/downloads and directly download whatever specific language deployment kits you want.

(you can use https://cloud.google.com/sdk/gcloud/reference/preview/app/deploy -- but as the "preview" indicates, that's still in beta, so, for production, the per-language deployment kits may be more suitable).

All client libraries for Google APIs for Go are at https://github.com/google/google-api-go-client/ -- in particular, see https://github.com/google/google-api-go-client/tree/master/compute/v1 .


Alex


Dave Greenly

unread,
Aug 25, 2015, 6:01:07 PM8/25/15
to google-a...@googlegroups.com
I downloaded the Go deployment script from this link as you suggested https://cloud.google.com/appengine/downloads and now I have the goapp command available.

But when I run the command, I am getting an authentication error and can't figure out what exactly it is asking me to do.

I used to just run the command "goapp deploy" and it would deploy my application to the App server.  Now I get the following error:  I am not sure what changed, but this command definitely worked before, and now I get this error.


goapp deploy09:47 PM Application: sn-auto-data-mgmt; version: 109:47 PM Host: appengine.google.com09:47 PM Starting update of app: xx-xx-xxx-xxx, version: 109:47 PM Getting current resource limits.Your browser has been opened to visit: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxIf your browser is on a different machine then exit and re-run thisapplication with the command-line parameter --noauth_local_webserve


I don't seem to understand the syntax of the command or something.  If I execute (I have tried a bunch of different options)
"goapp deploy --noauth_local_webserver app.yaml"

Then I just get the typical usage error:usage: deploy [deploy flags] [ application_dir | package | yaml_files...]
Deploy uploads your application files to Google App Engine, and then compilesand lauches your application.The argument to this command should be your application's root directory or asingle package which contains an app.yaml file. If you are using the Modulesfeature, then you should pass multiple YAML files to deploy, rather than adirectory, to specify which modules to update. If no arguments are provided,deploy looks in your current directory for an app.yaml file.The -application flag sets the application ID, overriding the application valuefrom the app.yaml file.The -version flag sets the major version, overriding the version value from theapp.yaml file.The -oauth flag causes authentication to be done using OAuth2, instead ofinteractive password auth.This command wraps the appcfg.py command provided as part of the App EngineSDK. For help using that command directly, run: ./appcfg.py help update

--
You received this message because you are subscribed to a topic in the Google Groups "Google App Engine" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/google-appengine/zUsIOjkBo9E/unsubscribe.
To unsubscribe from this group and all its topics, send an email to google-appengi...@googlegroups.com.

To post to this group, send email to google-a...@googlegroups.com.
Visit this group at http://groups.google.com/group/google-appengine.

Alex Martelli

unread,
Aug 25, 2015, 6:21:42 PM8/25/15
to google-a...@googlegroups.com
*Do* you have a browser on the machine you're running goapp in? If so, then, when it says "Your browser has been opened to visit" then go to the tab it has opened and follow the instructions there. If not, that's when you need the --oauth --noauth_local_webserver (and visiting that URL from a browser on a different machine, etc, again per instruction) -- as documented at https://cloud.google.com/appengine/docs/go/tools/uploadinganapp .

(I imagine the reason things worked previously for you is because goapp was riding piggyback on the auth tokens stored by gcloud, but now it needs its own).


Alex


Dave Greenly

unread,
Aug 25, 2015, 6:38:51 PM8/25/15
to google-a...@googlegroups.com
I could not get the goapp deploy to work using the --noauth_local_server follwing the instructions. ( I am not running it on a machine with a browser).

But I did get it to work using the appcfg.py directly.  It then asked for the authentication code etc... like "normal?  

 ./appcfg.py --noauth_local_webserver update /xxxx/xxxx/AppEngineCode/src/xxx/

And thanks for pointing out why it may have worked previously. (Just to keep my sanity!!! :))

Now I am having trouble finding what actual import statement to use in my Go application.  Again, this is something that was working before but now it seems to have been moved, and I can't find it.

This worked and deployed before:

But now, I cannot seem to find any of the API items.... (Do I have to download something or give privileges to see something?) These also do not work:  (I tried all that have been commented out)



Alex Martelli

unread,
Aug 25, 2015, 7:09:46 PM8/25/15
to google-a...@googlegroups.com
Unfortunately I'm no Go expert and I'm not sure we have any reading this group -- I suspect the Go experts mostly hang out at https://github.com/google/google-api-go-client/issues (for Google API issues) so asking there might be more productive.

Alex

Ronoaldo Pereira

unread,
Aug 27, 2015, 11:05:03 AM8/27/15
to Google App Engine
Hi Dave,

If you are doing the deployment using appcfg.py from the Python runtime, then the Python version of appcfg.py will not upload code that resides in your $GOPATH, i.e., outside of your project root. They are reacheable by goapp, but they are not found during the upload if appcfg.py is not the right one. I happen to work with multiple SDKs on the same machine, and this happened to be before.

Could you please share the output of these commands:

$ which appcfg.py # just to make sure that the Go one is the first in your PATH

Also, try calling appcfg.py directly from the Go SDK. I.e., if your extracted your go_appengine SDK in your $HOME:

~/go_appengine/appcfg.py update --noauth_local_webserver update . # from your app root

This worked for me after digging over and over. And the reason is that appcfg.py form the Go SDK does extra work looking for .go files in your $GOPATH.

Best regards,
Reply all
Reply to author
Forward
0 new messages