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

Docker-compose Installation Returning An Error #89

Open
davyzhang3 opened this issue May 30, 2023 · 0 comments
Open

Docker-compose Installation Returning An Error #89

davyzhang3 opened this issue May 30, 2023 · 0 comments

Comments

@davyzhang3
Copy link

I would like to install this add-on on Plone 6 through a docker-compose.yml file and it looked like it was successfully installed according to the message below:
Successfully installed ZEO-5.4.0 ZODB3-3.11.0 collective.documentviewer-6.0.3 repoze.catalog-0.9.0 zdaemon-5.0 zope.index-6.0

However, the backend could not work properly and returned some error message which i pasted below. The reason might be some modules that the plone backend was using being replaced by this add-on somehow.

backend_1    | =======================================================================================
backend_1    | Creating Plone volto SITE: Plone
backend_1    | Aditional profiles: 
backend_1    | THIS IS NOT MEANT TO BE USED IN PRODUCTION
backend_1    | Read about it: https://6.docs.plone.org/install/containers/images/backend.html
backend_1    | =======================================================================================
backend_1    | Traceback (most recent call last):
backend_1    |   File "/app/lib/python3.11/site-packages/zope/configuration/xmlconfig.py", line 393, in endElementNS
backend_1    |     self.context.end()
backend_1    |   File "/app/lib/python3.11/site-packages/zope/configuration/config.py", line 703, in end
backend_1    |     self.stack.pop().finish()
backend_1    |   File "/app/lib/python3.11/site-packages/zope/configuration/config.py", line 872, in finish
backend_1    |     args = toargs(context, *self.argdata)
backend_1    |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
backend_1    |   File "/app/lib/python3.11/site-packages/zope/configuration/config.py", line 1702, in toargs
backend_1    |     args[str(name)] = field.fromUnicode(s)
backend_1    |                       ^^^^^^^^^^^^^^^^^^^^
backend_1    |   File "/app/lib/python3.11/site-packages/zope/configuration/fields.py", line 173, in fromUnicode
backend_1    |     value = self.context.resolve(name)
backend_1    |             ^^^^^^^^^^^^^^^^^^^^^^^^^^
backend_1    |   File "/app/lib/python3.11/site-packages/zope/configuration/config.py", line 225, in resolve
backend_1    |     __import__(mname)
backend_1    |   File "/app/lib/python3.11/site-packages/collective/documentviewer/upgrades.py", line 7, in <module>
backend_1    |     from collective.documentviewer import storage
backend_1    |   File "/app/lib/python3.11/site-packages/collective/documentviewer/storage.py", line 3, in <module>
backend_1    |     from collective.documentviewer.settings import GlobalSettings, Settings
backend_1    |   File "/app/lib/python3.11/site-packages/collective/documentviewer/settings.py", line 5, in <module>
backend_1    |     from collective.documentviewer.interfaces import IDocumentViewerSettings
backend_1    |   File "/app/lib/python3.11/site-packages/collective/documentviewer/interfaces.py", line 5, in <module>
backend_1    |     from zope.component.interfaces import IObjectEvent
backend_1    | ImportError: cannot import name 'IObjectEvent' from 'zope.component.interfaces' (/app/lib/python3.11/site-packages/zope/component/interfaces.py)
backend_1    | 
backend_1    | During handling of the above exception, another exception occurred:
backend_1    | 
backend_1    | Traceback (most recent call last):
backend_1    |   File "/app/bin/zconsole", line 8, in <module>
backend_1    |     sys.exit(main())
backend_1    |              ^^^^^^
backend_1    |   File "/app/lib/python3.11/site-packages/Zope2/utilities/zconsole.py", line 50, in main
backend_1    |     runscript(namespace.zopeconf, *namespace.scriptargs)
backend_1    |   File "/app/lib/python3.11/site-packages/Zope2/utilities/zconsole.py", line 13, in runscript
backend_1    |     make_wsgi_app({}, zopeconf)
backend_1    |   File "/app/lib/python3.11/site-packages/Zope2/Startup/run.py", line 61, in make_wsgi_app
backend_1    |     starter.prepare()
backend_1    |   File "/app/lib/python3.11/site-packages/Zope2/Startup/starter.py", line 38, in prepare
backend_1    |     self.startZope()
backend_1    |   File "/app/lib/python3.11/site-packages/Zope2/Startup/starter.py", line 94, in startZope
backend_1    |     Zope2.startup_wsgi()
backend_1    |   File "/app/lib/python3.11/site-packages/Zope2/__init__.py", line 36, in startup_wsgi
backend_1    |     _startup()
backend_1    |   File "/app/lib/python3.11/site-packages/Zope2/App/startup.py", line 126, in startup
backend_1    |     load_zcml()
backend_1    |   File "/app/lib/python3.11/site-packages/Zope2/App/startup.py", line 41, in load_zcml
backend_1    |     load_site()
backend_1    |   File "/app/lib/python3.11/site-packages/Zope2/App/zcml.py", line 45, in load_site
backend_1    |     _context = xmlconfig.file(site_zcml)
backend_1    |                ^^^^^^^^^^^^^^^^^^^^^^^^^
backend_1    |   File "/app/lib/python3.11/site-packages/zope/configuration/xmlconfig.py", line 663, in file
backend_1    |     include(context, name, package)
backend_1    |   File "/app/lib/python3.11/site-packages/zope/configuration/xmlconfig.py", line 560, in include
backend_1    |     processxmlfile(f, context)
backend_1    |   File "/app/lib/python3.11/site-packages/zope/configuration/xmlconfig.py", line 409, in processxmlfile
backend_1    |     parser.parse(src)
backend_1    |   File "/usr/local/lib/python3.11/xml/sax/expatreader.py", line 111, in parse
backend_1    |     xmlreader.IncrementalParser.parse(self, source)
backend_1    |   File "/usr/local/lib/python3.11/xml/sax/xmlreader.py", line 125, in parse
backend_1    |     self.feed(buffer)
backend_1    |   File "/usr/local/lib/python3.11/xml/sax/expatreader.py", line 217, in feed
backend_1    |     self._parser.Parse(data, isFinal)
backend_1    |   File "./Modules/pyexpat.c", line 468, in EndElement
backend_1    |   File "/usr/local/lib/python3.11/xml/sax/expatreader.py", line 381, in end_element_ns
backend_1    |     self._cont_handler.endElementNS(pair, None)
backend_1    |   File "/app/lib/python3.11/site-packages/zope/configuration/xmlconfig.py", line 395, in endElementNS
backend_1    |     self._handle_exception(ex, info)
backend_1    |   File "/app/lib/python3.11/site-packages/zope/configuration/xmlconfig.py", line 393, in endElementNS
backend_1    |     self.context.end()
backend_1    |   File "/app/lib/python3.11/site-packages/zope/configuration/config.py", line 703, in end
backend_1    |     self.stack.pop().finish()
backend_1    |   File "/app/lib/python3.11/site-packages/zope/configuration/config.py", line 873, in finish
backend_1    |     actions = self.handler(context, **args)
backend_1    |               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
backend_1    |   File "/app/lib/python3.11/site-packages/OFS/metaconfigure.py", line 47, in loadProducts
backend_1    |     xmlconfig.include(_context, zcml, package=product)
backend_1    |   File "/app/lib/python3.11/site-packages/zope/configuration/xmlconfig.py", line 560, in include
backend_1    |     processxmlfile(f, context)
backend_1    |   File "/app/lib/python3.11/site-packages/zope/configuration/xmlconfig.py", line 409, in processxmlfile
backend_1    |     parser.parse(src)
backend_1    |   File "/usr/local/lib/python3.11/xml/sax/expatreader.py", line 111, in parse
backend_1    |     xmlreader.IncrementalParser.parse(self, source)
backend_1    |   File "/usr/local/lib/python3.11/xml/sax/xmlreader.py", line 125, in parse
backend_1    |     self.feed(buffer)
backend_1    |   File "/usr/local/lib/python3.11/xml/sax/expatreader.py", line 217, in feed
backend_1    |     self._parser.Parse(data, isFinal)
backend_1    |   File "./Modules/pyexpat.c", line 468, in EndElement
backend_1    |   File "/usr/local/lib/python3.11/xml/sax/expatreader.py", line 381, in end_element_ns
backend_1    |     self._cont_handler.endElementNS(pair, None)
backend_1    |   File "/app/lib/python3.11/site-packages/zope/configuration/xmlconfig.py", line 395, in endElementNS
backend_1    |     self._handle_exception(ex, info)
backend_1    |   File "/app/lib/python3.11/site-packages/zope/configuration/xmlconfig.py", line 393, in endElementNS
backend_1    |     self.context.end()
backend_1    |   File "/app/lib/python3.11/site-packages/zope/configuration/config.py", line 703, in end
backend_1    |     self.stack.pop().finish()
backend_1    |   File "/app/lib/python3.11/site-packages/zope/configuration/config.py", line 873, in finish
backend_1    |     actions = self.handler(context, **args)
backend_1    |               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
backend_1    |   File "/app/lib/python3.11/site-packages/plone/autoinclude/zcml.py", line 39, in includePluginsDirective
backend_1    |     loader.load_configure(context, filename, dists)
backend_1    |   File "/app/lib/python3.11/site-packages/plone/autoinclude/loader.py", line 180, in load_configure
backend_1    |     load_zcml_file(context, module_name, package, filename)
backend_1    |   File "/app/lib/python3.11/site-packages/plone/autoinclude/loader.py", line 173, in load_zcml_file
backend_1    |     include(context, filename, package)
backend_1    |   File "/app/lib/python3.11/site-packages/zope/configuration/xmlconfig.py", line 560, in include
backend_1    |     processxmlfile(f, context)
backend_1    |   File "/app/lib/python3.11/site-packages/zope/configuration/xmlconfig.py", line 409, in processxmlfile
backend_1    |     parser.parse(src)
backend_1    |   File "/usr/local/lib/python3.11/xml/sax/expatreader.py", line 111, in parse
backend_1    |     xmlreader.IncrementalParser.parse(self, source)
backend_1    |   File "/usr/local/lib/python3.11/xml/sax/xmlreader.py", line 125, in parse
backend_1    |     self.feed(buffer)
backend_1    |   File "/usr/local/lib/python3.11/xml/sax/expatreader.py", line 217, in feed
backend_1    |     self._parser.Parse(data, isFinal)
backend_1    |   File "./Modules/pyexpat.c", line 468, in EndElement
backend_1    |   File "/usr/local/lib/python3.11/xml/sax/expatreader.py", line 381, in end_element_ns
backend_1    |     self._cont_handler.endElementNS(pair, None)
backend_1    |   File "/app/lib/python3.11/site-packages/zope/configuration/xmlconfig.py", line 395, in endElementNS
backend_1    |     self._handle_exception(ex, info)
backend_1    |   File "/app/lib/python3.11/site-packages/zope/configuration/xmlconfig.py", line 393, in endElementNS
backend_1    |     self.context.end()
backend_1    |   File "/app/lib/python3.11/site-packages/zope/configuration/config.py", line 703, in end
backend_1    |     self.stack.pop().finish()
backend_1    |   File "/app/lib/python3.11/site-packages/zope/configuration/config.py", line 873, in finish
backend_1    |     actions = self.handler(context, **args)
backend_1    |               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
backend_1    |   File "/app/lib/python3.11/site-packages/zope/configuration/xmlconfig.py", line 560, in include
backend_1    |     processxmlfile(f, context)
backend_1    |   File "/app/lib/python3.11/site-packages/zope/configuration/xmlconfig.py", line 409, in processxmlfile
backend_1    |     parser.parse(src)
backend_1    |   File "/usr/local/lib/python3.11/xml/sax/expatreader.py", line 111, in parse
backend_1    |     xmlreader.IncrementalParser.parse(self, source)
backend_1    |   File "/usr/local/lib/python3.11/xml/sax/xmlreader.py", line 125, in parse
backend_1    |     self.feed(buffer)
backend_1    |   File "/usr/local/lib/python3.11/xml/sax/expatreader.py", line 217, in feed
backend_1    |     self._parser.Parse(data, isFinal)
backend_1    |   File "./Modules/pyexpat.c", line 468, in EndElement
backend_1    |   File "/usr/local/lib/python3.11/xml/sax/expatreader.py", line 381, in end_element_ns
backend_1    |     self._cont_handler.endElementNS(pair, None)
backend_1    |   File "/app/lib/python3.11/site-packages/zope/configuration/xmlconfig.py", line 395, in endElementNS
backend_1    |     self._handle_exception(ex, info)
backend_1    |   File "/app/lib/python3.11/site-packages/zope/configuration/xmlconfig.py", line 237, in _handle_exception
backend_1    |     reraise(exc, None, sys.exc_info()[2])
backend_1    |   File "/app/lib/python3.11/site-packages/zope/configuration/_compat.py", line 31, in reraise
backend_1    |     raise value.with_traceback(tb)
backend_1    |   File "/app/lib/python3.11/site-packages/zope/configuration/xmlconfig.py", line 393, in endElementNS
backend_1    |     self.context.end()
backend_1    |   File "/app/lib/python3.11/site-packages/zope/configuration/config.py", line 703, in end
backend_1    |     self.stack.pop().finish()
backend_1    |   File "/app/lib/python3.11/site-packages/zope/configuration/config.py", line 872, in finish
backend_1    |     args = toargs(context, *self.argdata)
backend_1    |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
backend_1    |   File "/app/lib/python3.11/site-packages/zope/configuration/config.py", line 1702, in toargs
backend_1    |     args[str(name)] = field.fromUnicode(s)
backend_1    |                       ^^^^^^^^^^^^^^^^^^^^
backend_1    |   File "/app/lib/python3.11/site-packages/zope/configuration/fields.py", line 173, in fromUnicode
backend_1    |     value = self.context.resolve(name)
backend_1    |             ^^^^^^^^^^^^^^^^^^^^^^^^^^
backend_1    |   File "/app/lib/python3.11/site-packages/zope/configuration/config.py", line 225, in resolve
backend_1    |     __import__(mname)
backend_1    |   File "/app/lib/python3.11/site-packages/collective/documentviewer/upgrades.py", line 7, in <module>
backend_1    |     from collective.documentviewer import storage
backend_1    |   File "/app/lib/python3.11/site-packages/collective/documentviewer/storage.py", line 3, in <module>
backend_1    |     from collective.documentviewer.settings import GlobalSettings, Settings
backend_1    |   File "/app/lib/python3.11/site-packages/collective/documentviewer/settings.py", line 5, in <module>
backend_1    |     from collective.documentviewer.interfaces import IDocumentViewerSettings
backend_1    |   File "/app/lib/python3.11/site-packages/collective/documentviewer/interfaces.py", line 5, in <module>
backend_1    |     from zope.component.interfaces import IObjectEvent
backend_1    | zope.configuration.xmlconfig.ZopeXMLConfigurationError: File "/app/lib/python3.11/site-packages/collective/documentviewer/upgrades.zcml", line 6.2-12.50
backend_1    |     File "/app/etc/site.zcml", line 14.2-14.23
backend_1    |     File "/app/lib/python3.11/site-packages/Products/CMFPlone/configure.zcml", line 118.2-122.8
backend_1    |     File "/app/lib/python3.11/site-packages/collective/documentviewer/configure.zcml", line 11.2-11.34
backend_1    |     ImportError: cannot import name 'IObjectEvent' from 'zope.component.interfaces' (/app/lib/python3.11/site-packages/zope/component/interfaces.py)

The docker-compose.yml file i used:

version: "3"
services:

  webserver:
    image: nginx
    volumes:
      - ./default.conf:/etc/nginx/conf.d/default.conf
    depends_on:
      - backend
      - frontend
    ports:
    - "80:80"

  frontend:
    image: plone/plone-frontend:latest
    environment:
      RAZZLE_INTERNAL_API_PATH: http://backend:8080/Plone
    ports:
    - "3000:3000"
    depends_on:
      - backend

  backend:
    image: plone/plone-backend
    environment:
      SITE: Plone
      ADDONS: "collective.documentviewer==6.0.3"
      RELSTORAGE_DSN: "dbname='postgres' user='postgres' host='db' password='postgres'"
    ports:
    - "8080:8080"
    depends_on:
      - db

  db:
    image: postgres
    environment:
      POSTGRES_USER: postgres
      POSTGRES_PASSWORD: postgres
      POSTGRES_DB: postgres
    volumes:
    - data:/var/lib/postgresql/data
    ports:
    - "5435:5432"

volumes:
  data: {}

The Nginx configuration file: default.conf

upstream backend {
  server backend:8080;
}
upstream frontend {
  server frontend:3000;
}

server {
  listen 80  default_server;
  server_name  plone.localhost;

  location ~ /\+\+api\+\+($|/.*) {
      rewrite ^/(\+\+api\+\+\/?)+($|/.*) /VirtualHostBase/http/$server_name/Plone/++api++/VirtualHostRoot/$2 break;
      proxy_pass http://backend;
  }

  location ~ / {
      location ~* \.(js|jsx|css|less|swf|eot|ttf|otf|woff|woff2)$ {
          add_header Cache-Control "public";
          expires +1y;
          proxy_pass http://frontend;
      }
      location ~* static.*\.(ico|jpg|jpeg|png|gif|svg)$ {
          add_header Cache-Control "public";
          expires +1y;
          proxy_pass http://frontend;
      }

      proxy_set_header        Host $host;
      proxy_set_header        X-Real-IP $remote_addr;
      proxy_set_header        X-Forwarded-For $proxy_add_x_forwarded_for;
      proxy_set_header        X-Forwarded-Proto $scheme;
      proxy_redirect http:// https://;
      proxy_pass http://frontend;
  }
}
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

1 participant