booktype / booktype-packaging

Debian packaging for https://github.com/sourcefabric/Booktype
GNU Affero General Public License v3.0
2 stars 0 forks source link

Ubuntu 16.04 DEB Installation #1

Open vClouds opened 6 years ago

vClouds commented 6 years ago

Installation of BookType v2.2.0 DEB snapshots packages always ending with the below shown error. http://apt.sourcefabric.org/snapshots/booktype_2.2.0~20171006-1_all.deb

For further instructions read INSTALL file.

Setting database parameters Setting admin password, name and email Setting the active profile to 'production' Setting Booktype site name and URL Setting report email user Setting email host and port Setting mPDF 6.0 path to /var/www/mpdf60/ Setting default publisher to vClouds Setting Redis parameters Setting default time zone to Europe/London Setting default language code to en-gb Setting path to distro's pandoc sed: -e expression #1, char 23: unknown option to `s' dpkg: error processing package booktype (--install): subprocess installed post-installation script returned error exit status 1 Processing triggers for man-db (2.7.5-1) ... Errors were encountered while processing: booktype

Examining the dpkg exit error results in

sh -x /var/lib/dpkg/info/booktype.postinst reconfigure

  • set -e
  • . /usr/share/debconf/confmodule
  • [ ! ]
  • PERL_DL_NONLAZY=1
  • export PERL_DL_NONLAZY
  • [ ]
  • exec /usr/share/debconf/frontend /var/lib/dpkg/info/booktype.postinst reconfigure

Not installing Python libraries Beginning automatic configuration

Creating instance directory /var/www/booktype

Directory already exists in /var/www/booktype/instance1!

Skipping instance creation!

Please advise. I'm trying to install from the source using virtualenv as per manual and per control scripts within the DEB package as well but ending with the below django errors

Traceback (most recent call last): File "/home/booktype/stack/main/manage.py", line 26, in execute_from_command_line(sys.argv) File "/home/booktype/local/lib/python2.7/site-packages/django/core/management/init.py", line 353, in execute_from_command_line utility.execute() File "/home/booktype/local/lib/python2.7/site-packages/django/core/management/init.py", line 345, in execute self.fetch_command(subcommand).run_from_argv(self.argv) File "/home/booktype/local/lib/python2.7/site-packages/django/core/management/base.py", line 348, in run_from_argv self.execute(*args, **cmd_options) File "/home/booktype/local/lib/python2.7/site-packages/django/core/management/base.py", line 398, in execute self.check() File "/home/booktype/local/lib/python2.7/site-packages/django/core/management/base.py", line 426, in check include_deployment_checks=include_deployment_checks, File "/home/booktype/local/lib/python2.7/site-packages/django/core/checks/registry.py", line 75, in run_checks new_errors = check(app_configs=app_configs) File "/home/booktype/local/lib/python2.7/site-packages/django/core/checks/urls.py", line 13, in check_url_config return check_resolver(resolver) File "/home/booktype/local/lib/python2.7/site-packages/django/core/checks/urls.py", line 23, in check_resolver for pattern in resolver.url_patterns: File "/home/booktype/local/lib/python2.7/site-packages/django/utils/functional.py", line 33, in get res = instance.dict[self.name] = self.func(instance) File "/home/booktype/local/lib/python2.7/site-packages/django/core/urlresolvers.py", line 417, in url_patterns patterns = getattr(self.urlconf_module, "urlpatterns", self.urlconf_module) File "/home/booktype/local/lib/python2.7/site-packages/django/utils/functional.py", line 33, in get res = instance.dict[self.name] = self.func(instance) File "/home/booktype/local/lib/python2.7/site-packages/django/core/urlresolvers.py", line 410, in urlconf_module return import_module(self.urlconf_name) File "/usr/lib/python2.7/importlib/init.py", line 37, in import_module import(name) File "/home/booktype/stack/main/main_site/urls/prod.py", line 4, in import booktype.urls File "/home/booktype/lib/booktype/urls.py", line 21, in from booktype.apps.account.views import profilethumbnail File "/home/booktype/lib/booktype/apps/account/views.py", line 61, in from .forms import UserSettingsForm, UserPasswordChangeForm, UserInviteForm, BookCreationForm File "/home/booktype/lib/booktype/apps/account/forms.py", line 116, in class BookCreationForm(BaseBooktypeForm, forms.Form): File "/home/booktype/lib/booktype/apps/account/forms.py", line 127, in BookCreationForm choices=_make_choices(queryset=Language.objects.all())) File "/home/booktype/lib/booktype/apps/account/forms.py", line 111, in _make_choices for obj in queryset: File "/home/booktype/local/lib/python2.7/site-packages/django/db/models/query.py", line 258, in iter self._fetch_all() File "/home/booktype/local/lib/python2.7/site-packages/django/db/models/query.py", line 1074, in _fetch_all self._result_cache = list(self.iterator()) File "/home/booktype/local/lib/python2.7/site-packages/django/db/models/query.py", line 52, in iter results = compiler.execute_sql() File "/home/booktype/local/lib/python2.7/site-packages/django/db/models/sql/compiler.py", line 848, in execute_sql cursor.execute(sql, params) File "/home/booktype/local/lib/python2.7/site-packages/django/db/backends/utils.py", line 64, in execute return self.cursor.execute(sql, params) File "/home/booktype/local/lib/python2.7/site-packages/django/db/utils.py", line 95, in exit six.reraise(dj_exc_type, dj_exc_value, traceback) File "/home/booktype/local/lib/python2.7/site-packages/django/db/backends/utils.py", line 64, in execute return self.cursor.execute(sql, params) django.db.utils.ProgrammingError: relation "editor_language" does not exist LINE 1: ...age"."name", "editor_language"."abbrevation" FROM "editor_la...

https://github.com/booktype/booktype-packaging/blob/c2385383107c392002c74984d0b5f06326af3270/debian/postinst#L163

danielhjames commented 6 years ago

Hi, sorry about my silly error with sed, this should be fixed in the next snapshot with the commit 2e8aca664237012b6dfb578362b78a6e5717d9b4

As for the issue with editor_language in the traceback, which instructions for creating the database are you following please? In general I would not recommend mixing the install from git and the install from deb package as they use slightly different methods for different audiences (developer and production).

vClouds commented 6 years ago

Hi, Thanks for reply, Following the git clone as per manual always fails at migrate stage results in many django errors as shown in the traceback above. My observation as compared with deb install method is python requirements doesn't collect the folder named Booktype.egg-info and its contents, not sure if this the root causes of django errors or not, as all other configurations and settings are correct.

Well, I have already working stack now by doing the above said approach as work-around

PostgreSQL Database

sudo -i -u postgres psql CREATE USER booktype password 'Zerro7SQL'; CREATE DATABASE booktype owner booktype encoding 'utf-8'; \q exit

After installation of all dependencies, deb package were installed with no instance to be created. Using git to clone a master copy and get it merged with the unpacked deb files /var/lib/booktype before pulling. Activate the virtualenv and update the prod requirements before creating instance manually.

I'm not sure that, this stack can be classified as production environment or no, but that's what I can get as of now.

x sudo dpkg -i booktype.deb cd /var/lib/booktype sudo git clone https://github.com/sourcefabric/Booktype.git --branch master --depth 1 cloned files were merged back before proceeding with sudo git pull origin master reboot

source /var/lib/booktype/bin/activate /var/lib/booktype/bin/pip install --upgrade pip /var/lib/booktype/bin/pip install pyparsing appdirs /var/lib/booktype/bin/pip install --upgrade virtualenv /var/lib/booktype/bin/pip install -r /var/lib/booktype/requirements/prod.txt /var/lib/booktype/scripts/createbooktype --check-versions --profile prod --database postgresql /var/www/booktype/main /var/www/booktype/main/manage.py migrate /var/www/booktype/main/manage.py createsuperuser /var/www/booktype/main/manage.py collectstatic --noinput /var/www/booktype/main/manage.py compress /var/www/booktype/main/manage.py update_permissions /var/www/booktype/main/manage.py update_default_roles ln -s /var/www/booktype/main/conf/booktype-celery.conf /etc/supervisor/conf.d/booktype-celery-main.conf

danielhjames commented 6 years ago

Glad to hear you have a working instance! I'll attempt to replicate your Django issues when we package the forthcoming 2.3.0 release.