Python installing private github repo giving "exit status 128" error? - python

I am on Windows 10 running Python 3.7.
I am trying to install a Python package on one of my private GitHub repositories. I want to use the GitHub deploy key to give only read access to the single repository.
So I generated the deploy key using
ssh-keygen -t rsa -b 4096 -C "email#domain.com"
This added the private and public key to the .ssh folder on my user machine. I then copied the public key to the deploy keys for my private GitHub python package repository.
Then I generated a virtualenv and tried to run the command
pip install git+ssh://git#github.com/<github_username>/<repo_name>.git
but I keep getting an error saying
ERROR: Command errored out with exit status 128: git clone -q 'ssh://****#github.com/<github_username>/<repo_name>.git' 'C:\Users\Alex\AppData\Local\Temp\pip-req-build-doj1og3o' Check the logs for full command output.
I've looked at other posts with the similar issue and as far as I can tell my syntax for the installation command is correct.
Here is my error log output:
2020-10-13T09:36:22,708 Using pip 20.2.3 from c:\users\alex\downloads\github_deploy_keys\env\lib\site-packages\pip (python 3.7)
2020-10-13T09:36:22,710 Non-user install because user site-packages disabled
2020-10-13T09:36:22,718 Created temporary directory: C:\Users\Alex\AppData\Local\Temp\pip-ephem-wheel-cache-35_xjrvi
2020-10-13T09:36:22,719 Created temporary directory: C:\Users\Alex\AppData\Local\Temp\pip-req-tracker-6m9f9yue
2020-10-13T09:36:22,719 Initialized build tracking at C:\Users\Alex\AppData\Local\Temp\pip-req-tracker-6m9f9yue
2020-10-13T09:36:22,719 Created build tracker: C:\Users\Alex\AppData\Local\Temp\pip-req-tracker-6m9f9yue
2020-10-13T09:36:22,721 Entered build tracker: C:\Users\Alex\AppData\Local\Temp\pip-req-tracker-6m9f9yue
2020-10-13T09:36:22,722 Created temporary directory: C:\Users\Alex\AppData\Local\Temp\pip-install-wco_t2va
2020-10-13T09:36:22,730 Collecting git+ssh://****#github.com/<github_username>/<repo_name>.git
2020-10-13T09:36:22,731 Created temporary directory: C:\Users\Alex\AppData\Local\Temp\pip-req-build-21n7avhs
2020-10-13T09:36:22,732 Cloning ssh://****#github.com/<github_username>/<repo_name>.git to c:\users\alex\appdata\local\temp\pip-req-build-21n7avhs
2020-10-13T09:36:23,013 ERROR: Command errored out with exit status 128: git clone -q 'ssh://****#github.com/<github_username>/<repo_name>.git' 'C:\Users\Alex\AppData\Local\Temp\pip-req-build-21n7avhs' Check the logs for full command output.
2020-10-13T09:36:23,016 Exception information:
2020-10-13T09:36:23,016 Traceback (most recent call last):
2020-10-13T09:36:23,016 File "c:\users\alex\downloads\github_deploy_keys\env\lib\site-packages\pip\_internal\cli\base_command.py", line 228, in _main
2020-10-13T09:36:23,016 status = self.run(options, args)
2020-10-13T09:36:23,016 File "c:\users\alex\downloads\github_deploy_keys\env\lib\site-packages\pip\_internal\cli\req_command.py", line 182, in wrapper
2020-10-13T09:36:23,016 return func(self, options, args)
2020-10-13T09:36:23,016 File "c:\users\alex\downloads\github_deploy_keys\env\lib\site-packages\pip\_internal\commands\install.py", line 324, in run
2020-10-13T09:36:23,016 reqs, check_supported_wheels=not options.target_dir
2020-10-13T09:36:23,016 File "c:\users\alex\downloads\github_deploy_keys\env\lib\site-packages\pip\_internal\resolution\legacy\resolver.py", line 183, in resolve
2020-10-13T09:36:23,016 discovered_reqs.extend(self._resolve_one(requirement_set, req))
2020-10-13T09:36:23,016 File "c:\users\alex\downloads\github_deploy_keys\env\lib\site-packages\pip\_internal\resolution\legacy\resolver.py", line 388, in _resolve_one
2020-10-13T09:36:23,016 abstract_dist = self._get_abstract_dist_for(req_to_install)
2020-10-13T09:36:23,016 File "c:\users\alex\downloads\github_deploy_keys\env\lib\site-packages\pip\_internal\resolution\legacy\resolver.py", line 340, in _get_abstract_dist_for
2020-10-13T09:36:23,016 abstract_dist = self.preparer.prepare_linked_requirement(req)
2020-10-13T09:36:23,016 File "c:\users\alex\downloads\github_deploy_keys\env\lib\site-packages\pip\_internal\operations\prepare.py", line 469, in prepare_linked_requirement
2020-10-13T09:36:23,016 hashes=self._get_linked_req_hashes(req)
2020-10-13T09:36:23,016 File "c:\users\alex\downloads\github_deploy_keys\env\lib\site-packages\pip\_internal\operations\prepare.py", line 239, in unpack_url
2020-10-13T09:36:23,016 unpack_vcs_link(link, location)
2020-10-13T09:36:23,016 File "c:\users\alex\downloads\github_deploy_keys\env\lib\site-packages\pip\_internal\operations\prepare.py", line 99, in unpack_vcs_link
2020-10-13T09:36:23,016 vcs_backend.unpack(location, url=hide_url(link.url))
2020-10-13T09:36:23,016 File "c:\users\alex\downloads\github_deploy_keys\env\lib\site-packages\pip\_internal\vcs\versioncontrol.py", line 733, in unpack
2020-10-13T09:36:23,016 self.obtain(location, url=url)
2020-10-13T09:36:23,016 File "c:\users\alex\downloads\github_deploy_keys\env\lib\site-packages\pip\_internal\vcs\versioncontrol.py", line 641, in obtain
2020-10-13T09:36:23,016 self.fetch_new(dest, url, rev_options)
2020-10-13T09:36:23,016 File "c:\users\alex\downloads\github_deploy_keys\env\lib\site-packages\pip\_internal\vcs\git.py", line 230, in fetch_new
2020-10-13T09:36:23,016 self.run_command(make_command('clone', '-q', url, dest))
2020-10-13T09:36:23,016 File "c:\users\alex\downloads\github_deploy_keys\env\lib\site-packages\pip\_internal\vcs\versioncontrol.py", line 774, in run_command
2020-10-13T09:36:23,016 log_failed_cmd=log_failed_cmd)
2020-10-13T09:36:23,016 File "c:\users\alex\downloads\github_deploy_keys\env\lib\site-packages\pip\_internal\vcs\versioncontrol.py", line 166, in call_subprocess
2020-10-13T09:36:23,016 raise SubProcessError(exc_msg)
2020-10-13T09:36:23,016 pip._internal.exceptions.SubProcessError: Command errored out with exit status 128: git clone -q 'ssh://****#github.com/<github_username>/<repo_name>.git' 'C:\Users\Alex\AppData\Local\Temp\pip-req-build-21n7avhs' Check the logs for full command output.
2020-10-13T09:36:23,032 Removed build tracker: 'C:\\Users\\Alex\\AppData\\Local\\Temp\\pip-req-tracker-6m9f9yue'

Hello I had this same exact problem!
I found the answer on:
https://docs.github.com/en/authentication/troubleshooting-ssh/error-permission-denied-publickey
It turns out that I needed to ensure that my ssh key was being used. I did so by following the directions on the github site which suggested that I run this command:
ssh -vT git#github.com
I ran this command prompt and It worked! I don't know how or why but it seems to have reset some sort of configuration to where my ssh shell now works. I'd tried all sorts of different solutions and was getting very discouraged about it because my linux setup worked fine! It was windows 10 that seemed to be giving me trouble.
After that I was able to pip install from github using the powershell inside of vscode (with a venv enabled).
I originally thought that the issue was my sshkey (that I'd pasted it wrong) but that wasn't the case. I also thought it might have been something with visual studio code but that wasn't the case either. Then I thought it might have been something with my security protocols. SO I tried enabling and disabling different ports through my firewall that were suggested in other forums and that didn't work either.
I knew something was up because whenever I created a key on my Desktop it would never show any activity of use when I viewed my keys on Github. But as soon as I ran the command a green light appeared and showed that it was recently activated. I have 2 ssh keys enabled (laptop and desktop) for my private repo and use it to pip install packages from there.
I hope this helps somebody out there! Sorry if I spoke too much. This is my first post. I just found this solution and had to share it because I was so excited!

Related

cookiecutter data science templet

I installed cookiecutter using
`conda install cookiecutter`
but when I try to import the repo from git hub using
`cookiecutter https://github.com/drivendata/cookiecutter-data-science`
I got the following error message:
{
Traceback (most recent call last):
File "C:\Users\iamuraptha\Anaconda3\Scripts\cookiecutter-script.py", line 5, in <module>
sys.exit(cookiecutter.cli.main())
File "C:\Users\iamuraptha\Anaconda3\lib\site-packages\click\core.py", line 722, in __call__
return self.main(*args, **kwargs)
File "C:\Users\iamuraptha\Anaconda3\lib\site-packages\click\core.py", line 697, in main
rv = self.invoke(ctx)
File "C:\Users\iamuraptha\Anaconda3\lib\site-packages\click\core.py", line 895, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "C:\Users\iamuraptha\Anaconda3\lib\site-packages\click\core.py", line 535, in invoke
return callback(*args, **kwargs)
File "C:\Users\iamuraptha\Anaconda3\lib\site-packages\cookiecutter\cli.py", line 120, in main
password=os.environ.get('COOKIECUTTER_REPO_PASSWORD')
File "C:\Users\iamuraptha\Anaconda3\lib\site-packages\cookiecutter\main.py", line 63, in cookiecutter
password=password
File "C:\Users\iamuraptha\Anaconda3\lib\site-packages\cookiecutter\repository.py", line 103, in determine_repo_dir
no_input=no_input,
File "C:\Users\iamuraptha\Anaconda3\lib\site-packages\cookiecutter\vcs.py", line 99, in clone
stderr=subprocess.STDOUT,
File "C:\Users\iamuraptha\Anaconda3\lib\subprocess.py", line 336, in check_output
**kwargs).stdout
File "C:\Users\iamuraptha\Anaconda3\lib\subprocess.py", line 418, in run
output=stdout, stderr=stderr)
subprocess.CalledProcessError: Command '['git', 'clone', 'https://github.com/drivendata/cookiecutter-data-science']' returned non-zero exit status 128.
}
You need something git can clone. Use https://github.com/drivendata/cookiecutter-data-science.git (this is the link you get when you click the 'clone or download' button in Github)
I just wanted to add a clarification for people coming here because they have a somewhat similar problem. The problem is not that the address isn't a valid git link. You can give cookiecutter a regular URL to a github repo and it will work, provided the directory in which cookiecooker is installed is in your environment's path. I'm not on Windows so I can't confirm, but check the documentation for more details about adjusting the path. And remember to factor Anaconda in if you are using it instead of the system Python.
For me this was a straightforward process on a Mac because I followed the prompt when I installed Anaconda, but I needed to add the path manually on Ubuntu machine
I installed the package like you did above:
conda install cookiecutter
Waited until the installation happened and then used:
cookiecutter https://github.com/drivendata/cookiecutter-data-science
I got the following output
project_name [project_name]: Fred
repo_name [Fred]: Fred
author_name [Your name (or your organization/company/team)]: Joseph
Cunningham
description [A short description of the project.]: test
Select open_source_license:
1 - MIT
2 - BSD-3-Clause
3 - No license file
Choose from 1, 2, 3 [1]: 3
s3_bucket [[OPTIONAL] your-bucket-for-syncing-data (do not include
's3://')]:
aws_profile [default]:
Select python_interpreter:
1 - python
2 - python3
Choose from 1, 2 [1]: 2
The people above are saying it is not a valid git but it worked for me.
I was behind a corporate firewall which prevented me from using
'cookiecutter https://github.com/drivendata/cookiecutter-data-science'
This may be an issue for someone else who lands up here.

How to fix ".dist-info directory not found" in my package?

I have a Python 2 package that I'm trying to upgrade to Python 3. It was written by someone who used to work on the same team I'm on now but who is no longer with the company, and unfortunately nobody left on the team is able to help out.
After running 2to3 on the files of the package, I ran python setup.py sdist to create a package, placed the package in a local repository, then attempted to use pip install to install the package. It ended up erroring out with the following:
Exception:
Traceback (most recent call last):
File "/home/user/project/lib/python3.5/site-packages/pip/basecommand.py", line 223, in main
status = self.run(options, args)
File "/home/user/project/lib/python3.5/site-packages/pip/commands/install.py", line 297, in run
root=options.root_path,
File "/home/user/project/lib/python3.5/site-packages/pip/req/req_set.py", line 622, in install
**kwargs
File "/home/user/project/lib/python3.5/site-packages/pip/req/req_install.py", line 808, in install
self.move_wheel_files(self.source_dir, root=root)
File "/home/user/project/lib/python3.5/site-packages/pip/req/req_install.py", line 1003, in move_wheel_files
isolated=self.isolated,
File "/home/user/project/lib/python3.5/site-packages/pip/wheel.py", line 340, in move_wheel_files
assert info_dir, "%s .dist-info directory not found" % req
AssertionError: my-package-name .dist-info directory not found
The old Python 2 version of the package didn't have anything called .dist-info in the .tgz archive, and it installed just fine. Does anyone know what's going on here and how to fix it?
In my case this was resolved by deleting AppData\Local\pip\Cache folder (windows). Should be fairly similar for other operating systems.

Failure during project creation using 'djangocms' command

Django CMS 3.4.1
Django 1.10.2
pip modules: http://pastebin.com/vJWvZVfA
pip 8.1.2
Python 2.7.12
OS: Amazon Linux AMI release 2016.03
I'm new to Django CMS, Django, and Python. My previous CMS experience has been with WordPress and I'm try to try out Django CMS as an alternative to WordPress, but am getting an error that I can not seem to figure out. I have updated the pip modules and installed others as suggested in threads on StackOverflow, but to no avail.
I followed the tutorial the instructions, with the exception of the djangocms command, which is incorrect in the tutorial. (It's missing the -w flag.)
EDIT: As requested, here is the output with the --verbose flag added:
(env)[ec2-user#(redacted) tutorial-project]$ djangocms -d postgres://(redacted) -e no --permissions yes -l "en-CA, en-US, en, fr-CA, fr-FR" -p . --starting-page yes --verbose --utc mysite
Creating the project
Please wait while I install dependencies
Package install command: install django-cms<3.5 djangocms-admin-style>=1.2,<1.3 django-treebeard>=4.0,<5.0 psycopg2 djangocms-text-ckeditor>=3.2.1 djangocms-link>=1.8 djangocms-style>=1.7 djangocms-googlemap>=0.5 djangocms-snippet>=1.9 djangocms-video>=2.0 djangocms-column>=1.6 easy_thumbnails django-filer>=1.2 cmsplugin-filer>=1.1 Django<1.9 pytz django-classy-tags>=0.7 html5lib>=0.999999,<0.99999999 Pillow>=3.0 django-sekizai>=0.9 django-select2<5.0six
Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-duWZSN/psycopg2/
The installation has failed.
*****************************************************************
Check documentation at https://djangocms-installer.readthedocs.io
*****************************************************************
Traceback (most recent call last):
File "/home/ec2-user/env/bin/djangocms", line 11, in <module>
sys.exit(execute())
File "/home/ec2-user/env/local/lib/python2.7/site-packages/djangocms_installer/main.py", line 33, in execute
verbose=config_data.verbose
File "/home/ec2-user/env/local/lib/python2.7/site-packages/djangocms_installer/install/__init__.py", line 91, in requirements
output = subprocess.check_output(['pip'] + args)
File "/usr/lib64/python2.7/subprocess.py", line 574, in check_output
raise CalledProcessError(retcode, cmd, output=output)
subprocess.CalledProcessError: Command '[u'pip', u'install', u'django-cms<3.5', u'djangocms-admin-style>=1.2,<1.3', u'django-treebeard>=4.0,<5.0', u'psycopg2', u'djangocms-text-ckeditor>=3.2.1', u'djangocms-link>=1.8', u'djangocms-style>=1.7', u'djangocms-googlemap>=0.5', u'djangocms-snippet>=1.9', u'djangocms-video>=2.0', u'djangocms-column>=1.6', u'easy_thumbnails', u'django-filer>=1.2', u'cmsplugin-filer>=1.1', u'Django<1.9', u'pytz', u'django-classy-tags>=0.7', u'html5lib>=0.999999,<0.99999999', u'Pillow>=3.0', u'django-sekizai>=0.9', u'django-select2<5.0six']' returned non-zero exit status 1
EDIT 2: (moved to answer)
EDIT 3:
After solving the first part, another error remains. I'll include it in this post since it still falls under the topic of the title:
Creating the project
Project creation command: /home/ec2-user/env/bin/python2.7 /home/ec2-user/env/bin/django-admin.py startproject mysite /home/ec2-user/tutorial-project
Database setup commands: /home/ec2-user/env/bin/python2.7 -W ignore manage.py migrate
Traceback (most recent call last):
File "manage.py", line 10, in <module>
execute_from_command_line(sys.argv)
File "/home/ec2-user/env/local/lib/python2.7/site-packages/django/core/management/__init__.py", line 354, in execute_from_command_line
utility.execute()
File "/home/ec2-user/env/local/lib/python2.7/site-packages/django/core/management/__init__.py", line 346, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "/home/ec2-user/env/local/lib/python2.7/site-packages/django/core/management/base.py", line 394, in run_from_argv
self.execute(*args, **cmd_options)
File "/home/ec2-user/env/local/lib/python2.7/site-packages/django/core/management/base.py", line 445, in execute
output = self.handle(*args, **options)
File "/home/ec2-user/env/local/lib/python2.7/site-packages/django/core/management/commands/migrate.py", line 93, in handle
executor = MigrationExecutor(connection, self.migration_progress_callback)
File "/home/ec2-user/env/local/lib/python2.7/site-packages/django/db/migrations/executor.py", line 19, in __init__
self.loader = MigrationLoader(self.connection)
File "/home/ec2-user/env/local/lib/python2.7/site-packages/django/db/migrations/loader.py", line 47, in __init__
self.build_graph()
File "/home/ec2-user/env/local/lib/python2.7/site-packages/django/db/migrations/loader.py", line 191, in build_graph
self.applied_migrations = recorder.applied_migrations()
File "/home/ec2-user/env/local/lib/python2.7/site-packages/django/db/migrations/recorder.py", line 59, in applied_migrations
self.ensure_schema()
File "/home/ec2-user/env/local/lib/python2.7/site-packages/django/db/migrations/recorder.py", line 49, in ensure_schema
if self.Migration._meta.db_table in self.connection.introspection.table_names(self.connection.cursor()):
File "/home/ec2-user/env/local/lib/python2.7/site-packages/django/db/backends/base/base.py", line 162, in cursor
cursor = self.make_debug_cursor(self._cursor())
File "/home/ec2-user/env/local/lib/python2.7/site-packages/django/db/backends/base/base.py", line 135, in _cursor
self.ensure_connection()
File "/home/ec2-user/env/local/lib/python2.7/site-packages/django/db/backends/base/base.py", line 130, in ensure_connection
self.connect()
File "/home/ec2-user/env/local/lib/python2.7/site-packages/django/db/backends/base/base.py", line 118, in connect
conn_params = self.get_connection_params()
File "/home/ec2-user/env/local/lib/python2.7/site-packages/django/db/backends/postgresql_psycopg2/base.py", line 158, in get_connection_params
"settings.DATABASES is improperly configured. "
django.core.exceptions.ImproperlyConfigured: settings.DATABASES is improperly configured. Please supply the NAME value.
The installation has failed.
*****************************************************************
Check documentation at https://djangocms-installer.readthedocs.io
*****************************************************************
Traceback (most recent call last):
File "/home/ec2-user/env/bin/djangocms", line 11, in <module>
sys.exit(execute())
File "/home/ec2-user/env/local/lib/python2.7/site-packages/djangocms_installer/main.py", line 41, in execute
django.setup_database(config_data)
File "/home/ec2-user/env/local/lib/python2.7/site-packages/djangocms_installer/django/__init__.py", line 388, in setup_database
output = subprocess.check_output(command, env=env)
File "/usr/lib64/python2.7/subprocess.py", line 574, in check_output
raise CalledProcessError(retcode, cmd, output=output)
subprocess.CalledProcessError: Command '['/home/ec2-user/env/bin/python2.7', u'-W', u'ignore', u'manage.py', u'migrate']' returned non-zero exit status 1
I'm going to guess that the problem lies in the message:
settings.DATABASES is improperly configured. Please supply the NAME value.
The installation has failed.
I'm using PostgreSQL, so I assume that the error is caused by the schema not being provided in the command argument. There was nothing in the guide that I saw indicating how to provide it, so I'll have to search some more.
The error message tells me absolutely nothing. It only tells me that Django tried to use pip to install something and for whatever reason it failed. In order to figure out what went wrong, try enabling verbose mode (python -v). If that gives the same output, or that isn't an option because you're using a program that calls Python (which it sounds like you are), let me know and prepare to go into the source code. Trust me, I have taken many a dive into source code for Python utilities, and as long as you don't do anything stupid (like delete a file) it's pretty hard to mess anything up. Even if you do you can always reinstall Django (or make a backup first). Don't worry about messing up your computer. You'd have to work hard to make Django do that!
Original error
The non-verbose error message indicates the error in a cryptic way, and using --verbose provides a more understandable message.
I was missing one required module (psycopg2) and four others were versions which were too new (easy_thumbnails, Django, html5lib, django-select2).
I uninstalled the four modules and then reinstalled them using the version requirement in the command. e.g. pip install 'Django<1.10'.
psycopg2 required extra steps, as I got an error message when trying to install it indicating that it could not find pg_config. Another SO answer advised that I just had to install postgresql-devel. After I did that, (sudo yum install postgresql-devel), I also uninstalled postgresql8-libs, as postgresql-devel came with a newer version. I didn't do it before since yum indicated a PHP dependency, and I wasn't sure if it would cause problems if I did.
Second error
Pretty simple. I was missing the /NAME component of the database URL (postgres://USER:PASSWORD#HOST:PORT/NAME).

Azure Batch Apps install python packages on startup

We are using Azure Batch Apps which will create multiple VMs which can be used to run our tasks parallelly. We are using python for data fetching tasks.
We have mentioned in the batch apps to install anaconda on the VMs when they start up. Anaconda is installed properly. We have listed out the packages(requirements.txt) we need to install to run the tasks.
pip install -r requirements.txt
Some packages get installed correclty, but some packages result in the following error,
Error [Error 6] The handle is invalid while executing command python setup.py egg_info
Exception:
Traceback (most recent call last):
File "C:\user\tasks\shared\anaconda2\lib\site-packages\pip\basecommand.py", line 209, in main
status = self.run(options, args)
File "C:\user\tasks\shared\anaconda2\lib\site-packages\pip\commands\install.py", line 310, in run
wb.build(autobuilding=True)
File "C:\user\tasks\shared\anaconda2\lib\site-packages\pip\wheel.py", line 748, in build
self.requirement_set.prepare_files(self.finder)
File "C:\user\tasks\shared\anaconda2\lib\site-packages\pip\req\req_set.py", line 360, in prepare_files
ignore_dependencies=self.ignore_dependencies))
File "C:\user\tasks\shared\anaconda2\lib\site-packages\pip\req\req_set.py", line 591, in _prepare_file
abstract_dist.prep_for_dist()
File "C:\user\tasks\shared\anaconda2\lib\site-packages\pip\req\req_set.py", line 127, in prep_for_dist
self.req_to_install.run_egg_info()
File "C:\user\tasks\shared\anaconda2\lib\site-packages\pip\req\req_install.py", line 430, in run_egg_info
command_desc='python setup.py egg_info')
File "C:\user\tasks\shared\anaconda2\lib\site-packages\pip\utils\__init__.py", line 678, in call_subprocess
cwd=cwd, env=env)
File "C:\user\tasks\shared\anaconda2\lib\subprocess.py", line 702, in __init__
errread, errwrite), to_close = self._get_handles(stdin, stdout, stderr)
File "C:\user\tasks\shared\anaconda2\lib\subprocess.py", line 823, in _get_handles
p2cread = _subprocess.GetStdHandle(_subprocess.STD_INPUT_HANDLE)
WindowsError: [Error 6] The handle is invalid
When we open the VM and give the same command, all packages get installed correctly.
I just wonder where the issue is.
It seems that the issue was caused by some limits for Azure Batch service, you can see these limits here.
According to the error information, it seems that the installation process needs to fork the subprocess, but the maximum number of tasks per computer node is 4, please see below.

Vaultier is unusable for docker/ubuntu/debian (Python)

I am looking for a good Password safe for my Company. I wanted to test Vaultier, but it newer works as expected. Neither with Docker or other Platforms. There is always and error, if its Docker i get that output.
I'm no python specialist, but making pip install --upgrade made the installation just missing the whole app.
i followed these guides https://www.vaultier.org/install/
sudo docker run -t -i --name vaultier -p 80:8088 rclick/vaultier:latest -e "VAULTIER_DOMAIN=vaultier.bla.com"
Error: invalid value for -e 'VAULTIER_DOMAIN=vaultier.bla.com': bad logging level name 'VAULTIER_DOMAIN=vaultier.bla.com'
For help, use /usr/bin/supervisord -h
Starting the Docker without this value, gives a (400 Bad Request)
Using Ubuntu:
Traceback (most recent call last):
File "/opt/vaultier/venv/bin/vaultier", line 5, in <module>
from pkg_resources import load_entry_point
File "/opt/vaultier/venv/local/lib/python2.7/site-packages/pkg_resources.py", line 2720, in <module>
parse_requirements(__requires__), Environment()
File "/opt/vaultier/venv/local/lib/python2.7/site-packages/pkg_resources.py", line 592, in resolve
raise VersionConflict(dist,req) # XXX put more info here
pkg_resources.VersionConflict: (six 1.4.1 (/opt/vaultier/venv/lib/python2.7/site-packages), Requirement.parse('six>=1.7'))
Using Debian:
Traceback (most recent call last):
File "/opt/vaultier/venv/local/lib/python2.7/site-packages/pip/basecommand.py", line 122, in main
status = self.run(options, args)
File "/opt/vaultier/venv/local/lib/python2.7/site-packages/pip/commands/install.py", line 295, in run
requirement_set.install(install_options, global_options, root=options.root_path)
File "/opt/vaultier/venv/local/lib/python2.7/site-packages/pip/req.py", line 1436, in install
requirement.install(install_options, global_options, *args, **kwargs)
File "/opt/vaultier/venv/local/lib/python2.7/site-packages/pip/req.py", line 707, in install
cwd=self.source_dir, filter_stdout=self._filter_install, show_stdout=False)
File "/opt/vaultier/venv/local/lib/python2.7/site-packages/pip/util.py", line 716, in call_subprocess
% (command_desc, proc.returncode, cwd))
InstallationError: Command /opt/vaultier/venv/bin/python2 -c "import setuptools, tokenize;__file__='/tmp/pip-build-08foqW/psycopg2/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-UUDq9M-record/install-record.txt --single-version-externally-managed --compile --install-headers /opt/vaultier/venv/include/site/python2.7 failed with error code 1 in /tmp/pip-build-08foqW/psycopg2
Any ideas on how to avoid that fail, or fixing this?
UPDATE
after the "six" problem solution i received a new error while running vaultier setup
File "/opt/vaultier/venv/bin/vaultier", line 9, in <module>
load_entry_point('Vaultier==0.7.5', 'console_scripts', 'vaultier')()
File "/opt/vaultier/venv/local/lib/python2.7/site-packages/vaultier/vaultier/runner.py", line 231, in main
settings_envvar='VAULTIER_CONF'
File "/opt/vaultier/venv/local/lib/python2.7/site-packages/logan/runner.py", line 169, in run_app
management.execute_from_command_line([runner_name, command] + command_args)
File "/opt/vaultier/venv/local/lib/python2.7/site-packages/django/core/management/__init__.py", line 399, in execute_from_command_line
utility.execute()
File "/opt/vaultier/venv/local/lib/python2.7/site-packages/django/core/management/__init__.py", line 392, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "/opt/vaultier/venv/local/lib/python2.7/site-packages/django/core/management/base.py", line 242, in run_from_argv
self.execute(*args, **options.__dict__)
File "/opt/vaultier/venv/local/lib/python2.7/site-packages/django/core/management/base.py", line 285, in execute
output = self.handle(*args, **options)
File "/opt/vaultier/venv/local/lib/python2.7/site-packages/vaultier/vaultier/management/commands/setup.py", line 22, in handle
management.call_command('syncdb')
File "/opt/vaultier/venv/local/lib/python2.7/site-packages/django/core/management/__init__.py", line 159, in call_command
return klass.execute(*args, **defaults)
File "/opt/vaultier/venv/local/lib/python2.7/site-packages/django/core/management/base.py", line 285, in execute
output = self.handle(*args, **options)
File "/opt/vaultier/venv/local/lib/python2.7/site-packages/django/core/management/base.py", line 415, in handle
return self.handle_noargs(**options)
File "/opt/vaultier/venv/local/lib/python2.7/site-packages/south/management/commands/syncdb.py", line 68, in handle_noargs
migrations = migration.Migrations(app_label)
File "/opt/vaultier/venv/local/lib/python2.7/site-packages/south/migration/base.py", line 64, in __call__
self.instances[app_label] = super(MigrationsMetaclass, self).__call__(app_label_to_app_module(app_label), **kwds)
File "/opt/vaultier/venv/local/lib/python2.7/site-packages/south/migration/base.py", line 90, in __init__
self.set_application(application, force_creation, verbose_creation)
File "/opt/vaultier/venv/local/lib/python2.7/site-packages/south/migration/base.py", line 154, in set_application
module = importlib.import_module(self.migrations_module())
File "/opt/vaultier/venv/local/lib/python2.7/site-packages/django/utils/importlib.py", line 40, in import_module
__import__(name)
File "/opt/vaultier/venv/local/lib/python2.7/site-packages/kombu/transport/django/migrations/__init__.py", line 16, in <module>
raise ImproperlyConfigured(SOUTH_ERROR_MESSAGE)
django.core.exceptions.ImproperlyConfigured:
For South support, customize the SOUTH_MIGRATION_MODULES setting
to point to the correct migrations module:
SOUTH_MIGRATION_MODULES = {
'kombu_transport_django': 'kombu.transport.django.south_migrations',
}
UPDATE2 -FIX
I couldnt find any solution online, so i tried another version of south and see there ... it works. :)
>>> DB is initialized, you can now try to run Vaultier using 'vaultier runserver'
(venv)root#Vaultier:/opt/vaultier# vaultier runserver
In the requirements.txt from vaultier, or setup.py ... doesnt matter which one you use. just set "South==1.0.2"
Dont forget to set "Six==1.9"
Have fun!
I found the same problem as you, the steps I did in Ubuntu to fix were:
Download Vaultier last version: wget https://pypi.python.org/packages/source/V/Vaultier/Vaultier-0.7.5.tar.gz
Unpack & unzip it: tar -xzvf Vaultier-0.7.5.tar.gz
Edit setup.py file and find the line that contains six==1.4,
change for this six==1.9,
Install it running: python setup.py install
If you wanna use the Docker Image the current Vaultier documentation is kind of confusing.
Try this:
Pull the latest Image (do not run the image!)
sudo docker pull rclick/vaultier:latest
Run the Image (replace EXAMPLE.COM with your desired Domain):
sudo docker run --name vaultier -p 80:80 -e "VAULTIER_DOMAIN=EXAMPLE.COM" rclick/vaultier:latest
After struggling many days, i found out how to install it :
If you install it with "apt-get install vaultier", then you will have the South and Six version issue, so just run in parallel "while [ 1 ]; do sed -i 's/six==1.4.1/six==1.9/' /tmp/pip*/setup.py; sed -i 's/South==0.8.4/South==1.0.2/' /tmp/pip*/setup.py;done 2>/dev/null"
After the installation succeed, if you run "vaultier check" and you got "No module named vaultier.runner", set the PYTHON_PATH variable : "export PYTHONPATH="/opt/vaultier/venv/local/lib/python2.7/site-packages/vaultier"", go to /opt/vaultier/venv/bin and try again.
I got issues with sending email (to invite and share with others). The environment variable FROM_EMAIL or VAULTIER_FROM_EMAIL wasn't effective, so Vaultier was using "noreply#vauliter.YOURDOMAIN.LOCAL" in the "from:" of the SMTP exchange.
I manually entered the desired email in "/opt/vaultier/venv/lib/python2.7/site-packages/vaultier/vaultier/business/mailer.py" line 33 : self.from_email = 'vaultier#YOURDOMAIN.COM'
If i got enough time, i'll make an OVA based on a CentOS 7 fully operationnal.
By the way, it's a good app, looks nice and do well it's job. By the way, it's the only free one that you can host. There was another one but ugly and not so easy to use.

Categories

Resources