QNetworkReply and QNetworAccessManager don't emit `finished` signal
-
@xueqli in the url, change https to http and try again
@Ronel_qtmaster unfortunately, that didn't help
-
For now I'm pretty sure that this is related to QTBUG-122281, because when I connect the
metaDataChangedsignal and look into reply's headers, they contain information about the invalid token, but nothing happens after -
For now I'm pretty sure that this is related to QTBUG-122281, because when I connect the
metaDataChangedsignal and look into reply's headers, they contain information about the invalid token, but nothing happens after -
@xueqli just to rule out the obvious, you have the same issue if you send requests to a different service ?
Is there one that is accessible that you can share for testing purposes so we can test it ?
@SGaist hmm, I haven't encountered this issue for other services
At first I thought that the problem is withwww-authenticateheader field
So I found the API which also sends it (https://registry-1.docker.io/v2/_catalog, for example), and it works fine (my API sends some other attributes inwww-authenticateheader, but they are all valid)The other difference I noticed, my API doesn't send any content (
answer.content == b''), and all API I've tried so far send a non-empty error message, so maybe my problem lies here -
i don't know, looks like it stuck somewhere in the
QIODevice::read?(Pdb) self.reply.isOpen() True (Pdb) self.reply.bytesAvailable() 0 (Pdb) self.reply.read(1000) b'' (Pdb) self.reply.read(1000) b'' (Pdb) self.reply.read(1000) b'' (Pdb) self.reply.read(1000) b'' (Pdb) self.reply.read(1000) b'' (Pdb) self.reply.close() got reply error! NetworkError.OperationCanceledError download progress! received=0 total=0 manager finished! QIODevice::read (QNetworkReplyHttpImpl): device not open reply finished! b''and after i manually close reply it says, that device is not open and emits all the signals i want it to emit
i also made up an http server, which sends similar headers and empty content and it magically works! (but with this "manual close" it has some different output:
self.reply.isOpen()=True got reply error! NetworkError.OperationCanceledError download progress! received=0 total=0 manager finished! QIODevice::read (QNetworkReplyHttpImpl): device not open reply finished! b'' QNetworkReplyImplPrivate::error: Internal problem, this method must only be called once.i have no ideas. think i probably should give up and create workarounds
-
i don't know, looks like it stuck somewhere in the
QIODevice::read?(Pdb) self.reply.isOpen() True (Pdb) self.reply.bytesAvailable() 0 (Pdb) self.reply.read(1000) b'' (Pdb) self.reply.read(1000) b'' (Pdb) self.reply.read(1000) b'' (Pdb) self.reply.read(1000) b'' (Pdb) self.reply.read(1000) b'' (Pdb) self.reply.close() got reply error! NetworkError.OperationCanceledError download progress! received=0 total=0 manager finished! QIODevice::read (QNetworkReplyHttpImpl): device not open reply finished! b''and after i manually close reply it says, that device is not open and emits all the signals i want it to emit
i also made up an http server, which sends similar headers and empty content and it magically works! (but with this "manual close" it has some different output:
self.reply.isOpen()=True got reply error! NetworkError.OperationCanceledError download progress! received=0 total=0 manager finished! QIODevice::read (QNetworkReplyHttpImpl): device not open reply finished! b'' QNetworkReplyImplPrivate::error: Internal problem, this method must only be called once.i have no ideas. think i probably should give up and create workarounds
@xueqli before working around, please open a ticket on the bug report system with your findings. It seems you have a valid case to make.
-
i found out that apparently it has nothing to do with either contents or headers,
and the real reason is: the request was using HTTP/2 protocol
disabling HTTP/2 (request.setAttribute(request.Attribute.Http2AllowedAttribute, False)) solves my problembut what's wrong with HTTP/2 is yet to be figured out
-
X xueqli has marked this topic as solved on
-
i found out that apparently it has nothing to do with either contents or headers,
and the real reason is: the request was using HTTP/2 protocol
disabling HTTP/2 (request.setAttribute(request.Attribute.Http2AllowedAttribute, False)) solves my problembut what's wrong with HTTP/2 is yet to be figured out
-
Thanks for the link and thorough spelunking !
Since you have a Python reproducer, you should add it to the bug report, it will make things easier for developers to reproduce :-)