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

ConfigFormatError #306

Closed
5 tasks done
PierrunoYT opened this issue May 3, 2024 · 9 comments
Closed
5 tasks done

ConfigFormatError #306

PierrunoYT opened this issue May 3, 2024 · 9 comments

Comments

@PierrunoYT
Copy link

PierrunoYT commented May 3, 2024

Describe the bug

I'm not really sure

Steps/commands/code to Reproduce

Use Codespaces and run the command in the readme

Error message/results

Traceback (most recent call last):
  File "/opt/conda/lib/python3.11/site-packages/config/init.py", line 803, in load
    items = p.container()
            ^^^^^^^^^^^^^
  File "/opt/conda/lib/python3.11/site-packages/config/parser.py", line 292, in container
    result = self.mappingbody()
             ^^^^^^^^^^^^^^^^^^^
  File "/opt/conda/lib/python3.11/site-packages/config/parser.py", line 195, in mappingbody
    raise pe
config.parser.ParserError: Unexpected identifier at (3, 21)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/workspaces/SWE-agent/run.py", line 492, in <module>
    main(getargs())
  File "/workspaces/SWE-agent/run.py", line 488, in main
    Main(args).main()
    ^^^^^^^^^^
  File "/workspaces/SWE-agent/run.py", line 289, in init
    self.agent = Agent("primary", args.agent)
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/workspaces/SWE-agent/sweagent/agent/agents.py", line 253, in init
    self.model = getmodel(
                 ^^^^^^^^^^
  File "/workspaces/SWE-agent/sweagent/agent/models.py", line 846, in getmodel
    return OpenAIModel(args, commands)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/workspaces/SWE-agent/sweagent/agent/models.py", line 228, in init
    cfg = config.Config(os.path.join(os.getcwd(), "keys.cfg"))
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/conda/lib/python3.11/site-packages/config/init.py", line 707, in _init
    self.load_file(stream_or_path, kwargs.get('encoding'))
  File "/opt/conda/lib/python3.11/site-packages/config/__init.py", line 816, in load_file
    self.load(f)
  File "/opt/conda/lib/python3.11/site-packages/config/__init.py", line 807, in load
    raise cfe
config.ConfigFormatError: Unexpected identifier at (3, 21)

System Information

Windows 11 Pro

Checklist

  • I'm running with the latest docker container/on the latest development version
  • I've searched the other issues for a duplicate
  • I have copied the full command/code that I ran
  • I have copied the full log file/error message that was the result (if applicable)
  • I have enclosed code/log messages in triple backticks (docs) and clicked "Preview" to make sure it's displayed correctly.
@klieret klieret changed the title Unknown Issue when running on Codespaces ConfigFormatError May 3, 2024
@klieret
Copy link
Member

klieret commented May 3, 2024

Could you show me how your keys.cfg looks?

Warning

Please replace your keys with some random text so they don't get stolen

@PierrunoYT
Copy link
Author

grafik

@PierrunoYT
Copy link
Author

I think the ' was missing

@PierrunoYT
Copy link
Author

PierrunoYT commented May 3, 2024

Now I get this

Traceback (most recent call last):
  File "/opt/conda/lib/python3.11/site-packages/urllib3/connectionpool.py", line 790, in urlopen
    response = self._make_request(
               ^^^^^^^^^^^^^^^^^^^
  File "/opt/conda/lib/python3.11/site-packages/urllib3/connectionpool.py", line 496, in _make_request
    conn.request(
  File "/opt/conda/lib/python3.11/site-packages/urllib3/connection.py", line 395, in request
    self.endheaders()
  File "/opt/conda/lib/python3.11/http/client.py", line 1289, in endheaders
    self._send_output(message_body, encode_chunked=encode_chunked)
  File "/opt/conda/lib/python3.11/http/client.py", line 1048, in _send_output
    self.send(msg)
  File "/opt/conda/lib/python3.11/http/client.py", line 986, in send
    self.connect()
  File "/opt/conda/lib/python3.11/site-packages/docker/transport/unixconn.py", line 27, in connect
    sock.connect(self.unix_socket)
PermissionError: [Errno 13] Permission denied

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/opt/conda/lib/python3.11/site-packages/requests/adapters.py", line 486, in send
    resp = conn.urlopen(
           ^^^^^^^^^^^^^
  File "/opt/conda/lib/python3.11/site-packages/urllib3/connectionpool.py", line 844, in urlopen
    retries = retries.increment(
              ^^^^^^^^^^^^^^^^^^
  File "/opt/conda/lib/python3.11/site-packages/urllib3/util/retry.py", line 470, in increment
    raise reraise(type(error), error, _stacktrace)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/conda/lib/python3.11/site-packages/urllib3/util/util.py", line 38, in reraise
    raise value.with_traceback(tb)
  File "/opt/conda/lib/python3.11/site-packages/urllib3/connectionpool.py", line 790, in urlopen
    response = self._make_request(
               ^^^^^^^^^^^^^^^^^^^
  File "/opt/conda/lib/python3.11/site-packages/urllib3/connectionpool.py", line 496, in _make_request
    conn.request(
  File "/opt/conda/lib/python3.11/site-packages/urllib3/connection.py", line 395, in request
    self.endheaders()
  File "/opt/conda/lib/python3.11/http/client.py", line 1289, in endheaders
    self._send_output(message_body, encode_chunked=encode_chunked)
  File "/opt/conda/lib/python3.11/http/client.py", line 1048, in _send_output
    self.send(msg)
  File "/opt/conda/lib/python3.11/http/client.py", line 986, in send
    self.connect()
  File "/opt/conda/lib/python3.11/site-packages/docker/transport/unixconn.py", line 27, in connect
    sock.connect(self.unix_socket)
urllib3.exceptions.ProtocolError: ('Connection aborted.', PermissionError(13, 'Permission denied'))

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/opt/conda/lib/python3.11/site-packages/docker/api/client.py", line 213, in _retrieve_server_version
    return self.version(api_version=False)["ApiVersion"]
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/conda/lib/python3.11/site-packages/docker/api/daemon.py", line 181, in version
    return self._result(self._get(url), json=True)
                        ^^^^^^^^^^^^^^
  File "/opt/conda/lib/python3.11/site-packages/docker/utils/decorators.py", line 44, in inner
    return f(self, *args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/conda/lib/python3.11/site-packages/docker/api/client.py", line 236, in _get
    return self.get(url, **self._set_request_timeout(kwargs))
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/conda/lib/python3.11/site-packages/requests/sessions.py", line 602, in get
    return self.request("GET", url, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/conda/lib/python3.11/site-packages/requests/sessions.py", line 589, in request
    resp = self.send(prep, **send_kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/conda/lib/python3.11/site-packages/requests/sessions.py", line 703, in send
    r = adapter.send(request, **kwargs)
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/conda/lib/python3.11/site-packages/requests/adapters.py", line 501, in send
    raise ConnectionError(err, request=request)
requests.exceptions.ConnectionError: ('Connection aborted.', PermissionError(13, 'Permission denied'))

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/workspaces/SWE-agent/sweagent/environment/utils.py", line 354, in get_container
    client = docker.from_env()
             ^^^^^^^^^^^^^^^^^
  File "/opt/conda/lib/python3.11/site-packages/docker/client.py", line 94, in from_env
    return cls(
           ^^^^
  File "/opt/conda/lib/python3.11/site-packages/docker/client.py", line 45, in __init__
    self.api = APIClient(*args, **kwargs)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/conda/lib/python3.11/site-packages/docker/api/client.py", line 197, in __init__
    self._version = self._retrieve_server_version()
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/conda/lib/python3.11/site-packages/docker/api/client.py", line 220, in _retrieve_server_version
    raise DockerException(
docker.errors.DockerException: Error while fetching server API version: ('Connection aborted.', PermissionError(13, 'Permission denied'))

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/workspaces/SWE-agent/run.py", line 492, in <module>
    main(get_args())
  File "/workspaces/SWE-agent/run.py", line 488, in main
    Main(args).main()
    ^^^^^^^^^^
  File "/workspaces/SWE-agent/run.py", line 290, in __init__
    self.env = SWEEnv(args.environment)
               ^^^^^^^^^^^^^^^^^^^^^^^^
  File "/workspaces/SWE-agent/sweagent/environment/swe_env.py", line 136, in __init__
    self._reset_container()
  File "/workspaces/SWE-agent/sweagent/environment/swe_env.py", line 414, in _reset_container
    self._init_container()
  File "/workspaces/SWE-agent/sweagent/environment/swe_env.py", line 437, in _init_container
    self.container, self.parent_pids = get_container(
                                       ^^^^^^^^^^^^^^
  File "/workspaces/SWE-agent/sweagent/environment/utils.py", line 369, in get_container
    raise RuntimeError(msg) from e
RuntimeError: Probably the Docker daemon is not running. Please start the Docker daemon and try again. You might need to allow the use of the docker socket (https://github.com/princeton-nlp/SWE-agent/issues/159) or symlink the socket if it's at a non-standard location (https://github.com/princeton-nlp/SWE-agent/issues/20#issuecomment-2047506005).
@PierrunoYT ➜ /workspaces/SWE-agent (main) $ 

@klieret
Copy link
Member

klieret commented May 3, 2024

Could you try rebuilding the container? Hit Ctrl Shift P and

image

@PierrunoYT
Copy link
Author

Let me try

@PierrunoYT
Copy link
Author

Could you try rebuilding the container? Hit Ctrl Shift P and
image

Do I need to use the Github Token to create a Pull Request?

@PierrunoYT
Copy link
Author

PierrunoYT commented May 3, 2024

I tried it out now I get this

         (Current directory: /OpenDevin__OpenDevin)                                                                                                                                                                                                                            
         bash-$                                                                                                                                                                                                                                                                
2024-05-03 19:25:02,829 - openai._base_client - INFO - Retrying request to /chat/completions in 0.849225 seconds
2024-05-03 19:25:03,679 - openai._base_client - INFO - Retrying request to /chat/completions in 1.987373 seconds
2024-05-03 19:25:06,405 - openai._base_client - INFO - Retrying request to /chat/completions in 0.969970 seconds
2024-05-03 19:25:07,375 - openai._base_client - INFO - Retrying request to /chat/completions in 1.987327 seconds
2024-05-03 19:25:10,579 - openai._base_client - INFO - Retrying request to /chat/completions in 0.856825 seconds
2024-05-03 19:25:11,437 - openai._base_client - INFO - Retrying request to /chat/completions in 1.659597 seconds
Traceback (most recent call last):
  File "/opt/conda/lib/python3.11/site-packages/httpx/_transports/default.py", line 69, in map_httpcore_exceptions
    yield
  File "/opt/conda/lib/python3.11/site-packages/httpx/_transports/default.py", line 233, in handle_request
    resp = self._pool.handle_request(req)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/conda/lib/python3.11/site-packages/httpcore/_sync/connection_pool.py", line 167, in handle_request
    raise UnsupportedProtocol(
httpcore.UnsupportedProtocol: Request URL is missing an 'http://' or 'https://' protocol.

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/opt/conda/lib/python3.11/site-packages/openai/_base_client.py", line 952, in _request
    response = self._client.send(
               ^^^^^^^^^^^^^^^^^^
  File "/opt/conda/lib/python3.11/site-packages/httpx/_client.py", line 914, in send
    response = self._send_handling_auth(
               ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/conda/lib/python3.11/site-packages/httpx/_client.py", line 942, in _send_handling_auth
    response = self._send_handling_redirects(
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/conda/lib/python3.11/site-packages/httpx/_client.py", line 979, in _send_handling_redirects
    response = self._send_single_request(request)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/conda/lib/python3.11/site-packages/httpx/_client.py", line 1015, in _send_single_request
    response = transport.handle_request(request)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/conda/lib/python3.11/site-packages/httpx/_transports/default.py", line 232, in handle_request
    with map_httpcore_exceptions():
  File "/opt/conda/lib/python3.11/contextlib.py", line 158, in __exit__
    self.gen.throw(typ, value, traceback)
  File "/opt/conda/lib/python3.11/site-packages/httpx/_transports/default.py", line 86, in map_httpcore_exceptions
    raise mapped_exc(message) from exc
httpx.UnsupportedProtocol: Request URL is missing an 'http://' or 'https://' protocol.

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/opt/conda/lib/python3.11/site-packages/httpx/_transports/default.py", line 69, in map_httpcore_exceptions
    yield
  File "/opt/conda/lib/python3.11/site-packages/httpx/_transports/default.py", line 233, in handle_request
    resp = self._pool.handle_request(req)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/conda/lib/python3.11/site-packages/httpcore/_sync/connection_pool.py", line 167, in handle_request
    raise UnsupportedProtocol(
httpcore.UnsupportedProtocol: Request URL is missing an 'http://' or 'https://' protocol.

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/opt/conda/lib/python3.11/site-packages/openai/_base_client.py", line 952, in _request
    response = self._client.send(
               ^^^^^^^^^^^^^^^^^^
  File "/opt/conda/lib/python3.11/site-packages/httpx/_client.py", line 914, in send
    response = self._send_handling_auth(
               ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/conda/lib/python3.11/site-packages/httpx/_client.py", line 942, in _send_handling_auth
    response = self._send_handling_redirects(
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/conda/lib/python3.11/site-packages/httpx/_client.py", line 979, in _send_handling_redirects
    response = self._send_single_request(request)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/conda/lib/python3.11/site-packages/httpx/_client.py", line 1015, in _send_single_request
    response = transport.handle_request(request)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/conda/lib/python3.11/site-packages/httpx/_transports/default.py", line 232, in handle_request
    with map_httpcore_exceptions():
  File "/opt/conda/lib/python3.11/contextlib.py", line 158, in __exit__
    self.gen.throw(typ, value, traceback)
  File "/opt/conda/lib/python3.11/site-packages/httpx/_transports/default.py", line 86, in map_httpcore_exceptions
    raise mapped_exc(message) from exc
httpx.UnsupportedProtocol: Request URL is missing an 'http://' or 'https://' protocol.

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/opt/conda/lib/python3.11/site-packages/httpx/_transports/default.py", line 69, in map_httpcore_exceptions
    yield
  File "/opt/conda/lib/python3.11/site-packages/httpx/_transports/default.py", line 233, in handle_request
    resp = self._pool.handle_request(req)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/conda/lib/python3.11/site-packages/httpcore/_sync/connection_pool.py", line 167, in handle_request
    raise UnsupportedProtocol(
httpcore.UnsupportedProtocol: Request URL is missing an 'http://' or 'https://' protocol.

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/opt/conda/lib/python3.11/site-packages/openai/_base_client.py", line 952, in _request
    response = self._client.send(
               ^^^^^^^^^^^^^^^^^^
  File "/opt/conda/lib/python3.11/site-packages/httpx/_client.py", line 914, in send
    response = self._send_handling_auth(
               ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/conda/lib/python3.11/site-packages/httpx/_client.py", line 942, in _send_handling_auth
    response = self._send_handling_redirects(
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/conda/lib/python3.11/site-packages/httpx/_client.py", line 979, in _send_handling_redirects
    response = self._send_single_request(request)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/conda/lib/python3.11/site-packages/httpx/_client.py", line 1015, in _send_single_request
    response = transport.handle_request(request)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/conda/lib/python3.11/site-packages/httpx/_transports/default.py", line 232, in handle_request
    with map_httpcore_exceptions():
  File "/opt/conda/lib/python3.11/contextlib.py", line 158, in __exit__
    self.gen.throw(typ, value, traceback)
  File "/opt/conda/lib/python3.11/site-packages/httpx/_transports/default.py", line 86, in map_httpcore_exceptions
    raise mapped_exc(message) from exc
httpx.UnsupportedProtocol: Request URL is missing an 'http://' or 'https://' protocol.

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/workspaces/SWE-agent/run.py", line 363, in main
    self.run(index)
  File "/workspaces/SWE-agent/run.py", line 347, in run
    info, trajectory = self.agent.run(
                       ^^^^^^^^^^^^^^^
  File "/workspaces/SWE-agent/sweagent/agent/agents.py", line 814, in run
    thought, action, output = self.forward(
                              ^^^^^^^^^^^^^
  File "/workspaces/SWE-agent/sweagent/agent/agents.py", line 509, in forward
    thought, action, output = self.forward_with_error_check(observation, state)
                              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/workspaces/SWE-agent/sweagent/agent/agents.py", line 663, in forward_with_error_check
    output = self.forward_model(observation, state)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/workspaces/SWE-agent/sweagent/agent/agents.py", line 571, in forward_model
    return self.model.query(self.local_history)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/conda/lib/python3.11/site-packages/tenacity/__init__.py", line 289, in wrapped_f
    return self(f, *args, **kw)
           ^^^^^^^^^^^^^^^^^^^^
  File "/opt/conda/lib/python3.11/site-packages/tenacity/__init__.py", line 379, in __call__
    do = self.iter(retry_state=retry_state)
         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/conda/lib/python3.11/site-packages/tenacity/__init__.py", line 325, in iter
    raise retry_exc.reraise()
          ^^^^^^^^^^^^^^^^^^^
  File "/opt/conda/lib/python3.11/site-packages/tenacity/__init__.py", line 158, in reraise
    raise self.last_attempt.result()
          ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/conda/lib/python3.11/concurrent/futures/_base.py", line 449, in result
    return self.__get_result()
           ^^^^^^^^^^^^^^^^^^^
  File "/opt/conda/lib/python3.11/concurrent/futures/_base.py", line 401, in __get_result
    raise self._exception
  File "/opt/conda/lib/python3.11/site-packages/tenacity/__init__.py", line 382, in __call__
    result = fn(*args, **kwargs)
             ^^^^^^^^^^^^^^^^^^^
  File "/workspaces/SWE-agent/sweagent/agent/models.py", line 264, in query
    response = self.client.chat.completions.create(
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/conda/lib/python3.11/site-packages/openai/_utils/_utils.py", line 277, in wrapper
    return func(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^
  File "/opt/conda/lib/python3.11/site-packages/openai/resources/chat/completions.py", line 579, in create
    return self._post(
           ^^^^^^^^^^^
  File "/opt/conda/lib/python3.11/site-packages/openai/_base_client.py", line 1240, in post
    return cast(ResponseT, self.request(cast_to, opts, stream=stream, stream_cls=stream_cls))
                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/conda/lib/python3.11/site-packages/openai/_base_client.py", line 921, in request
    return self._request(
           ^^^^^^^^^^^^^^
  File "/opt/conda/lib/python3.11/site-packages/openai/_base_client.py", line 976, in _request
    return self._retry_request(
           ^^^^^^^^^^^^^^^^^^^^
  File "/opt/conda/lib/python3.11/site-packages/openai/_base_client.py", line 1053, in _retry_request
    return self._request(
           ^^^^^^^^^^^^^^
  File "/opt/conda/lib/python3.11/site-packages/openai/_base_client.py", line 976, in _request
    return self._retry_request(
           ^^^^^^^^^^^^^^^^^^^^
  File "/opt/conda/lib/python3.11/site-packages/openai/_base_client.py", line 1053, in _retry_request
    return self._request(
           ^^^^^^^^^^^^^^
  File "/opt/conda/lib/python3.11/site-packages/openai/_base_client.py", line 986, in _request
    raise APIConnectionError(request=request) from err
openai.APIConnectionError: Connection error.
WARNING  ❌ Failed on OpenDevin__OpenDevin-i411: Connection error.                                                                                                                                                                                                             
INFO     Beginning environment shutdown...                                                                                                                                                                                                                                     
INFO     Agent container stopped      

@klieret
Copy link
Member

klieret commented May 3, 2024

Sounds like swe-agent is running and you ran into a different issue with a malformated URL (--data_path, I presume). You can open a new issue with the full command etc.

@klieret klieret closed this as completed May 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants