QtNetworkAccessManager doesn't work after network restart and issues QNetworkReply:UnknownNetworkError - c++

I am a beginner in QT. I have a custom application which sends and receives information from my http server. When the network services are restarted, the Qt application doesn't connect with the server and issues network error as below. Also, after restart the issue gets resolved.
Here is my error log:
Network error QNetworkReply::UnknownNetworkError received
requestFinished, code: 500 url: "xxxx/xxxx/xxxx" (unknown:0) -
QIODevice::read (QDisabledNetworkReply): device not open
I have searched in forums but I couldn't get a solution to the same.

Related

Re-connecting to QDBus server after server has been restarted (Qt C++)

I'm testing out using DBus for inter process communication for an QT C++ project (Linux).
I'm not using the bus daemon and i'm using unix paths / sockets.
After navigating my way through the mysterious world that is QT DBUS all seemed to be going well, until i wanted to test the robustness of one of my interfaces.
After killing the server process en restarting it, the connection times out.. i cleanup the connection objects (client-side) and i try to re-connect to the server.
The client does not seem to be able to reconnect and i get the following errors:
errName: org.freedesktop.DBus.Error.NoServer
errMesage: Failed to connect to socket /tmp/abcd: Connection refused
Ive tried:
- QDBusConnection::disconnectFromPeer(addr);
- cleaning up all related object, so no references to the connection exist.
When i restart the client, it has no problems connecting to the (restarted) server.
Problem found!
Seems to be a bug in Qt 4.8.x:
https://bugreports.qt.io/browse/QTBUG-27973
https://codereview.qt-project.org/#/c/60709/
QDBusConnection::disconnectFromBus and QDBusConnection::disconnectFromPeer does not remove invalid connection

Error connecting to Icecast

I have setup Icecast server on Ubuntu 14.04. I am using ezstream source client to send to the Icecast server. Everything seems to work for a while. After I load many streams, Icecast seems to hang and does not accept the new request.
Log for Icecast:
[2014-08-20 05:07:24] EROR connection/_handle_connection Wrong request type from client
[2014-08-20 05:07:24] INFO source/source_main listener count on /streaming/76cafede98c3aa484821fe707f3a919f now 0
Occasionally, log reports this error as well:
WARN source/get_next_buffer Disconnecting source due to socket timeout
It seems that you are overloading your network?
WARN source/get_next_buffer Disconnecting source due to socket timeout
The above error usually happens when the source client fails to send data fast enough to the Icecast server.

visualsvn cannot connect to WMI namespace the RPC server is unavailable

I did a lot of research for following matter and I got a lot of helpful information but the matter still remains, so I'm going to write it with full details
I'm trying to run "Remote Server Administration" with VisualSVN Server (Enterprise Edition), the server is Windows Server 2008 connected to the internet via router with port forwarding to this server. The client is not at local network so I use a static IP for the server.
Also I did every things written at this URL: http://www.visualsvn.com/support/topic/00025/
but I still get the following error message Connot connect to WMI namespace "..." : the RPC server is unavalible (0x800706ba) when I'm trying to "connecting to another computer".
On the other-hand, I can browsing the "Repositories" content by any web-browser successfully.
How can I manage the Repositories at remote servers?
"...the RPC server is unavalible (0x800706ba)" error indicates a connectivity issue to the remote machine.
Accessing WMI remotely requires port 135 TCP/UDP and all TCP ports above 1024 (1024-65535) to be opened (and forwarded), by default. You can setup fixed port for WMI to simplify the port-forwarding / proxy setup task. In order to setup the fixed port, follow steps described in the article "Setting Up a Fixed Port for WMI". After you follow these steps you are required to setup port forwarding and proxy rewrites (if any) for 135 TCP/UDP and port 24158 TCP.
"...Access is denied (0x80070005)" error indicates insufficient permissions to access WMI remotely. Add your user account to the local group on the remote machine: "Distributed COM Users".

QtApplication in Netbeans: "Not connected to D-Bus server"

I have created simple QtGui Application in QtCreator. it works.
then I have created QtApplication in Netbeans and added files generated in Creator (mainwindow.h,cpp,ui_mainwindow.h) to new Netbeans project.
it compiles, links, builds.
when I try to run executable, the window appears but there is also this message:
root#comp:~/NetBeansProjects/QtApplication_3/dist/Debug/GNU-Linux-x86#
./QtApplication_3 Qt at-spi: error getting the accessibility dbus
address: "Not connected to D-Bus server" Accessibility DBus not
found. Falling back to session bus. Could not connect to DBus. Could
not connect to dbus.
(process:10309): GConf-WARNING **: Client failed to connect to the
D-BUS daemon: Did not receive a reply. Possible causes include: the
remote application did not send a reply, the message bus security
policy blocked the reply, the reply timeout expired, or the network
connection was broken.
** (QtApplication_3:10309): WARNING **: Unable to create Ubuntu Menu Proxy: The connection is closed
root#ubuntuamd:~/NetBeansProjects/QtApplication_3/dist/Debug/GNU-Linux-x86#
how is this related to network connection? this is just window.
is my approach OK to copy the code generated in Creator? maybe then I have to do something additionally?
here I have found some tips regarding these errors

Windows service running on Windows Server 2003 cannot call an xml web service on the same machine

I have an XML web service running on my Windows 2003 server. I have a windows service running on the same machine. I want to call the XML web service from the windows service.
This works fine on my development machine, which is running Windows XP. However, when I try to do this on my Windows Server 2003 box, it times out and throws an exception. My windows service catches the exception and writes it to the eventlog. This is how the error shows up in the event log :
The description for Event ID ( 0 ) in Source ( myWS ) cannot be found. The local computer may not have the necessary registry information or message DLL files to display messages from a remote computer. You may be able to use the /AUXSOURCE= flag to retrieve this description; see Help and Support for details. The following information is part of the event:
Exception in MyWS service : [System.Net.WebException: Unable to connect to the remote server ---> System.Net.Sockets.SocketException: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond [MY IP ADDRESS HERE]
at System.Net.Sockets.Socket.DoConnect(EndPoint endPointSnapshot, SocketAddress socketAddress)
at System.Net.Sockets.Socket.InternalConnect(EndPoint remoteEP)
at System.Net.ServicePoint.ConnectSocketInternal(Boolean connectFailure, Socket s4, Socket s6, Socket& socket, IPAddress& address, ConnectSocketState state, IAsyncResult asyncResult, Int32 timeout, Exception& exception)
--- End of inner exception stack trace ---
at System.Net.HttpWebRequest.GetRequestStream()
at System.Web.Services.Protocols.SoapHttpClientProtocol.Invoke(String methodName, Object[] parameters)
at TesterClient.Test() in C:\Projects\Odyl\OdylUtilities\MyWS\TesterClient.cs:line 30
at MyWS.MyWSWindowsService.DoMyWSService() in C:\Projects\Odyl\OdylUtilities\MyWS\MyWSWindowsService.cs:line 81
at MyWS.MyWSWindowsService.StartService() in C:\Projects\Odyl\OdylUtilities\MyWS\MyWSWindowsService.cs:line 45].
As you can see, it has some problem with writing to the eventlog (all that AUXSOURCE stuff), but the main problem is that it's getting a timeout error from the web service.
Here's the truly odd thing, though -- from my dev box (running XP), I can call the web service that's running on my Windows 2003 Server box. This is really perplexing -- obviously the web service is working fine, but for some reason, Windows Server 2003 will not let you call a web service from the same machine!
Can anybody please give me a hint as to what's going on?
This sounds like a networking issue related to your Win2K3 server. The network configuration is preventing it from accessing the service url at the given location.
Easiest way to troubleshoot this: RDP to the Win2K3 Server desktop and open up a web browser to connect to the web service. I expect you will get a timeout.
Easiest way to remedy this: if there is a URL to the service that works locally, i.e. localhost, try that from your service. Otherwise, be prepared to get your network administrator involved to understand the DNS settings necessary to support the URL path you want to use for your service.