question

Tyler Hasman avatar image
Tyler Hasman asked

Server written in java, how to launch?

I have a server written in Java. I bundled it with a jre and uploaded it to my builds. I made the math jre/bin/java.exe but the server doesn't seem to launch. It launches for about 20 seconds and just stops. Is there a certain java build that I should use?

Custom Game ServersMatchmaking
1 comment
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Tyler Hasman avatar image Tyler Hasman commented ·

I also have it outputting a log file in the code but that never gets outputted so I am guessing it isn't even being launched. I tested the java version on a Windows 2K12 R2 virtual machine and it worked fine so not sure what is going on. I am using the legacy game servers if that makes a difference.

0 Likes 0 ·

1 Answer

·
brendan avatar image
brendan answered

So, if the log file isn't there, these are the most common reasons. 1 and 2 are the only ones I think we need to consider, since you're saying the server stops right away, but 3 is worth double-checking.

1. The executable didn't successfully start. In testing, was your Win2K12 R2 server set up with just the base version of the OS, or does the executable have dependencies you added to the server?

2. The execution target you have set in the configuration, that launches the game server, isn't actually the game server exe. This is the case if you have a "shim" file that in turn runs the actual server exe. The issue is that whatever you call to start the server has to stay running. If it exits, that signals our server wrangler that your game server has stopped, and it removes that virtual machine from usage.

3. The log file was written to the wrong directory. If you've got the configuration set up to use log_file_path appropriately though, that shouldn't be the issue.

These next two are just for completeness - they won't be the issue in this case.

4. The file isn't done loading. If the server only just shut down, it's possible it's still being copied to S3.

5. The file was too large. We have noticed that files that are more than a couple hundred MB take long enough to copy to S3 that the server shutdown occurs before the copy is complete.

33 comments
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Tyler Hasman avatar image Tyler Hasman commented ·

1. Just the base version, clean install of Win2K12 R2
2. No, the java.exe process stays open while running the jar file so I don't think that is it.

3. It should be fine, in testing I got it to output a log no problem
4 + 5. The log file is very small, less than 1KB so I doubt that could be it.
I'm sure it must be 1 but since I cant view an error report or anything I have no way of knowing.

0 Likes 0 ·
brendan avatar image brendan Tyler Hasman commented ·

Hm. What I'd like to recommend is that we move you to using the newer Servers 2.0 hosting, as that will provide for better debugging options, if the issue still occurs there. Do you want to try that and, if so, what is your Title ID?

0 Likes 0 ·
Tyler Hasman avatar image Tyler Hasman brendan commented ·

It is EF783

I appreciate you doing this for me

0 Likes 0 ·
Show more comments
Show more comments
Tyler Hasman avatar image Tyler Hasman commented ·

It seems like when a build 'fails' it will keep getting restarted for 1-2 hours until it finally gets declared Unhealthy. It seems arbitrary what causes it to fail and I have no logs or any data to be able to figure out what went wrong. I've just been uploading builds with small differences to see what causes it to hang.

Those two builds do work but when I try uploading one with a fix for something it fails to work.

0 Likes 0 ·
Tyler Hasman avatar image Tyler Hasman commented ·

Hey so I think I figured out most problems. I found lots of quirks with PlayFab along the way, is there a specific github project I can report them on?

0 Likes 0 ·
brendan avatar image brendan Tyler Hasman commented ·

The best thing to do would be to write up your issues as a question in the forums. If it's aligned to what we're already discussing, you can just post that here. I did some checking though, and I wanted to confirm one thing. Looking at your title, you have two builds: 067544e2-15ae-49e7-aa96-2f52e7947d4a: This one took a max of 15 minutes from the time the buld request was issued to when you get a VM. b05a5f3a-22b1-4c11-a81d-3a00d54828b0: This one took 21 mintues.

Neither of those are unexpectedly high. There's a lot of work to be done when you're first starting a new build, from requesting servers to imaging them and copying over your build. It does take time - that's specifically why we have the standby server setting. It needs to be non-zero, to prevent this delay in the wild, and if you expect to need to scale up quickly, it should be higher. We can work with you on specifics, if you have estimates for your game.
0 Likes 0 ·
Tyler Hasman avatar image Tyler Hasman brendan commented ·

Those were actually incredibly fast! Perhaps when there are problems deploying it, it just takes a long time to fail. Is there any way we could have the ability to change startup command, number of servers per vm, etc on the fly? Otherwise I need to redeploy just to make small changes.

0 Likes 0 ·
Show more comments
Show more comments

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.