AutoGPT icon indicating copy to clipboard operation
AutoGPT copied to clipboard

Fatal error reading JSON

Open jcoon-icapitalnetwork opened this issue 1 year ago • 9 comments

⚠️ Search for existing issues first ⚠️

  • [X] I have searched the existing issues, and there is no existing issue for my problem

Which Operating System are you using?

MacOS

Which version of Auto-GPT are you using?

Master (branch)

GPT-3 or GPT-4?

GPT-3.5

Steps to reproduce 🕹

Stack trace of the error. The error handling should allow for a graceful fail that allows AutoGPT to continue.

Traceback (most recent call last): File "/usr/local/lib/python3.10/runpy.py", line 196, in _run_module_as_main return _run_code(code, main_globals, None, File "/usr/local/lib/python3.10/runpy.py", line 86, in _run_code exec(code, run_globals) File "/app/autogpt/main.py", line 5, in autogpt.cli.main() File "/usr/local/lib/python3.10/site-packages/click/core.py", line 1130, in call return self.main(*args, **kwargs) File "/usr/local/lib/python3.10/site-packages/click/core.py", line 1055, in main rv = self.invoke(ctx) File "/usr/local/lib/python3.10/site-packages/click/core.py", line 1635, in invoke rv = super().invoke(ctx) File "/usr/local/lib/python3.10/site-packages/click/core.py", line 1404, in invoke return ctx.invoke(self.callback, **ctx.params) File "/usr/local/lib/python3.10/site-packages/click/core.py", line 760, in invoke return __callback(*args, **kwargs) File "/usr/local/lib/python3.10/site-packages/click/decorators.py", line 26, in new_func return f(get_current_context(), *args, **kwargs) File "/app/autogpt/cli.py", line 90, in main run_auto_gpt( File "/app/autogpt/main.py", line 186, in run_auto_gpt agent.start_interaction_loop() File "/app/autogpt/agent/agent.py", line 113, in start_interaction_loop assistant_reply = chat_with_ai( File "/app/autogpt/llm/chat.py", line 165, in chat_with_ai agent.summary_memory = update_running_summary( File "/app/autogpt/memory_management/summary_memory.py", line 78, in update_running_summary content_dict = json.loads(event["content"]) File "/usr/local/lib/python3.10/json/init.py", line 346, in loads return _default_decoder.decode(s) File "/usr/local/lib/python3.10/json/decoder.py", line 337, in decode obj, end = self.raw_decode(s, idx=_w(s, 0).end()) File "/usr/local/lib/python3.10/json/decoder.py", line 353, in raw_decode obj, end = self.scan_once(s, idx) json.decoder.JSONDecodeError: Expecting property name enclosed in double quotes: line 13 column 9 (char 874) ERROR: 1

Current behavior 😯

Exit on error.

Expected behavior 🤔

Graceful fail on error.

Your prompt 📝

# Paste your prompt here

Your Logs 📒

<insert your logs here>

jcoon-icapitalnetwork avatar May 09 '23 12:05 jcoon-icapitalnetwork

Can anyone explain the error? Is it caused when saving memory? Or loading memory?

I am using local memory and running locally (w/o docker container)

Same error while reading a local python file that I copied into the working directory:

NEXT ACTION:  COMMAND = read_file ARGUMENTS = {'filename': '/home/hangyu5/Documents/Git-repoMy/AIResearchVault/repo/LLMApp/Auto-GPT/autogpt/auto_gpt_workspace/hash-grid-encoding/train.py'}
  Enter 'y' to authorise command, 'y -N' to run N continuous commands, 's' to run self-feedback commands'n' to exit program, or enter feedback for ...
  Asking user via keyboard...
Input:y
-=-=-=-=-=-=-= COMMAND AUTHORISED BY USER -=-=-=-=-=-=-= 

SYSTEM: 『Spit out the code correctly』
Traceback (most recent call last):
  File "/home/hangyu5/anaconda3/envs/autogpt/lib/python3.10/runpy.py", line 196, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "/home/hangyu5/anaconda3/envs/autogpt/lib/python3.10/runpy.py", line 86, in _run_code
    exec(code, run_globals)
  File "/home/hangyu5/Documents/Git-repoMy/AIResearchVault/repo/LLMApp/Auto-GPT/autogpt/__main__.py", line 5, in <module>
    autogpt.cli.main()
  File "/home/hangyu5/anaconda3/envs/autogpt/lib/python3.10/site-packages/click/core.py", line 1130, in __call__
    return self.main(*args, **kwargs)
  File "/home/hangyu5/anaconda3/envs/autogpt/lib/python3.10/site-packages/click/core.py", line 1055, in main
    rv = self.invoke(ctx)
  File "/home/hangyu5/anaconda3/envs/autogpt/lib/python3.10/site-packages/click/core.py", line 1635, in invoke
    rv = super().invoke(ctx)
  File "/home/hangyu5/anaconda3/envs/autogpt/lib/python3.10/site-packages/click/core.py", line 1404, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/home/hangyu5/anaconda3/envs/autogpt/lib/python3.10/site-packages/click/core.py", line 760, in invoke
    return __callback(*args, **kwargs)
  File "/home/hangyu5/anaconda3/envs/autogpt/lib/python3.10/site-packages/click/decorators.py", line 26, in new_func
    return f(get_current_context(), *args, **kwargs)
  File "/home/hangyu5/Documents/Git-repoMy/AIResearchVault/repo/LLMApp/Auto-GPT/autogpt/cli.py", line 90, in main
    run_auto_gpt(
  File "/home/hangyu5/Documents/Git-repoMy/AIResearchVault/repo/LLMApp/Auto-GPT/autogpt/main.py", line 171, in run_auto_gpt
    agent.start_interaction_loop()
  File "/home/hangyu5/Documents/Git-repoMy/AIResearchVault/repo/LLMApp/Auto-GPT/autogpt/agent/agent.py", line 94, in start_interaction_loop
    assistant_reply = chat_with_ai(
  File "/home/hangyu5/Documents/Git-repoMy/AIResearchVault/repo/LLMApp/Auto-GPT/autogpt/llm/chat.py", line 166, in chat_with_ai
    agent.summary_memory = update_running_summary(
  File "/home/hangyu5/Documents/Git-repoMy/AIResearchVault/repo/LLMApp/Auto-GPT/autogpt/memory_management/summary_memory.py", line 76, in update_running_summary
    content_dict = json.loads(event["content"])
  File "/home/hangyu5/anaconda3/envs/autogpt/lib/python3.10/json/__init__.py", line 346, in loads
    return _default_decoder.decode(s)
  File "/home/hangyu5/anaconda3/envs/autogpt/lib/python3.10/json/decoder.py", line 337, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
  File "/home/hangyu5/anaconda3/envs/autogpt/lib/python3.10/json/decoder.py", line 353, in raw_decode
    obj, end = self.scan_once(s, idx)
json.decoder.JSONDecodeError: Expecting property name enclosed in double quotes: line 13 column 9 (char 913)

yhyu13 avatar May 09 '23 17:05 yhyu13

@ALL need help with this error, it is annoying, can't even make gpt read local file?!

yhyu13 avatar May 09 '23 17:05 yhyu13

Hey posting you need help after reporting an issue is not going to do much for anyone... I suggest looking through all the other similar issue posts and the DISCUSSIONS pages...

GoZippy avatar May 09 '23 21:05 GoZippy

I'm having a similar problem, program runs normally when I stop this error

XaviscoB avatar May 09 '23 22:05 XaviscoB

I get this error all the time, tried several different python versions, but it seems that there is some hallucination from gpt 3.5 that creates bad JSON, then the program crashes with that error, or similar with json.decoder.JSONDecodeError getting pissed off.

suparious avatar May 09 '23 23:05 suparious

guys - have any of you searched the current and all issues for this? A quick search shows lots of threads on this same topic... no need to add new issues... look at the different ways and work arounds that are already posted...

GoZippy avatar May 10 '23 01:05 GoZippy

guys - have any of you searched the current and all issues for this? A quick search shows lots of threads on this same topic... no need to add new issues... look at the different ways and work arounds that are already posted...

Yep, but none is solved? https://github.com/Significant-Gravitas/Auto-GPT/issues/21

yhyu13 avatar May 10 '23 05:05 yhyu13

Microsoft/Github probably need an AI to automatically reply issue/bug repot/erro with best fitting history answers, so that we do have to repetivively search issues/discussions all the time!!!

yhyu13 avatar May 10 '23 05:05 yhyu13

I have tried this several times now, and every time it stops and crashes with this JSON error. Will there be an update that fixes this problem?

HGWebdesign avatar May 10 '23 17:05 HGWebdesign

Duplicate of the various JSONDecodeError bugs coming from summary_memory.py. Marking as duplicate of https://github.com/Significant-Gravitas/Auto-GPT/issues/3716

See: https://github.com/anonhostpi/AUTOGPT.TRACKERS/blob/main/TOPICS/0017.BUGS/JSON.md

anonhostpi avatar May 12 '23 07:05 anonhostpi

Possibly fixed in Fixed with in #3996

suparious avatar May 13 '23 03:05 suparious