django Interrupted system call with tutorial app - python

I keep receiving this intermittent error even with just the poll application. My application is fairly simple, where at least for the moment, it is just serving up a small csv file via JSON to a jquery table. Both the traceback and my system configuration is listed below. Thanks in advance!
Code
Traceback (most recent call last):
File "manage.py", line 14, in
execute_manager(settings)
File "/home/baldig/shared_libraries/centos64/pkgs/python/2.6.5/lib/python2.6/site-packages/django/core/management/init.py", line 459, in execute_manager
utility.execute()
File "/home/baldig/shared_libraries/centos64/pkgs/python/2.6.5/lib/python2.6/site-packages/django/core/management/init.py", line 382, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "/home/baldig/shared_libraries/centos64/pkgs/python/2.6.5/lib/python2.6/site-packages/django/core/management/base.py", line 196, in run_from_argv
self.execute(*args, **options.dict)
File "/home/baldig/shared_libraries/centos64/pkgs/python/2.6.5/lib/python2.6/site-packages/django/core/management/base.py", line 232, in execute
output = self.handle(*args, **options)
File "/home/baldig/shared_libraries/centos64/pkgs/python/2.6.5/lib/python2.6/site-packages/django/core/management/commands/runserver.py", line 69, in handle
self.run(*args, **options)
File "/home/baldig/shared_libraries/centos64/pkgs/python/2.6.5/lib/python2.6/site-packages/django/core/management/commands/runserver.py", line 80, in run
self.inner_run(*args, **options)
File "/home/baldig/shared_libraries/centos64/pkgs/python/2.6.5/lib/python2.6/site-packages/django/core/management/commands/runserver.py", line 111, in inner_run
ipv6=self.use_ipv6, threading=threading)
File "/home/baldig/shared_libraries/centos64/pkgs/python/2.6.5/lib/python2.6/site-packages/django/core/servers/basehttp.py", line 253, in run
httpd.serve_forever()
File "/home/baldig/shared_libraries/centos64/pkgs/python/2.6.5/lib/python2.6/SocketServer.py", line 224, in serve_forever
r, w, e = select.select([self], [], [], poll_interval)
select.error: (4, 'Interrupted system call')
Config #
Django version 1.4.1
Python 2.6.5
CentOS 6
Intel Xeon E5630
64GB RAM

Please check this thread with the same error for SocketServer.py, 'Interrupted system call' .

Related

AttributeError: module 'asyncio.coroutines' has no attribute '_is_coroutine'

I'm deploying a django app made with django channels using nginx, gunicorn and daphne. During deployment when I run python manage.py makemigrations, I get the following error. Could it be because the python version on my local machine was 3.7 and on remote ubuntu server is 3.5?
from cryptography import x509
/home/ubuntu/django/virtualenv2/lib/python3.5/site-packages/OpenSSL/crypto.py:12: CryptographyDeprecationWarning: Python 3.5 support will be dropped in the next release of cryptography. Please upgrade your Python.
from cryptography import x509
Watching for file changes with StatReloader
Exception in thread django-main-thread:
Traceback (most recent call last):
File "/usr/lib/python3.5/threading.py", line 914, in _bootstrap_inner
self.run()
File "/usr/lib/python3.5/threading.py", line 862, in run
self._target(*self._args, **self._kwargs)
File "/home/ubuntu/django/virtualenv2/lib/python3.5/site-packages/django/utils/autoreload.py", line 54, in wrapper
fn(*args, **kwargs)
File "/home/ubuntu/django/virtualenv2/lib/python3.5/site-packages/django/core/management/commands/runserver.py", line 109, in inner_run
autoreload.raise_last_exception()
File "/home/ubuntu/django/virtualenv2/lib/python3.5/site-packages/django/utils/autoreload.py", line 77, in raise_last_exception
raise _exception[1]
File "/home/ubuntu/django/virtualenv2/lib/python3.5/site-packages/django/core/management/__init__.py", line 337, in execute
autoreload.check_errors(django.setup)()
File "/home/ubuntu/django/virtualenv2/lib/python3.5/site-packages/django/utils/autoreload.py", line 54, in wrapper
fn(*args, **kwargs)
File "/home/ubuntu/django/virtualenv2/lib/python3.5/site-packages/django/__init__.py", line 24, in setup
apps.populate(settings.INSTALLED_APPS)
File "/home/ubuntu/django/virtualenv2/lib/python3.5/site-packages/django/apps/registry.py", line 122, in populate
app_config.ready()
File "/home/ubuntu/django/virtualenv2/lib/python3.5/site-packages/channels/apps.py", line 20, in ready
monkeypatch_django()
File "/home/ubuntu/django/virtualenv2/lib/python3.5/site-packages/channels/hacks.py", line 10, in monkeypatch_django
from .management.commands.runserver import Command as RunserverCommand
File "/home/ubuntu/django/virtualenv2/lib/python3.5/site-packages/channels/management/commands/runserver.py", line 11, in <module>
from channels.routing import get_default_application
File "/home/ubuntu/django/virtualenv2/lib/python3.5/site-packages/channels/routing.py", line 10, in <module>
from channels.http import AsgiHandler
File "/home/ubuntu/django/virtualenv2/lib/python3.5/site-packages/channels/http.py", line 152, in <module>
class AsgiHandler(base.BaseHandler):
File "/home/ubuntu/django/virtualenv2/lib/python3.5/site-packages/channels/http.py", line 214, in AsgiHandler
#sync_to_async
File "/home/ubuntu/django/virtualenv2/lib/python3.5/site-packages/asgiref/sync.py", line 375, in sync_to_async
return SyncToAsync(func, thread_sensitive=thread_sensitive)
File "/home/ubuntu/django/virtualenv2/lib/python3.5/site-packages/asgiref/sync.py", line 262, in __init__
self._is_coroutine = asyncio.coroutines._is_coroutine
AttributeError: module 'asyncio.coroutines' has no attribute '_is_coroutine'
The error is beacause of asgiref package that uses asyncio.coroutines._is_coroutine attribute since version 3.2.2.
You can install asgiref 3.2.1 and this problem doesn't happen.
pip install asgiref==3.2.1

Django error: too many open files

I'm using Anaconda python and I'm trying to run a simple Django server using the official documentation. When I run python manage.py runserver I get this error
Nuseirs-MacBook-Pro:anothertry nyassin$ python manage.py runserver
Validating models...
0 errors found
November 06, 2013 - 18:27:10
Django version 1.7.dev20131105182658, using settings 'anothertry.settings'
Starting development server at http://127.0.0.1:8000/
Quit the server with CONTROL-C.
Traceback (most recent call last):
File "manage.py", line 10, in <module>
execute_from_command_line(sys.argv)
File "/Users/nyassin/django-trunk/django/core/management/__init__.py", line 416, in execute_from_command_line
utility.execute()
File "/Users/nyassin/django-trunk/django/core/management/__init__.py", line 408, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "/Users/nyassin/django-trunk/django/core/management/base.py", line 244, in run_from_argv
self.execute(*args, **options.__dict__)
File "/Users/nyassin/django-trunk/django/core/management/base.py", line 291, in execute
output = self.handle(*args, **options)
File "/Users/nyassin/django-trunk/django/core/management/commands/runserver.py", line 76, in handle
self.run(*args, **options)
File "/Users/nyassin/django-trunk/django/core/management/commands/runserver.py", line 85, in run
autoreload.main(self.inner_run, args, options)
File "/Users/nyassin/django-trunk/django/utils/autoreload.py", line 359, in main
reloader(wrapped_main_func, args, kwargs)
File "/Users/nyassin/django-trunk/django/utils/autoreload.py", line 325, in python_reloader
reloader_thread()
File "/Users/nyassin/django-trunk/django/utils/autoreload.py", line 304, in reloader_thread
if fn():
File "/Users/nyassin/django-trunk/django/utils/autoreload.py", line 217, in kqueue_code_changed
new_descriptors = set(open(filename) for filename in new_filenames)
File "/Users/nyassin/django-trunk/django/utils/autoreload.py", line 217, in <genexpr>
new_descriptors = set(open(filename) for filename in new_filenames)
IOError: [Errno 24] Too many open files: '//anaconda/lib/python2.7/lib-dynload/resource.so'
Any ideas what might be causing this?
It's an operating system error. The maximum number of open files is limited. Try to find where you open files and forget to close them.
Open less file descriptors at once.
set(open(filename) for filename in new_filenames)
is where the error occurs.

jenkins job fails when i run full django tests

When i run the tests on my local machine everything works fine
when i run only my apps tests everything works
but when i run the full set of tests in jenkins it fails,
and the even stranger thing is all the tests pass.
Im guessing it has something to do with pylint, but im not sure.
Would greatly appreciate any suggestions on whats happening?
+ python nexus7/manage.py jenkins
............................................................................................................................................................................................................................................................................................................................................................................................s............................................................................................
----------------------------------------------------------------------
Ran 473 tests in 12.744s
OK (skipped=1)
Creating test database for alias 'default'...
Destroying test database for alias 'default'...
Traceback (most recent call last):
File "nexus7/manage.py", line 10, in <module>
execute_from_command_line(sys.argv)
File "/var/lib/jenkins/shiningpanda/jobs/cb5c943f/virtualenvs/d41d8cd9/local/lib/python2.7/site-packages/Django-1.4.3-py2.7.egg/django/core/management/__init__.py", line 443, in execute_from_command_line
utility.execute()
File "/var/lib/jenkins/shiningpanda/jobs/cb5c943f/virtualenvs/d41d8cd9/local/lib/python2.7/site-packages/Django-1.4.3-py2.7.egg/django/core/management/__init__.py", line 382, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "/var/lib/jenkins/shiningpanda/jobs/cb5c943f/virtualenvs/d41d8cd9/local/lib/python2.7/site-packages/Django-1.4.3-py2.7.egg/django/core/management/base.py", line 196, in run_from_argv
self.execute(*args, **options.__dict__)
File "/var/lib/jenkins/shiningpanda/jobs/cb5c943f/virtualenvs/d41d8cd9/local/lib/python2.7/site-packages/Django-1.4.3-py2.7.egg/django/core/management/base.py", line 232, in execute
output = self.handle(*args, **options)
File "/var/lib/jenkins/shiningpanda/jobs/cb5c943f/virtualenvs/d41d8cd9/local/lib/python2.7/site-packages/django_jenkins/management/commands/__init__.py", line 81, in handle
if test_runner.run_tests(test_labels):
File "/var/lib/jenkins/shiningpanda/jobs/cb5c943f/virtualenvs/d41d8cd9/local/lib/python2.7/site-packages/Django-1.4.3-py2.7.egg/django/test/simple.py", line 384, in run_tests
self.teardown_test_environment()
File "/var/lib/jenkins/shiningpanda/jobs/cb5c943f/virtualenvs/d41d8cd9/local/lib/python2.7/site-packages/django_jenkins/runner.py", line 253, in teardown_test_environment
signals.teardown_test_environment.send(sender=self)
File "/var/lib/jenkins/shiningpanda/jobs/cb5c943f/virtualenvs/d41d8cd9/local/lib/python2.7/site-packages/Django-1.4.3-py2.7.egg/django/dispatch/dispatcher.py", line 172, in send
response = receiver(signal=self, sender=sender, **named)
File "/var/lib/jenkins/shiningpanda/jobs/cb5c943f/virtualenvs/d41d8cd9/local/lib/python2.7/site-packages/django_jenkins/tasks/run_pylint.py", line 43, in teardown_test_environment
lint.Run(args, reporter=ParseableTextReporter(output=self.output), exit=False)
File "/var/lib/jenkins/shiningpanda/jobs/cb5c943f/virtualenvs/d41d8cd9/local/lib/python2.7/site-packages/pylint/lint.py", line 929, in __init__
linter.check(args)
File "/var/lib/jenkins/shiningpanda/jobs/cb5c943f/virtualenvs/d41d8cd9/local/lib/python2.7/site-packages/pylint/lint.py", line 542, in check
self.check_astng_module(astng, walker, rawcheckers)
File "/var/lib/jenkins/shiningpanda/jobs/cb5c943f/virtualenvs/d41d8cd9/local/lib/python2.7/site-packages/pylint/lint.py", line 615, in check_astng_module
walker.walk(astng)
File "/var/lib/jenkins/shiningpanda/jobs/cb5c943f/virtualenvs/d41d8cd9/local/lib/python2.7/site-packages/pylint/utils.py", line 558, in walk
cb(astng)
File "/var/lib/jenkins/shiningpanda/jobs/cb5c943f/virtualenvs/d41d8cd9/local/lib/python2.7/site-packages/pylint/checkers/variables.py", line 176, in leave_module
elt_name = elt.value
AttributeError: 'Name' object has no attribute 'value'
Build step 'Virtualenv Builder' marked build as failure
Archiving artifacts
Skipping Cobertura coverage report as build was not UNSTABLE or better ...
Recording test results
Notifying upstream projects of job completion
Finished: FAILURE

DjangoAppEngine TestApp

Need some help starting up the djangoappengine testapp.I followed the instructions at http://www.allbuttonspressed.com/projects/djangoappengine, but when I run ./manage.py runserver . while in the project directory I get the following error:
WARNING 2011-03-24 12:23:21,994 datastore_file_stub.py:657] Could not read datastore
data from /media/disk/Projex/AppEngineApp/app/.gaedata/datastore
Error: option --rdbms_sqlite_path not recognized
Runs a development application server for an application.
manage.py [options] <application root>__
When I try and comment the ' 'rdbms_sqlite_path': os.path.join(DATA_ROOT, 'rdbms'),' line in app/djangoappengine/db/base.py I get the following error:
WARNING 2011-03-24 12:26:07,239 datastore_file_stub.py:657] Could not read datastore
data from /media/disk/Projex/AppEngineApp/app/.gaedata/datastore
Traceback (most recent call last):
File "./manage.py", line 11, in <module>
execute_manager(settings)
File "/media/disk/Projex/AppEngineApp/app/django/core/management/__init__.py", line 438,
in execute_manager
utility.execute()
File "/media/disk/Projex/AppEngineApp/app/django/core/management/__init__.py", line 379,
in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File
"/media/disk/Projex/AppEngineApp/app/djangoappengine/management/commands/runserver.py",
line 94, in run_from_argv
start_dev_appserver(argv)
File
"/media/disk/Projex/AppEngineApp/app/djangoappengine/management/commands/runserver.py",
line 81, in start_dev_appserver
dev_appserver_main.main([progname] + args + [PROJECT_DIR])
File "/usr/local/gaepy/google/appengine/tools/dev_appserver_main.py", line 426, in main
static_caching=static_caching)
File "/usr/local/gaepy/google/appengine/tools/dev_appserver.py", line 3820, in
CreateServer
server = HTTPServerWithScheduler((serve_address, port), handler_class)
File "/usr/local/gaepy/google/appengine/tools/dev_appserver.py", line 3840, in __init__
request_handler_class)
File "/usr/lib/python2.6/SocketServer.py", line 400, in __init__
self.server_bind()
File "/usr/lib/python2.6/BaseHTTPServer.py", line 108, in server_bind
SocketServer.TCPServer.server_bind(self)
File "/usr/lib/python2.6/SocketServer.py", line 411, in server_bind
self.socket.bind(self.server_address)
File "<string>", line 1, in bind
socket.gaierror: [Errno -5] No address associated with hostname
Anyone experienced this issue ?
You probably already solved this, but for future users:
The warning can have multiple causes:
data store is empty, in that case ignore
wrong permissions on the datastore files
data corruption issue
The error can be solved by updating djangoappengine
Update to the latest version of google app engine.

Django failing to find apps

I have been working on a django app on my local computer for some time now and i am trying to move it to a mediatemple container and im having a problem when i try to start up django. it gives me this traceback:
application failed to start, starting manage.py fastcgi failed:Traceback
(most recent call last): File "manage.py", line 11, in ?
execute_manager(settings) File
"/home/58626/data/python/lib/django/core/management/__init__.py", line 340,
in execute_manager utility.execute() File
"/home/58626/data/python/lib/django/core/management/__init__.py", line 295,
in execute self.fetch_command(subcommand).run_from_argv(self.argv) File
"/home/58626/data/python/lib/django/core/management/base.py", line 192, in
run_from_argv self.execute(*args, **options.__dict__) File
"/home/58626/data/python/lib/django/core/management/base.py", line 210, in
execute translation.activate('en-us') File
"/home/58626/data/python/lib/django/utils/translation/__init__.py", line
73, in activate return real_activate(language) File
"/home/58626/data/python/lib/django/utils/translation/__init__.py", line
43, in delayed_loader return g['real_%s' % caller](*args, **kwargs) File
"/home/58626/data/python/lib/django/utils/translation/trans_real.py", line
209, in activate _active[currentThread()] = translation(language) File
"/home/58626/data/python/lib/django/utils/translation/trans_real.py", line
198, in translation default_translation = _fetch(settings.LANGUAGE_CODE)
File "/home/58626/data/python/lib/django/utils/translation/trans_real.py",
line 181, in _fetch app = getattr(__import__(appname[:p], {}, {},
[appname[p+1:]]), appname[p+1:]) AttributeError: 'module' object has no
attribute 'web'
The name of the first app is "web".
Steps I would take would be
Run the dev server on your Media Template instance. If that runs successfully, it obviously is an error with your apache/nginx/whaever setup.
I dont have experience running apps as FCGI, which it looks to em you are trying to do. It looks to me that somehow when Fcgi runs, it is unable to find your apps. So this is possibly a PYTHONPATH issue. Log/Print sys.path from your fcgi script and look there.

Categories

Resources