Hello,

It is always faild when I start bibrank. 

I load demo-records, it is faild  when it run task_5

2012-04-13 15:38:21 --> Task #5 submitted.
2012-04-13 15:38:23 --> Task #5 started.
2012-04-13 15:38:23 --> 
Exception caught: 'task_id'
2012-04-13 15:38:23 --> 
Exception caught: 'task_id'
2012-04-13 15:38:23 --> 
Exception caught: 
2012-04-13 15:38:23 --> 
Exception caught: 
2012-04-13 15:38:23 --> Task #5 finished. [ERROR]


the log in invenio.err


>>> User details
No client information available

The following problem occurred on <http://inveniobak.ihep.ac.cn> (Invenio 1.0.0)

>>> Traceback details
Traceback (most recent call last):
  File 
"/usr/lib/python2.6/site-packages/invenio/invenio/bibrank_tag_based_indexer.py",
 line 355, in bibrank_engine
    task_sleep_now_if_required(can_stop_too=True)
  File "/usr/lib/python2.6/site-packages/invenio/invenio/invenio/bibtask.py", 
line 548, in task_sleep_now_if_required
    status = task_read_status()
  File "/usr/lib/python2.6/site-packages/invenio/invenio/invenio/bibtask.py", 
line 499, in task_read_status
    (_TASK_PARAMS['task_id'],), 1)
KeyError: 'task_id'
Locals by frame, innermost last
>>>> Frame <module> in /opt/invenio/bin/bibrank at line 79
*******************************************************************************
        76     import sys
        77     sys.exit(1)
        78
---->   79 main()
*******************************************************************************
                __revision__ =  "'$Id$'"
                __builtins__ =  "<module '__builtin__' (built-in)>"
                    __file__ =  "'/opt/<*****>/bin/bibrank'"
                 __package__ =  'None'
                    __name__ =  "'__main__'"
       232             task_submit_elaborate_specific_parameter_fnc=
       233                 task_submit_elaborate_specific_parameter,
       236
*******************************************************************************
       353                     ret = _task_run(task_run_fnc)
       354                     write_message("ERROR: The Python Profiler is not 
installed!", stream=sys.stderr)
       355             else:
---->  356                 ret = _task_run(task_run_fnc)
       357             if not ret:
       358                 write_message("Error occurred.  Exiting.", 
sys.stderr)
       359         except Exception, e:
*******************************************************************************
        task_submit_check_options_fnc =  'None'
        task_stop_helper_fnc =  'None'
                     version =  "'$Id$'"
             to_be_submitted =  'False'
                        argv =  "['/opt/<*****>/bin/bibrank', '-u', 'admin']"
                task_run_fnc =  '<function task_run_core at 0x521c410>'
        authorization_action =  "'runbibrank'"
           authorization_msg =  "'BibRank Task Submission'"
>>>> Frame _task_run in 
>>>> /usr/lib/python2.6/site-packages/invenio/invenio/bibtask.py at line 754
*******************************************************************************
       751     sleeptime = _TASK_PARAMS['sleeptime']
       752     try:
       753         try:
---->  754             if callable(task_run_fnc) and task_run_fnc():
       755                 task_update_status("DONE")
       756             else:
       757                 task_update_status("DONE WITH ERRORS")
*******************************************************************************
                   sleeptime =  "''"
                    time_now =  '1334302703.2953811'
                pidfile_name =  "'/opt/<*****>/var/run/bibsched_task_5.pid'"
                task_run_fnc =  '<function task_run_core at 0x521c410>'
                 task_status =  "'WAITING'"
                     pidfile =  "<closed file 
'/opt/<*****>/var/run/bibsched_task_5.pid', mode 'w' at 0x5213810>"
>>>> Frame task_run_core in /usr/lib/python2.6/site-packages/invenio/bibrank.py 
>>>> at line 157
*******************************************************************************
       154             cfg_function = config.get("rank_method", "function")
       155             func_object = globals().get(cfg_function)
       156             if func_object:
---->  157                 func_object(key)
       158             else:
       159                 write_message("Cannot run method '%s', no function 
to call"
       160                     % key)
*******************************************************************************
                    filename =  "'/opt/<*****>/etc/bibrank/citation.cfg'"
                         key =  "'citation'"
                      config =  '<ConfigParser.ConfigParser instance at 
0x4ec4758>'
                cfg_function =  "'citation'"
>>>> Frame citation in 
>>>> /usr/lib/python2.6/site-packages/invenio/invenio/bibrank_tag_based_indexer.py
>>>>  at line 490
*******************************************************************************
       487     write_message("Time used: %d second(s)." % timeused, verbose=9)
       488
       489 def citation(run):
---->  490     return bibrank_engine(run)
*******************************************************************************
                         run =  "'citation'"
>>>> Frame bibrank_engine in 
>>>> /usr/lib/python2.6/site-packages/invenio/invenio/bibrank_tag_based_indexer.py
>>>>  at line 415
*******************************************************************************
       412                 raise StandardError
       413     except StandardError, e:
       414         write_message("\nException caught: %s" % e, sys.stderr)
---->  415         register_exception()
       416         raise StandardError
       417
       418     if task_get_option("verbose"):
*******************************************************************************
                         run =  "'citation'"
            rank_method_code =  "'citation'"
                 startCreate =  '1334302703.298511'
                           e =  "KeyError('task_id',)"
*******************************************************************************
       545     """This function should be called during safe state of BibTask,
       546     e.g. after flushing caches or outside of run_sql calls.
       547     """
---->  548     status = task_read_status()
       549     write_message('Entering task_sleep_now_if_required with 
status=%s' % status, verbose=9)
       550     if status == 'ABOUT TO SLEEP':
       551         write_message("sleeping...")
*******************************************************************************
                can_stop_too =  'True'
>>>> Frame task_read_status in 
>>>> /usr/lib/python2.6/site-packages/invenio/invenio/invenio/bibtask.py at 
>>>> line 499
*******************************************************************************
       496 def task_read_status():
       497     """Read status information in the BibSched task table."""
       498     res = run_sql("SELECT status FROM schTASK where id=%s",
---->  499         (_TASK_PARAMS['task_id'],), 1)
       500     try:
       501         out = res[0][0]
       502     except:
*******************************************************************************

The following problem occurred on <http://inveniobak.ihep.ac.cn> (Invenio 1.0.0)

>>> Traceback details
Traceback (most recent call last):
  File "/usr/lib/python2.6/site-packages/invenio/bibrank.py", line 157, in 
task_run_core
    func_object(key)
  File 
"/usr/lib/python2.6/site-packages/invenio/invenio/bibrank_tag_based_indexer.py",
 line 490, in citation
    return bibrank_engine(run)
  File 
"/usr/lib/python2.6/site-packages/invenio/invenio/bibrank_tag_based_indexer.py",
 line 416, in bibrank_engine
    raise StandardError
StandardError
Locals by frame, innermost last
>>>> Frame <module> in /opt/invenio/bin/bibrank at line 79
*******************************************************************************
        76     import sys
        77     sys.exit(1)
        78
---->   79 main()
*******************************************************************************
                __revision__ =  "'$Id$'"
                __builtins__ =  "<module '__builtin__' (built-in)>"
                    __file__ =  "'/opt/<*****>/bin/bibrank'"
                 __package__ =  'None'
                    __name__ =  "'__main__'"
       232             task_submit_elaborate_specific_parameter_fnc=
       233                 task_submit_elaborate_specific_parameter,
       236
*******************************************************************************
       353                     ret = _task_run(task_run_fnc)
       354                     write_message("ERROR: The Python Profiler is not 
installed!", stream=sys.stderr)
       355             else:
---->  356                 ret = _task_run(task_run_fnc)
       357             if not ret:
       358                 write_message("Error occurred.  Exiting.", 
sys.stderr)
       359         except Exception, e:
*******************************************************************************
        task_submit_check_options_fnc =  'None'
        task_stop_helper_fnc =  'None'
                     version =  "'$Id$'"
             to_be_submitted =  'False'
                        argv =  "['/opt/<*****>/bin/bibrank', '-u', 'admin']"
                task_run_fnc =  '<function task_run_core at 0x521c410>'
        authorization_action =  "'runbibrank'"
           authorization_msg =  "'BibRank Task Submission'"
>>>> Frame _task_run in 
>>>> /usr/lib/python2.6/site-packages/invenio/invenio/bibtask.py at line 754
*******************************************************************************
       751     sleeptime = _TASK_PARAMS['sleeptime']
       752     try:
       753         try:
---->  754             if callable(task_run_fnc) and task_run_fnc():
       755                 task_update_status("DONE")
       756             else:
       757                 task_update_status("DONE WITH ERRORS")
*******************************************************************************
                   sleeptime =  "''"
                    time_now =  '1334302703.2953811'
                pidfile_name =  "'/opt/<*****>/var/run/bibsched_task_5.pid'"
                task_run_fnc =  '<function task_run_core at 0x521c410>'
                 task_status =  "'WAITING'"
                     pidfile =  "<closed file 
'/opt/<*****>/var/run/bibsched_task_5.pid', mode 'w' at 0x5213810>"
>>>> Frame task_run_core in /usr/lib/python2.6/site-packages/invenio/bibrank.py 
>>>> at line 163
*******************************************************************************
       160                     % key)
       161     except StandardError, e:
       162         write_message("\nException caught: %s" % e, sys.stderr)
---->  163         register_exception()
       164         task_update_status("ERROR")
       165         sys.exit(1)
       166
*******************************************************************************
                           e =  'StandardError()'
                        name =  "('wrd',)"
                 func_object =  '<function citation at 0x51f5050>'
                    filename =  "'/opt/<*****>/etc/bibrank/citation.cfg'"
                         key =  "'citation'"
                      config =  '<ConfigParser.ConfigParser instance at 
0x4ec4758>'
                cfg_function =  "'citation'"
>>>> Frame citation in 
>>>> /usr/lib/python2.6/site-packages/invenio/invenio/bibrank_tag_based_indexer.py
>>>>  at line 490
*******************************************************************************
       487     write_message("Time used: %d second(s)." % timeused, verbose=9)
       488
       489 def citation(run):
---->  490     return bibrank_engine(run)
*******************************************************************************
                         run =  "'citation'"
>>>> Frame bibrank_engine in 
>>>> /usr/lib/python2.6/site-packages/invenio/invenio/bibrank_tag_based_indexer.py
>>>>  at line 416
*******************************************************************************
       413     except StandardError, e:
       414         write_message("\nException caught: %s" % e, sys.stderr)
       415         register_exception()
---->  416         raise StandardError
       417
       418     if task_get_option("verbose"):
       419         showtime((time.time() - startCreate))
*******************************************************************************
                         run =  "'citation'"
            rank_method_code =  "'citation'"
                 startCreate =  '1334302703.298511'
                           e =  "KeyError('task_id',)"

If I remove demo records,  it is also faild when I start bibrank.
I have no idea how to fix the problem. Please help

Thanks a lot,
Regards,
Lanxin

________________________________________
From: Lanxin Ma
Sent: 12 April 2012 15:45
To: Samuele Kaplun
Cc: project-invenio-general (Invenio users)
Subject: RE: my bibsched does not work

hello,

I saw the bibsched monitor via

sudo -u apache /opt/invenio/bin/bibsched

I got the messages:

2012-04-12 15:30:48 -->
Exception caught: 'task_id'
2012-04-12 15:30:48 -->
Exception caught:

the log in invenio.log

more  /opt/invenio/var/log/invenio.err
The following problem occurred on <http://inveniobak.ihep.ac.cn> (Invenio 1.0.0)
>> 2012-04-12 21:31:21 -> StandardError: BibTask with ERRORS:
    #5 bibrank -> ERROR
>>> User details
No client information available
>>> Traceback details
Traceback (most recent call last):
  File "/usr/lib/python2.6/site-packages/invenio/bibsched.py", line 980, in 
watch_loop
    calculate_rows()
  File "/usr/lib/python2.6/site-packages/invenio/bibsched.py", line 950, in 
calculate_rows
    raise StandardError('BibTask with ERRORS:\n%s' % "\n".join(errors))
StandardError: BibTask with ERRORS:
    #5 bibrank -> ERROR
Locals by frame, innermost last
>>>> Frame <module> in /opt/invenio/bin/bibsched at line 33
*******************************************************************************
        30     import sys
        31     sys.exit(1)
        32
---->   33 main()
*******************************************************************************
                __revision__ =  "'$Id$'"
                __builtins__ =  "<module '__builtin__' (built-in)>"
                    __file__ =  "'/opt/<*****>/bin/bibsched'"
                 __package__ =  'None'
                    __name__ =  "'__main__'"
                        main =  '<function main at 0x23e4758>'
                     __doc__ =  "'BibSched - task management, scheduling and 
executing system for Invenio\\n'"
>>>> Frame main in /usr/lib/python2.6/site-packages/invenio/bibsched.py at line 
>>>> 1345
*******************************************************************************
      1342             'halt':    halt,
      1343             'stop': stop,
      1344             'restart': restart,
----> 1345             'monitor': monitor} [cmd] (verbose)
      1346     except KeyError:
      1347         usage(1, 'unkown command: %s' % cmd)
      1348
*******************************************************************************
                      status =  'None'
        check_running_process_user =  '<function check_running_process_user at 
0x2931320>'
                       tasks =  'None'
                     verbose =  'True'
                        args =  "['start']"
                       since =  'None'
                         cmd =  "'start'"
                        opts =  '[]'
>>>> Frame start in /usr/lib/python2.6/site-packages/invenio/bibsched.py at 
>>>> line 1147
*******************************************************************************
      1144
      1145     sched = BibSched()
      1146     try:
----> 1147         sched.watch_loop()
      1148     finally:
      1149         try:
      1150             os.remove(pidfile)
*******************************************************************************
                         pid =  '0'
                       sched =  '<<*****>.bibsched.BibSched instance at 
0x2929cb0>'
                     verbose =  'True'
>>>> Frame watch_loop in /usr/lib/python2.6/site-packages/invenio/bibsched.py 
>>>> at line 1001
*******************************************************************************
       998                     else:
       999                         time.sleep(CFG_BIBSCHED_REFRESHTIME)
      1000         except Exception, err:
----> 1001             register_exception(alert_admin=True)
      1002             try:
      1003                 register_emergency('Emergency from %s: BibSched 
halted: %s' % (CFG_SITE_URL, err))
      1004             except NotImplementedError:
*******************************************************************************
        calculate_task_status =  '<function calculate_task_status at 0x2931398>'
              calculate_rows =  '<function calculate_rows at 0x23ea9b0>'
                        self =  '<<*****>.bibsched.BibSched instance at 
0x2929cb0>'
                         err =  "StandardError('BibTask with ERRORS:\\n    #5 
bibrank -> ERROR',)"
>>>> Frame calculate_rows in 
>>>> /usr/lib/python2.6/site-packages/invenio/bibsched.py at line 950
*******************************************************************************
       947             if run_sql("SELECT count(id) FROM schTASK WHERE 
status='ERROR' OR status='DONE WITH ERRORS'")[0][0] > 0:
       948                 errors = run_sql("SELECT id,proc,status FROM schTASK 
WHERE status='ERROR' OR status='DONE WITH ERRORS'")
       949                 errors = ["    #%s %s -> %s" % row for row in errors]
---->  950                 raise StandardError('BibTask with ERRORS:\n%s' % 
"\n".join(errors))
       951             max_bibupload_priority = run_sql("SELECT max(priority) 
FROM schTASK WHERE status='WAITING' AND proc='bibupload' AND runtime<=NOW()")
       952             if max_bibupload_priority:
       953                 run_sql("UPDATE schTASK SET priority=%s WHERE 
status='WAITING' AND proc='bibupload' AND runtime<=NOW()", ( 
max_bibupload_priority[0][0], ))
*******************************************************************************
                        self =  '<<*****>.bibsched.BibSched instance at 
0x2929cb0>'
                      errors =  "['    #5 bibrank -> ERROR']"
                         row =  "(5L, 'bibrank', 'ERROR')"



It seems the bibtask 5(bibrank) is faild.  I do not know what the error mean. 
How to fix it?

Thanks a lot,

Regards,
Lanxin

________________________________________
From: Samuele Kaplun
Sent: 12 April 2012 11:50
To: Lanxin Ma
Cc: project-invenio-general (Invenio users)
Subject: Re: my bibsched does not work

Dear Lanxin,

In data giovedì, 12 aprile 2012 11.37:45, Lanxin Ma ha scritto:
>   File "/usr/lib/python2.6/site-packages/invenio/bibsched.py", line 950, in
> calculate_rows raise StandardError('BibTask with ERRORS:\n%s' %
> "\n".join(errors)) StandardError: BibTask with ERRORS:
>     #5 bibrank -> ERROR

this means that the bibsched queue is interrupted because there's at least one
failed bibtask. You inspect the log of this bibtask by:

starting the bibsched monitor via:

$ sudo -u apache /opt/invenio/bin/bibsched

using the keyboard harrows to move to the failed task, and then press either
"l" (i.e., lower-case L) to see the standard output of the failed task, or "L"
(i.e. upper-case L) to see the standard error of the failed task.

These same logs will be available in:

/opt/invenio/var/lob/bibsched_task_5.log and bibsched_task_5.err (in the case
of this bibtask which had task_id 5).

Moreover if there was any exception not handled you can find it in
/opt/invenio/var/log/invenio.err

Best regards,
        Samuele


--
Samuele Kaplun
Invenio Developer ** <http://invenio-software.org/>

Reply via email to