Portable client will not connect to admin account 1.0-alpha4

Submitted by milliwatt on 2011-03-16

It is very strange: I cannot connect to the admin account with the portable client 1.0-alpha4.
I get the message : Connection could not be opened. Server returned an invalid response.
I connect ok to the admin account wiht the web browser interface.
All other login accounts work fine with the portable client.

Strange indeed. Are there any error messages in the event log? If not, perhaps you could enable debug logging in the server and see what's happening.


The problem is back!
I installed the non portable version : same result.
There are no log entries for access and error.
I tried creating a site.ini in in /data/sites file with the code you suggest but there are no log files:
debug_level = DEBUG_ALL
I used right click "connect as admin" with password saved from previous successfull login
As soon as I clic ok on the login connexion window, the window disappears, I hear an error "beep"
and the message "Connection could not be opened: Server returned an invalid response" appears

Same problem on both alpha3 and alpha4.
Actually not only admin account but any other too.
Tried winxp sp3 (x86) and win7 sp1 (x64).


[2011-03-20 17:24:32, (ip here)]

Running script: /server/webissues/handler.php
SQL Query: SELECT server_name, server_uuid, db_version FROM wi_a4_server
Query execution time: 1.3 ms
Returned rows: 1
SQL Query: SELECT set_key, set_value FROM wi_a4_settings
Query execution time: 0.2 ms
Returned rows: 11
Executing command: HELLO
S 'server name' 'cf0fe763-a8c6-412d-be30-5914855e3e4c' '1.0-alpha4'
Total execution time: 65.3 ms

I think I'l try to debug the problem when I'l have some some spare time.

Nice anti-spam captcha btw.

A capture of Fiddler log for application login:
• Lines 1 to 7 represent a successful login
• Close session does not generate any line
• Lines 11-12 represent a login with admin with a 403 error response

Fiddler log capture

The Apache error log for the 403 response is : File does not exist: … /public_html/subd/common
but the correct path should be
… /public_html/subd/webissues/common

Probably we have two different problems.
Should I continue posting to this thread?

According to Wireshark logs there is only one response "S 'server name' 'cf0fe763-a8c6-412d-be30-5914855e3e4c' '1.0-alpha4''.
After that connection is closed by client. There is no other requests.

I've traced client application. It hits setError() in file src\commands\commandmanager.cpp on line 409:

if ( m_contentType != "text/plain" )
  setError( InvalidResponse );

m_content equals to "text/plain; charset=windows-1251" in this place.
The problem is in additional information. It's allowed by documentation. (HTTP 1.1 Header field definitions) According to documentation (as a temporary solution) we can truncate all characters after ';' because "Accept" information always should be first.

We can do something like this

Index: commandmanager.cpp
--- commandmanager.cpp	(revision 1339)
+++ commandmanager.cpp	(working copy)
@@ -386,6 +386,10 @@
     m_protocolVersion = m_currentReply->rawHeader( "X-WebIssues-Version" );
     m_sslConfiguration = m_currentReply->sslConfiguration();
+    if ( m_contentType.contains(";") ) {
+        m_contentType.remove(m_contentType.indexOf(";"), m_contentType.size());
+    }
     if ( m_statusCode != 200 )

or like this

Index: commandmanager.cpp
--- commandmanager.cpp	(revision 1339)
+++ commandmanager.cpp	(working copy)
@@ -386,6 +386,11 @@
     m_protocolVersion = m_currentReply->rawHeader( "X-WebIssues-Version" );
     m_sslConfiguration = m_currentReply->sslConfiguration();
+    int index_of_semicolon = m_contentType.indexOf(";");
+    if ( index_of_semicolon != -1 ) {
+        m_contentType.remove(index_of_semicolon, m_contentType.size());
+    }
     if ( m_statusCode != 200 )

I haven't tested that solution works well.
All patches are relative to the latest svn source.

P.S. I hit some problems building and debugging application. Actually I've cursed everything while building it and making debugger work correctly. Maybe it's just I'm stupid but I think that it would be great to have a detailed manual in wiki on how to build and debug webissues client (for example in QtCreator or msvc).
Why the hell QtCreator looks for executable in wrong directory?
(webissues.exe compiled to (webissues_dir)debug/webissues.exe but debugger tries to start (webissues_dir)src/debug/webissues.exe) What am I doing wrong?

Thanks for reading my long boring post!

Anton Vasiliev.

I know that additional information is allowed but it is incorrect (it should be utf-8) and the server is explicitly setting the content type to "text/plain" so I don't know were this windows-1251 comes from.

But you're right, the solution is to truncate content type to the first semicolon and perhaps to set content type to "text/plain; charset=utf-8" on the server side so there is no ambiguity.

Regarding the problem with building, the INSTALL file explains how to use the configure script with various environment. I'm not using QtCreator so I don't know what the problem is - but my guess is that you should be able to change the path of the executable for debugging somewhere?


Seems like "charset windows-1251" is misconfiguration in my apache settings files.
I found this line in my .htaccess file in htdocs folder: "AddDefaultCharset windows-1251"
I removed that line but nothing happends. My web hosting is really strange pre-configured.

Regarding to problem with building, I've found where to change destination directory but nothing happend. о_о
Probably it's not my day.