ImportError: No module named modilabs.utils.subprocess_timeout - django

I use KoboToolbox and run KOBOCAT but it give the following Errors when I run manage.py.It works perfect on the port but it shows A server error occurred. Please contact the administrator. And it shows that it cannot import ProcessTimeout.
Here is the the Error log:
Traceback (most recent call last):
File "manage.py", line 21, in
execute_from_command_line(sys.argv)
File "/home/sakib/.virtualenvs/kc/local/lib/python2.7/site-packages/django/core/management/init.py", line 399, in execute_from_command_line
utility.execute()
File "/home/sakib/.virtualenvs/kc/local/lib/python2.7/site-packages/django/core/management/init.py", line 392, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "/home/sakib/.virtualenvs/kc/local/lib/python2.7/site-packages/djcelery/management/base.py", line 82, in run_from_argv
return super(CeleryCommand, self).run_from_argv(argv)
File "/home/sakib/.virtualenvs/kc/local/lib/python2.7/site-packages/django/core/management/base.py", line 242, in run_from_argv
self.execute(*args, **options.dict)
File "/home/sakib/.virtualenvs/kc/local/lib/python2.7/site-packages/djcelery/management/base.py", line 75, in execute
super(CeleryCommand, self).execute(*args, **options)
File "/home/sakib/.virtualenvs/kc/local/lib/python2.7/site-packages/django/core/management/base.py", line 285, in execute
output = self.handle(*args, **options)
File "/home/sakib/.virtualenvs/kc/local/lib/python2.7/site-packages/djcelery/management/commands/celeryd.py", line 25, in handle
worker.run(**options)
File "/home/sakib/.virtualenvs/kc/local/lib/python2.7/site-packages/celery/bin/worker.py", line 212, in run
state_db=self.node_format(state_db, hostname), **kwargs
File "/home/sakib/.virtualenvs/kc/local/lib/python2.7/site-packages/celery/worker/init.py", line 95, in init
self.app.loader.init_worker()
File "/home/sakib/.virtualenvs/kc/local/lib/python2.7/site-packages/celery/loaders/base.py", line 128, in init_worker
self.import_default_modules()
File "/home/sakib/.virtualenvs/kc/local/lib/python2.7/site-packages/djcelery/loaders.py", line 141, in import_default_modules
self.autodiscover()
File "/home/sakib/.virtualenvs/kc/local/lib/python2.7/site-packages/djcelery/loaders.py", line 144, in autodiscover
self.task_modules.update(mod.name for mod in autodiscover() or ())
File "/home/sakib/.virtualenvs/kc/local/lib/python2.7/site-packages/djcelery/loaders.py", line 179, in autodiscover
for app in settings.INSTALLED_APPS])
File "/home/sakib/.virtualenvs/kc/local/lib/python2.7/site-packages/djcelery/loaders.py", line 203, in find_related_module
return importlib.import_module('{0}.{1}'.format(app, related_name))
File "/usr/lib/python2.7/importlib/init.py", line 37, in import_module
import(name)
File "/home/sakib/d2WebApp/kobocat/onadata/apps/viewer/tasks.py", line 14, in
from onadata.libs.utils.logger_tools import mongo_sync_status, report_exception
File "/home/sakib/d2WebApp/kobocat/onadata/libs/utils/logger_tools.py", line 28, in
from modilabs.utils.subprocess_timeout import ProcessTimedOut
ImportError: No module named modilabs.utils.subprocess_timeout

Related

Django error : exceptions caused by format_suffix_patterns are.error: redefinition of group name 'id' as group 2; was group 1 at position 56

my code works fine in my old computer,
but I changed my computer suddenly I get this error, I couldn't fix it
error:
Traceback (most recent call last):
File "/manage.py", line 22, in <module>
main()
File "/manage.py", line 18, in main
execute_from_command_line(sys.argv)
File "/my_env/lib/python3.8/site-packages/django/core/management/__init__.py", line 425, in execute_from_command_line
utility.execute()
File "/my_env/lib/python3.8/site-packages/django/core/management/__init__.py", line 419, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "/my_env/lib/python3.8/site-packages/django/core/management/base.py", line 373, in run_from_argv
self.execute(*args, **cmd_options)
File "/my_env/lib/python3.8/site-packages/django/core/management/base.py", line 412, in execute
self.check()
File "/my_env/lib/python3.8/site-packages/django/core/management/base.py", line 438, in check
all_issues = checks.run_checks(
File "/my_env/lib/python3.8/site-packages/django/core/checks/registry.py", line 77, in run_checks
new_errors = check(app_configs=app_configs, databases=databases)
File "/my_env/lib/python3.8/site-packages/django/core/checks/urls.py", line 13, in check_url_config
return check_resolver(resolver)
File "/my_env/lib/python3.8/site-packages/django/core/checks/urls.py", line 23, in check_resolver
return check_method()
File "/my_env/lib/python3.8/site-packages/django/urls/resolvers.py", line 449, in check
messages.extend(check_resolver(pattern))
File "/my_env/lib/python3.8/site-packages/django/core/checks/urls.py", line 23, in check_resolver
return check_method()
File "/my_env/lib/python3.8/site-packages/django/urls/resolvers.py", line 449, in check
messages.extend(check_resolver(pattern))
File "/usr/lib/python3.8/sre_parse.py", line 443, in _parse_sub
itemsappend(_parse(source, state, verbose, nested + 1,
File "/usr/lib/python3.8/sre_parse.py", line 831, in _parse
raise source.error(err.msg, len(name) + 1) from None
re.error: redefinition of group name 'id' as group 2; was group 1 at position 56
anyone knows how can i fix it?

TypeError in py36compat

I get this strange error on Python2.7. It works fine with Python3:
Traceback (most recent call last):
File "/home/guettli/descript/projects/descript_jugendhaus/.tox/py27-django14/lib/python2.7/site-packages/pip/_vendor/pep517/_in_process.py", line 280, in <module>
main()
File "/home/guettli/descript/projects/descript_jugendhaus/.tox/py27-django14/lib/python2.7/site-packages/pip/_vendor/pep517/_in_process.py", line 263, in main
json_out['return_val'] = hook(**hook_input['kwargs'])
File "/home/guettli/descript/projects/descript_jugendhaus/.tox/py27-django14/lib/python2.7/site-packages/pip/_vendor/pep517/_in_process.py", line 133, in prepare_metadata_for_build_wheel
return hook(metadata_directory, config_settings)
File "/tmp/pip-build-env-sy2MSY/overlay/lib/python2.7/site-packages/setuptools/build_meta.py", line 156, in prepare_metadata_for_build_wheel
self.run_setup()
File "/tmp/pip-build-env-sy2MSY/overlay/lib/python2.7/site-packages/setuptools/build_meta.py", line 243, in run_setup
self).run_setup(setup_script=setup_script)
File "/tmp/pip-build-env-sy2MSY/overlay/lib/python2.7/site-packages/setuptools/build_meta.py", line 142, in run_setup
exec(compile(code, __file__, 'exec'), locals())
File "setup.py", line 195, in <module>
distclass=BinaryDistribution,
File "/tmp/pip-build-env-sy2MSY/overlay/lib/python2.7/site-packages/setuptools/__init__.py", line 162, in setup
return distutils.core.setup(**attrs)
File "/usr/lib/python2.7/distutils/core.py", line 151, in setup
dist.run_commands()
File "/usr/lib/python2.7/distutils/dist.py", line 953, in run_commands
self.run_command(cmd)
File "/usr/lib/python2.7/distutils/dist.py", line 972, in run_command
cmd_obj.run()
File "/tmp/pip-build-env-sy2MSY/overlay/lib/python2.7/site-packages/setuptools/command/dist_info.py", line 31, in run
egg_info.run()
File "/tmp/pip-build-env-sy2MSY/overlay/lib/python2.7/site-packages/setuptools/command/egg_info.py", line 296, in run
self.find_sources()
File "/tmp/pip-build-env-sy2MSY/overlay/lib/python2.7/site-packages/setuptools/command/egg_info.py", line 303, in find_sources
mm.run()
File "/tmp/pip-build-env-sy2MSY/overlay/lib/python2.7/site-packages/setuptools/command/egg_info.py", line 534, in run
self.add_defaults()
File "/tmp/pip-build-env-sy2MSY/overlay/lib/python2.7/site-packages/setuptools/command/egg_info.py", line 570, in add_defaults
sdist.add_defaults(self)
File "/tmp/pip-build-env-sy2MSY/overlay/lib/python2.7/site-packages/setuptools/command/py36compat.py", line 36, in add_defaults
self._add_defaults_ext()
File "/tmp/pip-build-env-sy2MSY/overlay/lib/python2.7/site-packages/setuptools/command/py36compat.py", line 118, in _add_defaults_ext
if self.distribution.has_ext_modules():
File "setup.py", line 109, in has_ext_modules
return super().has_ext_modules() or 'SETUPPY_ALLOW_PURE' not in os.environ
TypeError: super() takes at least 1 argument (0 given)
What could be the root-cause?
I found a solution.
If I disable the python-hunter library it works.
I guess python-hunter is not compatible with Python2.7 any more.
That's fine for my use case. I this case I can remove the library (although it is a great tracing library).

Unable to restore DB after Database change to Postgres (Django)

I have migrated from SQLite to Postgres, but now I am unable to restore my data on Postgres, i am using Django db-backup package, it is giving me this error on dbrestore command
Traceback (most recent call last):
File "C:\Users\atifs\Documents\food_deliveryapp\fooddelivery\manage.py", line 22, in <module>
main()
File "C:\Users\atifs\Documents\food_deliveryapp\fooddelivery\manage.py", line 18, in main
execute_from_command_line(sys.argv)
File "C:\Users\atifs\Documents\food_deliveryapp\virtual-env\lib\site-packages\django\core\management\__init__.py", line 419, in execute_from_command_line
utility.execute()
File "C:\Users\atifs\Documents\food_deliveryapp\virtual-env\lib\site-packages\django\core\management\__init__.py", line 413, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "C:\Users\atifs\Documents\food_deliveryapp\virtual-env\lib\site-packages\django\core\management\base.py", line 354, in run_from_argv
self.execute(*args, **cmd_options)
File "C:\Users\atifs\Documents\food_deliveryapp\virtual-env\lib\site-packages\django\core\management\base.py", line 398, in execute
output = self.handle(*args, **options)
File "C:\Users\atifs\Documents\food_deliveryapp\virtual-env\lib\site-packages\dbbackup\management\commands\dbrestore.py", line 53, in handle
self._restore_backup()
File "C:\Users\atifs\Documents\food_deliveryapp\virtual-env\lib\site-packages\dbbackup\management\commands\dbrestore.py", line 94, in _restore_backup
self.connector.restore_dump(input_file)
File "C:\Users\atifs\Documents\food_deliveryapp\virtual-env\lib\site-packages\dbbackup\db\base.py", line 92, in restore_dump
result = self._restore_dump(dump)
File "C:\Users\atifs\Documents\food_deliveryapp\virtual-env\lib\site-packages\dbbackup\db\postgresql.py", line 56, in _restore_dump
stdout, stderr = self.run_command(cmd, stdin=dump, env=self.restore_env)
File "C:\Users\atifs\Documents\food_deliveryapp\virtual-env\lib\site-packages\dbbackup\db\postgresql.py", line 21, in run_command
return super(PgDumpConnector, self).run_command(*args, **kwargs)
File "C:\Users\atifs\Documents\food_deliveryapp\virtual-env\lib\site-packages\dbbackup\db\base.py", line 150, in run_command
raise exceptions.CommandConnectorError(
dbbackup.db.exceptions.CommandConnectorError: Error running: psql --host=localhost --port=5432 --username=postgres --no-password --set ON_ERROR_STOP=on --single-transaction postgres
ERROR: syntax error at or near "AUTOINCREMENT"
LINE 1: ...S "auth_group" ("id" integer NOT NULL PRIMARY KEY AUTOINCREM...

Error in sentry --config=/etc/sentry.conf.py start

Please tell me how solve this
I try install Install and configure a Sentry Service on a CentOS, and when i try start sentry service i get this error:
[root#felipeurrego ~]# source /var/www/sentry/bin/activate
(sentry)[root#felipeurrego ~]# sentry --config=/etc/sentry.conf.py start
Traceback (most recent call last):
File "/var/www/sentry/bin/sentry", line 8, in <module>
load_entry_point('sentry==5.4.5', 'console_scripts', 'sentry')()
File "/var/www/sentry/lib/python2.6/site-packages/sentry-5.4.5-py2.6.egg/sentry/utils/runner.py", line 197, in main
initializer=initialize_app,
File "/var/www/sentry/lib/python2.6/site-packages/logan-0.5.5-py2.6.egg/logan/runner.py", line 155, in run_app
management.execute_from_command_line([runner_name, command] + command_args)
File "/var/www/sentry/lib/python2.6/site-packages/Django-1.4.5-py2.6.egg/django/core/management/__init__.py", line 443, in execute_from_command_line
utility.execute()
File "/var/www/sentry/lib/python2.6/site-packages/Django-1.4.5-py2.6.egg/django/core/management/__init__.py", line 382, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "/var/www/sentry/lib/python2.6/site-packages/Django-1.4.5-py2.6.egg/django/core/management/__init__.py", line 252, in fetch_command
app_name = get_commands()[subcommand]
File "/var/www/sentry/lib/python2.6/site-packages/Django-1.4.5-py2.6.egg/django/core/management/__init__.py", line 101, in get_commands
apps = settings.INSTALLED_APPS
File "/var/www/sentry/lib/python2.6/site-packages/Django-1.4.5-py2.6.egg/django/utils/functional.py", line 184, in inner
self._setup()
File "/var/www/sentry/lib/python2.6/site-packages/Django-1.4.5-py2.6.egg/django/conf/__init__.py", line 42, in _setup
self._wrapped = Settings(settings_module)
File "/var/www/sentry/lib/python2.6/site-packages/Django-1.4.5-py2.6.egg/django/conf/__init__.py", line 93, in __init__
mod = importlib.import_module(self.SETTINGS_MODULE)
File "/var/www/sentry/lib/python2.6/site-packages/Django-1.4.5-py2.6.egg/django/utils/importlib.py", line 35, in import_module
__import__(name)
File "/var/www/sentry/lib/python2.6/site-packages/logan-0.5.5-py2.6.egg/logan/importer.py", line 68, in load_module
return self._load_module(fullname)
File "/var/www/sentry/lib/python2.6/site-packages/logan-0.5.5-py2.6.egg/logan/importer.py", line 92, in _load_module
load_settings(self.config_path, allow_extras=self.allow_extras, settings=settings_mod)
File "/var/www/sentry/lib/python2.6/site-packages/logan-0.5.5-py2.6.egg/logan/settings.py", line 49, in load_settings
execfile(mod_or_filename, conf.__dict__)
django.core.exceptions.ImproperlyConfigured: IndentationError('unexpected indent', ('/etc/sentry.conf.py', 58, 1, " SENTRY_URL_PREFIX = 'http://logs.felipeurrego.com'\n"))
And thats all
It's very clear:
django.core.exceptions.ImproperlyConfigured: IndentationError('unexpected indent', ('/etc/sentry.conf.py', 58, 1, " SENTRY_URL_PREFIX = 'http://logs.felipeurrego.com'\n"))
You have a unwarranted space before the configuration variable SENTRY_URL_PREFIX in your /etc/sentry.conf.py. Python requires that everything is uniformly indented in your source code files.

'NoneType' object is unsubscriptable during war file creation in Django-Jython

I am trying to generate a war file on my local machine, so as to deploy the Django application on the web server. I am using Django-Jython for the same purpose. I am using a MySQL database and have set the CLASSPATH variable as mentioned in the documentation. The name of my Django project is "gui" and it resides in C:\
I run the following command :
C:\gui> jython C:\gui\manage.py war --include-java-libs=C:\mysql-connector-java-5.1.16-bin.jar
And I get the following error :
Traceback (most recent call last): File "C:\gui\manage.py", line
10, in execute_from_command_line(sys.argv)
File
"C:\jython2.5.3\Lib\site-packages\django-1.4.3-py2.5.egg\django\core\management__init__.py",
line 443, in execute_from_command_line utility.execute()
File
"C:\jython2.5.3\Lib\site-packages\django-1.4.3-py2.5.egg\django\core\management__init__.py",
line 382, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File
"C:\jython2.5.3\Lib\site-packages\django-1.4.3-py2.5.egg\django\core\management\base.py",
line 196, in run_from_argv
self.execute(*args, **options.dict)
File
"C:\jython2.5.3\Lib\site-packages\django-1.4.3-py2.5.egg\django\core\management\base.py",
line 217, in execute
translation.activate('en-us')
File
"C:\jython2.5.3\Lib\site-packages\django-1.4.3-py2.5.egg\django\core\management\base.py",
line 217, in execute
translation.activate('en-us')
File
"C:\jython2.5.3\Lib\site-packages\django-1.4.3-py2.5.egg\django\utils\translation__init__.py",
line 105, in activate
return _trans.activate(language)
File
"C:\jython2.5.3\Lib\site-packages\django-1.4.3-py2.5.egg\django\utils\translation\trans_real.py",
line 194, in activate
_active.value = translation(language)
File
"C:\jython2.5.3\Lib\site-packages\django-1.4.3-py2.5.egg\django\utils\translation\trans_real.py",
line 183, in translation
default_translation = _fetch(settings.LANGUAGE_CODE)
File
"C:\jython2.5.3\Lib\site-packages\django-1.4.3-py2.5.egg\django\utils\translation\trans_real.py",
line 161, in _fetch
apppath = os.path.join(os.path.dirname(app.file), 'locale')
File "C:\jython2.5.3\Lib\ntpath.py", line 207, in dirname
return split(p)[0] File "C:\jython2.5.3\Lib\ntpath.py", line 164, in split
d, p = splitdrive(p) File "C:\jython2.5.3\Lib\ntpath.py", line 119, in splitdrive
if p[1:2] == ':': TypeError: 'NoneType' object is unsubscriptable