WSGIServerException: [Errno 8] nodename or servname provided or unknown

I get this error intermittently, but when this happens, my automatic integration testing using Django LiveServerTestCase leads to a hang that causes the following error:

WSGIServerException: [Errno 8] nodename nor servname provided, or not known 

A crash occurs as soon as the main test class is created from any given test (this happens after creating the database in memory and loading my devices).

My setup is as follows:

  • Mac OSX Snow leopard
  • Django 1.4.1
  • Virtual environment (hosting all Python libraries)
  • sqlite (for testing) MySQL / InnoDB for production
  • Local Git code for branch hulls

While this error occurs only during testing in our local network in my office. At home, the tests pass fine, but then the tests work fine again at my work for a while, so intermittent disappointment.

In the spirit of troubleshooting, I created a new virtualenv, deleted all .pyc files throughout the system, reinstalled MySQL from the source, as well as all the necessary libraries.

If someone meets this mistake and knows how to defeat it, share it.

thanks

+7
source share
4 answers

It looks like this could be a network issue. Make sure that you have a permanent Internet connection (for example, when you regularly call the appropriate server when you run tests) and that your DNS server constantly reports results (for example, not accidentally dropping requests or timeout).

You can also try changing the address of the live server to a direct IP address (for example, changing localhost to 127.0.0.1) so that it does not search for the address.

+8
source

For me, turning on and off WiFi again helped Max OS X Yosemite.

+3
source

I solved this problem by changing this line in /etc/hosts :

# 127.0.0.1 localhost

to

127.0.0.1 localhost

I do not know why the line was commented out.

+3
source

In my case, I started the local Django server with:

 ./manage.py runserver silberpfeil.local:8000 

and after a few seconds I got an error:

 Error: [Errno 8] nodename nor servname provided, or not known 

In the settings under "Share Points," I saw that Mac OS X somehow seemed to change the computer name to silberpfeil-2.local

enter image description here

So, I have to run this command now or change the host name:

 ./manage.py runserver silberpfeil-2.local:8000 
0
source

All Articles