Auto-GPT-Plugins icon indicating copy to clipboard operation
Auto-GPT-Plugins copied to clipboard

How to get proper error logs/messages?

Open JaWas2019 opened this issue 2 years ago • 2 comments

Hey there, I need to see proper stack traces in order to debug the plugin I am working on. However, the error.log file remains empty, and the output with --debug doesn't help at all either:

Input:y
-=-=-=-=-=-=-= COMMAND AUTHORISED BY USER -=-=-=-=-=-=-= 
SYSTEM:  Command browse_gospatz returned: Error: object of type 'NoneType' has no len()
  Token limit: 4000
  Memory Stats: {'index_name': 'auto-gpt', 'index_options': [], 'index_definition': [b'key_type', b'HASH', b'prefixes', [b'auto-gpt:'], b'default_score', b'1'], 'attributes': [[b'identifier', b'data', b'attribute', b'data', b'type', b'TEXT', b'WEIGHT', b'1'], [b'identifier', b'embedding', b'attribute', b'embedding', b'type', b'VECTOR']], 'num_docs': '0', 'max_doc_id': '0', 'num_terms': '0', 'num_records': '0', 'inverted_sz_mb': '0', 'vector_index_sz_mb': '0', 'total_inverted_index_blocks': '0', 'offset_vectors_sz_mb': '0', 'doc_table_size_mb': '0', 'sortable_values_size_mb': '0', 'key_table_size_mb': '0', 'records_per_doc_avg': '-nan', 'bytes_per_record_avg': '-nan', 'offsets_per_term_avg': '-nan', 'offset_bits_per_record_avg': '-nan', 'hash_indexing_failures': '0', 'total_indexing_time': '0', 'indexing': '0', 'percent_indexed': '1', 'number_of_uses': 22, 'gc_stats': [b'bytes_collected', b'0', b'total_ms_run', b'0', b'total_cycles', b'0', b'average_cycle_time_ms', b'-nan', b'last_run_time_ms', b'0', b'gc_numeric_trees_missed', b'0', b'gc_blocks_denied', b'0'], 'cursor_stats': [b'global_idle', 0, b'global_total', 0, b'index_capacity', 128, b'index_total', 0], 'dialect_stats': [b'dialect_1', 0, b'dialect_2', 0, b'dialect_3', 0]}
  Creating chat completion with model gpt-3.5-turbo, temperature 0.4, max_tokens None
  Response: { 
  "choices": [
    {
      "finish_reason": "stop",
      "index": 0,
      "message": {
        "content": "As a system, I recall that nothing new has happened since my creation.",
        "role": "assistant"
      }
    }
  ],
  "created": 1683219095,
  "id": "chatcmpl-[REDACTED]",
  "model": "gpt-3.5-turbo-0301",
  "object": "chat.completion",
  "usage": {
    "completion_tokens": 15,
    "prompt_tokens": 120,
    "total_tokens": 135
  }
}
  Total running cost: $0.006
  Your remaining API budget is $4.994

There is no len() in my code, so it probably occurs somewhere in the AutoGPT code, but currently I don't have a way of finding the source. Any pointers?

JaWas2019 avatar May 04 '23 16:05 JaWas2019

that error probably occurs deep within your code. Can you link it?

ntindle avatar May 10 '23 06:05 ntindle

Hey ntindle, as I said my code doesn't contain any len() statements. It is of course possible, that one of the packages calls that function. But to track that down, I need proper error logs. As AutoGPT seems to catch all errors that occur during command execution without logging them to the error file, I don't have any proper stacktraces. Is there any way of disabling the automatic error catching? I just want it to result in a proper runtime error so I can see the trace python spits out.

JaWas2019 avatar May 10 '23 10:05 JaWas2019

run with --debug

ntindle avatar May 20 '23 05:05 ntindle