GreyDGL / PentestGPT

A GPT-empowered penetration testing tool
MIT License
7.28k stars 883 forks source link

RetryError When I ask a question to pentestgpt #246

Closed violinist2149 closed 2 weeks ago

violinist2149 commented 3 weeks ago

pentestgpt Your CHATGPT_COOKIE is not set. Please set it in the environment variable. Your GOOGLE_API_KEY is not set. Please set it in the environment variable. Your GOOGLE_API_KEY is not set. Please set it in the environment variable. Welcome to pentestGPT, an automated penetration testing parser empowered by GPT. The settings are:

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

Traceback (most recent call last): File "/Users/rahulbhor/Documents/pentestgpt/bin/pentestgpt", line 8, in sys.exit(main()) File "/Users/rahulbhor/Documents/pentestgpt/lib/python3.10/site-packages/pentestgpt/main.py", line 62, in main pentestGPTHandler.main() File "/Users/rahulbhor/Documents/pentestgpt/lib/python3.10/site-packages/pentestgpt/utils/pentest_gpt.py", line 737, in main self.initialize(previous_session_ids=loaded_ids) File "/Users/rahulbhor/Documents/pentestgpt/lib/python3.10/site-packages/pentestgpt/utils/pentest_gpt.py", line 266, in initialize self._feed_init_prompts() File "/Users/rahulbhor/Documents/pentestgpt/lib/python3.10/site-packages/pentestgpt/utils/pentest_gpt.py", line 193, in _feed_init_prompts _reasoning_response = self.reasoningAgent.send_message( File "/Users/rahulbhor/Documents/pentestgpt/lib/python3.10/site-packages/tenacity/init.py", line 336, in wrapped_f return copy(f, *args, **kw) File "/Users/rahulbhor/Documents/pentestgpt/lib/python3.10/site-packages/tenacity/init.py", line 475, in call do = self.iter(retry_state=retry_state) File "/Users/rahulbhor/Documents/pentestgpt/lib/python3.10/site-packages/tenacity/init.py", line 376, in iter result = action(retry_state) File "/Users/rahulbhor/Documents/pentestgpt/lib/python3.10/site-packages/tenacity/init.py", line 419, in exc_check raise retry_exc from fut.exception() tenacity.RetryError: RetryError[<Future at 0x1083795a0 state=finished raised KeyError>]

Screenshot 2024-10-31 at 12 35 00
GreyDGL commented 3 weeks ago

Looking into this now.

GreyDGL commented 3 weeks ago

@violinist2149 Did you link a payment method to your OpenAI account? Can you validate if you can successfully request the OpenAI API? A simple debug is to use pentestgpt-connection.

bibo318 commented 2 weeks ago

┌──(root㉿xxxx)-[~] └─# pentestgpt-connection You're testing the connection for PentestGPT v"0.14.0"

Test connection for OpenAI api (GPT-3.5)

New conversation.xxxxxxxxxx-00155d2c852f is created.

  1. You're connected with OpenAI API. You have GPT-3.5 access. To start PentestGPT, please use <pentestgpt --reasoning_model=gpt-3.5-turbo-16k>

    Test connection for OpenAI api (GPT-4)

    New conversation.xxxxxxxx-xxxx-00155d2c852f is created.

  2. You're connected with OpenAI API. You have GPT-4(o) access. To start PentestGPT, please use <pentestgpt --reasoning_model=gpt-4o>

┌──(root㉿xxxx)-[~] └─# pentestgpt --reasoning_model=gpt-4o Your GOOGLE_API_KEY is not set. Please set it in the environment variable. Your GOOGLE_API_KEY is not set. Please set it in the environment variable. usage: pentestgpt [-h] [--log_dir LOG_DIR] [--reasoning_model {gpt-4,gpt-4-turbo}] [--parsing_model {gpt-4-turbo,gpt-3.5-turbo-16k}] [--logging] [--useAPI] pentestgpt: error: argument --reasoning_model: invalid choice: 'gpt-4o' (choose from 'gpt-4', 'gpt-4-turbo')

@violinist2149 Did you link a payment method to your OpenAI account? Can you validate if you can successfully request the OpenAI API? A simple debug is to use pentestgpt-connection.

violinist2149 commented 2 weeks ago

@GreyDGL It's working now after linking a payment method . Thanks for your help !