epifanio / adc-pycsw

Setup and deployment of PyCSW for the Arctic Data Centre (ADC) project
2 stars 0 forks source link

docker setup #1

Open epifanio opened 2 years ago

epifanio commented 2 years ago

The docker set-up uses the entrypoint.py to start pycsw which has pointers to a repository table:

https://github.com/geopython/pycsw/blob/master/docker/entrypoint.py#L88 which returns:

DEBUG:__main__:Setting up pycsw's data repository...
DEBUG:__main__:Repository URL: None
Traceback (most recent call last):
  File "/usr/local/lib/python3.8/configparser.py", line 789, in get
    value = d[option]
  File "/usr/local/lib/python3.8/collections/__init__.py", line 898, in __getitem__
    return self.__missing__(key)            # support subclasses that define __missing__
  File "/usr/local/lib/python3.8/collections/__init__.py", line 890, in __missing__
    raise KeyError(key)
KeyError: 'table'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/bin/entrypoint.py", line 188, in <module>
    launch_pycsw(config, workers=workers, reload=args.reload)
  File "/usr/local/bin/entrypoint.py", line 88, in launch_pycsw
    pycsw_config.get("repository", "table"),
  File "/usr/local/lib/python3.8/configparser.py", line 792, in get
    raise NoOptionError(option, section)
configparser.NoOptionError: No option 'table' in section: 'repository'

Trying to add a table entry in the pycsw.cfg for debugging, I then got:

912ax DEBUG:__main__:Setting up pycsw's data repository...
912ax DEBUG:__main__:Repository URL: None
912ax Traceback (most recent call last):
912ax   File "/usr/local/bin/entrypoint.py", line 188, in <module>
912ax     launch_pycsw(config, workers=workers, reload=args.reload)
912ax   File "/usr/local/bin/entrypoint.py", line 86, in launch_pycsw
912ax     db_handler(
912ax TypeError: 'NoneType' object is not callable
8k9fd DEBUG:__main__:Setting up pycsw's data repository...
8k9fd DEBUG:__main__:Repository URL: None
8k9fd Traceback (most recent call last):
8k9fd   File "/usr/local/bin/entrypoint.py", line 188, in <module>
8k9fd     launch_pycsw(config, workers=workers, reload=args.reload)
8k9fd   File "/usr/local/bin/entrypoint.py", line 86, in launch_pycsw
8k9fd     db_handler(
8k9fd TypeError: 'NoneType' object is not callable

I guess to fix this we have to modify the entrypoint.py , should suffice to just avoid to execute the db_handler() if the repository.database is set to None in the config?

epifanio commented 2 years ago

@tomkralidis trying to get the plug-in running

I tried to modify the entry point so that the db postgres is not called - but that is not enough.

This log:

https://gist.github.com/epifanio/84aef6743d9f2d39e971d229653c71ad#file-gistfile1-txt-L31-L33

I am looking into pycsw/pycsw/wsgi_flask.py and pycsw/pycsw/ogc/api/records.py to understand how to pass the SOLR backend from the plug-in.

epifanio commented 2 years ago

It seems the plug-in is ignored by pycsw and the code still looks for the database backend. @tomkralidis, any clue on how to debug the issue?