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

Unable to connect: "Failed to clear webhook"|"Connection reset by peer" #61

Closed
Tieru opened this issue Jun 29, 2018 · 11 comments
Closed

Comments

@Tieru
Copy link

Tieru commented Jun 29, 2018

Hello, my bot is failing to start with error

Failed to clear webhook
akka.stream.StreamTcpException: The connection closed with error: Connection reset by peer

My guess is my connection to Telegram servers gets blocked.

Among your resent issues I saw your answer about proxy support. Is it still possible to access your refactored version (3.1.0-RC1)?

@mukel
Copy link
Member

mukel commented Jun 29, 2018

It could be that you have another instance of your bot already running e.g. in the background, an instance that didn't died even if you Ctrl-C it... it happens.
Make sure to run a single instance of your bot. Kill all the java processes.

@Tieru
Copy link
Author

Tieru commented Jun 30, 2018

You are probably right, but I've just tried running another bot which has never been launched before. The error reminds the same. So I still think, proxy will help me :)

@mukel
Copy link
Member

mukel commented Jun 30, 2018

You can pull the proxy logic yourself.
Just need to copy ScalajHttpClient.scala and ScalajHttpMarshalling and use it as you client.
Here's an example
https://github.com/mukel/telegrambot4s/blob/refactor/examples/src/ProxyBot.scala

@Tieru
Copy link
Author

Tieru commented Jun 30, 2018

I tried to copy two mentioned files, but no luck. These classes depend on changes in JsonMarshallers, RequestHandler, which I managed to repeat in my project as well. But there is one more thing I can't solve: ScalajHttpMarshalling is working with sealed trait InputFile, and I can't apply case operator on project private classes Path, Contents etc

@mukel
Copy link
Member

mukel commented Jun 30, 2018

I'm on vacation ATM (no laptop) but I could publish an RC2 with the recent patches and proxy support next week.
I've been working on a large refactor (ScalaJs support, circe-based serialization, proxy support via ScalajHttpClient, modular design...) You can try building from source the js branch (it uses mill instead of SBT).
Sorry for the inconvenience, feel free to open an issue or continue the discussion here, I'll galdly help you sort it out.

@Tieru
Copy link
Author

Tieru commented Jun 30, 2018

I can wait, I don't have urgent tasks :)

Btw, here is the bot I created using your library (just a dictionary of English words): https://github.com/Tieru/MacMillanTelegramBot . If you have time to look at that, any feedback is welcome.

I can also help you with maintaining your library. When you are back from your vacation you can delegate me simple tasks that you have in mind, but have no time to spend on them.

Please let this issue open until we try proxy. I guess many Russians will have problems with running their bots, so this topics might be a solution for them in the future.

@Tieru
Copy link
Author

Tieru commented Jul 7, 2018

I couldn't find any proxy support in 'js' branch. However I tried 'refactor' and now I can confirm that proxy does solve the issue! Thanks for your help!

@Tieru Tieru closed this as completed Jul 7, 2018
@Tieru
Copy link
Author

Tieru commented Aug 17, 2018

Hello, @mukel . Could you please release a version that includes proxy? I have built a jar that includes those changes and it's fine for development, but deploy process to server or to another pc is a bit painful.

Probably I could help you somehow in order to save your time and prepare new releases

@mukel
Copy link
Member

mukel commented Aug 17, 2018

I'll allocate some time this weekend, mainly to update the API to v4.0 . Probably push a release candidate; would be nice to get it tested.

@Tieru
Copy link
Author

Tieru commented Aug 19, 2018

Okay, I will gladly help you to test features I'm using, but I can't promise about the rest of them, since I don't know how :)

@mukel
Copy link
Member

mukel commented Aug 20, 2018

Closing this in favor of #63

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