orchestracities / ngsi-timeseries-api

QuantumLeap: a FIWARE Generic Enabler to support the usage of NGSIv2 (and NGSI-LD experimentally) data in time-series databases
https://quantumleap.rtfd.io/
MIT License
38 stars 49 forks source link

docker-compose | image: smartsdk/quantumleap exited (1) #272

Closed MRROOX closed 5 years ago

MRROOX commented 5 years ago

Hello, with the latest update of quantum leap (smartsdk/quantumleap "latest") the following error occurs:

 # Quantum Leap is persisting Short Term History to Crate-DB
  quantumleap:
    image: smartsdk/quantumleap
    container_name: fiware-quantumleap
    ports:
      - "8668:8668"
    networks:
      - fiware_grafana_net
      - fiware_orion_net
    depends_on:
      - crate-db
      - orion
      - mongo-db
    environment:
      - "CRATE_HOST=http://crate-db"
    healthcheck:
      test: curl --fail -s http://localhost:8668/v2/version || exit 1
docker logs -f 18b17d6dcef306e065a27a5b9e71c98c972fc793c6152ef223c9aa9615b9c636
Failed to add operation for POST /v2/config
Traceback (most recent call last):
  File "/usr/local/lib/python3.6/site-packages/connexion/apis/abstract.py", line 207, in add_paths
    self.add_operation(path, method)
  File "/usr/local/lib/python3.6/site-packages/connexion/apis/abstract.py", line 171, in add_operation
    pass_context_arg_name=self.pass_context_arg_name
  File "/usr/local/lib/python3.6/site-packages/connexion/operations/__init__.py", line 8, in make_operation
    return spec.operation_cls.from_spec(spec, *args, **kwargs)
  File "/usr/local/lib/python3.6/site-packages/connexion/operations/swagger2.py", line 137, in from_spec
    **kwargs
  File "/usr/local/lib/python3.6/site-packages/connexion/operations/swagger2.py", line 96, in __init__
    pass_context_arg_name=pass_context_arg_name
  File "/usr/local/lib/python3.6/site-packages/connexion/operations/abstract.py", line 98, in __init__
    self._resolution = resolver.resolve(self)
  File "/usr/local/lib/python3.6/site-packages/connexion/resolver.py", line 40, in resolve
    return Resolution(self.resolve_function_from_operation_id(operation_id), operation_id)
  File "/usr/local/lib/python3.6/site-packages/connexion/resolver.py", line 64, in resolve_function_from_operation_id
    raise ResolverError(msg, sys.exc_info())
connexion.exceptions.ResolverError: <ResolverError: Cannot resolve operationId "reporter.reporter.config"! Import error was "No module named 'pytest'">

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "app.py", line 9, in <module>
    pythonic_params=True,
  File "/usr/local/lib/python3.6/site-packages/connexion/apps/flask_app.py", line 54, in add_api
    api = super(FlaskApp, self).add_api(specification, **kwargs)
  File "/usr/local/lib/python3.6/site-packages/connexion/apps/abstract.py", line 155, in add_api
    options=api_options.as_dict())
  File "/usr/local/lib/python3.6/site-packages/connexion/apis/abstract.py", line 109, in __init__
    self.add_paths()
  File "/usr/local/lib/python3.6/site-packages/connexion/apis/abstract.py", line 214, in add_paths
    self._handle_add_operation_error(path, method, err.exc_info)
  File "/usr/local/lib/python3.6/site-packages/connexion/apis/abstract.py", line 228, in _handle_add_operation_error
    six.reraise(*exc_info)
  File "/usr/local/lib/python3.6/site-packages/six.py", line 693, in reraise
    raise value
  File "/usr/local/lib/python3.6/site-packages/connexion/resolver.py", line 61, in resolve_function_from_operation_id
    return self.function_resolver(operation_id)
  File "/usr/local/lib/python3.6/site-packages/connexion/utils.py", line 100, in get_function_from_name
    raise last_import_error
  File "/usr/local/lib/python3.6/site-packages/connexion/utils.py", line 88, in get_function_from_name
    module = importlib.import_module(module_name)
  File "/usr/local/lib/python3.6/importlib/__init__.py", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 994, in _gcd_import
  File "<frozen importlib._bootstrap>", line 971, in _find_and_load
  File "<frozen importlib._bootstrap>", line 955, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 665, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 678, in exec_module
  File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
  File "/src/ngsi-timeseries-api/src/reporter/reporter.py", line 32, in <module>
    from translators.crate import NGSI_TO_CRATE, NGSI_TEXT
  File "/src/ngsi-timeseries-api/src/translators/crate.py", line 7, in <module>
    from translators import base_translator
  File "/src/ngsi-timeseries-api/src/translators/base_translator.py", line 1, in <module>
    from utils.common import TIME_INDEX_NAME
  File "/src/ngsi-timeseries-api/src/utils/common.py", line 2, in <module>
    import pytest
ModuleNotFoundError: No module named 'pytest'

But with quantum leap version 0.7.5 (smartsdk/quantumleap:0.7.5) it works well

 # Quantum Leap is persisting Short Term History to Crate-DB
  quantumleap:
    image: smartsdk/quantumleap:0.7.5
    container_name: fiware-quantumleap
    ports:
      - "8668:8668"
    networks:
      - fiware_grafana_net
      - fiware_orion_net
    depends_on:
      - crate-db
      - orion
      - mongo-db
    environment:
      - "CRATE_HOST=http://crate-db"
    healthcheck:
      test: curl --fail -s http://localhost:8668/v2/version || exit 1
docker logs -f d1bbe30997661b29c9ed0f1cbb597711fc7f0d6622588d11610302827a5fa909
 * Serving Flask app "app" (lazy loading)
 * Environment: production
   WARNING: This is a development server. Do not use it in a production deployment.
   Use a production WSGI server instead.
 * Debug mode: off
 * Running on http://0.0.0.0:8668/ (Press CTRL+C to quit)
127.0.0.1 - - [02/Nov/2019 19:07:56] "GET /v2/version HTTP/1.1" 200 -

I only report the bug with the latest version and how I have "fixed" by doing a downgrade of the image version of quantum leap.

My Environment:

c0c0n3 commented 5 years ago

@MRROOX thanks for this. We have a fix for this already, see #271 and #269. If you could please try again after we merge #271 and let us know if you still have any issues. Many thanks!

chicco785 commented 5 years ago

271 is merged and the build is successful

taliaga commented 5 years ago

@MRROOX prefer not to use latest tag in your images. Sometimes latest will require upgrades of the dependencies (e.g. docker image of the database) and you will only find out with a broken container.