Getting ServiceFault response from server - opc-ua

In OPCUA, Initially server responding properly to all
CreateMonitoredItemRequest with CreateMonitoredItemResponse. After
sometime, server sending Service Fault response to
CreateMonitoredItemRequest.
Using One tool I am sending CreateMonitoredItemRequest to server
after that server respond with server fault.
Can anyone tell what is the meaning of service Fault? I am quite new to OPCUA protocol.

A ServiceFault response contains a StatusCode that should indicate the reason for failure.

Related

Vert.x - How to know which connection was closed

I have a Vert.x app that gets HTTP requests as a Server and later down the road sends the data (HTTP request as well) as a Client to several other servers (more than one Client exits).
I see in the logs that sometimes I get io.vertx.core.VertxException: Connection was closed
but with no other info.
How can I know which connection was the one that was actually closed? I have more than one connections active.
I tried to add exceptionHandler to HttpServer and to HttpClientRequest, but they both were never called.
The io.vertx.core.VertxException: Connection was closed can be triggered for both client connections and server connections.
You'd get these errors on your HTTP client connection if the remote server closed the connection before completing the response, and you'd be able to capture them by setting the appropriate handlers on the client request (With Vert.x 4, you'd do something like ...send().onFailure(err -> /* handle the failure */) ), which I believe you already do.
You'd get these errors for the HTTP server connection if the remote client disconnects, either before your server completed the response, or - if the connection has keep-alive enabled (which is the default for HTTP/1.1 connections) - even after the response was sent.
In case the client closed the server connection before the response was fully sent, you should be able to capture and handle there errors in the HttpServer.exceptionHandler(), as I'm sure you already do.
In case the client closed the server connection after the response was fully sent, while it is in a keep-alive state, then there is no HttpServerRequest (or RoutingContext if you are using vertx-web, as you should) where the exception happens in, so Vert.x would just disregard the error (see here for the code).
So why do you still see those errors in the log? It could be various things because that exception is also used to handle EventBus connections and all kinds of internal network streams managed by Vert.x servers - and all without a stack trace (the actual exception instance being thrown is created statically here), so Vert.x kinds of sucks in that way.
My recommendation: make sure you attach error handlers to everything (pay attention to websocket connections or HTTP response streams, if you use them) and if you still get those errors in the logs - maybe you can just ignroe them as the commenter suggested.

NSURLRequest Timing out without making connection to server

I have an application written in swift that communicated with my server using PHP. Throughout my testing the app has worked perfectly until I began testing on multiple devices simultaneously. When i try to load both devices at the same time it will sporadically (not 100%) create this timeout:
Error Domain=NSURLErrorDomain Code=-1001 "The request timed out." UserInfo=
{NSUnderlyingError=0x127ea9fb0 {Error Domain=kCFErrorDomainCFNetwork Code=-1001 "(null)" UserInfo={_kCFStreamErrorCodeKey=-2102, _kCFStreamErrorDomainKey=4}}, NSErrorFailingURLStringKey=https://myhttpsdomain/my_page.php, NSErrorFailingURLKey=https://myhttpsdomain/my_page.php, _kCFStreamErrorDomainKey=4, _kCFStreamErrorCodeKey=-2102, NSLocalizedDescription=The request timed out.}
Error with domain:https://myhttpsdomain/my_page.php
It creates this timer without ever making the connection to the server. Once the issue has been triggered all web requests from that device will create the error for a few minutes.
I am using a basic let task = session.dataTaskWithRequest to send post requests to my server.
To decide whether the server connection was made or not the first line in my php file is error_log("Page has been called"); And this line isn't even printing.
This is probably one of the following:
a DNS problem
a routing problem/network problem
a server configuration issue
First, check the server logs and see if the request suddenly appears in the logs whenever the client gives up on the connection. If so, you'll need a packet trace to know for sure, but chances are, your PHP script is wedging forever before it sends headers or the server is otherwise misconfigured in some way.
If not, then sniff the network and see if it is even sending out a request. And make sure that both devices can ping each other.

Connect to C++ REST sdk SERVER on Windows from LAN

I have a server written on C++ REST SDK.
There's http_listener which listens to "http://localhost:34568".
When I try to send a request in browser or from the client to localhost it works fine and I get the responses from my server. But the point is to use the application in network. And here where the problem comes.
When I try to request the server from the other PC using IP(192.168.1.103:34568) I get "HTTP Error 400. The request hostname is invalid."
I'm aware that that could be some firewall issues but it's turned off. Also I tried to set port rules in brandmauer and it didn't help.
And even more! I got XAMPP running Apache server and when I do the same thing but with (192.168.1.103:80) I do get the response from Apache and have an access.
Anybody had something similar or somebody knows what the problem is about?
Listen to local ip address or to your network name (dns):
"http://xxx.xxx.xxx.xxx:34568" or
"http://your_network_name:34568"
So, if you have multiple network adapters, you can choose which one.

Disconnects in FIX connections in local network

I have a FIX server and FIX client implementing FIX4.4 running on the same network. I use QuickFIX C++ engine. Altough they are on the same network, sometimes they disconnect. In the FIX server's event logs:
20140612-01:21:30.000 : Sent test request TEST
20140612-04:11:56.000 : Sent test request TEST
20140612-07:05:26.029 : Sent test request TEST
20140612-07:05:26.029 : Socket Error: An established connection was aborted by the software in your host machine.
Means HEARTBIT messages are failed to send/recv.
What can be wrong? I have a regular setup and nothing special..
Thanks
while the client connection was accepted by the server, it doesn't look like you then achieved "logon". First you connect, then you logon. You need to make a logon request after you connect. Look at the initial FIX messages sent between client and server.

"connection refused" when my play app makes http call to itself

I am implementing a heartbeat endpoint/route using play 2.2.1 built with Scala 2.10.2 (running Java 1.7.0_45). When
the heartbeat endpoint is called, I want the controller to make http calls to localhost. If all of those
calls are ok, then the heartbeat endpoint will return an OK http response.
When I execute the following url from curl, I get the expected 200 response:
http://localhost:9000/oauth2/token. I am also able to telnet to localhost 9000.
I am also able to use WS successfully with an external URL:
WS.url("http://www.example.com").withHeaders("Content-Type" -> "application/json").get()
However, when I execute it from within my play app, I get a 500 tcp_error response.
WS.url("http://localhost:9000/oauth2/token").withHeaders("Content-Type" -> "application/json").get()
WS.url("http://127.0.0.1:9000/oauth2/token").withHeaders("Content-Type" -> "application/json").get()
WS.url("http://HostName:9000/oauth2/token").withHeaders("Content-Type" -> "application/json").get()
Here is the exact error message I receive:
Network Error (tcp_error)
A communication error occurred: "Connection refused"
The Web Server may be down, too busy, or experiencing other problems preventing it from responding to requests. You may wish to try again at a later time.
For assistance, contact your network support team.
Do I need to configure something to allow a play application to make calls to itself? Is this a network problem on
my box? If so, why do curl and telnet work? If a network issue, then it must be a jvm specific networking issue?
Could it be a security problem with play calling to itself? Not sure where to go next.