Vaultier is unusable for docker/ubuntu/debian (Python) - 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.

Related

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

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!

Docker build failing while installing pandas in docker in python2.7-alpine

I am running a flask application in Docker. I am also using Pandas. I am using python2.7-alpine image. Earlier it was working fine i.e. I was able to build images with the same configuration.
But now I am unable to build the image as it says:
ERROR: Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-install-Sm9A7D/pandas/
The command '/bin/sh -c pip install -r /tmp/requirements.txt' returned a non-zero code: 1
I cannot change the python version. As my application is built on python2 and was as expected for a long back.
My Dockerfile
FROM python:2.7-alpine
RUN echo "ipv6" >> /etc/modules;
# echo "http://dl-cdn.alpinelinux.org/alpine/latest-stable/main" > /etc/apk/repositories; \
# echo "http://dl-cdn.alpinelinux.org/alpine/latest-stable/community" >> /etc/apk/repositories; \
# echo "http://dl-2.alpinelinux.org/alpine/latest-stable/community" >> /etc/apk/repositories; \
# echo "http://dl-3.alpinelinux.org/alpine/latest-stable/community" >> /etc/apk/repositories; \
# echo "http://dl-4.alpinelinux.org/alpine/latest-stable/community" >> /etc/apk/repositories; \
# echo "http://dl-5.alpinelinux.org/alpine/latest-stable/community" >> /etc/apk/repositories
RUN rm -rf /var/cache/apk/* && \
rm -rf /tmp/* && \
apk update && \
apk add --update bash sudo
#================================================================
# add dependencies
#================================================================
RUN apk add --update --no-cache g++ gcc libffi-dev make gpgme p11-kit openssl-dev openssh
#================================================================
# pip and required modules install
#================================================================
### Upgrade pip to prevent errors
RUN pip install setuptools --upgrade
ADD requirements.txt /tmp/requirements.txt
RUN pip install -r /tmp/requirements.txt
The full error track back is:
ERROR: Complete output from command python setup.py egg_info:
ERROR: Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/tmp/pip-install-Sm9A7D/pandas/setup.py", line 749, in <module>
**setuptools_kwargs)
File "/usr/local/lib/python2.7/site-packages/setuptools/__init__.py", line 144, in setup
_install_setup_requires(attrs)
File "/usr/local/lib/python2.7/site-packages/setuptools/__init__.py", line 139, in _install_setup_requires
dist.fetch_build_eggs(dist.setup_requires)
File "/usr/local/lib/python2.7/site-packages/setuptools/dist.py", line 717, in fetch_build_eggs
replace_conflicting=True,
File "/usr/local/lib/python2.7/site-packages/pkg_resources/__init__.py", line 782, in resolve
replace_conflicting=replace_conflicting
File "/usr/local/lib/python2.7/site-packages/pkg_resources/__init__.py", line 1065, in best_match
return self.obtain(req, installer)
File "/usr/local/lib/python2.7/site-packages/pkg_resources/__init__.py", line 1077, in obtain
return installer(requirement)
File "/usr/local/lib/python2.7/site-packages/setuptools/dist.py", line 784, in fetch_build_egg
return cmd.easy_install(req)
File "/usr/local/lib/python2.7/site-packages/setuptools/command/easy_install.py", line 679, in easy_install
return self.install_item(spec, dist.location, tmpdir, deps)
File "/usr/local/lib/python2.7/site-packages/setuptools/command/easy_install.py", line 705, in install_item
dists = self.install_eggs(spec, download, tmpdir)
File "/usr/local/lib/python2.7/site-packages/setuptools/command/easy_install.py", line 890, in install_eggs
return self.build_and_install(setup_script, setup_base)
File "/usr/local/lib/python2.7/site-packages/setuptools/command/easy_install.py", line 1158, in build_and_install
self.run_setup(setup_script, setup_base, args)
File "/usr/local/lib/python2.7/site-packages/setuptools/command/easy_install.py", line 1144, in run_setup
run_setup(setup_script, args)
File "/usr/local/lib/python2.7/site-packages/setuptools/sandbox.py", line 253, in run_setup
raise
File "/usr/local/lib/python2.7/contextlib.py", line 35, in __exit__
self.gen.throw(type, value, traceback)
File "/usr/local/lib/python2.7/site-packages/setuptools/sandbox.py", line 195, in setup_context
yield
File "/usr/local/lib/python2.7/contextlib.py", line 35, in __exit__
self.gen.throw(type, value, traceback)
File "/usr/local/lib/python2.7/site-packages/setuptools/sandbox.py", line 166, in save_modules
saved_exc.resume()
File "/usr/local/lib/python2.7/site-packages/setuptools/sandbox.py", line 141, in resume
six.reraise(type, exc, self._tb)
File "/usr/local/lib/python2.7/site-packages/setuptools/sandbox.py", line 154, in save_modules
yield saved
File "/usr/local/lib/python2.7/site-packages/setuptools/sandbox.py", line 195, in setup_context
yield
File "/usr/local/lib/python2.7/site-packages/setuptools/sandbox.py", line 250, in run_setup
_execfile(setup_script, ns)
File "/usr/local/lib/python2.7/site-packages/setuptools/sandbox.py", line 45, in _execfile
exec(code, globals, locals)
File "/tmp/easy_install-2BV0tR/numpy-1.17.0rc1/setup.py", line 31, in <module>
def is_platform_mac():
RuntimeError: Python version >= 3.5 required.
----------------------------------------
ERROR: Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-install-Sm9A7D/pandas/
The command '/bin/sh -c pip install -r /tmp/requirements.txt' returned a non-zero code: 1
The error tells you the reason:
File "/tmp/easy_install-r9No9Q/numpy-1.17.0rc1/setup.py", line 31, in
def is_platform_mac():
RuntimeError: Python version >= 3.5 required.
From pandas 0.23.4 source: we can see the minimum version for numpy is 1.9.0:
min_numpy_ver = '1.9.0'
So, if you did not install a version by yourself, pandas will just install a newest suitable version of numpy which >1.9.0 for you, here is numpy-1.17.0rc1, but it needs >python3.5 as seen here, so failure happens.
python_requires='>=3.5'
Finally, if you check the source code of numpy, you will find 1.16.4 is the last version which support python2.7, see this,
python_requires='>=2.7,!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*',
So, final solution:
Pre-install numpy 1.16.4, then pandas find there is a suitable numpy there, and will not install a newest numpy for you. As a result, no error will happen, detail steps as next:
apk update
apk add build-base
pip install numpy==1.16.4
pip install pandas==0.23.4
For Dockerfile, add above command to one RUN could make the fix:
RUN apk update && \
apk add build-base && \
pip install numpy==1.16.4 && \
pip install pandas==0.23.4
Additional, you said in question:
Earlier it was working fine i.e. I was able to build images with the same configuration.
This is because numpy latest version was just updated July.1st 2019, before that, it always 1.16.4 version which don't have issue for python27, but now, things changed...

dev_appserver fails to launch on Ubuntu docker container (ValidationError: Value 'None' for application does not match expression)

I started seeing this issue after upgrading docker container. I couldn't find a way to use an older package for app engine. Using options =157.x.y to get older versions doesn't work in apt-get.
Failure log:
Traceback (most recent call last):
File "/usr/lib/google-cloud-sdk/platform/google_appengine/dev_appserver.py", line 103, in <module>
_run_file(__file__, globals())
File "/usr/lib/google-cloud-sdk/platform/google_appengine/dev_appserver.py", line 97, in _run_file
execfile(_PATHS.script_file(script_name), globals_)
File "/usr/lib/google-cloud-sdk/platform/google_appengine/google/appengine/tools/devappserver2/devappserver2.py", line 322, in <module>
main()
File "/usr/lib/google-cloud-sdk/platform/google_appengine/google/appengine/tools/devappserver2/devappserver2.py", line 310, in main
dev_server.start(options)
File "/usr/lib/google-cloud-sdk/platform/google_appengine/google/appengine/tools/devappserver2/devappserver2.py", line 106, in start
env_variables=parsed_env_variables)
File "/usr/lib/google-cloud-sdk/platform/google_appengine/google/appengine/tools/devappserver2/application_configuration.py", line 851, in __init__
env_variables)
File "/usr/lib/google-cloud-sdk/platform/google_appengine/google/appengine/tools/devappserver2/application_configuration.py", line 131, in __init__
self._config_path)
File "/usr/lib/google-cloud-sdk/platform/google_appengine/google/appengine/tools/devappserver2/application_configuration.py", line 443, in _parse_configuration
config.application = self._forced_app_id
File "/usr/lib/google-cloud-sdk/platform/google_appengine/google/appengine/api/validation.py", line 361, in __setattr__
value = self.GetValidator(key)(value, key)
File "/usr/lib/google-cloud-sdk/platform/google_appengine/google/appengine/api/validation.py", line 599, in __call__
return self.Validate(value, key)
File "/usr/lib/google-cloud-sdk/platform/google_appengine/google/appengine/api/validation.py", line 881, in Validate
return self.validator(value, key)
File "/usr/lib/google-cloud-sdk/platform/google_appengine/google/appengine/api/validation.py", line 599, in __call__
return self.Validate(value, key)
File "/usr/lib/google-cloud-sdk/platform/google_appengine/google/appengine/api/validation.py", line 955, in Validate
'\'%s\'' % (value, key, self.re.pattern))
google.appengine.api.validation.ValidationError: Value 'None' for application does not match expression '^(?:(?:[a-z\d\-]{1,100}\~)?(?:(?!\-)[a-z\d\-\.]{1,100}:)?(?!-)[a-z\d\-]{0,99}[a-z\d])$'
Docker file
FROM ubuntu:16.04
RUN apt-get upgrade
RUN apt-get update
RUN apt-get install -y wget
RUN apt-get install -y curl
RUN apt-get install -y apt-transport-https
RUN echo "deb https://packages.cloud.google.com/apt cloud-sdk-xenial main" | tee -a /etc/apt/sources.list.d/google-cloud-sdk.list
RUN wget -O - https://packages.cloud.google.com/apt/doc/apt-key.gpg | apt-key add -
RUN apt-get update
RUN cat /etc/apt/sources.list.d/google-cloud-sdk.list
RUN apt-get install -y google-cloud-sdk
RUN apt-get install -y google-cloud-sdk-app-engine-python
WORKDIR /mycodepath
EXPOSE 8080
My version of dev_appserver started doing the same.
I dug onto the code and found that the argument parser sets an empty app_id command-line argument to "None" (yes, that's a String not a NoneType). Incidentally, the app_id regex does not match for uppercase characters and thus the ValidationError triggers. (I'm glad that's the case or else it would've caused trickier bugs by silently making my application's name 'None')
My workaround for now is to explicitly pass in the name of your application from the command line with the -A flag. Note that this overrides the application variable in the app.yaml configuration.
I was thinking my version of argparse was broken but now it sounds like a dev_appserver bug.

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).

Issues in Installing Python packages in webfaction

I am trying to install packages using PIP but it doesn't work for me initially it gives the permission denied error and after that when I tried to use easy_install it gives me this error :->
Searching for mezzanine
Reading https://pypi.python.org/simple/mezzanine/
Reading http://github.com/stephenmcd/mezzanine/
Reading http://mezzanine.jupo.org/
Best match: Mezzanine 3.1.8
Downloading https://pypi.python.org/packages/source/M/Mezzanine/Mezzanine-3.1.8.tar.gz#md5=dcc46016b866ea8de1c87fb9dffd9163
Processing Mezzanine-3.1.8.tar.gz
Writing /tmp/easy_install-2cSSS_/Mezzanine-3.1.8/setup.cfg
Running Mezzanine-3.1.8/setup.py -q bdist_egg --dist-dir /tmp/easy_install-2cSSS_/Mezzanine-3.1.8/egg-dist-tmp-uDjreS
Traceback (most recent call last):
File "/usr/local/bin/easy_install", line 8, in ?
sys.exit(
File "/usr/local/lib/python2.4/site-packages/setuptools/command/easy_install.py", line 1924, in main
with_ei_usage(lambda:
File "/usr/local/lib/python2.4/site-packages/setuptools/command/easy_install.py", line 1911, in with_ei_usage
return f()
File "/usr/local/lib/python2.4/site-packages/setuptools/command/easy_install.py", line 1928, in <lambda>
distclass=DistributionWithoutHelpCommands, **kw
File "/usr/local/lib/python2.4/distutils/core.py", line 149, in setup
dist.run_commands()
File "/usr/local/lib/python2.4/distutils/dist.py", line 946, in run_commands
self.run_command(cmd)
File "/usr/local/lib/python2.4/distutils/dist.py", line 966, in run_command
cmd_obj.run()
File "/usr/local/lib/python2.4/site-packages/setuptools/command/easy_install.py", line 374, in run
self.easy_install(spec, not self.no_deps)
File "/usr/local/lib/python2.4/site-packages/setuptools/command/easy_install.py", line 609, in easy_install
return self.install_item(spec, dist.location, tmpdir, deps)
File "/usr/local/lib/python2.4/site-packages/setuptools/command/easy_install.py", line 639, in install_item
dists = self.install_eggs(spec, download, tmpdir)
File "/usr/local/lib/python2.4/site-packages/setuptools/command/easy_install.py", line 825, in install_eggs
return self.build_and_install(setup_script, setup_base)
File "/usr/local/lib/python2.4/site-packages/setuptools/command/easy_install.py", line 1031, in build_and_install
self.run_setup(setup_script, setup_base, args)
File "/usr/local/lib/python2.4/site-packages/setuptools/command/easy_install.py", line 1016, in run_setup
run_setup(setup_script, args)
File "/usr/local/lib/python2.4/site-packages/setuptools/sandbox.py", line 68, in run_setup
DirectorySandbox(setup_dir).run(
File "/usr/local/lib/python2.4/site-packages/setuptools/sandbox.py", line 120, in run
return func()
File "/usr/local/lib/python2.4/site-packages/setuptools/sandbox.py", line 71, in <lambda>
{'__file__':setup_script, '__name__':'__main__'}
File "setup.py", line 22
with open(e, "r") as f:
^
SyntaxError: invalid syntax
After this when I again try to use pip then I am getting different error (not permission denied) :
File "/home/rishi/bin/pip", line 8, in ?
sys.exit(
File "/usr/local/lib/python2.4/site-packages/pkg_resources.py", line 357, in load_entry_point
return get_distribution(dist).load_entry_point(group, name)
File "/usr/local/lib/python2.4/site-packages/pkg_resources.py", line 2394, in load_entry_point
return ep.load()
File "/usr/local/lib/python2.4/site-packages/pkg_resources.py", line 2108, in load
entry = __import__(self.module_name, globals(),globals(), ['__name__'])
File "/home/rishi/lib/python2.4/pip-1.5.6-py2.4.egg/pip/__init__.py", line 9, in ?
from pip.log import logger
File "/home/rishi/lib/python2.4/pip-1.5.6-py2.4.egg/pip/log.py", line 19
real_consumer = (consumer if not isinstance(consumer, colorama.AnsiToWin32)
^
SyntaxError: invalid syntax
Now I don't know what I am doing wrong , can anybody help me ?
EDIT :- syntex errro solved due to wrong python version , I was using 2.4 .
OSError: [Errno 13] Permission denied: '/usr/local/lib/python2.7/site-packages/mezzanine'
$which pip result is
~/bin/pip
Just add the --user option to your pip command, it will install with your logged in user permissions:
pip2.7 install mezzanine --user
as Daniel Roseman noted - the syntax error came from using Python2.4
the permission problem is caused by trying to install into system Python, what requires sudo or being root
Possible solutions
Install into system Pyhton (using sudo)
$ sudo pip install mezzanine
This will spoil the system Python and is not much recommended. It would be well acceptable if you are e.g. under Docker.
Install into user profile
$ pip install --user mezzanine
It will install the package into user scheme and will not spoil system Python.
This is more acceptable, but can soon become messy environment to run code in, as Python will import form user scheme, sometime from system.
Use virtualenv
Assuming you have virtualenv installed:
$ cd ~/projects
$ mkdir mezza
$ cd mezza
$ virtualenv venv
$ source venv/bin/activate
(venv)$ pip install mezzanine
$ pip freeze
mezzanine==3.1.8
(there will be a bit more lines from freeze).
This installs into virtualenv, which is easy to recreate, destroy, and does not mess up with other environments.
With virtulanevwrapper you will get set of additional tools, which will simplify your environment a lot.

Categories

Resources