Re: self.channel.writeHeaders(version, code, reason, headers)\nbuiltins.AttributeError: \'NoneType\' object has no attribute \'writeHeaders\'\

Glyph <[email protected]> Sat, 3 Aug 2019 12:55:36 -0700
Newsgroups gmane.comp.python.twisted
Message-ID <[email protected]>
--===============4890215300132384779==
Content-Type: multipart/alternative;
	boundary="Apple-Mail=_A5A36E43-2E96-4867-86F5-C87CC1DD594E"


--Apple-Mail=_A5A36E43-2E96-4867-86F5-C87CC1DD594E
Content-Transfer-Encoding: quoted-printable
Content-Type: text/plain;
	charset=us-ascii



> On Aug 2, 2019, at 4:31 PM, Waqar Khan <[email protected]> wrote:
>=20
> Hi,
>   I have a twisted server. And I have been seeing this annoying issue.
> Normally. when i develop and test it out. everything is fine..
> But then I try to loadtest is via https://locust.io/ =
<https://locust.io/>
>=20
> Again, everything is fine.. until I "stop" the test.
> Then, I see this
> 'Traceback (most recent call last):\n  File =
"/usr/local/Cellar/python/3.7.1/Frameworks/Python.framework/Versions/3.7/l=
ib/python3.7/asyncio/events.py", line 88, in _run\n    =
self._context.run(self._callback, *self._args)\n  File =
"/usr/local/lib/python3.7/site-packages/twisted/internet/defer.py", line =
827, in adapt\n    adapt.actual.callback(extracted)\n  File =
"/usr/local/lib/python3.7/site-packages/twisted/internet/defer.py", line =
460, in callback\n    self._startRunCallbacks(result)\n  File =
"/usr/local/lib/python3.7/site-packages/twisted/internet/defer.py", line =
568, in _startRunCallbacks\n    self._runCallbacks()\n--- <exception =
caught here> ---\n  File =
"/usr/local/lib/python3.7/site-packages/twisted/internet/defer.py", line =
654, in _runCallbacks\n    current.result =3D callback(current.result, =
*args, **kw)\n  File=20
> ....
>  File "/usr/local/lib/python3.7/site-packages/twisted/web/server.py", =
line 238, in write\n    http.Request.write(self, data)\n  File =
"/usr/local/lib/python3.7/site-packages/twisted/web/http.py", line 1118, =
in write\n    self.channel.writeHeaders(version, code, reason, =
headers)\nbuiltins.AttributeError: \'NoneType\' object has no attribute =
\'writeHeaders\'\n'
>=20
>=20
> I found this similar bug report: =
https://github.com/buildbot/buildbot/issues/4045 =
<https://github.com/buildbot/buildbot/issues/4045>
> But I am using 19.2.1 twisted version..

There is a prerelease version, with this bug fixed, that is awaiting =
final release upload right now; can you try with Twisted=3D=3D19.7.0rc1 =
?  That should fix this issue.  If not, then we have some investigating =
to do :-).

-g

-g=

--Apple-Mail=_A5A36E43-2E96-4867-86F5-C87CC1DD594E
Content-Transfer-Encoding: quoted-printable
Content-Type: text/html;
	charset=us-ascii

<html><head><meta http-equiv=3D"Content-Type" content=3D"text/html; =
charset=3Dus-ascii"></head><body style=3D"word-wrap: break-word; =
-webkit-nbsp-mode: space; line-break: after-white-space;" class=3D""><br =
class=3D""><div><br class=3D""><blockquote type=3D"cite" class=3D""><div =
class=3D"">On Aug 2, 2019, at 4:31 PM, Waqar Khan &lt;<a =
href=3D"mailto:[email protected]" class=3D"">[email protected]</a>&gt; =
wrote:</div><br class=3D"Apple-interchange-newline"><div class=3D""><div =
dir=3D"ltr" class=3D"">Hi,<div class=3D"">&nbsp; I have a twisted =
server. And I have been seeing this annoying issue.</div><div =
class=3D"">Normally. when i develop and test it out. everything is =
fine..<br class=3D"">But then I try to loadtest is via&nbsp;<a =
href=3D"https://locust.io/" class=3D"">https://locust.io/</a></div><div =
class=3D""><br class=3D""></div><div class=3D"">Again, everything is =
fine.. until I "stop" the test.</div><div class=3D"">Then, I see this<br =
class=3D"">'Traceback (most recent call last):\n &nbsp;File =
"/usr/local/Cellar/python/3.7.1/Frameworks/Python.framework/Versions/3.7/l=
ib/python3.7/asyncio/events.py", line 88, in _run\n &nbsp; =
&nbsp;self._context.run(self._callback, *self._args)\n &nbsp;File =
"/usr/local/lib/python3.7/site-packages/twisted/internet/defer.py", line =
827, in adapt\n &nbsp; &nbsp;adapt.actual.callback(extracted)\n =
&nbsp;File =
"/usr/local/lib/python3.7/site-packages/twisted/internet/defer.py", line =
460, in callback\n &nbsp; &nbsp;self._startRunCallbacks(result)\n =
&nbsp;File =
"/usr/local/lib/python3.7/site-packages/twisted/internet/defer.py", line =
568, in _startRunCallbacks\n &nbsp; &nbsp;self._runCallbacks()\n--- =
&lt;exception caught here&gt; ---\n &nbsp;File =
"/usr/local/lib/python3.7/site-packages/twisted/internet/defer.py", line =
654, in _runCallbacks\n &nbsp; &nbsp;current.result =3D =
callback(current.result, *args, **kw)\n &nbsp;File&nbsp;</div><div =
class=3D"">....</div><div class=3D"">&nbsp;File =
"/usr/local/lib/python3.7/site-packages/twisted/web/server.py", line =
238, in write\n &nbsp; &nbsp;http.Request.write(self, data)\n &nbsp;File =
"/usr/local/lib/python3.7/site-packages/twisted/web/http.py", line 1118, =
in write\n &nbsp; &nbsp;self.channel.writeHeaders(version, code, reason, =
headers)\nbuiltins.AttributeError: \'NoneType\' object has no attribute =
\'writeHeaders\'\n'<br class=3D""></div><div class=3D""><br =
class=3D""></div><div class=3D""><br class=3D""></div><div class=3D"">I =
found this similar bug report:&nbsp;<a =
href=3D"https://github.com/buildbot/buildbot/issues/4045" =
class=3D"">https://github.com/buildbot/buildbot/issues/4045</a></div><div =
class=3D"">But I am using&nbsp;19.2.1 twisted =
version..</div></div></div></blockquote><div><br =
class=3D""></div><div>There is a prerelease version, with this bug =
fixed, that is awaiting final release upload right now; can you try =
with&nbsp;Twisted=3D=3D19.7.0rc1 ? &nbsp;That should fix this issue. =
&nbsp;If not, then we have some investigating to do :-).</div><div><br =
class=3D""></div><div>-g</div></div><div class=3D""><br =
class=3D""></div><div class=3D"">-g</div></body></html>=

--Apple-Mail=_A5A36E43-2E96-4867-86F5-C87CC1DD594E--


--===============4890215300132384779==
Content-Type: text/plain; charset="utf-8"
MIME-Version: 1.0
Content-Transfer-Encoding: base64
Content-Disposition: inline

X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX18KVHdpc3RlZC1Q
eXRob24gbWFpbGluZyBsaXN0ClR3aXN0ZWQtUHl0aG9uQHR3aXN0ZWRtYXRyaXguY29tCmh0dHBz
Oi8vdHdpc3RlZG1hdHJpeC5jb20vY2dpLWJpbi9tYWlsbWFuL2xpc3RpbmZvL3R3aXN0ZWQtcHl0
aG9uCg==

--===============4890215300132384779==--