Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Statistics have hard dependency on Postgres #205

Open
thet opened this issue May 12, 2023 · 1 comment
Open

Statistics have hard dependency on Postgres #205

thet opened this issue May 12, 2023 · 1 comment
Assignees

Comments

@thet
Copy link
Member

thet commented May 12, 2023

It looks like the statistics module have a hard dependency on PostgreSQL. There are several occurrences on get_postgres_url throughout the osha.oira code base. This breaks at least some upgrade steps on installations which use sqlite.

image

Example broken upgrade: Add modified and completion percentage columns to survey statistics.

Example of broken upgrade step:

2023-05-12 19:51:44,809 ERROR   [Zope.SiteErrorLog:252][waitress-2] 1683913904.80870720.6203021530749309 http://localhost:9600/Plone/portal_setup/manage_doUpgrades
Traceback (innermost last):
  Module ZPublisher.WSGIPublisher, line 176, in transaction_pubevents
  Module ZPublisher.WSGIPublisher, line 385, in publish_module
  Module ZPublisher.WSGIPublisher, line 280, in publish
  Module ZPublisher.mapply, line 85, in mapply
  Module ZPublisher.WSGIPublisher, line 63, in call_object
  Module Products.GenericSetup.tool, line 1135, in manage_doUpgrades
  Module Products.GenericSetup.upgrade, line 185, in doStep
  Module ftw.upgrade.directory.wrapper, line 11, in upgrade_step_wrapper
  Module ftw.upgrade.step, line 60, in __new__
  Module ., line 52, in __call__
  Module osha.oira.upgrade.utils, line 48, in alembic_upgrade_statistics_to
  Module osha.oira.statistics.model, line 27, in get_postgres_url
AttributeError: 'NoneType' object has no attribute 'get'

/cc @reinhardt

@reinhardt
Copy link
Contributor

Despite the method name this doesn't really rely on postgres. It's more likely that there's some configuration missing:

https://github.com/EU-OSHA/oira.application.buildout/blob/master/base.cfg#L18

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants