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
Related
This might seem like an already asked question but I have searched for an answer for a week now and got nothing.
The problem is I have developed an API using Django which is hosted on a server. Now when I run the following command to initiate the server :
python manage.py runserver 0.0.0.0:9000
The server starts as usual. Its only when I send request to the server via "Postman" that I see the following error:
FileNotFoundError: [Errno 2] No such file or directory: 'manage.py'
The strange thing is there is no error in running the server but only when I send a request to it. Also I have many more Django APIs running on the same server with same python version(Python 3.4.3) and same virtual environment (but different port) that are running just fine.
Full error traceback :
Traceback (most recent call last):
File "manage.py", line 15, in <module>
execute_from_command_line(sys.argv)
File "/home/ubuntu/py3env/lib/python3.4/site-packages/django/core/management/__init__.py", line 371, in execute_from_command_line
utility.execute()
File "/home/ubuntu/py3env/lib/python3.4/site-packages/django/core/management/__init__.py", line 365, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "/home/ubuntu/py3env/lib/python3.4/site-packages/django/core/management/base.py", line 288, in run_from_argv
self.execute(*args, **cmd_options)
File "/home/ubuntu/py3env/lib/python3.4/site-packages/django/core/management/commands/runserver.py", line 61, in execute
super().execute(*args, **options)
File "/home/ubuntu/py3env/lib/python3.4/site-packages/django/core/management/base.py", line 335, in execute
output = self.handle(*args, **options)
File "/home/ubuntu/py3env/lib/python3.4/site-packages/django/core/management/commands/runserver.py", line 98, in handle
self.run(**options)
File "/home/ubuntu/py3env/lib/python3.4/site-packages/django/core/management/commands/runserver.py", line 105, in run
autoreload.main(self.inner_run, None, options)
File "/home/ubuntu/py3env/lib/python3.4/site-packages/django/utils/autoreload.py", line 317, in main
python_reloader(wrapped_main_func, args, kwargs)
File "/home/ubuntu/py3env/lib/python3.4/site-packages/django/utils/autoreload.py", line 296, in python_reloader
reloader_thread()
File "/home/ubuntu/py3env/lib/python3.4/site-packages/django/utils/autoreload.py", line 274, in reloader_thread
change = fn()
File "/home/ubuntu/py3env/lib/python3.4/site-packages/django/utils/autoreload.py", line 204, in code_changed
stat = os.stat(filename)
FileNotFoundError: [Errno 2] No such file or directory: 'manage.py'
Things I have tried:
I have tried changing the !# as suggested on various posts.
I have tried using dos2unix to convert the file to unix format(server on which my API is hosted is linux based).
I even have tried to create a new Django project.
And yes I'm running manage.py from the correct directory.
I have also tried making manage.py executable by :
chmod +x manage.py
Nothing worked for me so far. Am I missing something?
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.
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' .
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.
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.