pangaea-data-publisher / fuji

FAIRsFAIR Research Data Object Assessment Service
MIT License
52 stars 39 forks source link

Application does not start. #43

Closed wilkos-dans closed 4 years ago

wilkos-dans commented 4 years ago

Hi there,

For EOSC-Synergy we'd like to evaluate this tool. However, We cannot get it started. Not from cmdline, neither from Docker (both the same issue's). After fixing dependencies (Levenshtein and rdflib version) the app exits with the following:

python3 -m fuji_server
2020-07-23 15:02:20,861 - root - INFO - Total metrics defined: 14
2020-07-23 15:02:20,902 - root - INFO - Total SPDX licenses : 422
2020-07-23 15:02:20,902 - root - INFO - Total re3repositories found from datacite api : 199
2020-07-23 15:02:20,902 - root - INFO - Total subjects area of imported metadata standards : 97
2020-07-23 15:02:20,902 - root - INFO - Total LD vocabs imported : 1021
2020-07-23 15:02:20,902 - root - INFO - Total default namespaces specified : 20
Traceback (most recent call last):
  File "/usr/local/lib/python3.7/site-packages/connexion/utils.py", line 120, in get_function_from_name
    function = deep_getattr(module, attr_path)
  File "/usr/local/lib/python3.7/site-packages/connexion/utils.py", line 68, in deep_getattr
    return functools.reduce(getattr, attrs, obj)
AttributeError: module 'fuji_server.controllers' has no attribute 'authorization_controller'

If I remove last line from yaml: https://github.com/pangaea-data-publisher/fuji/blob/2913bbe84d756057c0f09682e8352a8e903079b8/fuji_server/yaml/swagger.yaml#L596 It will start, but only 404 responses are returned.

2020-07-23 14:44:49,253 - root - INFO - Total metrics defined: 14
2020-07-23 14:44:49,269 - root - INFO - Total SPDX licenses : 422
2020-07-23 14:44:49,269 - root - INFO - Total re3repositories found from datacite api : 199
2020-07-23 14:44:49,269 - root - INFO - Total subjects area of imported metadata standards : 97
2020-07-23 14:44:49,269 - root - INFO - Total LD vocabs imported : 1021
2020-07-23 14:44:49,269 - root - INFO - Total default namespaces specified : 20
 * Serving Flask app "__main__" (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
2020-07-23 14:44:50,370 - werkzeug - INFO -  * Running on http://0.0.0.0:1071/ (Press CTRL+C to quit)
2020-07-23 14:45:03,840 - werkzeug - INFO - 127.0.0.1 - - [23/Jul/2020 14:45:03] "GET / HTTP/1.1" 404 -
2020-07-23 14:46:04,943 - werkzeug - INFO - 127.0.0.1 - - [23/Jul/2020 14:46:04] "GET /uji/api/v1/swagger.json HTTP/1.1" 404 -
2020-07-23 14:48:18,504 - werkzeug - INFO - 127.0.0.1 - - [23/Jul/2020 14:48:18] "GET / HTTP/1.1" 404 -
2020-07-23 14:53:23,659 - werkzeug - INFO - 127.0.0.1 - - [23/Jul/2020 14:53:23] "GET /evaluate HTTP/1.1" 404 -

Any suggestions?

kitchenprinzessin3880 commented 4 years ago

hi, you need implement a controller named 'authorization_controller.py' and include a function check_UserLogin:

def check_UserLogin(username, password, required_scopes):
    return {'test_key': 'test_value'}

added, see https://github.com/pangaea-data-publisher/fuji/tree/master/fuji_server/controllers

kitchenprinzessin3880 commented 4 years ago

Not from cmdline, neither from Docker (both the same issue's).

the docker script is not used and tested fully.

wilkos-dans commented 4 years ago

Thanks for the quick response! Now I can start it properly, but no application seems to be running, since I receive a 404 at any request I do:

$ python3 -m fuji_server
2020-07-23 17:15:48,414 - root - INFO - Total metrics defined: 14
2020-07-23 17:15:48,420 - root - INFO - Total SPDX licenses : 422
2020-07-23 17:15:48,420 - root - INFO - Total re3repositories found from datacite api : 199
2020-07-23 17:15:48,420 - root - INFO - Total subjects area of imported metadata standards : 97
2020-07-23 17:15:48,420 - root - INFO - Total LD vocabs imported : 1021
2020-07-23 17:15:48,421 - root - INFO - Total default namespaces specified : 20
 * Serving Flask app "__main__" (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
2020-07-23 17:15:49,077 - werkzeug - INFO -  * Running on http://0.0.0.0:1071/ (Press CTRL+C to quit)
2020-07-23 17:16:07,232 - werkzeug - INFO - 127.0.0.1 - - [23/Jul/2020 17:16:07] "GET / HTTP/1.1" 404 -
2020-07-23 17:17:29,817 - werkzeug - INFO - 127.0.0.1 - - [23/Jul/2020 17:17:29] "GET /fuji/api/v1/ui/ HTTP/1.1" 404 -
2020-07-23 17:19:44,813 - werkzeug - INFO - 1
27.0.0.1 - - [23/Jul/2020 17:19:44] "POST /fuji/api/v1/ui/ HTTP/1.1" 404 -

Is there anything I might have missed?

kitchenprinzessin3880 commented 4 years ago

@wilkos-dans it seems the issue is from swagger ui. can you please check is you have installed it : pip install swagger_ui_bundle if you want to access the test service hosted by pangaea, please send an email to adevaraju@marum.de.

wilkos-dans commented 4 years ago

Hello,

Not sure what you mean with client script?

Do you mean like: /client/ex_evaluate.py?

I’m trying to get it to work, however the import of the FAIRCheck object errors:

from fuji_server.controllers.fair_check import FAIRCheck

  File "/fuji_server/helper/preprocessor.py", line 321, in getRE3repositories

    cls.retrieve_retrieve_linkeddata(cls.RE3DATA_API, cls.DATACITE_API_REPO, True)

AttributeError: type object 'Preprocessor' has no attribute 'retrieve_retrieve_linkeddata'

I think I need some instructions on how to get started.

Thanks!

Best,

Wilko

@wilkos-dans can you please share your client script?

kitchenprinzessin3880 commented 4 years ago

@wilkos-dans the client script is not updated, it was created for an older version. please contact me via email (adevaraju@marum.de) so that i can help you setting it up on your local computer. or you can the test service which is also available at http://seprojects.marum.de:1071/fuji/api/v1/ui/ you need user name and password to access service, which i can provide via email.

wilkos-dans commented 4 years ago

Thanks for the quick feedback. I managed to run the tool locally now. However, I needed to add a restriction in requirements.txt because of this error: ERROR: extruct 0.9.0 has requirement rdflib<5.0.0, but you'll have rdflib 5.0.0 which is incompatible. I changed line#3 from rdflib to: rdflib<5.0.0 It now builds without errors. I can create PR for it if wanted.