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

Getting sometimes error 205 (QNetworkReply::ContentReSendError) #33

Open
IAmWebSA opened this issue Dec 1, 2020 · 4 comments
Open

Getting sometimes error 205 (QNetworkReply::ContentReSendError) #33

IAmWebSA opened this issue Dec 1, 2020 · 4 comments

Comments

@IAmWebSA
Copy link
Contributor

IAmWebSA commented Dec 1, 2020

I have oberserved on my long time running unit, that the LCD Display stays in idle and just refreshes some ajax calls it can happen somethimes if I want to POST data like for login I get and error back and I need to reload the complete page.

In the logs I can see the following error reported (running 1.99.7 qt-webkit-kiosk based on qt 4.8.7):

Build with: Qt = 4.8.7 ; WebKit = 2.2.4 
Runing with: Qt = 4.8.7 ; WebKit = "534.34" 
"Thu Oct 22 14:42:54 2020" handleNetworkReply URL: "http://127.0.0.1:99/inc/ajaxlogin.php" 
"Thu Oct 22 14:42:54 2020" handleNetworkReply ERROR: 205 = "Unknown error" 
"Thu Oct 22 14:42:54 2020" MainWindow::handleQwkNetworkError "

From the qt docs it seems the error 205 is "QNetworkReply::ContentReSendError".

Do you have any idea, why this happens sometimes?

@sergey-dryabzhinsky
Copy link
Owner

This can be if your site page with some input form was open too long.
And your site is checking CSRF hash, or other things, captcha maybe.
And user input data was wasted.

I think page should be reloaded automaticaly by that error (205 http code).

@IAmWebSA
Copy link
Contributor Author

IAmWebSA commented Nov 2, 2021

Hi Sergey,

any update on this?

I am still getting these errors, shall the page just reload in this case?
Any hotfix available?

@IAmWebSA
Copy link
Contributor Author

IAmWebSA commented Nov 2, 2021

I force a invalid CSRF token then I get the following:

2021-11-02T08:25:14.015300+00:00 TL-803E3A OcpApp: "Tue Nov 2 08:25:14 2021" handleNetworkReply URL: "http://127.0.0.1:81/inc/status.php"
2021-11-02T08:25:14.015910+00:00 TL-803E3A OcpApp: "Tue Nov 2 08:25:14 2021" handleNetworkReply ERROR: 202 = "Error downloading http://127.0.0.1:81/inc/status.php - server replied: Forbidden"
2021-11-02T08:25:14.016580+00:00 TL-803E3A OcpApp: "Tue Nov 2 08:25:14 2021" on URL: "http://127.0.0.1:81/inc/status.php"

So the Error 205 is not caused by a outdated CSRF token, any idea why this occurrs Error 205?

Also as I can see these Error codes are not HTTP Codes:

https://het.as.utexas.edu/HET/Software/html/qnetworkreply.html

QNetworkReply::ContentAccessDenied 201 the access to the remote content was denied (similar to HTTP error 401)
QNetworkReply::ContentOperationNotPermittedError 202 the operation requested on the remote content is not permitted
QNetworkReply::ContentNotFoundError 203 the remote content was not found at the server (similar to HTTP error 404)
QNetworkReply::AuthenticationRequiredError 204 the remote server requires authentication to serve the content but the credentials provided were not accepted (if any)
QNetworkReply::ContentReSendError 205 the request needed to be sent again, but this failed for example because the upload data could not be read a second time.

Also related:

https://bugreports.qt.io/browse/QTBUG-32606

@IAmWebSA
Copy link
Contributor Author

IAmWebSA commented Nov 4, 2021

added

`/* workaround for unknown root cause for ContentReSendError after xx hours */
else if ( error == QNetworkReply::ContentReSendError){
if( !m_bContentResendErr ){
//set member (will be reset in target slot)
m_bContentResendErr = true;
qDebug() << "view reload QNetworkReply::ContentReSendError";

        // force NetSession restart
        n_session->close();
        n_session->open();

        // Try reload broken view
        qint32 delay_reload = qwkSettings->getInt("browser/network_error_reload_delay", 15000);
        if (delay_reload >= 0) {
            delayedLoad->singleShot(
                delay_reload,
                this, SLOT(delayedPageReloadResend())  
            ); //m_bContentResendErr  will be reset in slot
        }
    }
}`

to MainWindow::handleQwkNetworkError

lets see if this would solve the problem

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants