Customization with Application Deployment - Custom Instances with local files

System Information

Field Value
Operating System Windows - Windows Server 2022 on x86_64
Product AMPService ‘Decadeus’ v2.4.6.6 (Mainline)
Virtualization Xen
Application Application Deployment
Module ADSModule
Running in Container No
Current State Indeterminate

Problem Description

Issue

We are trying to create a custom instance for a game server, but we cannot get it to work. The game server files are licensed, so they cannot be hosted on a webiste or github. We have the game files at c:\gamefiles.zip and we would like AMP to extract these files to the instance directory when created. We also dont seem to be able to get any log files showing us whats going wrong…

Help would be appreciated.

Thanks.

Reproduction Steps

  • Use new online config generator to generate config
  • Add CopyFilePath as an update source
  • Validate and download config
  • Extract config files and place into C:\AMPDatastore\Instances\ADS01\Plugins\ADSModule\DeploymentTemplates\CubeCoders-AMPTemplates
  • Config->instance deployment->fetch to refresh instance types
  • Create new instance type - it never copies the files

What do the logs say when it does the update?

Nothing, really… Trying to update manually doesnt add anything to the logs either. Its like it doesnt even try…?

[21:26:55] [Program Info]         : Starting AMP version 2.4.6.6 (Decadeus), built 05/10/2023 11:56
[21:26:55] [Program Info]         : Stream: Mainline / Release - built by CUBECODERS/buildbot on CCL-DEV
[21:26:55] [Program Info]         : Running in a Xen environment.
[21:26:55] [Core Warning]         : Current time zone is set to Pacific Standard Time - It is recommended you switch to UTC+0 to avoid time-zone related issues
[21:26:55] [Program Info]         : OS: Windows / x86_64
[21:26:55] [Program Info]         : CPU: AMD EPYC Processor (3C/3T)
[21:26:55] [Program Info]         : RAM: 3999MB
[21:26:55] [Program Info]         : AMP Instance ID: b367bac4-dd77-4b87-a39b-c400ad92faef
[21:26:56] [Loader Info]          : Loaded GenericModule version 1.0.0.0 by CubeCoders Limited
[21:26:56] [Core Info]            : Metrics publishing is enabled at udp://localhost:12820.
[21:26:56] [Loader Info]          : Loaded FileManagerPlugin by CubeCoders Limited
[21:26:56] [Loader Info]          : Loaded EmailSenderPlugin by CubeCoders Limited
[21:26:56] [Loader Info]          : Loaded WebRequestPlugin by CubeCoders Limited
[21:26:56] [Loader Info]          : Loaded LocalFileBackupPlugin by CubeCoders Limited
[21:26:56] [Loader Info]          : Loaded CommonCorePlugin by CubeCoders Limited
[21:26:56] [Loader Info]          : GenericModule requests dependency steamcmdplugin...
[21:26:56] [Loader Info]          : Loaded steamcmdplugin by CubeCoders Limited
[21:26:56] [Loader Info]          : GenericModule requests dependency RCONPlugin...
[21:26:56] [Loader Info]          : Loaded RCONPlugin by CubeCoders Limited
[21:26:56] [Core Warning]         : Unable to update setting node GenericModule.App.Ports.$MainGamePort - the target type of (List<PortRequirement>) is not supported.
[21:26:56] [Core Info]            : Licence Present: AMP Advanced Edition
[21:26:56] [FileManager Notice]   : No SSH keypair available for embedded server, generating new keypair...
[21:26:56] [FileManager Notice]   : Generated new keypair with fingerprint <removed>
[21:26:56] [FileManager Notice]   : Using keypair with fingerprint <removed>
[21:26:56] [FileManager Info]     : SFTP Server started on 0.0.0.0:2224
[21:26:56] [Webserver Info]       : Websockets are enabled.
[21:26:57] [Webserver Info]       : Webserver started on http://127.0.0.1:8081
[21:26:57] [Webserver Info]       : RouterTimer@10Hz with 2 jobs started
[21:26:57] [Core Info]            : Checking for AMP updates...
[21:26:57] [Core Info]            : Startup mode is StartApplication, SkipThisTime.
[21:26:57] [Core Info]            : AMP is up to date.

That is a log for an AMP instance that has been started and had nothing else done to it, not managed or anything else - never mind an update attempted.

I did mention in the original post that logs dont appear to show anything. I dont claim to know how the software works - theres little in the way of documentation.

My assumption is that on instance creation, where anything other than “do notthing” is selected under “after creation”, an update is attempted. Those are the logs after creating an instance. I have also tried to do an update manually. A little box comes up saying “performing upgrade” and it goes away. Nothing is updated in the logs.

I would encourage you to try yourself, and if successful, share your instance config and I can try here. Alternatively, I can share my instance config and you can try to replicate on a dev instance.

Could you share your update stages?

I just have this at the moment. Although I have tried with various combinations and nothing seems to work. I’m not sure I fully understand the difference or intended use of the following

UpdateSourceData
UpdateSourceArgs
UpdateSourceTarget

In my mind I read “SourceData” as file source and “SourceTarget” as file destination.

[
    {
        "UpdateStageName": "Copy and extract pr files...",
        "UpdateSourcePlatform": "Windows",
        "UpdateSource": "CopyFilePath",
        "UpdateSourceData": "C:\\pr.zip",
        "UpdateSourceArgs": "",
        "UpdateSourceTarget": "serverfiles",
        "UnzipUpdateSource": true,
        "OverwriteExistingFiles": true,
        "DeleteAfterExtract": false,
        "OneShot": false
    }
]

EDIT:

Okay… so playing around I managed to get something working, but it isnt quite right.

[
    {
        "UpdateStageName": "Copy and extract pr files...",
        "UpdateSourcePlatform": "Windows",
        "UpdateSource": "CopyFilePath",
        "UpdateSourceData": "{{$FullRootDir}}\\pr.zip",
        "UpdateSourceArgs": "C:\\pr.zip",
        "UpdateSourceTarget": "serverfiles",
        "UnzipUpdateSource": true,
        "OverwriteExistingFiles": true,
        "DeleteAfterExtract": false,
        "OneShot": false
    }
]

Trying to update the application manually does nothing, but starting the app at least shows some logs now. I’m not sure why it silently fails sometimes…

I can see the zip file is copied from C:\pr.zip to C:\AMPDatastore\Instances\prtest0101\project-reality. “C:\AMPDatastore\Instances\prtest0101\project-reality\pr.zip”

But as you can see from the logs, its expecting the file to be in the directory up from project-reality. I haven’t told AMP that the file should be in "C:\AMPDatastore\Instances\prtest0101", but thats where its looking… Is there something hardcoded in AMPs code thats causing this? I suspect this isn’t intended behaviour and is a bug.

[21:32:06] [Core Info]            : Startup mode is StartApplication.
[21:32:06] [Generic Info]         : Specified executable 'C:\AMPDatastore\Instances\prtest0101\project-reality\serverfiles\prbf2_w32ded.exe does not exist. Updating application...
[21:32:06] [Core Info]            : AMP is up to date.
[21:32:10] [Generic Info]         : Extracting C:\AMPDatastore\Instances\prtest0101\pr.zip to C:\AMPDatastore\Instances\prtest0101\project-reality\serverfiles...
[21:32:10] [Generic Info]         : Specified executable 'C:\AMPDatastore\Instances\prtest0101\project-reality\serverfiles\prbf2_w32ded.exe does not exist. Updating application...
[21:32:12] [Generic Info]         : Extracting C:\AMPDatastore\Instances\prtest0101\pr.zip to C:\AMPDatastore\Instances\prtest0101\project-reality\serverfiles...