Software and hardware engineering

Sun 28 August 2011 Posted by Matt Williamson in Workarounds

App Engine ClientLoginError

I’m using a pretty specific set of tools and I’ve come across an error that I couldn’t find a solution to, so I hacked my way out of it. I’m using django-nonrel to run Django on App Engine, while preserving some important features, like the admin app. I’m also using a Google Apps account (xxxx@appdelegateinc.com) as my App Engine account and I do my development on a Mac. When I try to run python manage.py remote createsuperuser to create a new user on the App Engine hosted app, I get the following error:

google.appengine.tools.appengine_rpc.ClientLoginError: HTTP Error 403: Forbidden

Full Traceback

I followed the traceback down to an App Engine SDK file which seems to not set a variable correctly. So I opened it up and hacked and got it working correctly.

edit

/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/tools/appengine_rpc.py

And change the line:

account_type = "GOOGLE"

To

account_type = "HOSTED_OR_GOOGLE"

Here's the diff

/google/appengine/tools/appengine_rpc.py
206c206
<         account_type = "GOOGLE"
---
>         account_type = "HOSTED_OR_GOOGLE"

Tue 18 May 2010 Posted by Matt Williamson in Experiments

Browser Based Map Reduce

What if you could offload some of your computational work onto the visitors of your site? We thought it would be pretty cool to make a quick little app to test the theory out using Google App Engine.

We opted to use the MapReduce paradigm as made famous by Google. The workflow is like this:

  1. Admin (you) create a new job
  2. Admin adds data set, a line break delimited string
  3. Admin adds a map function, written in pure javascript
  4. Admin adds a reduce function
  5. Client visits web page with javascript embedded
  6. Javascript library prompts the user to contribute CPU cycles and writes to a cookie to remember
  7. If user accepts, request a random function and data set item from all jobs that is not complete
  8. Execute job and submit result
  9. Request another job, if there is none, wait a while and check again, if there is, don’t delay and start step 8 again
  10. It works like a charm! Try it out at http://bbmapreduce.appspot.com/. You can find the sources on my GitHub project page. To allow your visitors to contribute CPU cycles, simply include the script tag at http://bbmapreduce.appspot.com/client/sample in your website.

Sample:

<script src="http://bbmapreduce.appspot.com/client/wrapper/"></script>

It should be noted that was not written with security in mind and you can never trust the data that gets sent back from your visitors, but there are ways to make it more reliable, such as executing one function on multiple clients and checking the data returned against the rest which is not currently implemented. The other issue is that the jobs being submitted on this test site is completely open and thus prone to spam alert calls.

DISCLAIMER

I am not responsible for any harm this causes you, your computer, or anyone who visits the URLs provided. This is simply for educational purposes.

Page 1 / 1