Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Results are not written to a file (disappointing ongoing issue) #3583

Closed
1 task done
concenit opened this issue Apr 30, 2023 · 10 comments
Closed
1 task done

Results are not written to a file (disappointing ongoing issue) #3583

concenit opened this issue Apr 30, 2023 · 10 comments

Comments

@concenit
Copy link

⚠️ Search for existing issues first ⚠️

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

Which Operating System are you using?

Windows

Which version of Auto-GPT are you using?

Latest Release

GPT-3 or GPT-4?

GPT-3.5

Steps to reproduce 🕹

Ask Auto-GPT to perform a task and write to results to a file. The program performs the task perfectly, but doesn’t provide a file containing the results (although it reports that it has done so).

Current behavior 😯

  1. Auto-GPT warns “Warning: The file 'auto-gpt.json' does not exist. Local memory would not be saved to a file.”
  2. Auto-GPT reports writing to a file, but the file can’t be found anywhere

Expected behavior 🤔

Write the results to a file

Your prompt 📝

Write to a file the name of the capital of the state of Montana

Your Logs 📒

<insert your logs here>
@concenit
Copy link
Author

concenit commented Apr 30, 2023

Symptoms:
Auto-GPT performs the task perfectly, but doesn’t provide a file containing the results.

  1. Auto-GPT warns “Warning: The file 'auto-gpt.json' does not exist. Local memory would not be saved to a file.”
  2. Auto-GPT reports writing to a file, but the file can’t be found anywhere

Attempted resolutions:
• Created an empty file called “AutoGpt.json” (size: 0K); and then tried a nonempty file (size:1K)
• Reinstalled Docker (4.19.0) and Git (2.40.1-64-bit)
• Upgraded Python from 3.10.10-amd64 to 3.11.3-amd64
• Installed Auto-GPT (0.2.2) in a new folder to address any permission issues
• Created a folder under “auto-gpt” called “auto_gpt_workspace”. This folder isn’t created automatically, which could be part of the problem
• Added to .env these lines. There’s no “#” before any of them:
o OPENAI_API_KEY=[full API key]
o EXECUTE_LOCAL_COMMANDS=true
o RESTRICT_TO_WORKSPACE=false

Examined similar bug reports, including
#2552
#2563
#959
#1889
#411

@amokduke
Copy link
Contributor

Maybe you can try again with:
o EXECUTE_LOCAL_COMMANDS=false
o RESTRICT_TO_WORKSPACE=true

See if the file is written to the folder " auto_gpt_workspace folder"

@concenit
Copy link
Author

Thanks for the suggestion, @amokduke! These are the default settings, if I remember right. If so, I already tested them.

By the way, is the folder auto_gpt_workspace supposed to be created by the user? Because the program didn't create it...

@gpt-hacker
Copy link

Auto-GPT warns “Warning: The file 'auto-gpt.json' does not exist. Local memory would not be saved to a file.”

Looks like you're using Docker? If so, this worked for me:

  1. create auto-gpt.json in project root.
  2. mount auto-gpt.json with docker run command; e.g.:

docker run -it --env-file=./.env -v $PWD/auto_gpt_workspace:/app/auto_gpt_workspace -v $PWD/auto-gpt.json:/home/appuser/auto-gpt.json autogpt

With this approach, the warning goes away and the file is written to outside of Docker as expected.

@gpt-hacker
Copy link

Auto-GPT reports writing to a file, but the file can’t be found anywhere.

I'm also running into this problem. I've confirmed that writing to the workspace within Docker yields the expected result, so I know it isn't a problem with my use of Docker.

@concenit
Copy link
Author

concenit commented May 3, 2023

Thanks for the suggestion, @gpt-hacker (true to your name!)

  1. We already created an empty file called “AutoGpt.json” (size: 0K); and then tried a nonempty file (size:1K). The file is located in the Auto-GPT folder in Windows.
  2. The command you suggested creates two new subfolders "auto_gpt_workspace" and "auto-gpt.json" (a folder, not a file). But the process terminates with an error

Unable to find image 'autogpt:latest' locally
docker: Error response from daemon: pull access denied for autogpt, repository does not exist or may require 'docker login': denied: requested access to the resource is denied.

What do we need to do to run Auto-GPT in Docker?

@mAlaliSy
Copy link

mAlaliSy commented May 5, 2023

I am using docker-compose and followed the installation guide in the documentation, but it has a wrong mount path of AutoGPT workspace volume

In Docs:
- ./auto_gpt_workspace:/app/auto_gpt_workspace

What path I saw in the logs:
/app/autogpt/auto_gpt_workspace

After changing the docker-compose volume, it worked

@Boostrix
Copy link
Contributor

Boostrix commented May 5, 2023

the docs/website are way out of date by now, I also didn't find those very useful TBH - probably, these should be updated, too - at the very least by copying info from this discussion

EDIT: Saw auto-gpt.json missing today for the first time, too - haven't looked at the code in question, but just touching/creating the file solved the problem for me (and it is being used). So probably we need a simple fix that creates the file if it's missing. Might be related to #1246 and #3034

@amourification
Copy link

Related error on Windows using GIT and Linux:

Command write_to_file returned: Error: write_to_file() got an unexpected keyword argument 'content'
Traceback (most recent call last):
File "/usr/lib/python3.10/runpy.py", line 196, in _run_module_as_main
return _run_code(code, main_globals, None,
File "/usr/lib/python3.10/runpy.py", line 86, in _run_code
exec(code, run_globals)
File "/home/amour/Auto-GPT/autogpt/main.py", line 5, in
autogpt.cli.main()
File "/home/amour/.local/lib/python3.10/site-packages/click/core.py", line 1130, in call
return self.main(*args, **kwargs)
File "/home/amour/.local/lib/python3.10/site-packages/click/core.py", line 1055, in main
rv = self.invoke(ctx)
File "/home/amour/.local/lib/python3.10/site-packages/click/core.py", line 1635, in invoke
rv = super().invoke(ctx)
File "/home/amour/.local/lib/python3.10/site-packages/click/core.py", line 1404, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "/home/amour/.local/lib/python3.10/site-packages/click/core.py", line 760, in invoke
return __callback(*args, **kwargs)
File "/home/amour/.local/lib/python3.10/site-packages/click/decorators.py", line 26, in new_func
return f(get_current_context(), *args, **kwargs)
File "/home/amour/Auto-GPT/autogpt/cli.py", line 90, in main
run_auto_gpt(
File "/home/amour/Auto-GPT/autogpt/main.py", line 171, in run_auto_gpt
agent.start_interaction_loop()
File "/home/amour/Auto-GPT/autogpt/agent/agent.py", line 94, in start_interaction_loop
assistant_reply = chat_with_ai(
File "/home/amour/Auto-GPT/autogpt/llm/chat.py", line 166, in chat_with_ai
agent.summary_memory = update_running_summary(
File "/home/amour/Auto-GPT/autogpt/memory_management/summary_memory.py", line 76, in update_running_summary
content_dict = json.loads(event["content"])
File "/usr/lib/python3.10/json/init.py", line 346, in loads
return _default_decoder.decode(s)
File "/usr/lib/python3.10/json/decoder.py", line 337, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
File "/usr/lib/python3.10/json/decoder.py", line 355, in raw_decode
raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
Press any key to continue...

@concenit
Copy link
Author

concenit commented May 7, 2023

Thanks to @Boostrix comment, I solved the problem. Yes, the documentation is out-of-date. Thanks a lot!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

7 participants