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

Bug report #31

Open
yongduosui opened this issue Dec 4, 2024 · 13 comments
Open

Bug report #31

yongduosui opened this issue Dec 4, 2024 · 13 comments

Comments

@yongduosui
Copy link

For runing Spider-Agent on Spider 2.0 dataset, I follow your instructions and run the following commands:

cd ../../methods/spider-agent
export OPENAI_API_KEY=your_openai_api_key
python run.py --model gpt-4o -s test1

I meet the following issues:

Warning: ../../spider2/examples/postgres_chinook001 is neither a file nor a directory.
Traceback (most recent call last):
  File "run.py", line 248, in <module>
    test(args)
  File "run.py", line 207, in test
    env = Spider_Agent_Env(
  File "/data/home/yongduosui/data/02-Spider2/03-Spider2/Spider2/methods/spider-agent/spider_agent/envs/spider_agent.py", line 82, in __init__
    self.setup_controller.setup(self.config)
  File "/data/home/yongduosui/data/02-Spider2/03-Spider2/Spider2/methods/spider-agent/spider_agent/controllers/setup.py", line 55, in setup
    config_function(self, **parameters)
  File "/data/home/yongduosui/data/02-Spider2/03-Spider2/Spider2/methods/spider-agent/spider_agent/configs/general.py", line 119, in copy_all_subfiles_postgres_setup
    sh_file_path = sh_files[0]
IndexError: list index out of range
@lfy79001
Copy link
Collaborator

lfy79001 commented Dec 4, 2024

Hi,

You can use python run.py --model gpt-4o -s test1 --bq_only --sf_only --local_only to exclude postgres examples, I will fix the bug asap.

And you might need to finish the setup process. Have you finished python setup.py ?

The step4 and step5 in the setup

Thanks!

@yongduosui
Copy link
Author

Yes, I have already finished python setup.py Thanks for the super quick answer!

@yongduosui
Copy link
Author

There is another problem, when I execute the ch project, i.e. python run.py --model azure/gpt-4o -s test1 --ch_only, it will produce the following docker error, while other projects, such as bq, sf and other images have no problem.

[2024-12-05 11:13:00,769 INFO run/171-MainProcess] Running gpt-4o-test1/ch001
[2024-12-05 11:13:00,769 INFO spider_agent/74-MainProcess] Initializing...
[2024-12-05 11:13:01,207 INFO spider_agent/151-MainProcess] Failed to construct container from image spider_agent_clickhouse-image with error: 400 Client Error for http+docker://localhost/v1.45/containers/548e2f6ba6be94ea71958c77ceefca651dadf59544b7a900e53dee3c3720f8e7/start: Bad Request ("failed to create task for container: failed to create shim task: OCI runtime create failed: runc create failed: unable to start container process: exec: "./entrypoint.sh": stat ./entrypoint.sh: no such file or directory: unknown")
Traceback (most recent call last):
  File "/data/home/yongduosui/anaconda3/envs/spider/lib/python3.8/site-packages/docker/api/client.py", line 275, in _raise_for_status
    response.raise_for_status()
  File "/data/home/yongduosui/anaconda3/envs/spider/lib/python3.8/site-packages/requests/models.py", line 1024, in raise_for_status
    raise HTTPError(http_error_msg, response=self)
requests.exceptions.HTTPError: 400 Client Error: Bad Request for url: http+docker://localhost/v1.45/containers/548e2f6ba6be94ea71958c77ceefca651dadf59544b7a900e53dee3c3720f8e7/start

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

Traceback (most recent call last):
  File "run.py", line 248, in <module>
    test(args)
  File "run.py", line 207, in test
    env = Spider_Agent_Env(
  File "/data/home/yongduosui/data/02-Spider2/03-Spider2/Spider2/methods/spider-agent/spider_agent/envs/spider_agent.py", line 75, in __init__
    self._construct_container()
  File "/data/home/yongduosui/data/02-Spider2/03-Spider2/Spider2/methods/spider-agent/spider_agent/envs/spider_agent.py", line 152, in _construct_container
    raise e
  File "/data/home/yongduosui/data/02-Spider2/03-Spider2/Spider2/methods/spider-agent/spider_agent/envs/spider_agent.py", line 140, in _construct_container
    self.container: Container = client.containers.run(image=image, volumes=volumes, **extra_params)
  File "/data/home/yongduosui/anaconda3/envs/spider/lib/python3.8/site-packages/docker/models/containers.py", line 883, in run
    container.start()
  File "/data/home/yongduosui/anaconda3/envs/spider/lib/python3.8/site-packages/docker/models/containers.py", line 420, in start
    return self.client.api.start(self.id, **kwargs)
  File "/data/home/yongduosui/anaconda3/envs/spider/lib/python3.8/site-packages/docker/utils/decorators.py", line 19, in wrapped
    return f(self, resource_id, *args, **kwargs)
  File "/data/home/yongduosui/anaconda3/envs/spider/lib/python3.8/site-packages/docker/api/container.py", line 1136, in start
    self._raise_for_status(res)
  File "/data/home/yongduosui/anaconda3/envs/spider/lib/python3.8/site-packages/docker/api/client.py", line 277, in _raise_for_status
    raise create_api_error_from_http_exception(e) from e
  File "/data/home/yongduosui/anaconda3/envs/spider/lib/python3.8/site-packages/docker/errors.py", line 39, in create_api_error_from_http_exception
    raise cls(e, response=response, explanation=explanation) from e
docker.errors.APIError: 400 Client Error for http+docker://localhost/v1.45/containers/548e2f6ba6be94ea71958c77ceefca651dadf59544b7a900e53dee3c3720f8e7/start: Bad Request ("failed to create task for container: failed to create shim task: OCI runtime create failed: runc create failed: unable to start container process: exec: "./entrypoint.sh": stat ./entrypoint.sh: no such file or directory: unknown")

@phkhanhtrinh23
Copy link

I also have the same problem with @yongduosui. Can the authors show how to fix it? Thank you.

@lfy79001
Copy link
Collaborator

@phkhanhtrinh23 @yongduosui
Hi, please ensure that the ch_and_postgres_setup.zip file is placed in the ./spider2 directory, and then run python setup.py. I believe this will fix the IndexError: list index out of range issue.

@lfy79001
Copy link
Collaborator

@yongduosui
For docker issue, I have uploaded the new clickhouse docker config file.

If you are in mainland China, try this following file,

FROM python:3.11

WORKDIR /workspace

RUN cat /etc/os-release

RUN echo "deb https://mirrors.aliyun.com/debian/ bookworm main contrib non-free" > /etc/apt/sources.list.d/aliyun.list \
    && echo "deb-src https://mirrors.aliyun.com/debian/ bookworm main contrib non-free" >> /etc/apt/sources.list.d/aliyun.list \
    && echo "deb https://mirrors.aliyun.com/debian-security bookworm-security main contrib non-free" >> /etc/apt/sources.list.d/aliyun.list \
    && echo "deb-src https://mirrors.aliyun.com/debian-security bookworm-security main contrib non-free" >> /etc/apt/sources.list.d/aliyun.list \
    && echo "deb https://mirrors.aliyun.com/debian/ bookworm-updates main contrib non-free" >> /etc/apt/sources.list.d/aliyun.list \
    && echo "deb-src https://mirrors.aliyun.com/debian/ bookworm-updates main contrib non-free" >> /etc/apt/sources.list.d/aliyun.list \
    && apt-get update \
    && apt-get install --fix-missing -y \
        build-essential \
        libicu-dev \
        libreadline-dev \
        libltdl7 \
        libssl-dev \
        libpam0g \
        libpthread-stubs0-dev \
        libpoco-dev \
        libunwind8 \
        libunwind-dev \
        libboost-all-dev \
        libcrypto++-dev \
        zlib1g-dev \
        curl \
        net-tools \
    && apt-get clean \
    && rm -rf /var/lib/apt/lists/*

RUN pip install --upgrade pip \
    && pip install pyarrow db-dtypes pandas numpy scipy tabulate clickhouse_driver

WORKDIR /opt/clickhouse
RUN curl -s https://clickhouse.com/ | sh \
    && chmod +x ./clickhouse

WORKDIR /workspace

CMD ["sh", "-c", "cd /opt/clickhouse && exec ./clickhouse server"]

@phkhanhtrinh23
Copy link

@lfy79001 Actually I am now living outside of China, do I have to modify anything to run your updated Docker? Thank you.

@lfy79001
Copy link
Collaborator

I uploaded a new config file, just try it https://github.com/xlang-ai/Spider2/blob/main/methods/spider-agent/spider_agent/images/spider_agent_clickhouse-image/Dockerfile

@phkhanhtrinh23
Copy link

@lfy79001 Thank you for your quick response! The problem is now fixed and I can run it.

@lfy79001
Copy link
Collaborator

@phkhanhtrinh23 GREAT!

@phkhanhtrinh23
Copy link

phkhanhtrinh23 commented Dec 25, 2024

@lfy79001 It seems that your new Dockerfile requires me to pip install clickhouse but then the system returned ERROR: Could not find a version that satisfies the requirement izihawa-commons>=0.0.7 (from clickhouse) (from versions: none)

Maybe the package izihawa-commons is not public yet, right? I have upgraded pip but the problem is the same. Could you fix it?

Thank you.

[UPDATED]
This error is from the wrong answer of the spider agent and has nothing to do with this issue. You can skip it for now, and sorry for the inconvenience!

@lfy79001
Copy link
Collaborator

@phkhanhtrinh23 Could you show the command log or the bug details? I haven't encountered this bug.

@phkhanhtrinh23
Copy link

@lfy79001 Well, sorry for the inconvenience! I have figured out that this error was from the Chain-of-thought and Actions of the Spider Agent (I used Meta Llama). The language model returned the command pip install clickhouse so it got error. You can skip it for now. Thank you for your support!

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

3 participants