facebookarchive / augmented-traffic-control

Augmented Traffic Control: A tool to simulate network conditions
https://facebook.github.io/augmented-traffic-control
Other
4.33k stars 600 forks source link

"cannot import name DurationField" when running from vagrant #279

Closed antranapp closed 8 years ago

antranapp commented 8 years ago

Run atc from Vagrant I get "cannot import name DurationField" error when try to open to UI

vagrant@trusty:~/atcui$ python
Python 2.7.6 (default, Jun 22 2015, 17:58:13) 
[GCC 4.8.2] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import django
>>> print(django.get_version())
1.7
antranapp commented 8 years ago

Actually the problem is the chef cookbook did not run successfully and I have to install everything manually. When starting vagrant, I can see the following errors:


==> trusty:     Expected process to exit with [0], but received '100'
==> trusty:     ---- Begin output of apt-get -q -y install python-dev=2.7.5-5ubuntu3 ----
==> trusty:     STDOUT: Reading package lists...
==> trusty:     Building dependency tree...
==> trusty:     Reading state information...
==> trusty:     The following extra packages will be installed:
==> trusty:       libexpat1-dev libpython-dev libpython2.7 libpython2.7-dev python2.7-dev
==> trusty:     The following NEW packages will be installed:
==> trusty:       libexpat1-dev libpython-dev libpython2.7 libpython2.7-dev python-dev
==> trusty:       python2.7-dev
==> trusty:     0 upgraded, 6 newly installed, 0 to remove and 0 not upgraded.
==> trusty:     Need to get 23.4 MB of archives.
==> trusty:     After this operation, 38.7 MB of additional disk space will be used.
==> trusty:     Get:1 http://us.archive.ubuntu.com/ubuntu/ trusty-updates/main libpython2.7 amd64 2.7.6-8ubuntu0.2 [1039 kB]
==> trusty:     Err http://us.archive.ubuntu.com/ubuntu/ trusty-updates/main libexpat1-dev amd64 2.1.0-4ubuntu1.2
==> trusty:       404  Not Found [IP: 91.189.91.26 80]
==> trusty:     Err http://security.ubuntu.com/ubuntu/ trusty-security/main libexpat1-dev amd64 2.1.0-4ubuntu1.2
==> trusty:       404  Not Found [IP: 91.189.88.162 80]
==> trusty:     Get:2 http://us.archive.ubuntu.com/ubuntu/ trusty-updates/main libpython2.7-dev amd64 2.7.6-8ubuntu0.2 [22.0 MB]
==> trusty:     Get:3 http://us.archive.ubuntu.com/ubuntu/ trusty/main libpython-dev amd64 2.7.5-5ubuntu3 [7078 B]
==> trusty:     Get:4 http://us.archive.ubuntu.com/ubuntu/ trusty-updates/main python2.7-dev amd64 2.7.6-8ubuntu0.2 [269 kB]
==> trusty:     Get:5 http://us.archive.ubuntu.com/ubuntu/ trusty/main python-dev amd64 2.7.5-5ubuntu3 [1166 B]
==> trusty:     Fetched 23.3 MB in 16s (1422 kB/s)
==> trusty:     STDERR: E: Failed to fetch http://security.ubuntu.com/ubuntu/pool/main/e/expat/libexpat1-dev_2.1.0-4ubuntu1.2_amd64.deb  404  Not Found [IP: 91.189.88.162 80]
==> trusty:     
==> trusty:     E: Unable to fetch some archives, maybe run apt-get update or try with --fix-missing?
==> trusty:     ---- End output of apt-get -q -y install python-dev=2.7.5-5ubuntu3 ----
==> trusty:     Ran apt-get -q -y install python-dev=2.7.5-5ubuntu3 returned 100
chantra commented 8 years ago

oh, that should be a simple fix by using https://github.com/chef-cookbooks/apt or the equivalent for yum so it refreshes the database before installing the packages.

I will not have time to deal with this before a while. Please file a PR if you can tackle this. Thanks

chantra commented 8 years ago

@peacemoon PR #280 should fix both your issues.

antranapp commented 8 years ago

thank you, will test again when the PR is merged

chantra commented 8 years ago

@peacemoon merged :)

antranapp commented 8 years ago

Tested, worked. Thank you