-
Notifications
You must be signed in to change notification settings - Fork 27
Connection Errror: 403 on connections #10
Comments
Hey @vibhoothiiaanand, This was a long term coming. I will play with this tomorrow. |
Hey @vibhoothiiaanand I have created a websocket version of the script.
Install above modules and test the |
@vijaiaeroastro thanks for the quick turnaround, I tried to see, on quick looks it looks like some issue in the way we are handling keeping connection, Full logs: python3 irccloud_ws.py
2021-05-13 14:46:25,921 INFO Successfully obtained authentication token.
2021-05-13 14:46:26,558 INFO Successfully obtained a session id.
Unhandled Error
Traceback (most recent call last):
File "/home/mindfreeze/.local/lib/python3.8/site-packages/twisted/python/log.py", line 101, in callWithLogger
return callWithContext({"system": lp}, func, *args, **kw)
File "/home/mindfreeze/.local/lib/python3.8/site-packages/twisted/python/log.py", line 85, in callWithContext
return context.call({ILogContext: newCtx}, func, *args, **kw)
File "/home/mindfreeze/.local/lib/python3.8/site-packages/twisted/python/context.py", line 118, in callWithContext
return self.currentContext().callWithContext(ctx, func, *args, **kw)
File "/home/mindfreeze/.local/lib/python3.8/site-packages/twisted/python/context.py", line 83, in callWithContext
return func(*args, **kw)
--- <exception caught here> ---
File "/home/mindfreeze/.local/lib/python3.8/site-packages/twisted/internet/posixbase.py", line 692, in _doReadOrWrite
why = selectable.doWrite()
File "/home/mindfreeze/.local/lib/python3.8/site-packages/twisted/internet/tcp.py", line 613, in doConnect
self._connectDone()
File "/home/mindfreeze/.local/lib/python3.8/site-packages/twisted/internet/tcp.py", line 641, in _connectDone
self.protocol.makeConnection(self)
File "/home/mindfreeze/.local/lib/python3.8/site-packages/twisted/protocols/tls.py", line 211, in makeConnection
ProtocolWrapper.makeConnection(self, transport)
File "/home/mindfreeze/.local/lib/python3.8/site-packages/twisted/protocols/policies.py", line 72, in makeConnection
self.wrappedProtocol.makeConnection(self)
builtins.AttributeError: 'WebSocketClientProtocol' object has no attribute 'makeConnection'
Unhandled Error
Traceback (most recent call last):
File "irccloud_ws.py", line 105, in ws_keep_alive
reactor.run()
File "/home/mindfreeze/.local/lib/python3.8/site-packages/twisted/internet/base.py", line 1423, in run
self.mainLoop()
File "/home/mindfreeze/.local/lib/python3.8/site-packages/twisted/internet/base.py", line 1436, in mainLoop
reactorBaseSelf.doIteration(t)
File "/home/mindfreeze/.local/lib/python3.8/site-packages/twisted/internet/epollreactor.py", line 244, in doPoll
log.callWithLogger(selectable, _drdw, selectable, fd, event)
--- <exception caught here> ---
File "/home/mindfreeze/.local/lib/python3.8/site-packages/twisted/python/log.py", line 101, in callWithLogger
return callWithContext({"system": lp}, func, *args, **kw)
File "/home/mindfreeze/.local/lib/python3.8/site-packages/twisted/python/log.py", line 85, in callWithContext
return context.call({ILogContext: newCtx}, func, *args, **kw)
File "/home/mindfreeze/.local/lib/python3.8/site-packages/twisted/python/context.py", line 118, in callWithContext
return self.currentContext().callWithContext(ctx, func, *args, **kw)
File "/home/mindfreeze/.local/lib/python3.8/site-packages/twisted/python/context.py", line 83, in callWithContext
return func(*args, **kw)
File "/home/mindfreeze/.local/lib/python3.8/site-packages/twisted/internet/posixbase.py", line 700, in _doReadOrWrite
self._disconnectSelectable(selectable, why, inRead)
File "/home/mindfreeze/.local/lib/python3.8/site-packages/twisted/internet/posixbase.py", line 306, in _disconnectSelectable
selectable.connectionLost(failure.Failure(why))
File "/home/mindfreeze/.local/lib/python3.8/site-packages/twisted/internet/tcp.py", line 506, in connectionLost
self._commonConnection.connectionLost(self, reason)
File "/home/mindfreeze/.local/lib/python3.8/site-packages/twisted/internet/tcp.py", line 324, in connectionLost
protocol.connectionLost(reason)
File "/home/mindfreeze/.local/lib/python3.8/site-packages/twisted/protocols/tls.py", line 394, in connectionLost
ProtocolWrapper.connectionLost(self, reason)
File "/home/mindfreeze/.local/lib/python3.8/site-packages/twisted/protocols/policies.py", line 111, in connectionLost
self.wrappedProtocol.connectionLost(reason)
builtins.AttributeError: 'WebSocketClientProtocol' object has no attribute 'connectionLost'
^C2021-05-13 14:46:36,905 ERROR IRC Cloud Session could not be Kept alive.
mindfreeze@garuda ~/t/irccloud (master)> I tried to see around online, on quick look I did not find any leads to fix-up, maybe due to handling of websockets |
Exactly the same error, but this time on the Expand
$ IRCCLOUD_USERNAME="[email protected]" IRCCLOUD_PASSWORD="pa$$w0rd_h3r3" python3 irccloud_ws.py
2021-05-13 16:06:47,022 INFO Successfully obtained authentication token.
2021-05-13 16:06:47,752 INFO Successfully obtained a session id.
Unhandled Error
Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/twisted/python/log.py", line 103, in callWithLogger
return callWithContext({"system": lp}, func, *args, **kw)
File "/usr/lib/python3/dist-packages/twisted/python/log.py", line 86, in callWithContext
return context.call({ILogContext: newCtx}, func, *args, **kw)
File "/usr/lib/python3/dist-packages/twisted/python/context.py", line 122, in callWithContext
return self.currentContext().callWithContext(ctx, func, *args, **kw)
File "/usr/lib/python3/dist-packages/twisted/python/context.py", line 85, in callWithContext
return func(*args,**kw)
--- <exception caught here> ---
File "/usr/lib/python3/dist-packages/twisted/internet/posixbase.py", line 619, in _doReadOrWrite
why = selectable.doWrite()
File "/usr/lib/python3/dist-packages/twisted/internet/tcp.py", line 627, in doConnect
self._connectDone()
File "/usr/lib/python3/dist-packages/twisted/internet/tcp.py", line 656, in _connectDone
self.protocol.makeConnection(self)
File "/usr/lib/python3/dist-packages/twisted/protocols/tls.py", line 213, in makeConnection
ProtocolWrapper.makeConnection(self, transport)
File "/usr/lib/python3/dist-packages/twisted/protocols/policies.py", line 75, in makeConnection
self.wrappedProtocol.makeConnection(self)
builtins.AttributeError: 'WebSocketClientProtocol' object has no attribute 'makeConnection'
Unhandled Error
Traceback (most recent call last):
File "irccloud_ws.py", line 102, in ws_keep_alive
reactor.run()
File "/usr/lib/python3/dist-packages/twisted/internet/base.py", line 1267, in run
self.mainLoop()
File "/usr/lib/python3/dist-packages/twisted/internet/base.py", line 1279, in mainLoop
self.doIteration(t)
File "/usr/lib/python3/dist-packages/twisted/internet/epollreactor.py", line 235, in doPoll
log.callWithLogger(selectable, _drdw, selectable, fd, event)
--- <exception caught here> ---
File "/usr/lib/python3/dist-packages/twisted/python/log.py", line 103, in callWithLogger
return callWithContext({"system": lp}, func, *args, **kw)
File "/usr/lib/python3/dist-packages/twisted/python/log.py", line 86, in callWithContext
return context.call({ILogContext: newCtx}, func, *args, **kw)
File "/usr/lib/python3/dist-packages/twisted/python/context.py", line 122, in callWithContext
return self.currentContext().callWithContext(ctx, func, *args, **kw)
File "/usr/lib/python3/dist-packages/twisted/python/context.py", line 85, in callWithContext
return func(*args,**kw)
File "/usr/lib/python3/dist-packages/twisted/internet/posixbase.py", line 627, in _doReadOrWrite
self._disconnectSelectable(selectable, why, inRead)
File "/usr/lib/python3/dist-packages/twisted/internet/posixbase.py", line 258, in _disconnectSelectable
selectable.connectionLost(failure.Failure(why))
File "/usr/lib/python3/dist-packages/twisted/internet/tcp.py", line 519, in connectionLost
self._commonConnection.connectionLost(self, reason)
File "/usr/lib/python3/dist-packages/twisted/internet/tcp.py", line 327, in connectionLost
protocol.connectionLost(reason)
File "/usr/lib/python3/dist-packages/twisted/protocols/tls.py", line 403, in connectionLost
ProtocolWrapper.connectionLost(self, reason)
File "/usr/lib/python3/dist-packages/twisted/protocols/policies.py", line 125, in connectionLost
self.wrappedProtocol.connectionLost(reason)
builtins.AttributeError: 'WebSocketClientProtocol' object has no attribute 'connectionLost'
^C2021-05-13 16:06:51,731 ERROR IRC Cloud Session could not be Kept alive. After this works I'll submit some |
Hey @PeGaSuS-Coder, Don't worry. Once the testing is finished. I will update both repositories 😃 |
@vibhoothiiaanand Will make sure this gets fixed somehow this week. I have never used |
Hi, If you still need some help, I hacked a keep alive app in go which seems to be working.
The complete go code can be found here: https://github.com/osm/icka/blob/master/main.go |
Hey @osm, Nice work. I am really not interested in maintaining this stuff anymore. Most of the simpler websocket libraries that i tried in Python simply suck when it comes to secure sockets and i hate using twisted for this. Even i was considering a Go based solution since Gorilla provides a nice implementation. But it wouldn't be fair to simply take your code in Go and put it in my repo either. I will most likely not maintain these repositories anymore and redirect traffic to your repo 😃 I am not even on IRC anymore honestly. Only maintained this since it grew too popular. Vijai |
Hi,
Right now when we try to establish a connection we get sessionID and auth_token properly but we end up with 403 response, I tired to talk to IRCcloud feedback channel, itseems the HTTP method is deprecated, and we require to use/migrate to wss method.
https://github.com/irccloud/irccloud-tools/wiki/API-Overview#websocket
The text was updated successfully, but these errors were encountered: