Closed nieivan closed 5 years ago
Your encryption key either isn’t specified correctly or you didn’t generate it according to the docs.
On Aug 12, 2019 at 20:28, <nieivan (mailto:notifications@github.com)> wrote:
Tried to run docker version Crypt-server - basic usage, the container keeps restarting, checked the log, it indicated there is Django incorrect padding exception.
Any clues to fix this error? thanks.
2019-08-13T03:12:51.285423650Z File "manage.py", line 10, in 2019-08-13T03:12:51.285426573Z execute_from_command_line(sys.argv) 2019-08-13T03:12:51.285428961Z File "/usr/local/lib/python3.7/site-packages/django/core/management/init.py", line 381, in execute_from_command_line 2019-08-13T03:12:51.285431611Z utility.execute() 2019-08-13T03:12:51.285433853Z File "/usr/local/lib/python3.7/site-packages/django/core/management/init.py", line 357, in execute 2019-08-13T03:12:51.285436254Z django.setup() 2019-08-13T03:12:51.285439077Z File "/usr/local/lib/python3.7/site-packages/django/init.py", line 24, in setup 2019-08-13T03:12:51.285441403Z apps.populate(settings.INSTALLED_APPS) 2019-08-13T03:12:51.285443523Z File "/usr/local/lib/python3.7/site-packages/django/apps/registry.py", line 112, in populate 2019-08-13T03:12:51.285445867Z app_config.import_models() 2019-08-13T03:12:51.285448151Z File "/usr/local/lib/python3.7/site-packages/django/apps/config.py", line 198, in import_models 2019-08-13T03:12:51.285450541Z self.models_module = import_module(models_module_name) 2019-08-13T03:12:51.285452650Z File "/usr/local/lib/python3.7/importlib/init.py", line 127, in import_module 2019-08-13T03:12:51.285455040Z return _bootstrap._gcd_import(name[level:], package, level) 2019-08-13T03:12:51.285457229Z File "", line 1006, in _gcd_import 2019-08-13T03:12:51.285459777Z File "", line 983, in _find_and_load 2019-08-13T03:12:51.285462241Z File "", line 967, in _find_and_load_unlocked 2019-08-13T03:12:51.285464589Z File "", line 677, in _load_unlocked 2019-08-13T03:12:51.285467579Z File "", line 728, in exec_module 2019-08-13T03:12:51.285470184Z File "", line 219, in _call_with_frames_removed 2019-08-13T03:12:51.285472510Z File "/home/docker/crypt/server/models.py", line 4, in 2019-08-13T03:12:51.285475031Z from encrypted_model_fields.fields import EncryptedCharField 2019-08-13T03:12:51.285477364Z File "/usr/local/lib/python3.7/site-packages/encrypted_model_fields/fields.py", line 45, in 2019-08-13T03:12:51.285479827Z CRYPTER = get_crypter() 2019-08-13T03:12:51.285481917Z File "/usr/local/lib/python3.7/site-packages/encrypted_model_fields/fields.py", line 37, in get_crypter 2019-08-13T03:12:51.285484250Z raise ImproperlyConfigured('FIELD_ENCRYPTION_KEY defined incorrectly: {}'.format(str(e))) 2019-08-13T03:12:51.285486627Z django.core.exceptions.ImproperlyConfigured: FIELD_ENCRYPTION_KEY defined incorrectly: Incorrect padding
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub (https://github.com/grahamgilbert/Crypt-Server/issues/76?email_source=notifications&email_token=AAJHBL7LYGTPMQPA3V5QPLLQEIS4TA5CNFSM4ILGYASKYY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4HE3KSKQ), or mute the thread (https://github.com/notifications/unsubscribe-auth/AAJHBL3LIW2M7U333Q6K5MDQEIS4TANCNFSM4ILGYASA).
Sorry, I didn't find the doc for generate the encryption key, may I have the link then?
Oh, I found it, let me try again, thanks a lot!
docker run --rm -ti macadmins/crypt-server \ python3 -c "from cryptography.fernet import Fernet; print(Fernet.generate_key())"
Your encryption key either isn’t specified correctly or you didn’t generate it according to the docs. … On Aug 12, 2019 at 20:28, <nieivan @.***)> wrote: Tried to run docker version Crypt-server - basic usage, the container keeps restarting, checked the log, it indicated there is Django incorrect padding exception. Any clues to fix this error? thanks. 2019-08-13T03:12:51.285423650Z File "manage.py", line 10, in 2019-08-13T03:12:51.285426573Z execute_from_command_line(sys.argv) 2019-08-13T03:12:51.285428961Z File "/usr/local/lib/python3.7/site-packages/django/core/management/init.py", line 381, in execute_from_command_line 2019-08-13T03:12:51.285431611Z utility.execute() 2019-08-13T03:12:51.285433853Z File "/usr/local/lib/python3.7/site-packages/django/core/management/init.py", line 357, in execute 2019-08-13T03:12:51.285436254Z django.setup() 2019-08-13T03:12:51.285439077Z File "/usr/local/lib/python3.7/site-packages/django/init.py", line 24, in setup 2019-08-13T03:12:51.285441403Z apps.populate(settings.INSTALLED_APPS) 2019-08-13T03:12:51.285443523Z File "/usr/local/lib/python3.7/site-packages/django/apps/registry.py", line 112, in populate 2019-08-13T03:12:51.285445867Z app_config.import_models() 2019-08-13T03:12:51.285448151Z File "/usr/local/lib/python3.7/site-packages/django/apps/config.py", line 198, in import_models 2019-08-13T03:12:51.285450541Z self.models_module = import_module(models_module_name) 2019-08-13T03:12:51.285452650Z File "/usr/local/lib/python3.7/importlib/init.py", line 127, in import_module 2019-08-13T03:12:51.285455040Z return _bootstrap._gcd_import(name[level:], package, level) 2019-08-13T03:12:51.285457229Z File "", line 1006, in _gcd_import 2019-08-13T03:12:51.285459777Z File "", line 983, in _find_and_load 2019-08-13T03:12:51.285462241Z File "", line 967, in _find_and_load_unlocked 2019-08-13T03:12:51.285464589Z File "", line 677, in _load_unlocked 2019-08-13T03:12:51.285467579Z File "", line 728, in exec_module 2019-08-13T03:12:51.285470184Z File "", line 219, in _call_with_frames_removed 2019-08-13T03:12:51.285472510Z File "/home/docker/crypt/server/models.py", line 4, in 2019-08-13T03:12:51.285475031Z from encrypted_model_fields.fields import EncryptedCharField 2019-08-13T03:12:51.285477364Z File "/usr/local/lib/python3.7/site-packages/encrypted_model_fields/fields.py", line 45, in 2019-08-13T03:12:51.285479827Z CRYPTER = get_crypter() 2019-08-13T03:12:51.285481917Z File "/usr/local/lib/python3.7/site-packages/encrypted_model_fields/fields.py", line 37, in get_crypter 2019-08-13T03:12:51.285484250Z raise ImproperlyConfigured('FIELD_ENCRYPTION_KEY defined incorrectly: {}'.format(str(e))) 2019-08-13T03:12:51.285486627Z django.core.exceptions.ImproperlyConfigured: FIELD_ENCRYPTION_KEY defined incorrectly: Incorrect padding — You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub (#76?email_source=notifications&email_token=AAJHBL7LYGTPMQPA3V5QPLLQEIS4TA5CNFSM4ILGYASKYY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4HE3KSKQ), or mute the thread (https://github.com/notifications/unsubscribe-auth/AAJHBL3LIW2M7U333Q6K5MDQEIS4TANCNFSM4ILGYASA).
I generated the key, and got the container running now, thank you very much.
Tried to run docker version Crypt-server - basic usage, the container keeps restarting, checked the log, it indicated there is Django incorrect padding exception.
Any clues to fix this error? thanks.
2019-08-13T03:12:51.285423650Z File "manage.py", line 10, in
2019-08-13T03:12:51.285426573Z execute_from_command_line(sys.argv)
2019-08-13T03:12:51.285428961Z File "/usr/local/lib/python3.7/site-packages/django/core/management/init.py", line 381, in execute_from_command_line
2019-08-13T03:12:51.285431611Z utility.execute()
2019-08-13T03:12:51.285433853Z File "/usr/local/lib/python3.7/site-packages/django/core/management/init.py", line 357, in execute
2019-08-13T03:12:51.285436254Z django.setup()
2019-08-13T03:12:51.285439077Z File "/usr/local/lib/python3.7/site-packages/django/init.py", line 24, in setup
2019-08-13T03:12:51.285441403Z apps.populate(settings.INSTALLED_APPS)
2019-08-13T03:12:51.285443523Z File "/usr/local/lib/python3.7/site-packages/django/apps/registry.py", line 112, in populate
2019-08-13T03:12:51.285445867Z app_config.import_models()
2019-08-13T03:12:51.285448151Z File "/usr/local/lib/python3.7/site-packages/django/apps/config.py", line 198, in import_models
2019-08-13T03:12:51.285450541Z self.models_module = import_module(models_module_name)
2019-08-13T03:12:51.285452650Z File "/usr/local/lib/python3.7/importlib/init.py", line 127, in import_module
2019-08-13T03:12:51.285455040Z return _bootstrap._gcd_import(name[level:], package, level)
2019-08-13T03:12:51.285457229Z File "", line 1006, in _gcd_import
2019-08-13T03:12:51.285459777Z File "", line 983, in _find_and_load
2019-08-13T03:12:51.285462241Z File "", line 967, in _find_and_load_unlocked
2019-08-13T03:12:51.285464589Z File "", line 677, in _load_unlocked
2019-08-13T03:12:51.285467579Z File "", line 728, in exec_module
2019-08-13T03:12:51.285470184Z File "", line 219, in _call_with_frames_removed
2019-08-13T03:12:51.285472510Z File "/home/docker/crypt/server/models.py", line 4, in
2019-08-13T03:12:51.285475031Z from encrypted_model_fields.fields import EncryptedCharField
2019-08-13T03:12:51.285477364Z File "/usr/local/lib/python3.7/site-packages/encrypted_model_fields/fields.py", line 45, in
2019-08-13T03:12:51.285479827Z CRYPTER = get_crypter()
2019-08-13T03:12:51.285481917Z File "/usr/local/lib/python3.7/site-packages/encrypted_model_fields/fields.py", line 37, in get_crypter
2019-08-13T03:12:51.285484250Z raise ImproperlyConfigured('FIELD_ENCRYPTION_KEY defined incorrectly: {}'.format(str(e)))
2019-08-13T03:12:51.285486627Z django.core.exceptions.ImproperlyConfigured: FIELD_ENCRYPTION_KEY defined incorrectly: Incorrect padding