lontivero / Open.NAT

Lightweight and easy-to-use class library to allow port forwarding in NAT devices with UPNP and/or PMP

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Server failed with error: 606 - Unknown Error Code

Mailaender opened this issue · comments

This happens with @OpenRA and a Fritz!Box 7490.

Open.NAT Information: 0 : Start Discovery
Open.NAT Information: 0 : Searching for: UpnpSearcher
Open.NAT Information: 0 : UPnP Response: Router advertised a 'urn:schemas-upnp-org:service:WANIPConnection:2' service!!!
Open.NAT Information: 0 : Found device at: http://192.168.178.1:49000/igd2desc.xml
Open.NAT Information: 0 : 192.168.178.1:49000: Fetching service list
Open.NAT Information: 0 : Found device at: http://192.168.178.1:49000/igd2desc.xml
Open.NAT Information: 0 : 192.168.178.1:49000: Parsed services list
Open.NAT Information: 0 : 192.168.178.1:49000: Found service: urn:schemas-upnp-org:service:WANIPConnection:2
Open.NAT Information: 0 : 192.168.178.1:49000: Found upnp service at: /igd2upnp/control/WANIPConn1
Open.NAT Information: 0 : 192.168.178.1:49000: Handshake Complete
Open.NAT Information: 0 : Stop Discovery
Open.NAT Information: 0 : GetExternalIPAsync - Getting external IP address
Open.NAT Verbose: 0 : SOAPACTION: **GetExternalIPAddress** url:http://192.168.178.1:49000/igd2upnp/control/WANIPConn1
Open.NAT Information: 0 : CreatePortMapAsync - Creating port mapping Tcp 1234 --> 192.168.178.33:1234 (OpenRA)
Open.NAT Verbose: 0 : SOAPACTION: **AddPortMapping** url:http://192.168.178.1:49000/igd2upnp/control/WANIPConn1
Open.NAT Verbose: 0 : WebException status: ProtocolError
Open.NAT Warning: 0 : Server failed with error: 606 - Unknown Error Code
  at Open.Nat.SoapClient.GetXmlDocument (System.String response) [0x00087] in <6d4a9fe16377494cb7ae3b94f6677780>:0 
  at Open.Nat.SoapClient+<InvokeAsync>d__3.MoveNext () [0x00242] in <6d4a9fe16377494cb7ae3b94f6677780>:0 
--- End of stack trace from previous location where exception was thrown ---
  at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x0000c] in <dca3b561b8ad4f9fb10141d81b39ff45>:0 
  at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess (System.Threading.Tasks.Task task) [0x0004e] in <dca3b561b8ad4f9fb10141d81b39ff45>:0 
  at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification (System.Threading.Tasks.Task task) [0x0002e] in <dca3b561b8ad4f9fb10141d81b39ff45>:0 
  at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd (System.Threading.Tasks.Task task) [0x0000b] in <dca3b561b8ad4f9fb10141d81b39ff45>:0 
  at System.Runtime.CompilerServices.TaskAwaiter`1[TResult].GetResult () [0x00000] in <dca3b561b8ad4f9fb10141d81b39ff45>:0 
  at Open.Nat.StreamExtensions+<TimeoutAfter>d__7`1[TResult].MoveNext () [0x0010a] in <6d4a9fe16377494cb7ae3b94f6677780>:0 
--- End of stack trace from previous location where exception was thrown ---
  at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x0000c] in <dca3b561b8ad4f9fb10141d81b39ff45>:0 
  at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess (System.Threading.Tasks.Task task) [0x0004e] in <dca3b561b8ad4f9fb10141d81b39ff45>:0 
  at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification (System.Threading.Tasks.Task task) [0x0002e] in <dca3b561b8ad4f9fb10141d81b39ff45>:0 
  at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd (System.Threading.Tasks.Task task) [0x0000b] in <dca3b561b8ad4f9fb10141d81b39ff45>:0 
  at System.Runtime.CompilerServices.TaskAwaiter`1[TResult].GetResult () [0x00000] in <dca3b561b8ad4f9fb10141d81b39ff45>:0 
  at Open.Nat.UpnpNatDevice+<CreatePortMapAsync>d__4.MoveNext () [0x00104] in <6d4a9fe16377494cb7ae3b94f6677780>:0 
--- End of stack trace from previous location where exception was thrown ---
  at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x0000c] in <dca3b561b8ad4f9fb10141d81b39ff45>:0 
  at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess (System.Threading.Tasks.Task task) [0x0004e] in <dca3b561b8ad4f9fb10141d81b39ff45>:0 
  at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification (System.Threading.Tasks.Task task) [0x0002e] in <dca3b561b8ad4f9fb10141d81b39ff45>:0 
  at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd (System.Threading.Tasks.Task task) [0x0000b] in <dca3b561b8ad4f9fb10141d81b39ff45>:0 
  at System.Runtime.CompilerServices.TaskAwaiter.GetResult () [0x00000] in <dca3b561b8ad4f9fb10141d81b39ff45>:0 
  at OpenRA.Network.UPnP+<ForwardPort>c__async1.MoveNext () [0x0009a] in <d64e6744391b472fa46cb62aa279c746>:0 
Open.NAT Information: 0 : DeletePortMapAsync - Deleteing port mapping Tcp 1234 --> 192.168.178.33:1234 (OpenRA)
Open.NAT Verbose: 0 : SOAPACTION: **DeletePortMapping** url:http://192.168.178.1:49000/igd2upnp/control/WANIPConn1
Open.NAT Verbose: 0 : WebException status: ProtocolError
Open.NAT Warning: 0 : Server failed with error: 714 - NoSuchEntryInArray

According to https://tools.ietf.org/html/rfc6970 606 means action not authorized. The router however has UPnP port forwardings set to allowed.

@Mailaender thanks for reporting issues. As you can see this error is returned by the router and Open.NAT simply informs the caller about it with an Exception.

Anyway, this can be because already exists a port mapping for Tcp 1234 --> 192.168.178.33:1234 (OpenRA). This should be easy to reproduce, just create the same mapping twice and check that the second one fails.

From my side I just can verify Open.NAT is sending the right messages to the right endpoint if you send me the log file.

Had to go to http://fritz.box/?lp=portoverview and allow the host specifically. Sorry, my bad.