EUDAT-B2SHARE / b2share

B2SHARE software for the EUDAT CDI services.
https://b2share.eudat.eu
GNU General Public License v2.0
35 stars 33 forks source link

Citations generates error message #678

Closed llehtine closed 7 years ago

llehtine commented 9 years ago
Hello:

This exception has already been seen 1 times
    last time it was seen: 2015-06-16 10:41:18
    last time it was notified: 2015-06-16 10:41:18

* 2015-06-16 10:41:18 -> ImportError: cannot import name get_self_cited_by (views.py:266:citations)

** User details
                                     agent: Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/28.0.1500.63 Safari/537.36
                                     email:
                               family_name:
                               given_names:
                                     group: []
                                     guest: 1
                                        id: 0
                                  nickname:
            precached_canseehiddenmarctags: False
precached_permitted_restricted_collections: []
                    precached_sendcomments: False
                        precached_useadmin: False
                       precached_usealerts: False
                      precached_useapprove: False
                      precached_usebaskets: False
                       precached_usegroups: False
                        precached_useloans: False
                     precached_usemessages: False
             precached_usepaperattribution: False
                   precached_usepaperclaim: False
                        precached_usestats: False
                   precached_viewclaimlink: False
                 precached_viewsubmissions: False
                                   referer: <http://b2share.eudat.eu/record/119/export>
                               remote_host:
                                 remote_ip: 194.136.154.133
                                   session: None
                                  settings: {}
                                       uid: 0
                                       uri: </record/119/citations>

** Traceback details

Traceback (most recent call last):
  File "/var/www/.virtualenvs/b2share/src/b2share/invenio/ext/legacy/__init__.py", line 124, in __call__
    response = self.app.full_dispatch_request()
  File "/var/www/.virtualenvs/b2share/lib/python2.7/site-packages/flask/app.py", line 1477, in full_dispatch_request
    rv = self.handle_user_exception(e)
  File "/var/www/.virtualenvs/b2share/lib/python2.7/site-packages/flask_restful/__init__.py", line 258, in error_router
    return original_handler(e)
  File "/var/www/.virtualenvs/b2share/src/b2share/invenio/base/wrappers.py", line 125, in handle_user_exception
    return super(Flask, self).handle_user_exception(e)
  File "/var/www/.virtualenvs/b2share/lib/python2.7/site-packages/flask/app.py", line 1381, in handle_user_exception
    reraise(exc_type, exc_value, tb)
  File "/var/www/.virtualenvs/b2share/lib/python2.7/site-packages/flask/app.py", line 1475, in full_dispatch_request
    rv = self.dispatch_request()
  File "/var/www/.virtualenvs/b2share/lib/python2.7/site-packages/flask/app.py", line 1461, in dispatch_request
    return self.view_functions[rule.endpoint](**req.view_args)
  File "/var/www/.virtualenvs/b2share/src/b2share/invenio/modules/records/views.py", line 154, in decorated
    return f(recid, *args, **kwargs)
  File "/var/www/.virtualenvs/b2share/src/b2share/invenio/modules/records/views.py", line 266, in citations
    from invenio.legacy.bibrank.citation_searcher import calculate_cited_by_list,\
ImportError: cannot import name get_self_cited_by

** Stack frame details

Frame citations in /var/www/.virtualenvs/b2share/src/b2share/invenio/modules/records/views.py at line 266
-------------------------------------------------------------------------------
       263                count=citations_nb_counts)
       264 def citations(recid):
       265     """Display citations."""
---->  266     from invenio.legacy.bibrank.citation_searcher import calculate_cited_by_list,\
       267         get_self_cited_by, calculate_co_cited_with_list
       268     citations = dict(
       269         citinglist=calculate_cited_by_list(recid),
-------------------------------------------------------------------------------
        calculate_cited_by_list =  '<function calculate_cited_by_list at 0x7f500c442488>'
                       recid =  '119'

Frame decorated in /var/www/.virtualenvs/b2share/src/b2share/invenio/modules/records/views.py at line 154
-------------------------------------------------------------------------------
       151             "%s.%s" % (blueprint.name, f.__name__),
       152             recid=recid,
       153         )
---->  154         return f(recid, *args, **kwargs)
       155     return decorated
       156
       157
-------------------------------------------------------------------------------
                           f =  '<function citations at 0x7f503734b320>'
               VIEWRESTRCOLL =  "'viewrestrcoll'"
        guess_primary_collection_of_a_record =  '<function guess_primary_collection_of_a_record at 0x7f500cc4b500>'
                    auth_msg =  "''"
        mail_cookie_create_authorize_action =  '<function mail_cookie_create_authorize_action at 0x7f50372f3cf8>'
                        args =  '()'
                       title =  "u'Study1.2'"
                merged_recid =  'None'
                      kwargs =  '{}'
               record_status =  '1'
                  collection =  'Collection <id: 2, name: Generic, dbquery: SELECT collection.id AS collection_id, collection.name AS collection_name, collection.dbquery AS collection_dbquery, collection.nbrecs AS collection_nbrecs, collection.reclist AS collection_reclist \nFROM collection, nbrecs: 182>'
            get_merged_recid =  '<function get_merged_recid at 0x7f500cc4b8c0>'
                        tabs =  '[]'
        check_user_can_view_record =  '<function check_user_can_view_record at 0x7f500cc2d6e0>'
                       recid =  '119'
          check_fresh_record =  '<function check_fresh_record at 0x7f500fa19848>'
                   auth_code =  '0'
                      record =  '{u\'restriction\': {u\'email\': u\'\'}, u\'coyright\': {}, u\'modification_date\': u\'2014-09-15T12:03:13\', u\'version_history\': None, u\'title\': {u\'title\': u\'Study1.2\'}, u\'language_note\': {u\'language_note\': u\'en\'}, u\'abstract\': {u\'summary\': u\'Study1.2\'}, u\'fft\': {u\'url\': u\'https://b2share.eudat.eu/record/119/files/eMails.rtf?version=1\', u\'file_size\': u\'4936\'}, u\'__meta_metadata__\': {u\'__additional_info__\': {u\'master_format\': u\'marc\', u\'namespace\': u\'reco [...]
              _format_record =  '<function _format_record at 0x7f5003337140>'
              record_context =  'None'
               record_exists =  '<function record_exists at 0x7f500c5f9848>'

Frame dispatch_request in /var/www/.virtualenvs/b2share/lib/python2.7/site-packages/flask/app.py at line 1461
-------------------------------------------------------------------------------
      1458            and req.method == 'OPTIONS':
      1459             return self.make_default_options_response()
      1460         # otherwise dispatch to the handler for that endpoint
----> 1461         return self.view_functions[rule.endpoint](**req.view_args)
      1462
      1463     def full_dispatch_request(self):
      1464         """Dispatches the request and on top of that performs request
-------------------------------------------------------------------------------
                        self =  "<Flask 'invenio.base'>"
                         req =  "<LegacyRequest 'http://b2share.eudat.eu/record/119/citations' [GET]>"
                        rule =  "<Rule '/record/<recid>/citations' (HEAD, POST, OPTIONS, GET) -> record.citations>"

Frame full_dispatch_request in /var/www/.virtualenvs/b2share/lib/python2.7/site-packages/flask/app.py at line 1477
-------------------------------------------------------------------------------
      1474             if rv is None:
      1475                 rv = self.dispatch_request()
      1476         except Exception as e:
----> 1477             rv = self.handle_user_exception(e)
      1478         response = self.make_response(rv)
      1479         response = self.process_response(response)
      1480         request_finished.send(self, response=response)
-------------------------------------------------------------------------------
                          rv =  'None'
                           e =  "ImportError('cannot import name get_self_cited_by',)"
                        self =  "<Flask 'invenio.base'>"

Frame handle_user_exception in /var/www/.virtualenvs/b2share/lib/python2.7/site-packages/flask/app.py at line 1381
-------------------------------------------------------------------------------
      1378             if isinstance(e, typecheck):
      1379                 return handler(e)
      1380
----> 1381         reraise(exc_type, exc_value, tb)
      1382
      1383     def handle_exception(self, e):
      1384         """Default exception handling that kicks in when an exception
-------------------------------------------------------------------------------
                           e =  "ImportError('cannot import name get_self_cited_by',)"
                    handlers =  'None'
                        self =  "<Flask 'invenio.base'>"
                   exc_value =  "ImportError('cannot import name get_self_cited_by',)"
          blueprint_handlers =  '()'
                app_handlers =  '()'
                          tb =  '<traceback object at 0x7f500087de60>'
                    exc_type =  "<type 'exceptions.ImportError'>"

Frame handle_user_exception in /var/www/.virtualenvs/b2share/src/b2share/invenio/base/wrappers.py at line 125
-------------------------------------------------------------------------------
       122         Hook a before handle to it.
       123         """
       124         before_handle_user_exception.send(e)
---->  125         return super(Flask, self).handle_user_exception(e)
       126
       127
       128 def lazy_import(name):
-------------------------------------------------------------------------------
                        self =  "<Flask 'invenio.base'>"
                           e =  "ImportError('cannot import name get_self_cited_by',)"

Frame error_router in /var/www/.virtualenvs/b2share/lib/python2.7/site-packages/flask_restful/__init__.py at line 258
-------------------------------------------------------------------------------
       255         """
       256         if self._has_fr_route():
       257             return self.handle_error(e)
---->  258         return original_handler(e)
       259
       260     def handle_error(self, e):
       261         """Error handler for the API transforms a raised exception into a Flask
-------------------------------------------------------------------------------
            original_handler =  "<bound method Flask.handle_user_exception of <Flask 'invenio.base'>>"
                        self =  '<flask_restful.Api object at 0x7f5036a00a50>'
                           e =  "ImportError('cannot import name get_self_cited_by',)"

Frame full_dispatch_request in /var/www/.virtualenvs/b2share/lib/python2.7/site-packages/flask/app.py at line 1477
-------------------------------------------------------------------------------
      1474             if rv is None:
      1475                 rv = self.dispatch_request()
      1476         except Exception as e:
----> 1477             rv = self.handle_user_exception(e)
      1478         response = self.make_response(rv)
      1479         response = self.process_response(response)
      1480         request_finished.send(self, response=response)
-------------------------------------------------------------------------------
                          rv =  'None'
                           e =  "ImportError('cannot import name get_self_cited_by',)"
                        self =  "<Flask 'invenio.base'>"

Frame __call__ in /var/www/.virtualenvs/b2share/src/b2share/invenio/ext/legacy/__init__.py at line 127
-------------------------------------------------------------------------------
       124                     response = self.app.full_dispatch_request()
       125                 except Exception as e:
       126                     from invenio.ext.logging import register_exception
---->  127                     register_exception(req=request, alert_admin=True)
       128                     response = self.app.handle_exception(e)
       129
       130                 return response(environ, start_response)
-------------------------------------------------------------------------------
              start_response =  '<built-in method start_response of mod_wsgi.Adapter object at 0x7f50011fceb8>'
                     environ =  "{'wsgi.version': (1, 0), 'HTTP_ACUNETIX_ASPECT_PASSWORD': '<*****>', 'mod_wsgi.listener_port': '80', 'HTTP_COOKIE': 'session=5dfe3a7d4bdc4ef299f6309ddc32947f; sessionstub=NO', 'SERVER_SOFTWARE': 'Apache', 'HTTP_ACUNETIX_ASPECT': 'enabled', 'SCRIPT_NAME': '', 'mod_wsgi.enable_sendfile': '0', 'mod_wsgi.handler_script': '', 'SERVER_SIGNATURE': '', 'REQUEST_METHOD': 'GET', 'PATH_INFO': '/record/119/citations', 'SERVER_PROTOCOL': 'HTTP/1.1', 'QUERY_STRING': '', 'HTTP_USER_AG [...]
                        self =  '<invenio.ext.legacy.LegacyAppMiddleware object at 0x7f5032d52390>'
          register_exception =  '<function register_exception at 0x7f503661a8c0>'
                           e =  "ImportError('cannot import name get_self_cited_by',)"
llehtine commented 9 years ago

You get this when trying to access "Citations"-page. Normally from the records-page there isn't any links to this page, but when i've tried to access https://b2share.eudat.eu/record/200/export for example, I got Information/References/Citations/Keyworks/Comments/Usage statistics/Files/Plots links visible.

emanueldima commented 7 years ago

won't fix in v1, N/A in v2