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

Network error #81

Closed
SoulOfDefend opened this issue Mar 18, 2023 · 23 comments
Closed

Network error #81

SoulOfDefend opened this issue Mar 18, 2023 · 23 comments

Comments

@SoulOfDefend
Copy link

Hi, when I try to install I get an error:

chatgpt-telegram-bot-chatgpt-telegram-bot-1 | File "/usr/local/lib/python3.9/site-packages/telegram/request/_httpxrequest.py", line 223, in do_request
chatgpt-telegram-bot-chatgpt-telegram-bot-1 | raise NetworkError(f"httpx.{err.class.name}: {err}") from err
chatgpt-telegram-bot-chatgpt-telegram-bot-1 | telegram.error.NetworkError: httpx.ConnectError: All connection attempts failed
chatgpt-telegram-bot-chatgpt-telegram-bot-1 exited with code 1

I tried to install the previous version and everything worked! Hope for help:)

@n3d1117
Copy link
Owner

n3d1117 commented Mar 18, 2023

Hey there @SoulOfDefend! Have you tried pulling from latest changes in main branch?

@SoulOfDefend
Copy link
Author

Yes. But the error was in the wrong version of python :) TY

@n3d1117 n3d1117 closed this as completed Mar 18, 2023
@SoulOfDefend
Copy link
Author

Or not:(( The error did not disappear, downloaded the current version, installed python 3.9, but still nothing works

@SoulOfDefend
Copy link
Author

The version for python 3.1 works, but not for 3.9

@rainbowjose
Copy link

All connection attempts failed

Same

@n3d1117
Copy link
Owner

n3d1117 commented Mar 19, 2023

Weird. Can you try using Docker?

@n3d1117 n3d1117 reopened this Mar 19, 2023
@areochi
Copy link

areochi commented Mar 19, 2023

same issue, cant deploy to the docker or cant even run the code, same errors. ive tried 3.7, 3.9, 3,11 python versions

@n3d1117
Copy link
Owner

n3d1117 commented Mar 19, 2023

Can you share your .env file (without api key and token)?

@areochi
Copy link

areochi commented Mar 20, 2023

Can you share your .env file (without api key and token)?

my .env file looks like that:
.env.txt

i add a .txt to upload it here. so inbefore i just changed .env.example -> .env

@Youquell
Copy link

Yes, I have the same mistake. Python 3.11 . For some reason, telegram refuses to connect.

@n3d1117
Copy link
Owner

n3d1117 commented Mar 20, 2023

@areochi you have proxy enabled with this line:

PROXY="http://localhost:8080"

just to confirm, do you actually have a proxy running at http://localhost:8080?

@areochi
Copy link

areochi commented Mar 20, 2023

no, i don't have any proxy. i just pulled from your github link and tried to run a code, and as you we have that errors. i've tried several python versions and also tried to install all requirements manualy but didnt help to me

@areochi
Copy link

areochi commented Mar 20, 2023

@areochi you have proxy enabled with this line:
PROXY="http://localhost:8080/"

just to confirm, do you actually have a proxy running at http://localhost:8080?

and if you check your .env.example file it has the same one:

Proxy to be used for OpenAI and Telegram bot

PROXY="http://localhost:8080/"

@n3d1117
Copy link
Owner

n3d1117 commented Mar 20, 2023

@areochi Yes, that's a sample configuration for optional parameters. The only required values are OPENAI_API_KEY and TELEGRAM_BOT_TOKEN. I probably should make that more clear. Can you try deleting everything from the .env file except openai key and telegram token?

@areochi
Copy link

areochi commented Mar 20, 2023

@areochi Yes, that's a sample configuration for optional parameters. The only required values are OPENAI_API_KEY and TELEGRAM_BOT_TOKEN. I probably should make that more clear. Can you try deleting everything from the .env file except openai key and telegram token?

yeah, it works. i didnt try to push docker yet, but the code works and bot gives proper replies

@areochi
Copy link

areochi commented Mar 20, 2023

@n3d1117 also voice messages doesnt work, and rest is working good

@n3d1117
Copy link
Owner

n3d1117 commented Mar 20, 2023

@n3d1117 also voice messages doesnt work, and rest is working good

Any error? Or no response/log at all?

@areochi
Copy link

areochi commented Mar 20, 2023

@n3d1117 also voice messages doesnt work, and rest is working good

Any error? Or no response/log at all?

can't do another test atm (i'm at work). But telegram replied me something like: wrong format or i can use this type of audio,

i'll test later

@n3d1117
Copy link
Owner

n3d1117 commented Mar 20, 2023

Okay, i'll keep this issue open. Please share exact error, logs and/or the audio file you used

@n3d1117
Copy link
Owner

n3d1117 commented Mar 20, 2023

@rainbowjose @SoulOfDefend @Youquell could you please check if removing all parameters your .env file (except openai key and telegram token) fixes the issue?

@areochi
Copy link

areochi commented Mar 20, 2023

Okay, i'll keep this issue open. Please share exact error, logs and/or the audio file you used

hp, ht, pid, tid = _winapi.CreateProcess(executable, args,
FileNotFoundError: [WinError 2] (File not found - in my language) and telegram says Unsupported file type

@n3d1117
Copy link
Owner

n3d1117 commented Mar 21, 2023

hp, ht, pid, tid = _winapi.CreateProcess(executable, args, FileNotFoundError: [WinError 2] (File not found - in my language) and telegram says Unsupported file type

Hmm, seems to be a Windows related issue. Please open a new GitHub issue so we can track it there

@SoulOfDefend
Copy link
Author

Hi! @n3d1117 I tried to delete everything from the .env file and everything worked! Thank you for your help in solving the problem:)

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

5 participants