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

TypeError When Using Diagnosis function. #96

Open
IamWWT opened this issue Feb 3, 2024 · 3 comments
Open

TypeError When Using Diagnosis function. #96

IamWWT opened this issue Feb 3, 2024 · 3 comments

Comments

@IamWWT
Copy link

IamWWT commented Feb 3, 2024

run python startup.py -a and operate in webpage. The normal chat and knowledge chat is ok.
after upload the project's test file of test_cases/xx.json,click diagnosis,for a while, the error occur as following and。

`
ConfigurationExpert Diagnosis!

  • Analyzing with tools ...
    0%| | 0/12024-02-03 21:35:18,444 - _client.py[line:1027] - INFO: HTTP Request: POST http://127.0.0.1:8000/v1/chat/completions "HTTP/1.1 200 OK"
    100%|█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 1/1
    Traceback (most recent call last):
    File "/home/hhw/Downloads/aigc/proj/gpt/TsinghuaDatabaseGroup_DB-GPT/dbgpt0203/run_diagnose.py", line 90, in
    asyncio.run(main(args))
    File "/home/hhw/anaconda3/envs/dbgpt/lib/python3.10/asyncio/runners.py", line 44, in run
    return loop.run_until_complete(main)
    File "/home/hhw/anaconda3/envs/dbgpt/lib/python3.10/asyncio/base_events.py", line 649, in run_until_complete
    return future.result()
    File "/home/hhw/Downloads/aigc/proj/gpt/TsinghuaDatabaseGroup_DB-GPT/dbgpt0203/run_diagnose.py", line 31, in main
    report, records = await multi_agents.run(args)
    File "/home/hhw/Downloads/aigc/proj/gpt/TsinghuaDatabaseGroup_DB-GPT/dbgpt0203/multiagents/multiagents.py", line 138, in run
    report, records = await self.environment.step(args)
    File "/home/hhw/Downloads/aigc/proj/gpt/TsinghuaDatabaseGroup_DB-GPT/dbgpt0203/multiagents/environments/dba.py", line 278, in step
    report = await self.decision_making(selected_experts, None, previous_plan, advice) # plans: the list of diagnosis messages
    File "/home/hhw/Downloads/aigc/proj/gpt/TsinghuaDatabaseGroup_DB-GPT/dbgpt0203/multiagents/environments/dba.py", line 358, in decision_making
    initial_diags = await self.decision_maker.astep(
    File "/home/hhw/Downloads/aigc/proj/gpt/TsinghuaDatabaseGroup_DB-GPT/dbgpt0203/multiagents/environments/decision_maker/vertical.py", line 30, in astep
    results = await asyncio.gather(
    File "/home/hhw/Downloads/aigc/proj/gpt/TsinghuaDatabaseGroup_DB-GPT/dbgpt0203/multiagents/agents/solver.py", line 140, in step
    result_node, top_abnormal_metric_values = chain.start(
    File "/home/hhw/Downloads/aigc/proj/gpt/TsinghuaDatabaseGroup_DB-GPT/dbgpt0203/multiagents/reasoning_algorithms/tree_of_thought/UCT_vote_function.py", line 184, in start
    end_node, top_abnormal_metric_values = self.default_policy(now_node,this_simulation,single_chain_max_step)
    File "/home/hhw/Downloads/aigc/proj/gpt/TsinghuaDatabaseGroup_DB-GPT/dbgpt0203/multiagents/reasoning_algorithms/tree_of_thought/UCT_vote_function.py", line 576, in default_policy
    result = temp_node.env.tool.call_function(parsed_response.tool, **parameters)
    File "/home/hhw/Downloads/aigc/proj/gpt/TsinghuaDatabaseGroup_DB-GPT/dbgpt0203/multiagents/tools/api_retrieval.py", line 30, in call_function
    return func(*args, **kwargs)
    File "/home/hhw/Downloads/aigc/proj/gpt/TsinghuaDatabaseGroup_DB-GPT/dbgpt0203/multiagents/tools/index_advisor/api.py", line 33, in optimize_index_selection
    for query_template in workload_statistics:
    TypeError: 'int' object is not iterable
    `

by the way, backend's gpu service is started by fastchat project, and i run chatglm3-6b in fastchat's openai-api for diagnosis function with a cuda of 24G.

@zhouxh19
Copy link
Collaborator

zhouxh19 commented Feb 4, 2024

What is the data within your ./workload_info.json? It looks like the value of "workload_statistics" is an integer.

image

@IamWWT
Copy link
Author

IamWWT commented Feb 5, 2024

the "workload_statistics" value is 0 in the file of workload_info.json.
i see this value obtained from the postgresql, i deploy pgsql12 with docker, and i had run python init_database.py --recreate-vs without error. i login in the pgsql and see the table with \l as following.

is there anything i've missed in my operations with the postgreSQL database?

(base) hhw@hhw:~$ docker exec -it postgres12   /bin/bash
root@732d08472db4:/# 
root@732d08472db4:/# 
root@732d08472db4:/# 
root@732d08472db4:/# 
root@732d08472db4:/# 
root@732d08472db4:/# PGPASSWORD=postgrespw psql -U postgres
psql (12.17 (Debian 12.17-1.pgdg120+1))
Type "help" for help.

postgres=# 
postgres=# 
postgres=# 
postgres=# \l
                                 List of databases
   Name    |  Owner   | Encoding |  Collate   |   Ctype    |   Access privileges   
-----------+----------+----------+------------+------------+-----------------------
 postgres  | postgres | UTF8     | en_US.utf8 | en_US.utf8 | 
 template0 | postgres | UTF8     | en_US.utf8 | en_US.utf8 | =c/postgres          +
           |          |          |            |            | postgres=CTc/postgres
 template1 | postgres | UTF8     | en_US.utf8 | en_US.utf8 | =c/postgres          +
           |          |          |            |            | postgres=CTc/postgres
(3 rows)

postgres=# 

@zhouxh19
Copy link
Collaborator

zhouxh19 commented Feb 6, 2024

Your postgresql looks fine. Make sure the test case (like ./diagnostic_files/testing_cases_1.json) can be successfully executed.
image

如果有任何其他问题(比如如何构建自己的alert),可以通过扫码进群交流。

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