Bug #226
[parabolaweb] error when i try to flag out-of-date packages
0%
Description
When i tray to flag out-of-date packages i have this error:
Environment: Request Method: POST Request URL: http://parabolagnulinux.org/packages/libre/i686/iceweasel-libre/flag/ Django Version: 1.3.1 Python Version: 2.7.2 Installed Applications: ['django.contrib.auth', 'django.contrib.contenttypes', 'django.contrib.messages', 'django.contrib.sessions', 'django.contrib.sites', 'django.contrib.sitemaps', 'django.contrib.admin', 'django.contrib.markup', 'django.contrib.staticfiles', 'south', 'main', 'mirrors', 'news', 'packages', 'todolists', 'devel', 'public', 'releng', 'visualize', 'retro'] Installed Middleware: ('django.middleware.common.CommonMiddleware', 'django.contrib.sessions.middleware.SessionMiddleware', 'django.middleware.csrf.CsrfViewMiddleware', 'django.contrib.auth.middleware.AuthenticationMiddleware', 'django.contrib.messages.middleware.MessageMiddleware', 'django.middleware.http.ConditionalGetMiddleware', 'django.middleware.doc.XViewMiddleware') Traceback: File "/usr/lib/python2.7/site-packages/django/core/handlers/base.py" in get_response 111. response = callback(request, *callback_args, **callback_kwargs) File "/usr/lib/python2.7/site-packages/django/views/decorators/cache.py" in _wrapped_view_func 79. response = view_func(request, *args, **kwargs) File "/srv/http/web/packages/views/flag.py" in flag 76. perform_updates() File "/usr/lib/python2.7/site-packages/django/db/transaction.py" in inner 217. res = func(*args, **kwargs) File "/srv/http/web/packages/views/flag.py" in perform_updates 74. flag_request.save() File "/usr/lib/python2.7/site-packages/django/db/models/base.py" in save 460. self.save_base(using=using, force_insert=force_insert, force_update=force_update) File "/usr/lib/python2.7/site-packages/django/db/models/base.py" in save_base 553. result = manager._insert(values, return_id=update_pk, using=using) File "/usr/lib/python2.7/site-packages/django/db/models/manager.py" in _insert 195. return insert_query(self.model, values, **kwargs) File "/usr/lib/python2.7/site-packages/django/db/models/query.py" in insert_query 1436. return query.get_compiler(using=using).execute_sql(return_id) File "/usr/lib/python2.7/site-packages/django/db/models/sql/compiler.py" in execute_sql 791. cursor = super(SQLInsertCompiler, self).execute_sql(None) File "/usr/lib/python2.7/site-packages/django/db/models/sql/compiler.py" in execute_sql 735. cursor.execute(sql, params) File "/usr/lib/python2.7/site-packages/django/db/backends/util.py" in execute 34. return self.cursor.execute(sql, params) File "/usr/lib/python2.7/site-packages/django/db/backends/postgresql_psycopg2/base.py" in execute 44. return self.cursor.execute(query, args) Exception Type: IntegrityError at /packages/libre/i686/iceweasel-libre/flag/ Exception Value: null value in column "ip_address" violates not-null constraint
History
Updated by loic.vaumerel over 9 years ago
Hi,
I think I may a clue regarding this bug.I need to access to the web server behind "http://parabolagnulinux.org/packages/libre/i686/iceweasel-libre/flag/" URL.
Especially to the below files:
- /srv/http/web/packages/views/flag.py
- /usr/lib/python2.7/site-packages/django/core/handlers/base.py
- /usr/lib/python2.7/site-packages/django/db/backends/postgresql_psycopg2/base.* /usr/lib/python2.7/site-packages/django/db/backends/util.py
- /usr/lib/python2.7/site-packages/django/db/models/base.py
- /usr/lib/python2.7/site-packages/django/db/models/manager.py
- /usr/lib/python2.7/site-packages/django/db/models/query.py
- /usr/lib/python2.7/site-packages/django/db/models/sql/compiler.py
- /usr/lib/python2.7/site-packages/django/db/transaction.py
- /usr/lib/python2.7/site-packages/django/views/decorators/cache.py
ip_address column is not nullable is packages_flagrequest table whereas the web page give a null value
Solution
3 options:
- find why the value is null and fix it (the best)
- set this column to nullable (not the best)
- put a default value when null (not the best)
How can I get access to this ?
This website can help too : http://www.pressthered.com/how_to_get_a_client_ip_address_in_django/
Regards
Updated by lukeshu over 9 years ago
Thanks for the interest, loic.vaumerel. I'm not entirely sure, but I think that this is because nginx is configured to filter the client IPs for privacy policy reasons. You can get access by sending one of us your ssh key, so it can be added to hackers.git, so you can get access to the git repos.
Updated by fauno about 9 years ago
fixed. the problem wasn't on parabolaweb but nginx. since fascgi_params weren't being included on the parabolaweb server block, nginx wasn't passing the remote_addr field to parabolaweb, so it received empty. when i included the fastcgi_params file the url request wasn't correct so i ended up just declaring remote_addr as 127.0.0.1 for both the server block and the fastcgi_params. now no cgi receives the remote address either :)