First time here? Check out the FAQ!

mrB's profile - activity

2022-04-11 23:18:43 -0500 received badge Popular Question (source)
2022-04-11 23:18:43 -0500 received badge Famous Question (source)
2022-04-11 23:18:43 -0500 received badge Notable Question (source)
2019-07-12 02:08:06 -0500 received badge Notable Question (source)
2019-07-12 02:08:06 -0500 received badge Popular Question (source)
2017-10-11 08:48:06 -0500 received badge Popular Question (source)
2017-10-11 08:48:06 -0500 received badge Famous Question (source)
2017-01-18 13:04:40 -0500 received badge Famous Question (source)
2016-09-02 12:33:10 -0500 received badge Notable Question (source)
2016-06-02 13:03:02 -0500 received badge Popular Question (source)
2016-06-02 13:03:02 -0500 received badge Notable Question (source)
2015-10-05 10:58:39 -0500 marked best answer Where is the "add_tsvector_column" method pulled from?

I still can't migrate past 0137.

Django 1.3.1
Askbot started with original version 0.7.43 and trying to migrate to Askbot 0.7.47
PostgreSQL 9.1.3

It seems that there is a Postgresql function that is being requested that doesn't exist: add_tsvector_column()

$ python manage.py migrate  

Running migrations for longerusername:  
- Nothing to migrate.  
 - Loading initial data for longerusername.  
No fixtures found.  
Running migrations for django_authopenid:  
- Nothing to migrate.  
 - Loading initial data for django_authopenid.  
No fixtures found.  
Running migrations for askbot:  
 - Migrating forwards to 0158_add_title_search_indices_for_postgresql_and_mysql.  
 > askbot:0127_save_category_tree_as_json  
 > askbot:0128_add_groups_field__to__thread_and_post  
 > askbot:0129_auto__del_field_post_is_private  
 > askbot:0130_auto__del_field_postrevision_revision_type  
 > askbot:0131_auto__add_field_tag_status  
 > askbot:0132_auto__add_draftquestion__add_draftanswer  
 > askbot:0133_apply_global_group_to_posts_and_users  
Moving group-less threads to the global group  
------------------------------------------------------------ 100.00%  
Added global group to 17 threads.  

Move groupless questions and answers to the global group  
------------------------------------------------------------ 100.00%  
Added global group to 19 posts.  

Adding all users to the global group  
------------------------------------------------------------ 100.00%  
Added global group to 3 users.  
 > askbot:0134_create_personal_groups_for_all_users  
Creating personal group for the users  
------------------------------------------------------------ 100.00%  
 > askbot:0135_auto__add_questionwidget__add_askwidget  
 > askbot:0136_auto__add_group__add_threadtogroup__add_unique_threadtogroup_thread_ta  
 > askbot:0137_create_groups_from_relevant_tags  
Transfering group information from Tag to Group model  
------------------------------------------------------------ 100.00%  
Deleting old group information  
------------------------------------------------------------ 100.00%  
The following content types are stale and need to be deleted:  

    askbot | groupprofile  

Any objects related to these content types by a foreign key will also  
be deleted. Are you sure you want to delete these content types?  
If you're unsure, answer 'no'.  

    Type 'yes' to continue, or 'no' to cancel: yes  
Traceback (most recent call last):  
  File "manage.py", line 11, in <module>  
    execute_manager(settings)  
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/django/core/management/__init__.py", line 438, in execute_manager  
    utility.execute()  
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/django/core/management/__init__.py", line 379, in execute  
    self.fetch_command(subcommand).run_from_argv(self.argv)  
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/django/core/management/base.py", line 191, in run_from_argv  
    self.execute(*args, **options.__dict__)  
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/django/core/management/base.py", line 220, in execute  
    output = self.handle(*args, **options)  
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/south/management/commands/migrate.py", line 105, in handle  
    ignore_ghosts = ignore_ghosts,  
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/south/migration/__init__.py", line 191, in migrate_app  
    success = migrator.migrate_many(target, workplan, database)  
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/south/migration/migrators.py", line 221, in migrate_many  
    result = migrator.__class__.migrate_many(migrator, target, migrations, database)  
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/south/migration/migrators.py", line 292, in migrate_many  
    result = self.migrate(migration, database)  
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/south/migration/migrators.py", line 125, in migrate  
    result = self.run(migration)  
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/south/migration/migrators.py", line 99, in run  
    return ...
(more)
2015-08-10 15:54:28 -0500 received badge Popular Question (source)
2015-03-25 11:11:26 -0500 received badge Popular Question (source)
2015-03-25 11:11:26 -0500 received badge Notable Question (source)
2015-02-08 16:39:53 -0500 received badge Famous Question (source)
2014-10-19 21:01:37 -0500 received badge Popular Question (source)
2014-10-19 21:01:37 -0500 received badge Famous Question (source)
2014-08-11 16:46:09 -0500 answered a question How do I debug a Migration error?

I was not able to debug the migration, but I worked around it via:

python manage.py syncdb --all

python manage.py migrate --fake

2014-08-07 10:25:58 -0500 received badge Enthusiast
2014-08-05 10:36:37 -0500 asked a question How do I debug a Migration error?

I ran syncdb which worked. When I attempt to migrate the app, the SQL generated seems to be incorrect.

$ python manage.py migrate askbot
Running migrations for askbot:
- Migrating forwards to 0178_auto__add_field_postrevision_ip_addr.

askbot:0001_initial
askbot:0002_auto__add_field_answer_text__chg_field_answer_html__add_field_question
FATAL ERROR - The following SQL query failed: ALTER TABLE answer ALTER COLUMN text TYPE longtext, ALTER COLUMN text DROP NOT NULL, ALTER COLUMN text DROP DEFAULT;
The error was: (1064, "You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'TYPE longtext, ALTER COLUMN text DROP NOT NULL, ALTER COLUMN text DROP DEFAU' at line 1")
...SNIP...
Error in migration: askbot:0002_auto__add_field_answer_text__chg_field_answer_html__add_field_question

This is the South expression that seems to be generating the error:

Adding field 'Answer.text'

db.add_column(u'answer', 'text', self.gf('django.db.models.fields.TextField')(null=True), keep_default=False)

South.__version__ = '1.0'
MySQLdb.__version__ = '1.2.5'
MySQL 5.6.19

2014-03-27 11:17:13 -0500 received badge Popular Question (source)
2014-02-20 15:26:52 -0500 asked a question Why am I getting ImportError: from askbot.models import signals

I've been trying to get Askbot to work in production and I keep getting this stack trace when I attempt to Migrate or enter the Shell.
Everything works fine on my development computer.
What's going wrong?

  File "manage.py", line 11, in <module>  
    execute_manager(settings)  
  File "/home/spirituality/webapps/askbot/lib/python2.7/django/core/management/__init__.py", line 438, in execute_manager  
    utility.execute()  
  File "/home/spirituality/webapps/askbot/lib/python2.7/django/core/management/__init__.py", line 379, in execute  
    self.fetch_command(subcommand).run_from_argv(self.argv)  
  File "/home/spirituality/webapps/askbot/lib/python2.7/django/core/management/base.py", line 191, in run_from_argv  
    self.execute(*args, **options.__dict__)  
  File "/home/spirituality/webapps/askbot/lib/python2.7/django/core/management/base.py", line 220, in execute  
    output = self.handle(*args, **options)  
  File "/home/spirituality/webapps/askbot/lib/python2.7/django/core/management/base.py", line 351, in handle  
    return self.handle_noargs(**options)  
  File "/home/spirituality/webapps/askbot/lib/python2.7/django/core/management/commands/shell.py", line 47, in handle_noargs  
    loaded_models = get_models()  
  File "/home/spirituality/webapps/askbot/lib/python2.7/django/db/models/loading.py", line 167, in get_models  
    self._populate()  
  File "/home/spirituality/webapps/askbot/lib/python2.7/django/db/models/loading.py", line 64, in _populate  
    self.load_app(app_name)  
  File "/home/spirituality/webapps/askbot/lib/python2.7/django/db/models/loading.py", line 78, in load_app  
    models = import_module('.models', app_name)  
  File "/home/spirituality/webapps/askbot/lib/python2.7/django/utils/importlib.py", line 35, in import_module  
    __import__(name)  
  File "/home/spirituality/webapps/askbot/askbot-discussion/askbot/models/__init__.py", line 71, in <module>  
    from askbot.models import signals  
ImportError: cannot import name signals
2014-02-14 16:34:46 -0500 asked a question Why am I getting SystemExit: 1 on startup?

I'm trying to get Askbot running on my virtual server.

[Fri Feb 14 16:23:05 2014] [error] [client 127.0.0.1] mod_wsgi (pid=8120): SystemExit exception raised by WSGI script '/home/bigB/webapps/askbot/askbotPaleo/django.wsgi' ignored.      [Fri Feb 14 16:23:05 2014] [error] [client 127.0.0.1] Traceback (most recent call last):  
    [Fri Feb 14 16:23:05 2014] [error] [client 127.0.0.1]   File "/home/bigB/lib/python2.7/django/core/handlers/wsgi.py", line 219, in __call__  
    [Fri Feb 14 16:23:05 2014] [error] [client 127.0.0.1]     self.load_middleware()  
    [Fri Feb 14 16:23:05 2014] [error] [client 127.0.0.1]   File "/home/bigB/lib/python2.7/django/core/handlers/base.py", line 45, in load_middleware  
    [Fri Feb 14 16:23:05 2014] [error] [client 127.0.0.1]     mod = import_module(mw_module)  
    [Fri Feb 14 16:23:05 2014] [error] [client 127.0.0.1]   File "/home/bigB/lib/python2.7/django/utils/importlib.py", line 35, in import_module

This is the content of the django.wsqi file.

import os
import sys

current_directory = os.path.dirname(__file__)
parent_directory = os.path.dirname(current_directory)
module_name = os.path.basename(current_directory)

sys.path.append(parent_directory)
sys.path.append(current_directory)
os.environ['DJANGO_SETTINGS_MODULE'] = '%s.settings' % module_name
import django.core.handlers.wsgi
application = django.core.handlers.wsgi.WSGIHandler()

Running Django 1.4.2 on Python2.7

2014-02-04 14:50:58 -0500 received badge Notable Question (source)
2013-12-06 12:57:27 -0500 received badge Famous Question (source)
2013-08-05 01:31:26 -0500 received badge Famous Question (source)
2013-07-05 01:31:45 -0500 received badge Famous Question (source)
2013-07-04 04:58:20 -0500 received badge Popular Question (source)
2013-07-04 04:58:20 -0500 received badge Famous Question (source)
2013-07-04 04:58:20 -0500 received badge Notable Question (source)
2013-07-04 04:01:01 -0500 received badge Popular Question (source)
2013-05-23 20:18:36 -0500 received badge Famous Question (source)
2013-05-09 08:15:52 -0500 answered a question How to diagnose UndefinedError: 'settings' is undefined ?

In the end, I found that my Memcache instance had been turned off. Once I restarted Memcache, everything worked great.

2013-05-08 15:01:16 -0500 commented question Why am I getting a Nonetype error in the code, when the same statment works in a logging directive?

Turns out, my Memcache instant had gotten turned off somehow. I restarted Memcache and it started working.

2013-05-08 15:00:49 -0500 answered a question Why doesn't settings = cache.get('askbot-livesettings') return anything?

Turns out, my Memcache instant had gotten turned off somehow. I restarted Memcache and it started working.

2013-05-08 09:48:16 -0500 asked a question Why doesn't settings = cache.get('askbot-livesettings') return anything?

I've been attempting to debug why I'm getting a nonetype error in my production askbot app. I've been able to trace it back to this statement.

2013-05-07 15:58:46 -0500 commented answer Why am I getting a Nonetype error in the code, when the same statment works in a logging directive?

I was able to log all the values of askbot_settings.__dict__ . However assignment to my_settings.askbot_settings.as_dict() does not work.

Why do would the assignment to my_settings not work?

2013-05-06 20:09:56 -0500 commented question Why am I getting a Nonetype error in the code, when the same statment works in a logging directive?

CACHE_BACKEND = 'django.core.cache.backends.memcached.MemcachedCache' #needed for django-keyedcache

CACHE_TIMEOUT = 6000

#sets a special timeout for livesettings if you want to make them different LIVESETTINGS_CACHE_TIMEOUT = CACHE_TIMEOUT KEY_PREFIX = 'askpaleo' #make this unique

CACHE_MIDDLEWARE_ANONYMOUS_ONLY = True

2013-05-03 14:27:08 -0500 asked a question Why am I getting a Nonetype error in the code, when the same statment works in a logging directive?

I'm trying to get Askbot working in production on Webfaction. I'm not sure what is going on because the app worked fine for a month, then suddenly, it stopped working. I didn't update the askbot code nor did I change anything on the templates.

The Django debug page is showing:

Exception Value: 'NoneType' object does not support item assignment
Exception Location: /home/username/webapps/askbot/askbot-discussion/askbot/context.py in application_settings, line 31

I decided to log the variables to see why I was getting a NoneType exception immediately before the NoneType error is thrown in the code.

import logging  
logging.critical("request[LANGUAGE_CODE] :" + getattr(request, 'LANGUAGE_CODE', settings.LANGUAGE_CODE) )  
my_settings['LANGUAGE_CODE'] = getattr(request, 'LANGUAGE_CODE', settings.LANGUAGE_CODE)

This logged: /home/username/webapps/askbot/askbot-discussion/askbot/context.py TIME: 2013-05-03 13:22:53,209 MSG: context.py:application_settings:33 request[LANGUAGE_CODE] :en

As you can see, getattr(request, 'LANGUAGE_CODE', settings.LANGUAGE_CODE) return "en" for the logging directive.

I'm at a loss for why I'd be getting a NoneType error, because the getattr() worked fine for logging, but for some reason it fails in the actual code.

What is going on?

+++++++EDIT+++++++

Turns out, my Memcache instant had gotten turned off somehow. I restarted Memcache and it started working.

2013-05-02 15:36:23 -0500 commented answer How to diagnose UndefinedError: 'settings' is undefined ?

I turned DEBUG=True and I still don't think the settings are defined. I'm getting 'NoneType' object does not support item assignment from askbot-discussion/askbot/context.py line 31: my_settings['LANGUAGE_CODE'] = getattr(request, 'LANGUAGE_CODE', settings.LANGUAGE_CODE)

The settings are visible on the debug page, but it would seem I would not be getting a NoneType error if settings.LANGUAGE_CODE existed.

2013-05-02 15:27:42 -0500 received badge Supporter ( source )
2013-05-02 12:29:34 -0500 asked a question How to diagnose UndefinedError: 'settings' is undefined ?

I set up the site, it runs fine for a few months, then the server stops serving. I don't understand why the settings can't be found because nothing has changed on the server.

This is from the error_askbot_log:

[Thu May 02 12:17:45 2013] [error] [client 127.0.0.1] mod_wsgi (pid=24567): Exception occurred processing WSGI script '/home/username/webapps/askbot/askbotSpirit/django.wsgi'.  
[Thu May 02 12:17:45 2013] [error] [client 127.0.0.1] Traceback (most recent call last):  
[Thu May 02 12:17:45 2013] [error] [client 127.0.0.1]   File "/home/username/lib/python2.7/Django-1.3.1-py2.7.egg/django/core/handlers/wsgi.py", line 272, in __call__  
[Thu May 02 12:17:45 2013] [error] [client 127.0.0.1]     response = self.get_response(request)  
[Thu May 02 12:17:45 2013] [error] [client 127.0.0.1]   File "/home/username/lib/python2.7/Django-1.3.1-py2.7.egg/django/core/handlers/base.py", line 169, in get_response  
[Thu May 02 12:17:45 2013] [error] [client 127.0.0.1]     response = self.handle_uncaught_exception(request, resolver, sys.exc_info())  
[Thu May 02 12:17:45 2013] [error] [client 127.0.0.1]   File "/home/username/lib/python2.7/Django-1.3.1-py2.7.egg/django/core/handlers/base.py", line 218, in handle_uncaught_exception  
[Thu May 02 12:17:45 2013] [error] [client 127.0.0.1]     return callback(request, **param_dict)  
[Thu May 02 12:17:45 2013] [error] [client 127.0.0.1]   File "/home/username/lib/python2.7/Django-1.3.1-py2.7.egg/django/utils/decorators.py", line 93, in _wrapped_view  
[Thu May 02 12:17:45 2013] [error] [client 127.0.0.1]     response = view_func(request, *args, **kwargs)  
[Thu May 02 12:17:45 2013] [error] [client 127.0.0.1]   File "/home/username/lib/python2.7/Django-1.3.1-py2.7.egg/django/views/defaults.py", line 31, in server_error  
[Thu May 02 12:17:45 2013] [error] [client 127.0.0.1]     return http.HttpResponseServerError(t.render(Context({})))  
[Thu May 02 12:17:45 2013] [error] [client 127.0.0.1]   File "/home/username/lib/python2.7/coffin/template/__init__.py", line 55, in render  
[Thu May 02 12:17:45 2013] [error] [client 127.0.0.1]     return super(Template, self).render(**context)  
[Thu May 02 12:17:45 2013] [error] [client 127.0.0.1]   File "/home/username/lib/python2.7/jinja2/environment.py", line 894, in render  
[Thu May 02 12:17:45 2013] [error] [client 127.0.0.1]     return self.environment.handle_exception(exc_info, True)  
[Thu May 02 12:17:45 2013] [error] [client 127.0.0.1]   File "/home/username/webapps/askbot/askbot-discussion/askbot/templates/500.html", line 1, in top-level template code  
[Thu May 02 12:17:45 2013] [error] [client 127.0.0.1]     {% extends "two_column_body.html" %}  
[Thu May 02 12:17:45 2013] [error] [client 127.0.0.1]   File "/home/username/webapps/askbot/askbot-discussion/askbot/templates/two_column_body.html", line ...
(more)