Using Ferris3 with webapp2 and endpoints

25 views
Skip to first unread message

Dewey Gaedcke

unread,
Mar 27, 2016, 5:35:47 PM3/27/16
to Ferris Framework
My endpoints work via API-Explorer, and also work in the app-engine runtime environment (over the net)

But when I point my IOS client (via the simulator) to localhost:8080, my IOS tests fail and I'm seeing empty message payloads arriving at the endpoint (on the python side)

It's quite frustrating and I've been trying to figure it out for several days.....

I went into the protorpc source and added a print and get this:

{"jsonrpc":"2.0","method":"tstone.person.createGuy","id":"gtl_1","params":{"resource":{"isFemale":false,"alias":"Alias","city":"Hanoi","id":"1","mobile":"+84932340799","privs":"privs","email":"hodanhcXXXgmail.com","last":"Danh Chuan","first":"Ho","tags":"tags"}},"apiVersion":"v1"}


So it's clear my data is arriving from the IOS client, but somewhere in the mix it's getting lost so that there is no data on the properties of the "request" message that reaches my code......all == None
I also see this warning in the server console:

protojson.py:267] No variant found for unrecognized field: resource


Stack overflow implies that "variant " error was common (on localhost) in a version of the dev server over 1.5 years ago......and I'm on (the latest) version:  

app-engine-python 1.9.34

bq 2.0.24

bq-nix 2.0.18

core 2016.03.22

core-nix 2016.02.05

gcloud 

gsutil 4.17

gsutil-nix 4.15


Since it works in the above (API-Explorer/app-engine runtime) environments, I surmise that it's not a problem with my code and instead an issue with my install or local config

So I started looking through the modules in my vendored /lib directory to see if any were old versions or conflicting with something in the dev_appserver modules....

I found several that I suspect should NOT be there.....
It seems like app engine should already have many of these in it's own path:
apiclient
googleapiclient
httplib2
oauth2
oauth2client  (used by identity toolkit so this one is probably ok)
protopigeon (a dep of ferris3 so I guess this is ok too)
pyasn1
pyasn1_modules
rsa
simpleauth  (I'm also using this for identity toolkit so its ok)
simplejson
six
wsgiproxy

Furthermore, on the Ferris install page, I found this:
If you're starting from scratch and you're using webapp2 or just using Cloud Endpoints:   use the Skeleton project
So if we are NOT using webapp2, we're allowed to do a simple pip install ferris
but if we ARE using endpoints or webapp2, we must go through some complex process via Node, Yeoman, and Ferris generator.....

Why the added complexity.....can someone please explain this to me?

And thanks for any tips!!
Dewey



Jonathan Parrott

unread,
Mar 27, 2016, 6:20:53 PM3/27/16
to Dewey Gaedcke, Ferris Framework
> Since it works in the above (API-Explorer/app-engine runtime) environments, I surmise that it's not a problem with my code and instead an issue with my install or local config

I wouldn't assume that. I also don't think this is a ferris issue. You could try using the google-provided endpoints starter sample to see if it works. If it doesn't; filing an issue on that repo or asking on stackoverflow might be your best course of action.

> I found several that I suspect should NOT be there.....

Every library you listed is a dependency of ferris, oauth2client, or google-api-python-client.

> Why the added complexity.....can someone please explain this to me?

You really don't have to, you can just clone this repo: https://github.com/jonparrott/Ferris-3-Skeleton

Dewey Gaedcke

unread,
Mar 27, 2016, 10:09:05 PM3/27/16
to ferris-f...@googlegroups.com, de...@pathoz.com
Thanks Jon.....but why clone a whole skeleton repo when I already have a project structure I like?
I assume it's to run the pip install -r requirements.txt......and then drag those /lib modules into my existing project.....

If that is the whole point, why can't I just run my own pip install into my project /lib and skip the skeleton?

I must be missing something or I suspect you would have said to do exactly that.....
and equally likely, the instructions would not have made a specific exception for cases with webapp2 and endpoints.....

So it seems there is still something I don't understand about Ferris3....
Thx
Dewey

Jonathan Parrott

unread,
Mar 28, 2016, 12:50:47 AM3/28/16
to Dewey Gaedcke, Ferris Framework
The skeleton repo just gives you a good place to start. You can of course just pip install ferris3 as described in using ferris as a library.

You'll just have to wire up everything yourself, see the main.py in the skeleton: https://github.com/jonparrott/Ferris-3-Skeleton/blob/master/main.py

On Sun, Mar 27, 2016 at 7:09 PM Dewey Gaedcke <de...@pathoz.com> wrote:
Thanks Jon.....but why clone a whole skeleton repo when I already have a project structure I like?
I assume it's to run the pip install -r requirements.txt......and then drag those /lib modules into my new project.....

If that is the whole point, why can't I just run my own pip install into my project /lib and skip the skeleton?

I must be missing something or I suspect you would have said to do exactly that.....
and equally likely, the instructions would not have made a specific exception for cases with webapp2 and endpoints.....

So it seems there is still something I don't understand about Ferris3....
Thx

Dewey

Dewey Gaedcke

unread,
Mar 28, 2016, 6:02:51 PM3/28/16
to Ferris Framework
Reply all
Reply to author
Forward
0 new messages