UPNP not working

Note - If you do not fill in every section below, your post won’t be answered - you must provide the steps you have followed so far and the actions you’ve already taken. Make sure to remove this notice from your post too.

OS Name/Version: Windows Server 2019 Standard

Product Name/Version: 2.3.3.4

Problem Description:
I enabled the UPNP sync. Upgraded the instances and restarted them. Checked my router and it did not forward the ports via UPNP. Other applications have port forwarding working within the network.

Actions taken to resolve so far:
Restarted AMP
Upgraded instances


Only new instances are added to UPnP right now. Existing instances are not included. The feature is still in beta so it’s usage is limited for now.

I tested with a newly created instance and it still did not create the port forward via UPNP

You might have to wait a while for the main firewall sync. Also make sure that ampinstmgr is the latest version as well as AMP itself.

You can run ampinstmgr updatefirewall on the command prompt to see what’s going on.

Ran the command and looks like it ran smooth bot no UPNP sadly :frowning:

[Info] AMP Instance Manager v2.3.2.8 built 28/03/2022 15:22
e[0m[Info] Release spec: Release - built by CUBECODERS/buildbot on CCL-DEV
e[0m[Info] Using Windows Advanced Firewall firewall.
e[0m[Info] Adding 3 new firewall rules
e[0m[Info] Firewall rule to add: TCP/2232 (AMP:TESTUPNP:FileManagerPlugin.SFTP.SFTPPortNumber)
e[0m[Info] Firewall rule to add: UDP/34197 (AMP:TESTUPNP:FactorioModule.Startup.Port)
e[0m[Info] Firewall rule to add: TCP/7779 (AMP:TESTUPNP:FactorioModule.Startup.RCONPort)
e[0m[Info] No existing firewall rules to remove
e[0m

Aah, UPnP sync also requires a whole new installation of the instance manager GUI app. Make sure to do a custom installation and make sure the feature is enabled.

Is there instructions some place I can follow to do the reinstallation so we don’t lose the existing instances as well?

Uninstalling the instance manager doesn’t affect instances at all. It’s entirely safe to do. It won’t even disrupt your running AMP instances.

Uninstalled the Instance Manager
Downloaded latest from the website, did custom installation and made sure UPNP was enabled
Created a new instance
Ran the updatefirewall
Still no UPNP Syncing :frowning: I did confirm the setting was still enabled.

[Info] AMP Instance Manager v2.3.4 built 16/06/2022 16:35
[Info] Release spec: Release - built by CUBECODERS/buildbot on CCL-DEV
[Info] Using Windows Advanced Firewall firewall.
[Info] Adding 3 new firewall rules
[Info] Firewall rule to add: TCP/2232 (AMP:TestUPNP:FileManagerPlugin.SFTP.SFTPPortNumber)
[Info] Firewall rule to add: UDP/34197 (AMP:TestUPNP:FactorioModule.Startup.Port)
[Info] Firewall rule to add: TCP/7779 (AMP:TestUPNP:FactorioModule.Startup.RCONPort)
[Info] No existing firewall rules to remove

In Regedit, is HKEY_LOCAL_MACHINE\Software\CubeCoders\AMP\InstanceManager\UPnPSyncEnabled turned on?

That registery entry is not there only has InstanceStore and ModuleMetadata

Add a integer field called UPnPSyncEnabled and set it to 1

Sadly that did not solve it. I added the registry entry. Restarted the Instance Manager. Recreated an instance. Ran the firewall tool. and no UPNP Sync still

Will have to wait until it gets another pass then I’m afraid. It’s only a beta feature at this time so there’s probably some issues with it.

so I went back to this and I noticed a space in the registry name. Correcting that registry name I get the following error now

[Error] IM was unable to execute the requested command.
[Error] TargetInvocationException
[Error] [0] (TargetInvocationException) : Exception has been thrown by the target of an invocation.
[Error]    at InstanceManagerCLI.Core.ExecuteCommand(List`1 Params, Dictionary`2 Args)
[Error] InvalidCastException
[Error] [1] (InvalidCastException) : Specified cast is not valid.
[Error]    at InstanceManagerPlugin.LocalInstanceManager.get_Platform_GetUPnPSyncEnabled()
   at InstanceManagerCLI.Core.UpdateFirewall(String SourceUser, Boolean DryRun, Boolean forceUPnPSync)

I tried both 32-Bit DWord and 64-Bit Qword