Some days ago I noticed there was something wrong with inveniogc. Every time I run inveniogc -a
I was getting errors like:
2013-04-17 08:31:30 --> 2013-04-17 08:31:30 --> Updating task status to ERROR. 2013-04-17 08:31:30 --> Task #21731 finished. [ERROR] |
Calling inveniogc with verbose level = 9 I got some more information (var/log/bibsched_task_XXXX.log
and .err
files):
2013-04-17 08:29:51 --> - deleting queries not attached to any user 2013-04-17 08:29:51 --> SELECT DISTINCT q.id FROM query AS q LEFT JOIN user_query AS uq ON uq.id_query = q.id WHERE uq.id_query IS NULL AND q.type <> 'p' 2013-04-17 08:31:30 --> 2013-04-17 08:31:30 --> Updating task status to ERROR. 2013-04-17 08:31:30 --> Task #21731 finished. [ERROR] |
The issue arised when inveniogc
tried to delete user queries not attached to any user. I edited lib/python/invenioinveniogc.py
and noticed the error was being produced by the output of a query result being printed. Just commented that out and inveniogc works again:
write_message(""" SELECT DISTINCT q.id\n FROM query AS q LEFT JOIN user_query AS uq\n ON uq.id_query = q.id\n WHERE uq.id_query IS NULL AND\n q.type <> 'p' """, verbose=9) result = run_sql("""SELECT DISTINCT q.id FROM query AS q LEFT JOIN user_query AS uq ON uq.id_query = q.id WHERE uq.id_query IS NULL AND q.type <> 'p'""") # write_message(result, verbose=9) |
Why is this? It seems that the output buffer that write_message is using is too small to store the result of the previous query, so it fails…