Jump to content

User:Valhallasw/Striker

From Wikitech

Some notes on Striker development

  • Recreated Vagrant environment; LDAP did not fully work out of the box, https://phabricator.wikimedia.org/T184872
  • Plan to work on https://phabricator.wikimedia.org/T177407.
  • Trying to run Striker via manage.py develop, but cannot find the correct virtualenv yet. /etc/apache2/site-confs/striker-local-wmftest-net/00-default.conf suggests /vagrant/srv/striker/.venv, but:
    vagrant@mediawikivagrant:/vagrant/srv/striker$ source .venv/bin/activate
    (.venv) vagrant@mediawikivagrant:/vagrant/srv/striker$ python manage.py develop
    Traceback (most recent call last):
      File "manage.py", line 30, in <module>
        execute_from_command_line(sys.argv)
      File "/vagrant/srv/striker/.venv/lib/python3.4/site-packages/django/core/management/__init__.py", line 354, in execute_from_command_line
        utility.execute()
      File "/vagrant/srv/striker/.venv/lib/python3.4/site-packages/django/core/management/__init__.py", line 328, in execute
        django.setup()
      File "/vagrant/srv/striker/.venv/lib/python3.4/site-packages/django/__init__.py", line 18, in setup
        apps.populate(settings.INSTALLED_APPS)
      File "/vagrant/srv/striker/.venv/lib/python3.4/site-packages/django/apps/registry.py", line 85, in populate
        app_config = AppConfig.create(entry)
      File "/vagrant/srv/striker/.venv/lib/python3.4/site-packages/django/apps/config.py", line 86, in create
        module = import_module(entry)
      File "/vagrant/srv/striker/.venv/lib/python3.4/importlib/__init__.py", line 109, in import_module
        return _bootstrap._gcd_import(name[level:], package, level)
      File "<frozen importlib._bootstrap>", line 2254, in _gcd_import
      File "<frozen importlib._bootstrap>", line 2237, in _find_and_load
      File "<frozen importlib._bootstrap>", line 2224, in _find_and_load_unlocked
    ImportError: No module named 'dal'
    
  • Let's try if pip install -r requirements.txt solves it. "Building wheels for collected packages: diff-match-patch, django-autocomplete-light, django-reversion" -- ok, that might indeed work.
  • It's python manage.py runserver, but that now seems to work.
  • First need to run migrations, python manage.py migrate
  • "django.db.utils.OperationalError: (1709, 'Index column size too large. The maximum column size is 767 bytes.')". Maybe I should just completely drop the database and start from zero? Or ignore it for now and focus on the bug.
  • From https://github.com/go-gitea/gitea/issues/2979: SET GLOBAL innodb_large_prefix = ON; SET GLOBAL innodb_file_format=Barracuda; SET GLOBAL innodb_file_per_table=ON;
  • That gave another migration error, so started mysql command line; drop database striker; create database striker. Migrations now run succesfully.
  • vagrant ssh -- -L 8000:localhost:8000
    cd /vagrant/srv/striker/
    source .venv/bin/activate
    python manage.py runserver
    
  • http://striker.local.wmftest.net:8000/ now correctly uses the runserver, and http://striker.local.wmftest.net:8000/tools/create/ gives the expected 403. Yay!
  • vim striker/striker.ini, set debug=true. But that doesn't really help
  • [14/Jan/2018 20:30:44] "GET /tools/create/ HTTP/1.1" 400 5410 <-- so it's a http/400, not a 403.
  • Logging doesn't seem to work well in general, even after setting it to DEBUG in striker.ini.
  • Even without logging, the issue was easy to find by just reading the source -- https://gerrit.wikimedia.org/r/404174
  • To be continued.