Couchbase with Azure Linux VM - c#
I installed ubuntu server VM on Azure there I installed couchbase community edition on now i need to access the couchbase using dotnet SDK but code gives me bucket not found or unreachable error.
even i try configuring a public dns and gave it as ip during cluster creation but still its giving the same.
even i added public dns to the host file like below
127.0.0.1 public dns
The SDK log includes below 2 statements
Attempted bootstrapping on endpoint "name.eastus.cloudapp.azure.com" has failed. (e80489ed)
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.
SDK Doctor Log:
09:51:20.331 INFO ▶ Parsing connection string `couchbases://hsotname.eastus.cloudapp.azure.com/travel-sample`
09:51:20.334 INFO ▶ Connection string was parsed as a potential DNS SRV record
09:51:31.316 INFO ▶ Connection string specifies to use secured connections
09:51:31.316 INFO ▶ Connection string identifies the following CCCP endpoints:
09:51:31.316 INFO ▶ 1. hsotname.eastus.cloudapp.azure.com:11207
09:51:31.316 INFO ▶ Connection string identifies the following HTTP endpoints:
09:51:31.316 INFO ▶ 1. hsotname.eastus.cloudapp.azure.com:18091
09:51:31.316 INFO ▶ Connection string specifies bucket `travel-sample`
09:51:31.316 WARN ▶ No certificate authority file specified (--tls-ca), skipping server certificate verification for this run.
09:51:42.453 WARN ▶ Your connection string specifies only a single host. You should consider adding additional static nodes from your cluster to this list to improve your applications fault-tolerance
09:51:42.462 INFO ▶ Performing DNS lookup for host `hsotname.eastus.cloudapp.azure.com`
09:51:42.462 INFO ▶ Bootstrap host `hsotname.eastus.cloudapp.azure.com` refers to a server with the address `13.82.80.55`
09:51:42.462 INFO ▶ Attempting to connect to cluster via CCCP
09:51:42.463 INFO ▶ Attempting to fetch config via cccp from `hsotname.eastus.cloudapp.azure.com:11207`
09:51:44.474 ERRO ▶ Failed to fetch configuration via cccp from `hsotname.eastus.cloudapp.azure.com:11207` (error: dial tcp 13.82.80.55:11207: i/o timeout)
09:51:44.474 INFO ▶ Attempting to connect to cluster via HTTP (Terse)
09:51:44.474 INFO ▶ Attempting to fetch terse config via http from `hsotname.eastus.cloudapp.azure.com:18091`
09:51:46.480 ERRO ▶ Failed to fetch terse configuration via http from `hsotname.eastus.cloudapp.azure.com:18091` (error: Get "http://hsotname.eastus.cloudapp.azure.com:18091/pools/default/b/travel-sample": context deadline exceeded (Client.Timeout exceeded while awaiting headers))
09:51:46.480 INFO ▶ Attempting to connect to cluster via HTTP (Full)
09:51:46.480 INFO ▶ Failed to connect via HTTP (Full), as it is not yet supported by the doctor
09:51:46.481 INFO ▶ Selected the following network type:
09:51:46.481 ERRO ▶ All endpoints specified by your connection string were unreachable, further cluster diagnostics are not possible
09:51:46.481 INFO ▶ Diagnostics completed
Summary:
←[33m[WARN]←[0m No certificate authority file specified (--tls-ca), skipping server certificate verification for this run.
←[33m[WARN]←[0m Your connection string specifies only a single host. You should consider adding additional static nodes from your cluster to this list to improve your applications fault-tolerance
←[31m[ERRO]←[0m Failed to fetch configuration via cccp from `hsotname.eastus.cloudapp.azure.com:11207` (error: dial tcp 13.82.80.55:11207: i/o timeout)
←[31m[ERRO]←[0m Failed to fetch terse configuration via http from `hsotname.eastus.cloudapp.azure.com:18091` (error: Get "http://hsotname.eastus.cloudapp.azure.com:18091/pools/default/b/travel-sample": context deadline exceeded (Client.Timeout exceeded while awaiting headers))
←[31m[ERRO]←[0m All endpoints specified by your connection string were unreachable, further cluster diagnostics are not possible
Found multiple issues, see listing above.
Both 18091 and 11207 port i added as inbound rule.
my ufw status is inactive
The above mentioned 2 ports are not listening
couchbaseadm#couchbasedbserver:~$ sudo lsof -i -P -n | grep LISTEN
systemd-r 926 systemd-resolve 13u IPv4 18715 0t0 TCP 127.0.0.53:53 (LISTEN)
sshd 1103 root 3u IPv4 21086 0t0 TCP *:22 (LISTEN)
sshd 1103 root 4u IPv6 21088 0t0 TCP *:22 (LISTEN)
beam.smp 6323 couchbase 17u IPv4 3937812 0t0 TCP 127.0.0.1:21200 (LISTEN)
epmd 6354 couchbase 3u IPv4 3937267 0t0 TCP *:4369 (LISTEN)
epmd 6354 couchbase 4u IPv6 3937268 0t0 TCP *:4369 (LISTEN)
beam.smp 6465 couchbase 34u IPv4 3943391 0t0 TCP *:21100 (LISTEN)
beam.smp 6465 couchbase 48u IPv4 3938657 0t0 TCP *:8091 (LISTEN)
beam.smp 6514 couchbase 17u IPv4 3938608 0t0 TCP 127.0.0.1:21300 (LISTEN)
beam.smp 6514 couchbase 27u IPv4 3938628 0t0 TCP *:8092 (LISTEN)
prometheu 6563 couchbase 9u IPv4 3938650 0t0 TCP 127.0.0.1:9123 (LISTEN)
goxdcr 6583 couchbase 11u IPv4 3938705 0t0 TCP 127.0.0.1:9998 (LISTEN)
memcached 6592 couchbase 5u IPv4 3938689 0t0 TCP 127.0.0.1:11280 (LISTEN)
memcached 6592 couchbase 12u IPv4 3937931 0t0 TCP *:11210 (LISTEN)
memcached 6592 couchbase 13u IPv4 3937932 0t0 TCP *:11209 (LISTEN)
memcached 6592 couchbase 14u IPv6 3937933 0t0 TCP *:11210 (LISTEN)
memcached 6592 couchbase 15u IPv6 3937934 0t0 TCP *:11209 (LISTEN)
indexer 6741 couchbase 16u IPv4 3944492 0t0 TCP *:9101 (LISTEN)
indexer 6741 couchbase 19u IPv4 3944066 0t0 TCP *:9100 (LISTEN)
indexer 6741 couchbase 20u IPv4 3944500 0t0 TCP *:9102 (LISTEN)
indexer 6741 couchbase 69u IPv4 3946013 0t0 TCP *:9105 (LISTEN)
projector 6762 couchbase 9u IPv4 3944075 0t0 TCP *:9999 (LISTEN)
cbq-engin 6782 couchbase 7u IPv6 3944534 0t0 TCP *:8093 (LISTEN)
cbq-engin 6782 couchbase 8u IPv4 3944535 0t0 TCP *:8093 (LISTEN)
cbft 6799 couchbase 8u IPv4 3944112 0t0 TCP *:9130 (LISTEN)
cbft 6799 couchbase 9u IPv4 3944149 0t0 TCP *:8094 (LISTEN)
sync_gate 11950 sync_gateway 8u IPv4 4119414 0t0 TCP 127.0.0.1:4985 (LISTEN)
sync_gate 11950 sync_gateway 9u IPv6 4119422 0t0 TCP *:4984 (LISTEN)
Here is the stacktrace:
StackTrace " at Couchbase.Core.ClusterContext.d__58.MoveNext()\r\n
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)\r\n
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n
at System.Threading.Tasks.ValueTask1.get_Result()\r\n at System.Runtime.CompilerServices.ConfiguredValueTaskAwaitable1.ConfiguredValueTaskAwaiter.GetResult()\r\n
at Couchbase.Cluster.<>c__DisplayClass30_0.<b__0>d.MoveNext()\r\n
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)\r\n
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n
at System.Threading.Tasks.ValueTask1.get_Result()\r\n at System.Runtime.CompilerServices.ConfiguredValueTaskAwaitable1.ConfiguredValueTaskAwaiter.GetResult()\r\n
Dotnet SDK Log
2022-02-09T17:28:46.3409884+05:30 [DBG] Waiting for 00:00:02.5000000 before polling. (c8639b24)
2022-02-09T17:28:48.8643285+05:30 [DBG] Done waiting, polling... (93018145)
2022-02-09T17:28:48.8649060+05:30 [DBG] Waiting for 00:00:02.5000000 before polling. (c8639b24)
2022-02-09T17:28:51.3664735+05:30 [DBG] Done waiting, polling... (93018145)
2022-02-09T17:28:51.3667541+05:30 [DBG] Waiting for 00:00:02.5000000 before polling. (c8639b24)
2022-02-09T17:28:53.8811651+05:30 [DBG] Done waiting, polling... (93018145)
2022-02-09T17:28:53.8814100+05:30 [DBG] Waiting for 00:00:02.5000000 before polling. (c8639b24)
2022-02-09T17:28:56.3823825+05:30 [DBG] Done waiting, polling... (93018145)
2022-02-09T17:28:56.3826183+05:30 [DBG] Waiting for 00:00:02.5000000 before polling. (c8639b24)
2022-02-09T17:28:58.8964320+05:30 [DBG] Done waiting, polling... (93018145)
2022-02-09T17:28:58.8967224+05:30 [DBG] Waiting for 00:00:02.5000000 before polling. (c8639b24)
2022-02-09T17:29:01.4007664+05:30 [DBG] Done waiting, polling... (93018145)
2022-02-09T17:29:01.4010274+05:30 [DBG] Waiting for 00:00:02.5000000 before polling. (c8639b24)
2022-02-09T17:29:01.7019750+05:30 [INF] Error trying to retrieve DNS SRV entries. (addddf06)
DnsClient.DnsResponseException: Query 12389 => _couchbases._tcp.hsotname.eastus.cloudapp.azure.com IN SRV on 192.168.8.1:53 timed out or is a transient error.
---> System.OperationCanceledException: The operation was canceled.
at System.Threading.Tasks.TaskExtensions.WithCancellation[T](Task`1 task, CancellationToken cancellationToken, Action onCancel)
at DnsClient.LookupClient.ResolveQueryAsync(IReadOnlyList`1 servers, DnsQuerySettings settings, DnsMessageHandler handler, DnsRequestMessage request, LookupClientAudit audit, CancellationToken cancellationToken)
--- End of inner exception stack trace ---
at DnsClient.LookupClient.ResolveQueryAsync(IReadOnlyList`1 servers, DnsQuerySettings settings, DnsMessageHandler handler, DnsRequestMessage request, LookupClientAudit audit, CancellationToken cancellationToken)
at DnsClient.LookupClient.QueryInternalAsync(DnsQuestion question, DnsQuerySettings queryOptions, IReadOnlyCollection`1 servers, CancellationToken cancellationToken)
at Couchbase.DnsClientDnsResolver.GetDnsSrvEntriesAsync(Uri bootstrapUri, CancellationToken cancellationToken)
at Couchbase.Core.ClusterContext.BootstrapGlobalAsync()
2022-02-09T17:29:01.7034867+05:30 [DBG] Bootstrapping with node "hsotname.eastus.cloudapp.azure.com" (98ca0e33)
2022-02-09T17:29:03.9124149+05:30 [DBG] Done waiting, polling... (93018145)
2022-02-09T17:29:03.9127285+05:30 [DBG] Waiting for 00:00:02.5000000 before polling. (c8639b24)
2022-02-09T17:29:06.4201295+05:30 [DBG] Done waiting, polling... (93018145)
2022-02-09T17:29:06.4205385+05:30 [DBG] Waiting for 00:00:02.5000000 before polling. (c8639b24)
2022-02-09T17:29:08.9317820+05:30 [DBG] Done waiting, polling... (93018145)
2022-02-09T17:29:08.9320832+05:30 [DBG] Waiting for 00:00:02.5000000 before polling. (c8639b24)
2022-02-09T17:29:11.4459313+05:30 [DBG] Done waiting, polling... (93018145)
2022-02-09T17:29:11.4463142+05:30 [DBG] Waiting for 00:00:02.5000000 before polling. (c8639b24)
2022-02-09T17:29:12.1488979+05:30 [DBG] Attempted bootstrapping on endpoint "hsotname.eastus.cloudapp.azure.com" has failed. (e80489ed)
System.Net.Sockets.SocketException (10060): 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.
at Couchbase.Core.IO.Connections.ConnectionFactory.CreateAndConnectAsync(HostEndpointWithPort hostEndpoint, CancellationToken cancellationToken)
at Couchbase.Core.IO.Connections.ConnectionPoolBase.CreateConnectionAsync(CancellationToken cancellationToken)
at Couchbase.Core.IO.Connections.DataFlow.DataFlowConnectionPool.<>c__DisplayClass30_0.<<AddConnectionsAsync>g__StartConnection|0>d.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at Couchbase.Core.IO.Connections.DataFlow.DataFlowConnectionPool.AddConnectionsAsync(Int32 count, CancellationToken cancellationToken)
at Couchbase.Core.IO.Connections.DataFlow.DataFlowConnectionPool.InitializeAsync(CancellationToken cancellationToken)
at Couchbase.Core.ClusterNode.InitializeAsync()
at Couchbase.Core.DI.ClusterNodeFactory.CreateAndConnectAsync(HostEndpointWithPort endPoint, BucketType bucketType, NodeAdapter nodeAdapter, CancellationToken cancellationToken)
at Couchbase.Core.ClusterContext.BootstrapGlobalAsync()
2022-02-09T17:29:33.3259787+05:30 [DBG] Done waiting, polling... (93018145)
2022-02-09T17:29:33.3262710+05:30 [DBG] Waiting for 00:00:02.5000000 before polling. (c8639b24)
2022-02-09T17:29:35.8341848+05:30 [DBG] Done waiting, polling... (93018145)
2022-02-09T17:29:35.8343993+05:30 [DBG] Waiting for 00:00:02.5000000 before polling. (c8639b24)
2022-02-09T17:29:36.9552318+05:30 [DBG] Setting TCP Keep-Alives using SocketOptions - enable keep-alives True, time 00:01:00, interval 00:00:01. (d66a37aa)
2022-02-09T17:29:36.9596725+05:30 [DBG] Setting TCP Keep-Alives using SocketOptions - enable keep-alives True, time 00:01:00, interval 00:00:01. (d66a37aa)
2022-02-09T17:29:37.0170984+05:30 [INF] Cannot bootstrap bucket "travel-sample" as Couchbase. (1ecb21a9)
System.IO.IOException: The operation is not allowed on non-connected sockets.
at System.Net.Sockets.NetworkStream..ctor(Socket socket, FileAccess access, Boolean ownsSocket)
at Couchbase.Core.IO.Connections.ConnectionFactory.CreateAndConnectAsync(HostEndpointWithPort hostEndpoint, CancellationToken cancellationToken)
at Couchbase.Core.IO.Connections.ConnectionPoolBase.CreateConnectionAsync(CancellationToken cancellationToken)
at Couchbase.Core.IO.Connections.DataFlow.DataFlowConnectionPool.<>c__DisplayClass30_0.<<AddConnectionsAsync>g__StartConnection|0>d.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at Couchbase.Core.IO.Connections.DataFlow.DataFlowConnectionPool.AddConnectionsAsync(Int32 count, CancellationToken cancellationToken)
at Couchbase.Core.IO.Connections.DataFlow.DataFlowConnectionPool.InitializeAsync(CancellationToken cancellationToken)
at Couchbase.Core.ClusterNode.InitializeAsync()
at Couchbase.Core.DI.ClusterNodeFactory.CreateAndConnectAsync(HostEndpointWithPort endPoint, BucketType bucketType, NodeAdapter nodeAdapter, CancellationToken cancellationToken)
at Couchbase.Core.ClusterContext.CreateAndBootStrapBucketAsync(String name, HostEndpointWithPort endpoint, BucketType type)
at Couchbase.Core.ClusterContext.GetOrCreateBucketAsync(String name)
2022-02-09T17:29:38.3360012+05:30 [DBG] Done waiting, polling... (93018145)
2022-02-09T17:29:38.3361875+05:30 [DBG] Waiting for 00:00:02.5000000 before polling. (c8639b24)
2022-02-09T17:29:40.3244490+05:30 [DBG] Setting TCP Keep-Alives using SocketOptions - enable keep-alives True, time 00:01:00, interval 00:00:01. (d66a37aa)
2022-02-09T17:29:40.3507801+05:30 [DBG] Setting TCP Keep-Alives using SocketOptions - enable keep-alives True, time 00:01:00, interval 00:00:01. (d66a37aa)
2022-02-09T17:29:40.3525230+05:30 [INF] Cannot bootstrap bucket "travel-sample" as Memcached. (1ecb21a9)
System.IO.IOException: The operation is not allowed on non-connected sockets.
at System.Net.Sockets.NetworkStream..ctor(Socket socket, FileAccess access, Boolean ownsSocket)
at Couchbase.Core.IO.Connections.ConnectionFactory.CreateAndConnectAsync(HostEndpointWithPort hostEndpoint, CancellationToken cancellationToken)
at Couchbase.Core.IO.Connections.ConnectionPoolBase.CreateConnectionAsync(CancellationToken cancellationToken)
at Couchbase.Core.IO.Connections.DataFlow.DataFlowConnectionPool.<>c__DisplayClass30_0.<<AddConnectionsAsync>g__StartConnection|0>d.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at Couchbase.Core.IO.Connections.DataFlow.DataFlowConnectionPool.AddConnectionsAsync(Int32 count, CancellationToken cancellationToken)
at Couchbase.Core.IO.Connections.DataFlow.DataFlowConnectionPool.InitializeAsync(CancellationToken cancellationToken)
at Couchbase.Core.ClusterNode.InitializeAsync()
at Couchbase.Core.DI.ClusterNodeFactory.CreateAndConnectAsync(HostEndpointWithPort endPoint, BucketType bucketType, NodeAdapter nodeAdapter, CancellationToken cancellationToken)
at Couchbase.Core.ClusterContext.CreateAndBootStrapBucketAsync(String name, HostEndpointWithPort endpoint, BucketType type)
at Couchbase.Core.ClusterContext.GetOrCreateBucketAsync(String name)
2022-02-09T17:29:40.8385667+05:30 [DBG] Done waiting, polling... (93018145)
2022-02-09T17:29:40.8387609+05:30 [DBG] Waiting for 00:00:02.5000000 before polling. (c8639b24)
2022-02-09T17:29:43.3380840+05:30 [DBG] Done waiting, polling... (93018145)
2022-02-09T17:29:43.3382393+05:30 [DBG] Waiting for 00:00:02.5000000 before polling. (c8639b24)
2022-02-09T17:29:43.6633010+05:30 [DBG] Setting TCP Keep-Alives using SocketOptions - enable keep-alives True, time 00:01:00, interval 00:00:01. (d66a37aa)
2022-02-09T17:29:43.6842924+05:30 [DBG] Setting TCP Keep-Alives using SocketOptions - enable keep-alives True, time 00:01:00, interval 00:00:01. (d66a37aa)
2022-02-09T17:29:43.6862758+05:30 [INF] Cannot bootstrap bucket "travel-sample" as Ephemeral. (1ecb21a9)
System.IO.IOException: The operation is not allowed on non-connected sockets.
at System.Net.Sockets.NetworkStream..ctor(Socket socket, FileAccess access, Boolean ownsSocket)
at Couchbase.Core.IO.Connections.ConnectionFactory.CreateAndConnectAsync(HostEndpointWithPort hostEndpoint, CancellationToken cancellationToken)
at Couchbase.Core.IO.Connections.ConnectionPoolBase.CreateConnectionAsync(CancellationToken cancellationToken)
at Couchbase.Core.IO.Connections.DataFlow.DataFlowConnectionPool.<>c__DisplayClass30_0.<<AddConnectionsAsync>g__StartConnection|0>d.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at Couchbase.Core.IO.Connections.DataFlow.DataFlowConnectionPool.AddConnectionsAsync(Int32 count, CancellationToken cancellationToken)
at Couchbase.Core.IO.Connections.DataFlow.DataFlowConnectionPool.InitializeAsync(CancellationToken cancellationToken)
at Couchbase.Core.ClusterNode.InitializeAsync()
at Couchbase.Core.DI.ClusterNodeFactory.CreateAndConnectAsync(HostEndpointWithPort endPoint, BucketType bucketType, NodeAdapter nodeAdapter, CancellationToken cancellationToken)
at Couchbase.Core.ClusterContext.CreateAndBootStrapBucketAsync(String name, HostEndpointWithPort endpoint, BucketType type)
at Couchbase.Core.ClusterContext.GetOrCreateBucketAsync(String name)
Thanks!!
Thank you for providing so much detailed information! I suspect the immediate issue is that you are trying to connect using TLS, which is not supported by Couchbase Community Edition (at least not as of February 2022). Ports 11207 and 18091 are for TLS connections; as you observed in the lsof output, the server is not listening on those ports.
I resolve the issue by changing the connection string for couchbase
from
couchbase://
to
http://
Related
SignalR Host No connection could be made because the target machine actively refused it
so currently i have a SignalR hub and an ASP API in the same project, all works fine and well ofcourse, however putting it onto the remote it'll give errors while connecting: System.Net.Http.HttpRequestException: No connection could be made because the target machine actively refused it. (--remoteIp--:80) ---> System.Net.Sockets.SocketException (10061): No connection could be made because the target machine actively refused it. at System.Net.Sockets.Socket.AwaitableSocketAsyncEventArgs.ThrowException(SocketError error, CancellationToken cancellationToken) at System.Net.Sockets.Socket.AwaitableSocketAsyncEventArgs.System.Threading.Tasks.Sources.IValueTaskSource.GetResult(Int16 token) at System.Net.Sockets.Socket.<ConnectAsync>g__WaitForConnectWithCancellation|277_0(AwaitableSocketAsyncEventArgs saea, ValueTask connectTask, CancellationToken cancellationToken) at System.Net.Http.HttpConnectionPool.ConnectToTcpHostAsync(String host, Int32 port, HttpRequestMessage initialRequest, Boolean async, CancellationToken cancellationToken) The api does work, just not the SignalR Hub Do i have to disable something firewall wise, or is there anything i have to do? server is Linux, Nginx. asp is currently proxy routed and is HTTP
WebSocketSharp returning "Input string was not in a correct format"
I have a c# client that I am trying to connect to a websocket server. Using the Chrome extension "Simple Web Socket Client", I can connect, and send commands ok to the websocket server so I know the server is working ok and it is a commerical product. I am trying to use the library WebSocketSharp and I get this error while trying to connect to the socket. Just so you know there are no proxy servers in play and the server is on the internal network. 2/03/2018 4:05:00 PM|Fatal|WebSocket.Connect|WebSocketSharp.WebSocketException: An exception has occurred while reading an HTTP request/response. ---> System.FormatException: Input string was not in a correct format. at System.Version.VersionResult.SetFailure(ParseFailureKind failure, String argument) at System.Version.TryParseComponent(String component, String componentName, VersionResult& result, Int32& parsedComponent) at System.Version.TryParseVersion(String version, VersionResult& result) at System.Version.Parse(String input) at System.Version..ctor(String version) at WebSocketSharp.HttpResponse.Parse(String[] headerParts) at WebSocketSharp.HttpBase.Read[T](Stream stream, Func`2 parser, Int32 millisecondsTimeout) --- End of inner exception stack trace --- at WebSocketSharp.HttpBase.Read[T](Stream stream, Func`2 parser, Int32 millisecondsTimeout) at WebSocketSharp.HttpRequest.GetResponse(Stream stream, Int32 millisecondsTimeout) at WebSocketSharp.WebSocket.sendHttpRequest(HttpRequest request, Int32 millisecondsTimeout) at WebSocketSharp.WebSocket.sendHandshakeRequest() at WebSocketSharp.WebSocket.doHandshake() at WebSocketSharp.WebSocket.connect() Using wireshark I followed the stream and got this as part of the handshake GET / HTTP/1.1 User-Agent: websocket-sharp/1.0 Host: 192.168.0.29:55537 Upgrade: websocket Connection: Upgrade Sec-WebSocket-Key: o0Smz22nOFWLW/3hvyvYQQ== Sec-WebSocket-Extensions: permessage-deflate; server_no_context_takeover; client_no_context_takeover Sec-WebSocket-Version: 13 ....HTTP/1.1 101 Switching Protocols Connection: Upgrade Upgrade: websocket Sec-WebSocket-Accept: guJWynqtY1ZrPq+m6bfUGE2yJvA= Any idea? I've even tried WebSocket4Net and that also had an issue connecting.
kestrel + nginx intermittent 502
I have an ASP.NET core 1.0 app running on ubuntu 16.04 behind nginx/1.10.0. However, I notice that intermittently nginx throws the following error (in nginx error-log) 2017/06/08 05:19:19 [error] 11572#11572: *119049 upstream prematurely closed connection while reading response header from upstream, client: <ipaddress>, server: <servername>, request: "POST /<uri> HTTP/1.1", upstream: "http://127.0.0.1:5000/<uri>", host: "<servername>" which results in a 502 Bad Gateway to the client although the request completes successfully in the application 2017-06-08 05:19:14.399 [DBG] Executed action method "<Controller.Action>", returned result "Microsoft.AspNetCore.Mvc.CreatedAtRouteResult Could this be an nginx configuration issue or ASP.NET/Kestrel issue? Can someone give me hints to debug this? Further notes: I also see the following in the application log just after request completion 2017-06-08 05:19:14.399 [DBG] Executed action method "<Controller.Action>", returned result "Microsoft.AspNetCore.Mvc.CreatedAtRouteResult 2017-06-08 05:19:18.632 [DBG] Some connections failed to close gracefully during server shutdown. 2017-06-08 05:19:22.402 [DBG] Hosting starting 2017-06-08 05:19:22.689 [DBG] Hosting started and the nginx error is just around the same time 2017/06/08 05:19:19 Also, normally in the logs I see messages around Executing ObjectResult and Executed time etc. which I don't see with the above request 2017-06-08 00:10:14.391 [DBG] Selected output formatter '"Microsoft.AspNetCore.Mvc.Formatters.JsonOutputFormatter"' and content type '"application/json"' to write the response. 2017-06-08 00:10:14.391 [INF] Executing ObjectResult, writing value "Microsoft.AspNetCore.Mvc.ControllerContext". 2017-06-08 00:10:14.504 [INF] Executed action "<Controller.Action>" in 1875.3845ms
Cannot initialize AndroidDriver
At W2k8 64 bit I have in the android emulator instance of android 4.1 API Level 16 with ARM as CPU. After launch of it I'm running my UnitTest and on the first line var webDriver = new AndroidDriver("http://localhost:8080/wd/hub"); //also with no argument I got an exception: Unexpected error. System.Net.WebException: Unable to connect to the remote server ---> System.Net.Sockets.SocketException: No connection could be made because the target machine actively refused it 127.0.0.1:8080 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(TransportContext& context) at System.Net.HttpWebRequest.GetRequestStream() at OpenQA.Selenium.Remote.HttpCommandExecutor.Execute(Command commandToExecute) at OpenQA.Selenium.Remote.RemoteWebDriver.Execute(String driverCommandToExecute, Dictionary`2 parameters) Version of this WebDriver is 2.25.1.0. I followed this article: http://www.nishantverma.com/2011/06/installing-webdriver-on-android.html When I'm using other drivers like Firefox- or ChromeDriver works fine. I would be gratefull for any advice
I might be telling you what you already know, but have you started the tcp port forwarding to android server you are running. for reference check Android Driver
Your server is not starting for some reason. Is it possible you already have something else running on port 8080? Try running netstat -a -n and see if port 8080 is listed. If it is in use, you might try setting up on a different port or killing the process which is using that port. You might also try disabling UAC and Firewall on your machine and/or running the process as Administrator and see if that helps (This would be temporary of course, don't leave these off).
.Net Web Request - Unable to connect to the remote server
I'm using .Net Web Request to read the html of selected Webpages. Once in a while I'm getting the following error: 2010-09-05 13:14:51,986 [File_29] ERROR Boxer.Classes.GetLinks [(null)] - HtmlUtils - GetResponse - Url - http://domain.com/index.html 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 69.212.110.118:5068 at System.Net.Sockets.Socket.DoConnect(EndPoint endPointSnapshot, SocketAddress socketAddress) 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.GetResponse() at Boxer.Classes.GetLinks.GetResponse(String url, Int32 timeout, Boolean& timeoutException) I know for sure that the target URL is available. Any idea what is the cause of the error?
There could be different reasons for this happening. Maybe the target server is throttling the response because it believes the request comes from a bot. In this case you might consider sending proper HTTP headers (if it works in your browser, try sending the same request headers). Also there could be a proxy in between that you need to configure and use.