Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

resolve bot incompatibility error #11751

Closed
asvitkine opened this issue Jul 9, 2023 · 10 comments · Fixed by #11752
Closed

resolve bot incompatibility error #11751

asvitkine opened this issue Jul 9, 2023 · 10 comments · Fixed by #11752
Assignees
Labels
2.6 Major Indicates the problem is very impactful, very noticable, no work around

Comments

@asvitkine
Copy link
Contributor

  • load a 2.6 lobby & bot
  • try to join with a 2.6 client
  • notice there is an "remote not found" error shortly after connecting
@asvitkine asvitkine added Major Indicates the problem is very impactful, very noticable, no work around 2.6 labels Jul 9, 2023
@asvitkine
Copy link
Contributor Author

asvitkine commented Jul 9, 2023

@DanVanAtta I converted this to an issue.

I wanted to look at what's broken here, but I'm not sure I fully understand the architecture. Perhaps you can help me understand this better?

  1. Why does 2.6 need a separate lobby? Did we make some incompatible protocol changes? If not, couldn't we just use the same lobby as 2.5?
  2. How do bots work? Do they run a version of the engine code? If so, how do I start one from my checkout?
  3. If a bot uses a copy of the engine, could it be run over an IP connection instead of through a lobby for easier testing?

@asvitkine asvitkine self-assigned this Jul 9, 2023
@asvitkine
Copy link
Contributor Author

asvitkine commented Jul 9, 2023

Answering some of my questions:

  1. I see that with each release there's a headless jar and script, so I can use that to run a bot. (And I should be able to run it directly from my source tree based on that.)
  2. It seems I can run a 2.6 bot without a 2.6 lobby and connect to it through IP.
  3. I am able to repro the issue, here's the error I get:

An unexpected error occurred!  RuntimeException: Exception on remote  RemoteNotFoundException: Not found:games.strategy.engine.framework.startup.mc.ClientModel.CLIENT_READY_CHANNEL, endpoints available: [games.strategy.engine.framework.AbstractGame.DISPLAY_CHANNEL, games.strategy.engine.framework.ui.IClientChannel.CHANNEL, _ChatRemote_games.strategy.engine.framework.ui.ServerStartup.CHAT_NAME, games.strategy.engine.framework.AbstractGame.SOUND_CHANNEL, _ChatControl_games.strategy.engine.framework.ui.ServerStartup.CHAT_NAME, games.strategy.engine.framework.ui.ServerStartup.SERVER_REMOTE]

I'll look at what's needed to fix.

@asvitkine
Copy link
Contributor Author

Looking at the console from the terminal, it seems the issue is a missing assets folder:

games.strategy.triplea.ResourceLoader$GameAssetsNotFoundException: Unable to find game assets folder starting from location: /Users/<myusername>/Downloads/triplea-game-headless
There is a problem with the installation, please report this to TripleA and the path where TripleA is installed.
	at java.base/java.util.Optional.orElseThrow(Optional.java:408)
	at games.strategy.triplea.ResourceLoader.<init>(ResourceLoader.java:53)
	at org.triplea.game.server.HeadlessLaunchAction.startGame(HeadlessLaunchAction.java:110)
	at games.strategy.triplea.TripleA.startGame(TripleA.java:62)
	at games.strategy.engine.framework.startup.launcher.ServerLauncher.loadGame(ServerLauncher.java:171)
	at games.strategy.engine.framework.startup.launcher.ServerLauncher.launch(ServerLauncher.java:105)
	at java.base/java.lang.Thread.run(Thread.java:835)

@asvitkine
Copy link
Contributor Author

@DanVanAtta

Manually copying the assets folder to the headless folder seems to resolve the issue and the bot is able to run the game fine it seems. So that's good news.

So we could just fix it by including assets in that zip file (it's an extra 7mb when uncompressed), but I take a quick glance at whether we can cut the dependency.

@asvitkine
Copy link
Contributor Author

The check for the missing assets folder was added in:
https://github.com/triplea-game/triplea/pull/8561/files

Perhaps we can just disable it for headless if headless doesn't use assets.

@asvitkine
Copy link
Contributor Author

Looks like the dependency is unnecessary. I posted a fix here:
#11752

@asvitkine
Copy link
Contributor Author

Closing per the above PR. Please re-open if I missed something.

@DanVanAtta
Copy link
Member

Interesting, the RemoteNotFound error was caused by the bot crashing due to not having an assets folder. I wonder why this was not a problem before? Is it because we had some sort of setup that existed, was not documented and not captured as part of deployment - and so the configuration "happened to work"?

@asvitkine
Copy link
Contributor Author

@DanVanAtta The assert wasn't there before, it got added as part of some refactoring.

@DanVanAtta
Copy link
Member

@asvitkine I never said thank you for fixing one. I finally do so now - a sincere thank you sir. We'd still be stuck, almost a year later, had it not been for your efforts here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
2.6 Major Indicates the problem is very impactful, very noticable, no work around
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

2 participants