Re: Bugs: cannot start runserver since Django 2.2.2

2019-06-05 Thread Ramiro Morales
Hi Bob,

Are you sure aren't Autobahn and/or Twisted (or any another lib) being
upgraded at the same time?
>From the look of the traceback it seems there is a sizeable list of chained
dependencies and it shows clearly cryptography is being actually imported
from autobahn.

On Wed, Jun 5, 2019 at 10:38 AM Bob Voorneveld 
wrote:

> Since the security fix there were 2 problems:
>
> The package cryptography is required (wasn't before updating the pip
> package). I'm running Django 2.2.2 with Daphne 2.3.0. See stacktrace:
>
> Loading .env environment variables…
> [05/Jun/2019 15:05:43] INFO [django.utils.autoreload:584] Watching for
> file changes with StatReloader
> Exception in thread django-main-thread:
> Traceback (most recent call last):
>   File "/usr/local/lib/python3.7/threading.py", line 917, in
> _bootstrap_inner
> self.run()
>   File "/usr/local/lib/python3.7/threading.py", line 865, in run
> self._target(*self._args, **self._kwargs)
>   File
> "/home/docker/.local/share/virtualenvs/dropper-TxELQAPU/lib/python3.7/site-packages/django/utils/autoreload.py"
> , line 54, in wrapper
> fn(*args, **kwargs)
>   File
> "/home/docker/.local/share/virtualenvs/dropper-TxELQAPU/lib/python3.7/site-packages/django/core/management/commands/runserver.py"
> , line 109, in inner_run
> autoreload.raise_last_exception()
>   File
> "/home/docker/.local/share/virtualenvs/dropper-TxELQAPU/lib/python3.7/site-packages/django/utils/autoreload.py"
> , line 77, in raise_last_exception
> raise _exception[1]
>   File
> "/home/docker/.local/share/virtualenvs/dropper-TxELQAPU/lib/python3.7/site-packages/django/core/management/__init__.py"
> , line 337, in execute
> autoreload.check_errors(django.setup)()
>   File
> "/home/docker/.local/share/virtualenvs/dropper-TxELQAPU/lib/python3.7/site-packages/django/utils/autoreload.py"
> , line 54, in wrapper
> fn(*args, **kwargs)
>   File
> "/home/docker/.local/share/virtualenvs/dropper-TxELQAPU/lib/python3.7/site-packages/django/__init__.py"
> , line 24, in setup
> apps.populate(settings.INSTALLED_APPS)
>   File
> "/home/docker/.local/share/virtualenvs/dropper-TxELQAPU/lib/python3.7/site-packages/django/apps/registry.py"
> , line 91, in populate
> app_config = AppConfig.create(entry)
>   File
> "/home/docker/.local/share/virtualenvs/dropper-TxELQAPU/lib/python3.7/site-packages/django/apps/config.py"
> , line 116, in create
> mod = import_module(mod_path)
>   File
> "/home/docker/.local/share/virtualenvs/dropper-TxELQAPU/lib/python3.7/importlib/__init__.py"
> , line 127, in import_module
> return _bootstrap._gcd_import(name[level:], package, level)
>   File "", line 1006, in _gcd_import
>   File "", line 983, in _find_and_load
>   File "", line 967, in
> _find_and_load_unlocked
>   File "", line 677, in _load_unlocked
>   File "", line 728, in exec_module
>   File "", line 219, in
> _call_with_frames_removed
>   File
> "/home/docker/.local/share/virtualenvs/dropper-TxELQAPU/lib/python3.7/site-packages/channels/apps.py"
> , line 6, in 
> import daphne.server
>   File
> "/home/docker/.local/share/virtualenvs/dropper-TxELQAPU/lib/python3.7/site-packages/daphne/server.py"
> , line 32, in 
> from .ws_protocol import WebSocketFactory
>   File
> "/home/docker/.local/share/virtualenvs/dropper-TxELQAPU/lib/python3.7/site-packages/daphne/ws_protocol.py"
> , line 6, in 
> from autobahn.twisted.websocket import (
>   File
> "/home/docker/.local/share/virtualenvs/dropper-TxELQAPU/lib/python3.7/site-packages/autobahn/twisted/__init__.py"
> , line 58, in 
> from autobahn.twisted.wamp import ApplicationSession
>   File
> "/home/docker/.local/share/virtualenvs/dropper-TxELQAPU/lib/python3.7/site-packages/autobahn/twisted/wamp.py"
> , line 50, in 
> from autobahn.wamp import protocol, auth
>   File
> "/home/docker/.local/share/virtualenvs/dropper-TxELQAPU/lib/python3.7/site-packages/autobahn/wamp/auth.py"
> , line 43, in 
> from cryptography.hazmat.primitives.kdf.pbkdf2 import PBKDF2HMAC
> ModuleNotFoundError: No module named 'cryptography'
>
>
>
>
> Installing the package fixed the above, but couldn't find any required
> dependencies for the package?
>
> Another one is that starting runserver, it crashes immediately. This is
> the stacktrace. Maybe something broke with StatReloader? I'm running Django
> in a docker-compose environment.
>
> As a workaround I reverted back to Django 2.2.1, please let me know how
> the latest problem can be mitigated. And I'm curious how cryptography is
> suddenly required.
>
> Loading .env environment variables…
> [05/Jun/2019 15:28:12] INFO [django.utils.autoreload:584] Watching for
> file changes with StatReloader
> Performing system checks...
> Traceback (most recent call last):
>
>   File "manage.py", line 15, in 
> execute_from_command_line(sys.argv)
>   File
> "/home/docker/.local/share/virtualenvs/dropper-TxELQAPU/lib/python3.7/site-packages/django/core/management/__init__.py"
> , line 381, in 

Bugs: cannot start runserver since Django 2.2.2

2019-06-05 Thread Bob Voorneveld
Since the security fix there were 2 problems:

The package cryptography is required (wasn't before updating the pip 
package). I'm running Django 2.2.2 with Daphne 2.3.0. See stacktrace:

Loading .env environment variables…
[05/Jun/2019 15:05:43] INFO [django.utils.autoreload:584] Watching for file 
changes with StatReloader
Exception in thread django-main-thread:
Traceback (most recent call last):
  File "/usr/local/lib/python3.7/threading.py", line 917, in 
_bootstrap_inner
self.run()
  File "/usr/local/lib/python3.7/threading.py", line 865, in run
self._target(*self._args, **self._kwargs)
  File 
"/home/docker/.local/share/virtualenvs/dropper-TxELQAPU/lib/python3.7/site-packages/django/utils/autoreload.py"
, line 54, in wrapper
fn(*args, **kwargs)
  File 
"/home/docker/.local/share/virtualenvs/dropper-TxELQAPU/lib/python3.7/site-packages/django/core/management/commands/runserver.py"
, line 109, in inner_run
autoreload.raise_last_exception()
  File 
"/home/docker/.local/share/virtualenvs/dropper-TxELQAPU/lib/python3.7/site-packages/django/utils/autoreload.py"
, line 77, in raise_last_exception
raise _exception[1]
  File 
"/home/docker/.local/share/virtualenvs/dropper-TxELQAPU/lib/python3.7/site-packages/django/core/management/__init__.py"
, line 337, in execute
autoreload.check_errors(django.setup)()
  File 
"/home/docker/.local/share/virtualenvs/dropper-TxELQAPU/lib/python3.7/site-packages/django/utils/autoreload.py"
, line 54, in wrapper
fn(*args, **kwargs)
  File 
"/home/docker/.local/share/virtualenvs/dropper-TxELQAPU/lib/python3.7/site-packages/django/__init__.py"
, line 24, in setup
apps.populate(settings.INSTALLED_APPS)
  File 
"/home/docker/.local/share/virtualenvs/dropper-TxELQAPU/lib/python3.7/site-packages/django/apps/registry.py"
, line 91, in populate
app_config = AppConfig.create(entry)
  File 
"/home/docker/.local/share/virtualenvs/dropper-TxELQAPU/lib/python3.7/site-packages/django/apps/config.py"
, line 116, in create
mod = import_module(mod_path)
  File 
"/home/docker/.local/share/virtualenvs/dropper-TxELQAPU/lib/python3.7/importlib/__init__.py"
, line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
  File "", line 1006, in _gcd_import
  File "", line 983, in _find_and_load
  File "", line 967, in _find_and_load_unlocked
  File "", line 677, in _load_unlocked
  File "", line 728, in exec_module
  File "", line 219, in 
_call_with_frames_removed
  File 
"/home/docker/.local/share/virtualenvs/dropper-TxELQAPU/lib/python3.7/site-packages/channels/apps.py"
, line 6, in 
import daphne.server
  File 
"/home/docker/.local/share/virtualenvs/dropper-TxELQAPU/lib/python3.7/site-packages/daphne/server.py"
, line 32, in 
from .ws_protocol import WebSocketFactory
  File 
"/home/docker/.local/share/virtualenvs/dropper-TxELQAPU/lib/python3.7/site-packages/daphne/ws_protocol.py"
, line 6, in 
from autobahn.twisted.websocket import (
  File 
"/home/docker/.local/share/virtualenvs/dropper-TxELQAPU/lib/python3.7/site-packages/autobahn/twisted/__init__.py"
, line 58, in 
from autobahn.twisted.wamp import ApplicationSession
  File 
"/home/docker/.local/share/virtualenvs/dropper-TxELQAPU/lib/python3.7/site-packages/autobahn/twisted/wamp.py"
, line 50, in 
from autobahn.wamp import protocol, auth
  File 
"/home/docker/.local/share/virtualenvs/dropper-TxELQAPU/lib/python3.7/site-packages/autobahn/wamp/auth.py"
, line 43, in 
from cryptography.hazmat.primitives.kdf.pbkdf2 import PBKDF2HMAC
ModuleNotFoundError: No module named 'cryptography'




Installing the package fixed the above, but couldn't find any required 
dependencies for the package?

Another one is that starting runserver, it crashes immediately. This is the 
stacktrace. Maybe something broke with StatReloader? I'm running Django in 
a docker-compose environment.

As a workaround I reverted back to Django 2.2.1, please let me know how the 
latest problem can be mitigated. And I'm curious how cryptography is 
suddenly required.

Loading .env environment variables…
[05/Jun/2019 15:28:12] INFO [django.utils.autoreload:584] Watching for file 
changes with StatReloader
Performing system checks...
Traceback (most recent call last):

  File "manage.py", line 15, in 
execute_from_command_line(sys.argv)
  File 
"/home/docker/.local/share/virtualenvs/dropper-TxELQAPU/lib/python3.7/site-packages/django/core/management/__init__.py"
, line 381, in execute_from_command_line
utility.execute()
  File 
"/home/docker/.local/share/virtualenvs/dropper-TxELQAPU/lib/python3.7/site-packages/django/core/management/__init__.py"
, line 375, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
  File 
"/home/docker/.local/share/virtualenvs/dropper-TxELQAPU/lib/python3.7/site-packages/django/core/management/base.py"
, line 323, in run_from_argv
self.execute(*args, **cmd_options)
  File