Call back error, migrate --fake-initial failing first migrate

Issue #313 resolved
Cody Crewson created an issue

On windows I had to install with python 3.5 or greater, as the 3.4 installer was giving me issues. It is old after all.

I had this issue with both 3.5 and 3.6.

 python migrate --fake-initial
Traceback (most recent call last):
  File "", line 10, in <module>
  File "C:\deploy\venvs\qatrack3\lib\site-packages\django\core\management\", line 364, in execute_from_command_line
  File "C:\deploy\venvs\qatrack3\lib\site-packages\django\core\management\", line 338, in execute
  File "C:\deploy\venvs\qatrack3\lib\site-packages\django\", line 27, in setup
  File "C:\deploy\venvs\qatrack3\lib\site-packages\django\apps\", line 108, in populate
  File "C:\deploy\venvs\qatrack3\lib\site-packages\django\apps\", line 202, in import_models
    self.models_module = import_module(models_module_name)
  File "C:\Program Files (x86)\Python36-32\Lib\importlib\", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 994, in _gcd_import
  File "<frozen importlib._bootstrap>", line 971, in _find_and_load
  File "<frozen importlib._bootstrap>", line 955, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 665, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 678, in exec_module
  File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
  File "C:\deploy\venvs\qatrack3\lib\site-packages\django\contrib\auth\", line 4, in <module>
    from django.contrib.auth.base_user import AbstractBaseUser, BaseUserManager
  File "C:\deploy\venvs\qatrack3\lib\site-packages\django\contrib\auth\", line 52, in <module>
    class AbstractBaseUser(models.Model):
  File "C:\deploy\venvs\qatrack3\lib\site-packages\django\db\models\", line 124, in __new__
    new_class.add_to_class('_meta', Options(meta, app_label))
  File "C:\deploy\venvs\qatrack3\lib\site-packages\django\db\models\", line 325, in add_to_class
    value.contribute_to_class(cls, name)
  File "C:\deploy\venvs\qatrack3\lib\site-packages\django\db\models\", line 214, in contribute_to_class
    self.db_table = truncate_name(self.db_table, connection.ops.max_name_length())
  File "C:\deploy\venvs\qatrack3\lib\site-packages\django\db\", line 33, in __getattr__
    return getattr(connections[DEFAULT_DB_ALIAS], item)
  File "C:\deploy\venvs\qatrack3\lib\site-packages\django\db\", line 212, in __getitem__
    conn = backend.DatabaseWrapper(db, alias)
  File "C:\deploy\venvs\qatrack3\lib\site-packages\sqlserver_ado\", line 184, in __init__
    super(DatabaseWrapper, self).__init__(*args, **kwargs)
  File "C:\deploy\venvs\qatrack3\lib\site-packages\django\db\backends\base\", line 96, in __init__
    self.client = self.client_class(self)
TypeError: 'NoneType' object is not callable

My google foo is indicating that it could be because I'm using an ms sql server for the db on this install, and mssql only supports django 1.8.

Comments (13)

  1. Cody Crewson reporter

    I'll try that, if it works we should remove the mssql call from requirements.txt

    Also considering the age of the most recent py34 installer, it might be prudent to be testing against 3.6 for release

  2. Randle Taylor

    Yes we will support Python 3.4-3.6. (I do all my dev in 3.5 right now since it's the default install on Ubuntu 16 LTS).

  3. Ryan Bottema

    Hmm, yep, django-mssql should already be removed from the requirements. Agreed that we should test against 3.6.

  4. Cody Crewson reporter


    Undocumented, I only had the one issue with getting it up and running on Ubuntu (WSL actually) which you helped with and ended up being a DB issue.

    I've experienced a number of issues Windows that led me down several rabbit holes, |

    Python 34 - Avoid Django-mssql django-pyodbc still doesn't work properly but I'll figure that out. The requirements file needs to add a version limit as the first time I ran pip it pulled down the django2.0 pyodbc version

    Separately, after migration the empty tables leads many pages to crash. Issue tracker, and Service require several entries right now. Would it be helpful if I documented each one?

  5. Randle Taylor

    Thanks Cody! Yes, @ryanbottema @xtal and I have discussed the empty table issue with ServiceLog and that it will need to be documented or have default values inserted during the migration. Any help you could provide on that front would be great. Don't wory about IssueTracker, I think Ryan just built that for internal testing and it will be ripped out before release.

  6. Cody Crewson reporter

    Oh no. Please don't do that. We love the idea and were looking at building it in ourselves before we found yours.

    What I'd love to see is the ability to edit issues or comment on them to link qa or service reports to an issue

  7. Randle Taylor

    Ha! Well what do you have in mind? The way it is now it is meant for when internal users are testing so they can log bugs, but it probably wouldn't take a lot to re-purpose it for something else. Maybe a good starter project for your student?!?

  8. Cody Crewson reporter

    That's what we were thinking, exactly! I logged Issue #315 to help separate these two issues. Now I'm going to dig up a windows server instance so I can get a better test system going for documenting the windows Migration Issues.

  9. Cody Crewson reporter

    on WSL, from working db with multiple machines (prod copy)

    install python3, python3-dev, python3-venv, libpg-dev

    create new virtualenv

    python migrate --fake-initial

    create new local_settings file

    launched site

    Service log -> Open new service event did not work

    all other pages did
  10. Cody Crewson reporter

    on wsl from working 0.3.0 db

    add service area

    add service status non default - failed

    add service status default - succeeded

    could now create new service event

    could not save - required service type, service area connection to unit, but at least it didn't throw an exception on the page.

  11. Log in to comment