Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7823305
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T08:11:55+00:00 2026-06-02T08:11:55+00:00

I recently upgraded to python2.7 and django1.3 and since then Unhandled exception in thread

  • 0

I recently upgraded to python2.7 and django1.3 and since then

Unhandled exception in thread started by <bound method Command.inner_run of <django.core.management.commands.runserver.Command object at 0x109c57490>>
Traceback (most recent call last):
    File "/Users/ApPeL/.virtualenvs/myhunt/lib/python2.7/site-packages/django/core/management/commands/runserver.py", line 88, in inner_run
        self.validate(display_num_errors=True)
    File "/Users/ApPeL/.virtualenvs/myhunt/lib/python2.7/site-packages/django/core/management/base.py", line 249, in validate
        num_errors = get_validation_errors(s, app)
    File "/Users/ApPeL/.virtualenvs/myhunt/lib/python2.7/site-packages/django/core/management/validation.py", line 36, in get_validation_errors
        for (app_name, error) in get_app_errors().items():
    File "/Users/ApPeL/.virtualenvs/myhunt/lib/python2.7/site-packages/django/db/models/loading.py", line 146, in get_app_errors
        self._populate()
    File "/Users/ApPeL/.virtualenvs/myhunt/lib/python2.7/site-packages/django/db/models/loading.py", line 67, in _populate
        self.write_lock.release()
    File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/threading.py", line 137, in release
        raise RuntimeError("cannot release un-acquired lock")
    RuntimeError: cannot release un-acquired lock

Your help would be greatly appreciated.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-02T08:11:57+00:00Added an answer on June 2, 2026 at 8:11 am

    A usual first recommendation is to apply the latest updates to gevent or greenlet or what you use related to threads. Implementation of threading.Thread.start has been changed between Python 2.6 and 2.7. There are many recipes how to start green… or green… with Django. Try to read any recent for Python 2.7. and send a link which one makes the problem.

    Debugging:
    Add following lines to your manage.py to enable logging of thread start etc. to stderr:

    import threading
    setattr(threading, '__debug__', True)
    

    Add the argument verbose to django/db/loading.py line 39 in order to see also what threads acquire and release the lock.

    -        write_lock = threading.RLock(),
    +        write_lock = threading.RLock(verbose=True),
    

    Run development server. For only one thread without autoreload you should see something like:

    $ python manage.py runserver --noreload
    Validating models...
    
    MainThread: <_RLock owner='MainThread' count=1>.acquire(1): initial success
    MainThread: <_RLock owner=None count=0>.release(): final release
    

    Notes:
    count=1 acquire(1) — the first acquire by a blocking lock
    owner=None count=0>.release() — the the lock is currently being unlocked

    $ python manage.py runserver
    Validating models...
    
    Dummy-1: <_RLock owner=-1222960272 count=1>.acquire(1): initial success
    Dummy-1: <_RLock owner=None count=0>.release(): final release
    

    This is the same with autoreload. Models are validated by the child process.
    “Dummy-1” is a symbolic name of the thread. This can be repeated for more threads, but no threads should/can acquire the lock until it is released by the previous thread. We can continue according the results.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I recently upgraded my GAE Python app to Python 2.7. Since then, I periodically
We recently upgraded from JDK6u20 (Linux, 32bit and 64bit) to JDK6u23. Since then, we
I recently upgraded my Xcode to 4.2. Since then my Organizer-Repository stopped working. Initially
I recently upgraded a 1.3.6 application to Grails2. My test cases have started failing
I recently upgraded from Emacs 23 to Emacs 24. Since the upgrade, it seems
Pair.net recently upgraded our PHP install and afterwards client started see HTML in email
I've recently upgraded a DjangoCMS project from 2.1.0beta3 to 2.1.0 final, and I've started
I recently upgraded to Flash Builder 4.5 for PHP since I’m working on a
I recently upgraded from jQuery 1.2.6 to 1.3.2 Now on the page I'm using
I recently upgraded to SilverLight 3 (beta) and for some reason the SilverLight plug

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.