AutoGPT icon indicating copy to clipboard operation
AutoGPT copied to clipboard

crash at a simple ls command

Open ram-sh opened this issue 2 years ago • 6 comments
trafficstars

⚠️ 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?

Windows

Which version of Auto-GPT are you using?

Latest Release

GPT-3 or GPT-4?

GPT-3.5

Steps to reproduce 🕹

when app tried to COMMAND = execute_shell ARGUMENTS = {'command_line': 'ls ecc_sha256.py'} it just crashed...

Current behavior 😯

No response

Expected behavior 🤔

No response

Your prompt 📝

# Paste your prompt here

Your Logs 📒

NEXT ACTION:  COMMAND = execute_shell ARGUMENTS = {'command_line': 'ls ecc_sha256.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 -=-=-=-=-=-=-= 
  Executing command 'ls ecc_sha256.py' in working directory '/workspace/Auto-GPT/autogpt/auto_gpt_workspace'
SYSTEM:  Command execute_shell returned: STDOUT: b'' STDERR: b"ls: cannot access 'ecc_sha256.py': No such file or directory\n"
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 "/workspace/Auto-GPT/autogpt/__main__.py", line 5, in <module>
    autogpt.cli.main()
  File "/home/vscode/.local/lib/python3.10/site-packages/click/core.py", line 1130, in __call__
    return self.main(*args, **kwargs)
  File "/home/vscode/.local/lib/python3.10/site-packages/click/core.py", line 1055, in main
    rv = self.invoke(ctx)
  File "/home/vscode/.local/lib/python3.10/site-packages/click/core.py", line 1635, in invoke
    rv = super().invoke(ctx)
  File "/home/vscode/.local/lib/python3.10/site-packages/click/core.py", line 1404, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/home/vscode/.local/lib/python3.10/site-packages/click/core.py", line 760, in invoke
    return __callback(*args, **kwargs)
  File "/home/vscode/.local/lib/python3.10/site-packages/click/decorators.py", line 26, in new_func
    return f(get_current_context(), *args, **kwargs)
  File "/workspace/Auto-GPT/autogpt/cli.py", line 90, in main
    run_auto_gpt(
  File "/workspace/Auto-GPT/autogpt/main.py", line 171, in run_auto_gpt
    agent.start_interaction_loop()
  File "/workspace/Auto-GPT/autogpt/agent/agent.py", line 94, in start_interaction_loop
    assistant_reply = chat_with_ai(
  File "/workspace/Auto-GPT/autogpt/llm/chat.py", line 166, in chat_with_ai
    agent.summary_memory = update_running_summary(
  File "/workspace/Auto-GPT/autogpt/memory_management/summary_memory.py", line 76, 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 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...

ram-sh avatar May 15 '23 07:05 ram-sh

The error message you received indicates that the file ecc_sha256.py does not exist in the specified directory /workspace/Auto-GPT/autogpt/auto_gpt_workspace. To fix this error, you can try one of the following options:

  • Check if the file ecc_sha256.py exists in a different directory and update the command with the correct path to the file.
  • If the file does not exist, you may need to create it or obtain it from another source.
  • If the file is not required for your task, you can update your command or script to exclude it. I hope this helps! Is there anything else you would like to know?

dewasahu2003 avatar May 15 '23 10:05 dewasahu2003

the root of the error is fully understood, the problem is that the file isn't there since AutoGPT hasn't created it yet, the ls command returns an empty JSON that crashes the system, AutoGPT should deal with that simple case ...

ram-sh avatar May 15 '23 10:05 ram-sh

the root of the error is fully understood, the problem is that the file isn't there since AutoGPT hasn't created it yet, the ls command returns an empty JSON that crashes the system, AutoGPT should deal with that simple case ...

@ram-sh I was getting a similar issue when trying to run AutoGPT using Windows CMD.

I stopped using CMD and switched to using VS Code with Dev Containers, and it works for me that way.

If you're using CMD, I suggest downloading VS Code as well as Docker, and try running it that way instead. I've had far less issues.

VS Code Download: https://code.visualstudio.com/ Docker Download: https://www.docker.com/products/docker-desktop/ Dev Containers Download: https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.remote-containers

Open up VS Code, navigate to the AutoGPT folder as your workspace, and it should auto detect the devcontainer file and ask if you want to run in a dev container. Click Yes, it will take a few mins to load. One it loads, go to Terminal tab at the top to open new terminal, and then try giving it a go running commands from the terminal window.

ZylerKade avatar May 15 '23 13:05 ZylerKade

@ZylerKade thanks much for your reply!

I'm using the same setup as you, VScode, Docker container, latest release 0.3, the error I got is using that setup.

ram-sh avatar May 15 '23 13:05 ram-sh

@ram-sh Just did a bit of digging. Looks like they may have just released a new stable version (v0.3.1) about an hour ago that includes a resolution to this issue.

If you're not already using the new stable, I suggest downloading it and trying again.

Hope it works!

ZylerKade avatar May 15 '23 13:05 ZylerKade

@ram-sh Just did a bit of digging. Looks like they may have just released a new stable version (v0.3.1) about an hour ago that includes a resolution to this issue.

If you're not already using the new stable, I suggest downloading it and trying again.

Hope it works!

awesome, will update my code now, thx mate!

ram-sh avatar May 15 '23 13:05 ram-sh

Closing issue based on comment: https://github.com/Significant-Gravitas/Auto-GPT/issues/4216#issuecomment-1547875303

Please reopen or open a new issue if this is still a problem.

lc0rp avatar Jun 12 '23 18:06 lc0rp