Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

server install script fails trying to install python-autodep8 on Ubuntu 12.04 #817

Closed
lawm opened this issue Apr 4, 2014 · 3 comments
Closed

Comments

@lawm
Copy link

lawm commented Apr 4, 2014

install-autotest-server.sh mentioned in https://github.com/autotest/autotest/wiki/AutotestServerInstallScript fails on Ubuntu 12.04 because python-autodep8 is not an available package in the Ubuntu package repository for versions earlier than Ubuntu 13.10 (http://packages.ubuntu.com/search?suite=default&section=all&arch=any&keywords=python-autopep8&searchon=names).

This dependency was added in 5e2f886.

To resolve this, I manually installed all the package dependencies manually, commented out install_packages() in the script and ran it again:

sudo apt-get install apache2-mpm-prefork git libapache2-mod-wsgi makepasswd mysql-server openjdk-7-jre-headless python-crypto python-django python-django-south python-httplib2 python-imaging python-matplotlib python-mysqldb python-numpy python-paramiko python-setuptools python-simplejson python-psutil unzip wget protobuf-compiler python-protobuf pylint

sudo apt-get install python-pip
sudo pip install --upgrade autopep8

sed 's/install_packages$/#install_packages/' install-autotest-server.sh > install-autotest-server-mod.sh
sudo ./install-autotest-server-mod.sh -u x -p x
@clebergnu
Copy link
Member

OK, the way to go here seems to be to add a distro version dependent list of packages, that is, if distro is Ubuntu and version is 13.10 or greater then include autopep8.

I'll take a look at that. Thanks for reporting.

@toralMevada
Copy link
Contributor

Hi @lawm ,

I could run script after following your steps on 12.04.

But the url http://localhost/afe gives 404 error.

Any comment on how to resolve this?

Script logs:
sudo bash install-autotest-server-mod.sh -u autotest -d a
12:15:35 INFO | Installing the Autotest server
12:15:35 INFO | A log of operation is kept in /tmp/install-autotest-server-mod-09-30-2015-12-15-35.log
12:15:35 INFO | Install started at: Wed Sep 30 12:15:35 IST 2015
12:15:35 INFO | /usr/local free 81G
12:15:35 INFO | /var free 81G
12:15:35 INFO | Installing basic packages
12:15:36 INFO | Creating autotest user
12:15:36 INFO | Installing autotest
12:15:36 INFO | Updating autotest repo in /usr/local/autotest
M apache/conf/django-directives
M apache/drone-conf
M client/tests
M global_config.ini
M server/tests
Already on 'master'
Already up-to-date.
12:15:40 INFO | Initializing and updating tests to the latest master
Submodule 'client/tests' () registered for path 'client/tests'
Submodule 'server/tests' () registered for path 'server/tests'
Submodule path 'client/tests': checked out '2780b7c9c39037a39a089176a34ea258dbf10591'
Submodule path 'virt': checked out '4e214c3186a2c83cae3966917edb59c311b5d854'
Submodule path 'server/tests': checked out '01751e20f607ea8eaf6b727942b784ed5a14690a'
Previous HEAD position was 2780b7c... Merge pull request #42 from autotest/pep8-fix
Switched to branch 'master'
Warning: you are leaving 910 commits behind, not connected to
any of your branches:

4e214c3 Merge pull request #2023 from Hao-Liu/fix_serial_log
59884a5 Merge pull request #2021 from waynesun09/cell_topo
3de538f Merge pull request #2000 from PandaWei/channel
93b821d unattended_install: Change serial log name accordingly
... and 906 more.

If you want to keep them by creating a new branch, this may be a good time
to do so with:

git branch new_branch_name 4e214c3186a2c83cae3966917edb59c311b5d854

Switched to branch 'master'
Previous HEAD position was 01751e2... Merge pull request #14 from autotest/pep8-fix
Switched to branch 'master'
12:15:40 INFO | Setting proper permissions for the autotest directory
install-autotest-server-mod.sh: line 271: _#install_packages: command not found
12:15:40 INFO | Enabling MySQL server on boot
update-rc.d: warning: /etc/init.d/mysql missing LSB information
update-rc.d: see http://wiki.debian.org/LSBInitScripts
12:15:40 INFO | Re-starting MySQL server
12:15:43 INFO | Setting MySQL root password
12:15:43 INFO | Verifying MySQL root password
12:15:43 INFO | Creating MySQL databases for autotest
12:16:25 INFO | Running autotest dependencies build (may take a while since it might download files)
12:16:25 INFO | Configuring Web server
Module rewrite already enabled
System start/stop links for /etc/init.d/apache2 already exist.
12:16:25 INFO | Re-starting MySQL server
12:16:29 INFO | Building the web rpc client (may take up to 10 minutes)

12:18:10 INFO | Import the base tests and profilers

Traceback (most recent call last):
File "/usr/local/autotest/utils/test_importer.py", line 591, in
main(sys.argv)
File "/usr/local/autotest/utils/test_importer.py", line 570, in main
options.add_experimental)
File "/usr/local/autotest/utils/test_importer.py", line 87, in update_all
autotest_dir=autotest_dir)
File "/usr/local/autotest/utils/test_importer.py", line 261, in update_tests_in_db
_log_or_execute(repr(new_test), new_test.save)
File "/usr/local/autotest/utils/test_importer.py", line 418, in _log_or_execute
func(_args)
File "/usr/local/lib/python2.7/dist-packages/django/db/models/base.py", line 546, in save
force_update=force_update, update_fields=update_fields)
File "/usr/local/lib/python2.7/dist-packages/django/db/models/base.py", line 626, in save_base
rows = manager.using(using).filter(pk=pk_val)._update(values)
File "/usr/local/lib/python2.7/dist-packages/django/db/models/query.py", line 603, in _update
return query.get_compiler(self.db).execute_sql(None)
File "/usr/local/lib/python2.7/dist-packages/django/db/models/sql/compiler.py", line 1014, in execute_sql
cursor = super(SQLUpdateCompiler, self).execute_sql(result_type)
File "/usr/local/lib/python2.7/dist-packages/django/db/models/sql/compiler.py", line 840, in execute_sql
cursor.execute(sql, params)
File "/usr/local/lib/python2.7/dist-packages/django/db/backends/mysql/base.py", line 122, in execute
six.reraise(utils.IntegrityError, utils.IntegrityError(_tuple(e.args)), sys.exc_info()[2])
File "/usr/local/lib/python2.7/dist-packages/django/db/backends/mysql/base.py", line 120, in execute
return self.cursor.execute(query, args)
File "/usr/lib/python2.7/dist-packages/MySQLdb/cursors.py", line 174, in execute
self.errorhandler(self, exc, value)
File "/usr/lib/python2.7/dist-packages/MySQLdb/connections.py", line 36, in defaulterrorhandler
raise errorclass, errorvalue
django.db.utils.IntegrityError: (1062, "Duplicate entry 'Netperf2 (Client)' for key 'name'")
12:18:14 INFO | Restarting web server

  • Restarting web server apache2 [Wed Sep 30 12:18:14 2015] [warn] The Alias directive in /etc/phpmyadmin/apache.conf at line 3 will probably never match because it overlaps an earlier Alias.
    [Wed Sep 30 12:18:14 2015] [warn] NameVirtualHost *:80 has no VirtualHosts
    [Wed Sep 30 12:18:14 2015] [warn] The Alias directive in /etc/phpmyadmin/apache.conf at line 3 will probably never match because it overlaps an earlier Alias.
    [Wed Sep 30 12:18:14 2015] [warn] NameVirtualHost *:80 has no VirtualHosts
    [ OK ]
    12:18:14 INFO | Installing/starting scheduler
    update-rc.d: warning: /etc/init.d/autotest missing LSB information
    update-rc.d: see http://wiki.debian.org/LSBInitScripts
    update-rc.d: warning: /etc/rc2.d/S99autotest is not a link to ../init.d/autotest or /etc/init.d/autotest

12:18:14 INFO | Usage: /etc/init.d/autotest start|stop|restart
12:18:15 INFO | Finished installing autotest server 0.16.1-149-g652f at: Wed Sep 30 12:18:15 IST 2015
12:18:15 INFO | You can access your server on http://192.168.1.106/afe

@lawm
Copy link
Author

lawm commented Sep 30, 2015

Your log says django.db.utils.IntegrityError: (1062, "Duplicate entry 'Netperf2 (Client)' for key 'name'"). You can check why that is.

@lawm lawm closed this as completed Mar 9, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants