PermissionError on closing connection
I have no clue how to reproduce this, but happens once in a while on my server:
2018-01-16T12:20:35+0100 [SSHChannel session (0) on SSHService b'ssh-connection' on SSHServerTransport,4,195.22.127.83] Unhandled Error
Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/twisted/internet/tcp.py", line 292, in connectionLost
protocol.connectionLost(reason)
File "/usr/lib/python3/dist-packages/twisted/conch/ssh/transport.py", line 513, in connectionLost
self.service.serviceStopped()
File "/usr/lib/python3/dist-packages/twisted/conch/ssh/connection.py", line 66, in serviceStopped
self.channelClosed(channel)
File "/usr/lib/python3/dist-packages/twisted/conch/ssh/connection.py", line 608, in channelClosed
log.callWithLogger(channel, channel.closed)
--- <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 118, in callWithContext
return self.currentContext().callWithContext(ctx, func, *args, **kw)
File "/usr/lib/python3/dist-packages/twisted/python/context.py", line 81, in callWithContext
return func(*args,**kw)
File "/usr/lib/python3/dist-packages/twisted/conch/ssh/session.py", line 129, in closed
self.session.closed()
File "/usr/lib/python3/dist-packages/twisted/conch/unix.py", line 311, in closed
os.chown(self.ptyTuple[2], 0, ttyGID)
builtins.PermissionError: [Errno 1] Operation not permitted: '/dev/pts/8'