TripleA Logo TripleA Forum
    • TripleA Website
    • Categories
    • Recent
    • Popular
    • Users
    • Groups
    • Tags
    • Register
    • Login

    Help Needed Hosting Bot(s) On Ubuntu Server

    Scheduled Pinned Locked Moved Player Help
    19 Posts 2 Posters 2.5k Views 2 Watching
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • LaFayetteL Offline
      LaFayette Admin
      last edited by

      update the run script,remove the '-all' from the jar name

      1 Reply Last reply Reply Quote 0
      • HSThompsnH Offline
        HSThompsn
        last edited by HSThompsn

        @LaFayette - I removed the '-all' from the jar name and it ran the script successfully.

        However, it looks like its getting errors connecting to the lobby and I don't see it when I log into the Online Lobby listed as a bot. Does the bot need to be operating using a registered username in order to connect to the lobby?

        flyinghellfish@flyinghellfishtripleaserver:~$ cd triplea-game-headless-2.5.22294
        flyinghellfish@flyinghellfishtripleaserver:~/triplea-game-headless-2.5.22294$ ls
        bin  run_bot  run_bot.bat
        flyinghellfish@flyinghellfishtripleaserver:~/triplea-game-headless-2.5.22294$ ./run_bot
        + readonly BOT_PORT=3300
        + BOT_PORT=3300
        + readonly BOT_NAME=Bot_flyinghellfish_3300
        + BOT_NAME=Bot_flyinghellfish_3300
        + readonly BOT_PASSWORD=
        + BOT_PASSWORD=
        + readonly LOBBY_URI=https://lobby.triplea-game.org
        + LOBBY_URI=https://lobby.triplea-game.org
        + java -server -Xmx256M -Djava.awt.headless=true -jar bin/triplea-game-headless-2.5.22294.jar -Ptriplea.lobby.uri=https://lobby.triplea-game.org -Ptriplea.map.folder=/home/flyinghellfish/triplea/downloadedMaps -Ptriplea.name=Bot_flyinghellfish_3300 -Ptriplea.port=3300 -Ptriplea.server.password=
        Jan 24, 2021 7:26:27 PM games.strategy.engine.framework.map.file.system.loader.AvailableGamesFileSystemReader lambda$parseMapFiles$0
        INFO: Found game: Pact of Steel @ jar:file:/home/flyinghellfish/triplea/downloadedMaps/the_pact_of_steel-master.zip!/the_pact_of_steel-master/map/games/pact_of_steel.xml
        Jan 24, 2021 7:26:27 PM games.strategy.engine.framework.map.file.system.loader.AvailableGamesFileSystemReader lambda$parseMapFiles$0
        INFO: Found game: Pact of Steel 2 @ jar:file:/home/flyinghellfish/triplea/downloadedMaps/the_pact_of_steel-master.zip!/the_pact_of_steel-master/map/games/pact_of_steel_2.xml
        Jan 24, 2021 7:26:27 PM org.triplea.game.server.HeadlessGameServer <init>
        INFO: Game Server initialized
        Jan 24, 2021 7:26:27 PM org.triplea.game.server.HeadlessGameServer lambda$new$1
        INFO: Headless Start
        Exception in thread "Initialize Headless Server Setup Model" feign.RetryableException: No subject alternative DNS name matching lobby.triplea-game.org found. executing POST https://lobby.triplea-game.org/lobby/game-hosting-request
        	at feign.FeignException.errorExecuting(FeignException.java:214)
        	at feign.SynchronousMethodHandler.executeAndDecode(SynchronousMethodHandler.java:115)
        	at feign.SynchronousMethodHandler.invoke(SynchronousMethodHandler.java:80)
        	at feign.ReflectiveFeign$FeignInvocationHandler.invoke(ReflectiveFeign.java:103)
        	at com.sun.proxy.$Proxy4.sendGameHostingRequest(Unknown Source)
        	at org.triplea.http.client.lobby.game.hosting.request.GameHostingClient.sendGameHostingRequest(GameHostingClient.java:25)
        	at games.strategy.engine.framework.startup.mc.ServerModel.createServerMessenger(ServerModel.java:425)
        	at games.strategy.engine.framework.startup.mc.ServerModel.lambda$new$1(ServerModel.java:289)
        	at java.base/java.util.Optional.ifPresent(Optional.java:183)
        	at games.strategy.engine.framework.startup.mc.ServerModel.<init>(ServerModel.java:289)
        	at org.triplea.game.server.HeadlessServerSetupPanelModel.showSelectType(HeadlessServerSetupPanelModel.java:28)
        	at org.triplea.game.server.HeadlessGameServer.lambda$new$1(HeadlessGameServer.java:69)
        	at java.base/java.lang.Thread.run(Thread.java:834)
        Caused by: javax.net.ssl.SSLHandshakeException: No subject alternative DNS name matching lobby.triplea-game.org found.
        	at java.base/sun.security.ssl.Alert.createSSLException(Alert.java:131)
        	at java.base/sun.security.ssl.TransportContext.fatal(TransportContext.java:350)
        	at java.base/sun.security.ssl.TransportContext.fatal(TransportContext.java:293)
        	at java.base/sun.security.ssl.TransportContext.fatal(TransportContext.java:288)
        	at java.base/sun.security.ssl.CertificateMessage$T12CertificateConsumer.checkServerCerts(CertificateMessage.java:654)
        	at java.base/sun.security.ssl.CertificateStatus$CertificateStatusConsumer.consume(CertificateStatus.java:295)
        	at java.base/sun.security.ssl.SSLHandshake.consume(SSLHandshake.java:392)
        	at java.base/sun.security.ssl.HandshakeContext.dispatch(HandshakeContext.java:444)
        	at java.base/sun.security.ssl.HandshakeContext.dispatch(HandshakeContext.java:422)
        	at java.base/sun.security.ssl.TransportContext.dispatch(TransportContext.java:183)
        	at java.base/sun.security.ssl.SSLTransport.decode(SSLTransport.java:171)
        	at java.base/sun.security.ssl.SSLSocketImpl.decode(SSLSocketImpl.java:1408)
        	at java.base/sun.security.ssl.SSLSocketImpl.readHandshakeRecord(SSLSocketImpl.java:1314)
        	at java.base/sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:440)
        	at java.base/sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:411)
        	at java.base/sun.net.www.protocol.https.HttpsClient.afterConnect(HttpsClient.java:567)
        	at java.base/sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.connect(AbstractDelegateHttpsURLConnection.java:185)
        	at java.base/sun.net.www.protocol.http.HttpURLConnection.getInputStream0(HttpURLConnection.java:1592)
        	at java.base/sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1520)
        	at java.base/java.net.HttpURLConnection.getResponseCode(HttpURLConnection.java:527)
        	at java.base/sun.net.www.protocol.https.HttpsURLConnectionImpl.getResponseCode(HttpsURLConnectionImpl.java:334)
        	at feign.Client$Default.convertResponse(Client.java:79)
        	at feign.Client$Default.execute(Client.java:75)
        	at feign.SynchronousMethodHandler.executeAndDecode(SynchronousMethodHandler.java:110)
        	... 11 more
        Caused by: java.security.cert.CertificateException: No subject alternative DNS name matching lobby.triplea-game.org found.
        	at java.base/sun.security.util.HostnameChecker.matchDNS(HostnameChecker.java:212)
        	at java.base/sun.security.util.HostnameChecker.match(HostnameChecker.java:103)
        	at java.base/sun.security.ssl.X509TrustManagerImpl.checkIdentity(X509TrustManagerImpl.java:455)
        	at java.base/sun.security.ssl.X509TrustManagerImpl.checkIdentity(X509TrustManagerImpl.java:415)
        	at java.base/sun.security.ssl.X509TrustManagerImpl.checkTrusted(X509TrustManagerImpl.java:229)
        	at java.base/sun.security.ssl.X509TrustManagerImpl.checkServerTrusted(X509TrustManagerImpl.java:129)
        	at java.base/sun.security.ssl.CertificateMessage$T12CertificateConsumer.checkServerCerts(CertificateMessage.java:638)
        	... 30 more
        
        
        
        
        1 Reply Last reply Reply Quote 0
        • LaFayetteL Offline
          LaFayette Admin
          last edited by

          @HSThompsn in the run_bot script, change lobby.triplea-game.org to prod2-lobby.triplea-game.org

          1 Reply Last reply Reply Quote 0
          • LaFayetteL Offline
            LaFayette Admin
            last edited by

            Likely that is going to be the last thing needed, most other validation generally happens before connecting to lobby.

            I recommend to stay with 2.5 for bots until there is a version update in lobby, but FWIW future versions will have this corrected: https://github.com/triplea-game/triplea/pull/8699

            1 Reply Last reply Reply Quote 0
            • HSThompsnH Offline
              HSThompsn
              last edited by

              @LaFayette just a preface to thank you again for the help and all day patience on this. I'll make sure to stick with this version until version update.

              I've changed the lobby address and now seem to get a new error. Output below:

              flyinghellfish@flyinghellfishtripleaserver:~/triplea-game-headless-2.5.22294$ ./run_bot
              + readonly BOT_PORT=3300
              + BOT_PORT=3300
              + readonly BOT_NAME=Bot_flyinghellfish_3300_TEST
              + BOT_NAME=Bot_flyinghellfish_3300_TEST
              + readonly BOT_PASSWORD=test
              + BOT_PASSWORD=test
              + readonly LOBBY_URI=prod2-lobby.triplea-game.org
              + LOBBY_URI=prod2-lobby.triplea-game.org
              + java -server -Xmx256M -Djava.awt.headless=true -jar bin/triplea-game-headless-2.5.22294.jar -Ptriplea.lobby.uri=prod2-lobby.triplea-game.org -Ptriplea.map.folder=/home/flyinghellfish/triplea/downloadedMaps -Ptriplea.name=Bot_flyinghellfish_3300_TEST -Ptriplea.port=3300 -Ptriplea.server.password=test
              Jan 24, 2021 7:54:13 PM games.strategy.engine.framework.map.file.system.loader.AvailableGamesFileSystemReader lambda$parseMapFiles$0
              INFO: Found game: Pact of Steel @ jar:file:/home/flyinghellfish/triplea/downloadedMaps/the_pact_of_steel-master.zip!/the_pact_of_steel-master/map/games/pact_of_steel.xml
              Jan 24, 2021 7:54:13 PM games.strategy.engine.framework.map.file.system.loader.AvailableGamesFileSystemReader lambda$parseMapFiles$0
              INFO: Found game: Pact of Steel 2 @ jar:file:/home/flyinghellfish/triplea/downloadedMaps/the_pact_of_steel-master.zip!/the_pact_of_steel-master/map/games/pact_of_steel_2.xml
              Jan 24, 2021 7:54:13 PM org.triplea.game.server.HeadlessGameServer <init>
              INFO: Game Server initialized
              Jan 24, 2021 7:54:13 PM org.triplea.game.server.HeadlessGameServer lambda$new$1
              INFO: Headless Start
              Exception in thread "Initialize Headless Server Setup Model" java.lang.IllegalArgumentException: target values must be absolute.
              	at feign.RequestTemplate.target(RequestTemplate.java:458)
              	at feign.Target$HardCodedTarget.apply(Target.java:101)
              	at feign.SynchronousMethodHandler.targetRequest(SynchronousMethodHandler.java:173)
              	at feign.SynchronousMethodHandler.executeAndDecode(SynchronousMethodHandler.java:101)
              	at feign.SynchronousMethodHandler.invoke(SynchronousMethodHandler.java:80)
              	at feign.ReflectiveFeign$FeignInvocationHandler.invoke(ReflectiveFeign.java:103)
              	at com.sun.proxy.$Proxy4.sendGameHostingRequest(Unknown Source)
              	at org.triplea.http.client.lobby.game.hosting.request.GameHostingClient.sendGameHostingRequest(GameHostingClient.java:25)
              	at games.strategy.engine.framework.startup.mc.ServerModel.createServerMessenger(ServerModel.java:425)
              	at games.strategy.engine.framework.startup.mc.ServerModel.lambda$new$1(ServerModel.java:289)
              	at java.base/java.util.Optional.ifPresent(Optional.java:183)
              	at games.strategy.engine.framework.startup.mc.ServerModel.<init>(ServerModel.java:289)
              	at org.triplea.game.server.HeadlessServerSetupPanelModel.showSelectType(HeadlessServerSetupPanelModel.java:28)
              	at org.triplea.game.server.HeadlessGameServer.lambda$new$1(HeadlessGameServer.java:69)
              	at java.base/java.lang.Thread.run(Thread.java:834)
              
              
              
              1 Reply Last reply Reply Quote 0
              • LaFayetteL Offline
                LaFayette Admin
                last edited by

                The lobby URI needs to be fully qualified. Change: prod2-lobby.triplea-game.org to https://prod2-lobby.triplea-game.org

                1 Reply Last reply Reply Quote 0
                • HSThompsnH Offline
                  HSThompsn
                  last edited by

                  @LaFayette SUCCESS! The script boots, connects, lists as a bot in lobby, and can accept direct URL connections as well. Thanks again for all the help today, I'll get some bots up in the lobby ASAP for public use.

                  alt text

                  1 Reply Last reply Reply Quote 3
                  • HSThompsnH Offline
                    HSThompsn
                    last edited by HSThompsn

                    @LaFayette One last question. Is it possible to have the bot not need to connect to the public lobby, if its going to be a private password protected bot?

                    My plan is to run (1) private bot in terminal (A) and (2) public bots in terminals (B,C) all on separate ports.

                    With the help you provided above, I'll have no issue getting those (2) public bots up and running in the lobby. As for the private bot, I was attempting to implement a suggestion from this post: ssollof private bot tip. By removing the url completely, it locks on the script executing- which was our experience we just hacked through above.

                    Is it possible not to have it have to connect to a lobby? That way it would only be accessible through "Connect to network game" using the URL.

                    1 Reply Last reply Reply Quote 0
                    • LaFayetteL Offline
                      LaFayette Admin
                      last edited by LaFayette

                      I think you'd have to launch a lobby instance to have a truly private bot instance. It's not currently possible to run without a lobby connection.

                      FWIW, here is a script to download maps:

                      • change the cd /home/bot/maps to be your maps folder
                      • change the 'sudo -u bot' to be your bot system user or remove entirely if you run the bot instance as yourself (likely just remove the 'sudo -u bot' prefixes on the various commands)
                      #!/bin/bash
                      
                      ## note:
                      ##  -  it appears that it takes some time for a repo to show up in an orgs repo list
                      ##  -  the curl call below is rate limited, not intended for repeated invocations
                      
                      # Usage:
                      # - Simply execute this script without any arguments
                      
                      update_maps="${1:-false}"
                      
                      sudo -u "bot" mkdir -p "/home/bot/maps"
                      cd "/home/bot/maps"
                      for j in 1 2; do
                        while read mapRepo; do
                          downloadFile="$(echo $mapRepo | sed 's|.*/||')-master.zip"
                          if [ "$update_maps" == "true" ] || [ ! -e "$downloadFile" ]; then
                            sudo -u "bot" wget -O "$downloadFile" "https://github.com/$mapRepo/archive/master.zip"
                          fi
                        done < <(curl --silent "https://api.github.com/orgs/triplea-maps/repos?page=$j&per_page=1000" \
                                | grep full_name | sed 's/.*: "//' | sed 's/",$//')
                      done
                      
                      1 Reply Last reply Reply Quote 0
                      • HSThompsnH Offline
                        HSThompsn
                        last edited by

                        @LaFayette Thanks for the auto-download script. All three bots are up an running in the lobby.

                        I saw the lobby server on GitHub and gave it a look. Didn't see a prebaked .sh file in there to launch, so figured its gotta be a pretty complex setup. If there's any documentation on the lobby server, I'd love to take a look.

                        1 Reply Last reply Reply Quote 0

                        Hello! It looks like you're interested in this conversation, but you don't have an account yet.

                        Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

                        With your input, this post could be even better 💗

                        Register Login
                        • 1 / 1
                        • First post
                          Last post
                        Powered by NodeBB Forums