Chipy icon indicating copy to clipboard operation
Chipy copied to clipboard

Friendship/Pinax trace investigation

Open alesage opened this issue 14 years ago • 1 comments

Brian presented a trace from the production system today. It appears to be from a Google bot hitting a profile URL with no permissions. Allan was unable to reproduce this locally, possibly because the necessary modules/profiles/pinaxes have not yet been enabled on our new branch, and/or because the necessary data is not current. Brian demonstrated that a human user arriving at any profile's url will produce this error.

To close this ticket, we should at least be able to demonstrate correct behavior on our new branch.

I'll attach the trace below.

alesage avatar May 06 '11 03:05 alesage

Here's the trace:

Traceback (most recent call last):

 File "/home/chipy/.virtualenvs/chipy/lib/python2.6/site-packages/django/core/handlers/base.py", line 100, in get_response
   response = callback(request, *callback_args, **callback_kwargs)

 File "/home/chipy/.virtualenvs/chipy/lib/python2.6/site-packages/pinax/apps/profiles/views.py", line 134, in profile
   previous_invitations_to = FriendshipInvitation.objects.invitations(to_user=other_user, from_user=request.user)

 File "/home/chipy/.virtualenvs/chipy/lib/python2.6/site-packages/friends/models.py", line 172, in invitations
   return self.filter(*args, **kwargs).exclude(status__in=["6", "8"])

 File "/home/chipy/.virtualenvs/chipy/lib/python2.6/site-packages/django/db/models/manager.py", line 141, in filter
   return self.get_query_set().filter(*args, **kwargs)

 File "/home/chipy/.virtualenvs/chipy/lib/python2.6/site-packages/django/db/models/query.py", line 550, in filter
   return self._filter_or_exclude(False, *args, **kwargs)

 File "/home/chipy/.virtualenvs/chipy/lib/python2.6/site-packages/django/db/models/query.py", line 568, in _filter_or_exclude
   clone.query.add_q(Q(*args, **kwargs))

 File "/home/chipy/.virtualenvs/chipy/lib/python2.6/site-packages/django/db/models/sql/query.py", line 1131, in add_q
   can_reuse=used_aliases)

 File "/home/chipy/.virtualenvs/chipy/lib/python2.6/site-packages/django/db/models/sql/query.py", line 1071, in add_filter
   connector)

 File "/home/chipy/.virtualenvs/chipy/lib/python2.6/site-packages/django/db/models/sql/where.py", line 66, in add
   value = obj.prepare(lookup_type, value)

 File "/home/chipy/.virtualenvs/chipy/lib/python2.6/site-packages/django/db/models/sql/where.py", line 299, in prepare
   return self.field.get_prep_lookup(lookup_type, value)

 File "/home/chipy/.virtualenvs/chipy/lib/python2.6/site-packages/django/db/models/fields/related.py", line 134, in get_prep_lookup
   return self._pk_trace(value, 'get_prep_lookup', lookup_type)

 File "/home/chipy/.virtualenvs/chipy/lib/python2.6/site-packages/django/db/models/fields/related.py", line 196, in _pk_trace
   v = getattr(field, prep_func)(lookup_type, v, **kwargs)

 File "/home/chipy/.virtualenvs/chipy/lib/python2.6/site-packages/django/db/models/fields/__init__.py", line 292, in get_prep_lookup
   return self.get_prep_value(value)

 File "/home/chipy/.virtualenvs/chipy/lib/python2.6/site-packages/django/db/models/fields/__init__.py", line 476, in get_prep_value
   return int(value)

TypeError: int() argument must be a string or a number, not 'AnonymousUser'


,
POST:,
COOKIES:{},
META:{'CSRF_COOKIE': 'a353d45f961235f4e11838e9d4ab0d92',
 'DOCUMENT_ROOT': '/var/www/',
 'GATEWAY_INTERFACE': 'CGI/1.1',
 'HTTP_ACCEPT': '*/*',
 'HTTP_ACCEPT_ENCODING': 'gzip,deflate',
 'HTTP_CONNECTION': 'Keep-alive',
 'HTTP_FROM': 'googlebot(at)googlebot.com',
 'HTTP_HOST': 'www.chipy.org',
 'HTTP_USER_AGENT': 'Mozilla/5.0 (compatible; Googlebot/2.1; +http://www.google.com/bot.html)',
 'PATH': '/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/X11R6/bin',
 'PATH_INFO': u'/profiles/profile/chipy/',
 'PATH_TRANSLATED': '/home/chipy/wwwchipy/deploy/pinax.wsgi/profiles/profile/chipy/',
 'QUERY_STRING': '',
 'REMOTE_ADDR': '66.249.71.148',
 'REMOTE_PORT': '48234',
 'REQUEST_METHOD': 'GET',
 'REQUEST_URI': '/profiles/profile/chipy/',
 'SCRIPT_FILENAME': '/home/chipy/wwwchipy/deploy/pinax.wsgi',
 'SCRIPT_NAME': u'',
 'SERVER_ADDR': '72.14.188.25',
 'SERVER_ADMIN': '[no address given]',
 'SERVER_NAME': 'www.chipy.org',
 'SERVER_PORT': '80',
 'SERVER_PROTOCOL': 'HTTP/1.1',
 'SERVER_SIGNATURE': '
Apache/2.2.14 (Ubuntu) Server at www.chipy.org Port 80
\n', 'SERVER_SOFTWARE': 'Apache/2.2.14 (Ubuntu)', 'mod_wsgi.application_group': 'chipy.org|', 'mod_wsgi.callable_object': 'application', 'mod_wsgi.listener_host': '', 'mod_wsgi.listener_port': '80', 'mod_wsgi.process_group': 'chipy', 'mod_wsgi.reload_mechanism': '1', 'mod_wsgi.script_reloading': '1', 'mod_wsgi.version': (2, 8), 'wsgi.errors': , 'wsgi.file_wrapper': , 'wsgi.input': , 'wsgi.multiprocess': True, 'wsgi.multithread': False, 'wsgi.run_once': False, 'wsgi.url_scheme': 'http', 'wsgi.version': (1, 0)}>

alesage avatar May 06 '11 03:05 alesage