seibert-media/teamvault

Install Failure.

Closed this issue · 5 comments

Running ubuntu server 15.04 4 bit.

used this guide to do the install.

https://pypi.python.org/pypi/teamvault/0.4.3

$ sudo pip install teamvault
Requirement already satisfied (use --upgrade to upgrade): teamvault in ./.local/lib/python2.7/site-packages
Downloading/unpacking cryptography==0.9 (from teamvault)
  Downloading cryptography-0.9.tar.gz (302kB): 302kB downloaded
  Running setup.py (path:/tmp/pip-build-ABU3zM/cryptography/setup.py) egg_info for package cryptography

    no previously-included directories found matching 'docs/_build'
    warning: no previously-included files matching '*' found under directory 'vectors'
Downloading/unpacking dj-static==0.0.6 (from teamvault)
  Downloading dj-static-0.0.6.tar.gz
  Running setup.py (path:/tmp/pip-build-ABU3zM/dj-static/setup.py) egg_info for package dj-static

Downloading/unpacking Django==1.8.1 (from teamvault)
  Downloading Django-1.8.1-py2.py3-none-any.whl (6.2MB): 6.2MB downloaded
Downloading/unpacking django-gravatar2==1.3.0 (from teamvault)
  Downloading django_gravatar2-1.3.0-py2.py3-none-any.whl
Downloading/unpacking djangorestframework==3.1.2 (from teamvault)
  Downloading djangorestframework-3.1.2-py2.py3-none-any.whl (463kB): 463kB downloaded
Downloading/unpacking djorm-ext-pgfulltext==0.9.3 (from teamvault)
  Downloading djorm_ext_pgfulltext-0.9.3-py2.py3-none-any.whl
Downloading/unpacking gunicorn==19.3.0 (from teamvault)
  Downloading gunicorn-19.3.0-py2.py3-none-any.whl (110kB): 110kB downloaded
Downloading/unpacking hashids==1.1.0 (from teamvault)
  Downloading hashids-1.1.0.tar.gz
  Running setup.py (path:/tmp/pip-build-ABU3zM/hashids/setup.py) egg_info for package hashids

Downloading/unpacking psycopg2==2.6 (from teamvault)
  Downloading psycopg2-2.6.tar.gz (367kB): 367kB downloaded
  Running setup.py (path:/tmp/pip-build-ABU3zM/psycopg2/setup.py) egg_info for package psycopg2

Downloading/unpacking pytz==2015.4 (from teamvault)
  Downloading pytz-2015.4-py2.py3-none-any.whl (475kB): 475kB downloaded
Requirement already satisfied (use --upgrade to upgrade): idna in /usr/lib/python2.7/dist-packages (from cryptography==0.9->teamvault)
Requirement already satisfied (use --upgrade to upgrade): pyasn1 in ./.local/lib/python2.7/site-packages (from cryptography==0.9->teamvault)
Requirement already satisfied (use --upgrade to upgrade): six>=1.4.1 in /usr/lib/python2.7/dist-packages (from cryptography==0.9->teamvault)
Requirement already satisfied (use --upgrade to upgrade): setuptools in /usr/lib/python2.7/dist-packages (from cryptography==0.9->teamvault)
Downloading/unpacking enum34 (from cryptography==0.9->teamvault)
  Downloading enum34-1.0.4.tar.gz
  Running setup.py (path:/tmp/pip-build-ABU3zM/enum34/setup.py) egg_info for package enum34

Downloading/unpacking ipaddress (from cryptography==0.9->teamvault)
  Downloading ipaddress-1.0.7-py27-none-any.whl
Downloading/unpacking cffi>=0.8 (from cryptography==0.9->teamvault)
  Downloading cffi-1.1.0.tar.gz (323kB): 323kB downloaded
  Running setup.py (path:/tmp/pip-build-ABU3zM/cffi/setup.py) egg_info for package cffi

Downloading/unpacking static3 (from dj-static==0.0.6->teamvault)
  Downloading static3-0.6.1.tar.gz
  Running setup.py (path:/tmp/pip-build-ABU3zM/static3/setup.py) egg_info for package static3

Downloading/unpacking pycparser (from cffi>=0.8->cryptography==0.9->teamvault)
  Downloading pycparser-2.13.tar.gz (299kB): 299kB downloaded
  Running setup.py (path:/tmp/pip-build-ABU3zM/pycparser/setup.py) egg_info for package pycparser

    warning: no previously-included files matching 'yacctab.*' found under directory 'tests'
    warning: no previously-included files matching 'lextab.*' found under directory 'tests'
    warning: no previously-included files matching 'yacctab.*' found under directory 'examples'
    warning: no previously-included files matching 'lextab.*' found under directory 'examples'
Installing collected packages: cryptography, dj-static, Django, django-gravatar2, djangorestframework, djorm-ext-pgfulltext, gunicorn, hashids, psycopg2, pytz, enum34, ipaddress, cffi, static3, pycparser
  Running setup.py install for cryptography
    c/_cffi_backend.c:2:20: fatal error: Python.h: No such file or directory
     #include <Python.h>
                        ^
    compilation terminated.
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/tmp/pip-build-ABU3zM/cryptography/setup.py", line 342, in <module>
        **keywords_with_side_effects(sys.argv)
      File "/usr/lib/python2.7/distutils/core.py", line 111, in setup
        _setup_distribution = dist = klass(attrs)
      File "/usr/lib/python2.7/dist-packages/setuptools/dist.py", line 265, in __init__
        self.fetch_build_eggs(attrs['setup_requires'])
      File "/usr/lib/python2.7/dist-packages/setuptools/dist.py", line 310, in fetch_build_eggs
        replace_conflicting=True,
      File "/usr/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 799, in resolve
        dist = best[req.key] = env.best_match(req, ws, installer)
      File "/usr/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 1049, in best_match
        return self.obtain(req, installer)
      File "/usr/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 1061, in obtain
        return installer(requirement)
      File "/usr/lib/python2.7/dist-packages/setuptools/dist.py", line 377, in fetch_build_egg
        return cmd.easy_install(req)
      File "/usr/lib/python2.7/dist-packages/setuptools/command/easy_install.py", line 646, in easy_install
        return self.install_item(spec, dist.location, tmpdir, deps)
      File "/usr/lib/python2.7/dist-packages/setuptools/command/easy_install.py", line 676, in install_item
        dists = self.install_eggs(spec, download, tmpdir)
      File "/usr/lib/python2.7/dist-packages/setuptools/command/easy_install.py", line 861, in install_eggs
        return self.build_and_install(setup_script, setup_base)
      File "/usr/lib/python2.7/dist-packages/setuptools/command/easy_install.py", line 1089, in build_and_install
        self.run_setup(setup_script, setup_base, args)
      File "/usr/lib/python2.7/dist-packages/setuptools/command/easy_install.py", line 1077, in run_setup
        raise DistutilsError("Setup script exited with %s" % (v.args[0],))
    distutils.errors.DistutilsError: Setup script exited with error: command 'x86_64-linux-gnu-gcc' failed with exit status 1
    Complete output from command /usr/bin/python -c "import setuptools, tokenize;__file__='/tmp/pip-build-ABU3zM/cryptography/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-D2izdk-record/install-record.txt --single-version-externally-managed --compile:
    c/_cffi_backend.c:2:20: fatal error: Python.h: No such file or directory

 #include <Python.h>

                    ^

compilation terminated.

Traceback (most recent call last):

  File "<string>", line 1, in <module>

  File "/tmp/pip-build-ABU3zM/cryptography/setup.py", line 342, in <module>

    **keywords_with_side_effects(sys.argv)

  File "/usr/lib/python2.7/distutils/core.py", line 111, in setup

    _setup_distribution = dist = klass(attrs)

  File "/usr/lib/python2.7/dist-packages/setuptools/dist.py", line 265, in __init__

    self.fetch_build_eggs(attrs['setup_requires'])

  File "/usr/lib/python2.7/dist-packages/setuptools/dist.py", line 310, in fetch_build_eggs

    replace_conflicting=True,

  File "/usr/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 799, in resolve

    dist = best[req.key] = env.best_match(req, ws, installer)

  File "/usr/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 1049, in best_match

    return self.obtain(req, installer)

  File "/usr/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 1061, in obtain

    return installer(requirement)

  File "/usr/lib/python2.7/dist-packages/setuptools/dist.py", line 377, in fetch_build_egg

    return cmd.easy_install(req)

  File "/usr/lib/python2.7/dist-packages/setuptools/command/easy_install.py", line 646, in easy_install

    return self.install_item(spec, dist.location, tmpdir, deps)

  File "/usr/lib/python2.7/dist-packages/setuptools/command/easy_install.py", line 676, in install_item

    dists = self.install_eggs(spec, download, tmpdir)

  File "/usr/lib/python2.7/dist-packages/setuptools/command/easy_install.py", line 861, in install_eggs

    return self.build_and_install(setup_script, setup_base)

  File "/usr/lib/python2.7/dist-packages/setuptools/command/easy_install.py", line 1089, in build_and_install

    self.run_setup(setup_script, setup_base, args)

  File "/usr/lib/python2.7/dist-packages/setuptools/command/easy_install.py", line 1077, in run_setup

    raise DistutilsError("Setup script exited with %s" % (v.args[0],))

distutils.errors.DistutilsError: Setup script exited with error: command 'x86_64-linux-gnu-gcc' failed with exit status 1

----------------------------------------
Cleaning up...
Command /usr/bin/python -c "import setuptools, tokenize;__file__='/tmp/pip-build-ABU3zM/cryptography/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-D2izdk-record/install-record.txt --single-version-externally-managed --compile failed with error code 1 in /tmp/pip-build-ABU3zM/cryptography
Storing debug log for failure in /home/USERNAME/.pip/pip.log

pip install cryptography was the failure.

install the below packages and pip install teamvault has worked

sudo apt-get install build-essential libssl-dev libffi-dev python-dev

So i've made progress.

But now when I run the application it seems it wants to use python2.7 but i don't know how to force the application gunicorn to run with python3.

i get the following:

root@teamvault:~# teamvault run
[2015-06-02 16:03:49 +0000] [18016] [INFO] Starting gunicorn 19.3.0
[2015-06-02 16:03:49 +0000] [18016] [INFO] Listening at: http://127.0.0.1:8000 (18016)
[2015-06-02 16:03:49 +0000] [18016] [INFO] Using worker: sync
[2015-06-02 16:03:49 +0000] [18021] [INFO] Booting worker with pid: 18021
[2015-06-02 16:03:49 +0000] [18021] [ERROR] Exception in worker process:
Traceback (most recent call last):
  File "/usr/local/lib/python2.7/dist-packages/gunicorn/arbiter.py", line 507, in spawn_worker
    worker.init_process()
  File "/usr/local/lib/python2.7/dist-packages/gunicorn/workers/base.py", line 118, in init_process
    self.wsgi = self.app.wsgi()
  File "/usr/local/lib/python2.7/dist-packages/gunicorn/app/base.py", line 67, in wsgi
    self.callable = self.load()
  File "/usr/local/lib/python2.7/dist-packages/gunicorn/app/wsgiapp.py", line 65, in load
    return self.load_wsgiapp()
  File "/usr/local/lib/python2.7/dist-packages/gunicorn/app/wsgiapp.py", line 52, in load_wsgiapp
    return util.import_app(self.app_uri)
  File "/usr/local/lib/python2.7/dist-packages/gunicorn/util.py", line 355, in import_app
    __import__(module)
ImportError: No module named teamvault.wsgi
Traceback (most recent call last):
  File "/usr/local/lib/python2.7/dist-packages/gunicorn/arbiter.py", line 507, in spawn_worker
    worker.init_process()
  File "/usr/local/lib/python2.7/dist-packages/gunicorn/workers/base.py", line 118, in init_process
    self.wsgi = self.app.wsgi()
  File "/usr/local/lib/python2.7/dist-packages/gunicorn/app/base.py", line 67, in wsgi
    self.callable = self.load()
  File "/usr/local/lib/python2.7/dist-packages/gunicorn/app/wsgiapp.py", line 65, in load
    return self.load_wsgiapp()
  File "/usr/local/lib/python2.7/dist-packages/gunicorn/app/wsgiapp.py", line 52, in load_wsgiapp
    return util.import_app(self.app_uri)
  File "/usr/local/lib/python2.7/dist-packages/gunicorn/util.py", line 355, in import_app
    __import__(module)
ImportError: No module named teamvault.wsgi
[2015-06-02 16:03:49 +0000] [18021] [INFO] Worker exiting (pid: 18021)
Traceback (most recent call last):
  File "/usr/local/bin/gunicorn", line 11, in <module>
    sys.exit(run())
  File "/usr/local/lib/python2.7/dist-packages/gunicorn/app/wsgiapp.py", line 74, in run
    WSGIApplication("%(prog)s [OPTIONS] [APP_MODULE]").run()
  File "/usr/local/lib/python2.7/dist-packages/gunicorn/app/base.py", line 189, in run
    super(Application, self).run()
  File "/usr/local/lib/python2.7/dist-packages/gunicorn/app/base.py", line 72, in run
    Arbiter(self).run()
  File "/usr/local/lib/python2.7/dist-packages/gunicorn/arbiter.py", line 174, in run
    self.manage_workers()
  File "/usr/local/lib/python2.7/dist-packages/gunicorn/arbiter.py", line 477, in manage_workers
    self.spawn_workers()
  File "/usr/local/lib/python2.7/dist-packages/gunicorn/arbiter.py", line 541, in spawn_workers
    time.sleep(0.1 * random.random())
  File "/usr/local/lib/python2.7/dist-packages/gunicorn/arbiter.py", line 214, in handle_chld
    self.reap_workers()
  File "/usr/local/lib/python2.7/dist-packages/gunicorn/arbiter.py", line 459, in reap_workers
    raise HaltServer(reason, self.WORKER_BOOT_ERROR)
gunicorn.errors.HaltServer: <HaltServer 'Worker failed to boot.' 3>

Try this:

sudo apt-get install python3-pip python3-dev
sudo pip3 install teamvault

Then teamvault run should work as expected. Don't forget to run teamvault setup and teamvault upgrade before your first teamvault run.

So after a clean restore to a base ubuntu.

I've got it working.

Steps that aren't documented well are:

sudo apt-get install python3-pip python3-dev build-essential libssl-dev libffi-dev libpq-dev mercurial python3.4-dev postgresql-contrib postgresql
sudo pip3 install teamvault
sudo teamvault setup

Then you need to setup a database in postgresql that has the same name, username and password that is listed in the /etc/teamvault.conf.

Now you do a run of the teamvault commands:

sudo teamvault upgrade
sudo teamvault run

And the website works via x11 forwarding firefox on http://localhost:8000...

Problems/issues I'm having:

Baseurl in conf does support inputs of https://ip.ad.dr.ess.

I've only been able to access the website on the address http://localhost:8000.

The Conf file states its https:// the Log when you run teamvault run saying it's listening on port 8000 via http:// and the dev section in the README.md says it accessible on http://.

The documentation says use the username and password I set-up before to log into the portal. In the install process I only ever made an account for the postgresql server.

That username and password doesn't work. How do you setup and account so you can login to admin the website?

You should configure a "real" webserver like nginx or Apache on ports 80 and 443 and have it handle HTTPS. It should then pass on incoming requests to localhost:8000 via proxy_pass (nginx).

You can create admin users using teamvault plumbing createsuperuser.

Thank you for working your way through this, while we're using TeamVault in production now, I didn't consider it ready for public consumption, so docs weren't a priority. I guess that should change.