deStrO / eBot-CSGO

The eBot is a full managed server-bot written in PHP and nodeJS. eBot features easy match creation and tons of player and matchstats. Once it's setup, using the eBot is simple and fast.
http://www.esport-tools.net/ebot
375 stars 140 forks source link

no demo upload on ebot #101

Closed gelleby closed 1 year ago

gelleby commented 8 years ago

Hi all,

I have no idea why I'm getting no demo upload on ebot. "There are currently no demo files available" is what I get behind the 'show' button of match in the demo folder : http://puu.sh/pP2cF/856404ac71.png Ebot doesn't send the command to copy the demo on the ebot server, but the recording did work. The demo's are on the csgo server: http://puu.sh/pP0o5/8f38891ff1.png

I'm running on debian (tried 7.x and 8.x) and followed the install via @themightychris his tutorial: https://github.com/themightychris/eBot-CSGO/blob/026e3663941a1171a962c6e412cd4e54ceae8721/install-debian7.sh

I'm using the last 3.2 version and tried the 3.1 version. Both versions have the same issue.

The csgo server log file doesn't show any command from ebot to upload the demo: quit L 07/03/2016 - 09:51:46: "War01 GOTV<2><BOT><>" disconnected (reason "Server shutting down") L 07/03/2016 - 09:51:46: server_message: "quit" L 07/03/2016 - 09:51:46: Log file closed L 07/03/2016 - 09:51:46: server_message: "restart" Shutdown function NET_Shutdown() not in list!!!

Everything works perfectly, apart from the demo upload. Any idea's?

wAsnk commented 8 years ago

Try the tutorial made by vince52: http://forum.esport-tools.net/d/2-how-to-install-ebot-on-debian-ubuntu-for-beginners

gelleby commented 8 years ago

@wAsnk, yeah tried that, same stuff :(

wAsnk commented 8 years ago

@gelleby Did you edit these lines in app_user.yml? log_match: ../../ebot-csgo/logs/log_match log_match_admin: ../../ebot-csgo/logs/log_match_admin demo_path: ../../ebot-csgo/demos

gelleby commented 8 years ago

yes: http://puu.sh/pP2Qk/e52ad3c8a4.png

wAsnk commented 8 years ago

edit like this: log_match: home/ebot/ebot-csgo/logs/log_match

wAsnk commented 8 years ago

and clear cache as root cd /home/ebot/ebot-web php symfony cc

gelleby commented 8 years ago

nope, didn't work :(

Keep in mind, ebot doesn't send the command to the game server to send the demo. Because it should show up in the csgo server log, right?

deStrO commented 8 years ago

Keep in mind that you need to have the CSay plugin installed on your game server to make it works. If you are using a Windows server for the game server, it won't works too.

gelleby commented 8 years ago

Hi @deStrO, like I said, everything works apart from the demo upload to the ebot server.

Janhouse commented 8 years ago

@gelleby, I had a similar issue. After checking ebot-csgo log file I noticed that it tried uploading to internal IP address from outside. To fix this I introduced new config variable "URL_ROOT" in pull request related to #103 that should point to your ebot's upload script. For example http://ebot.example.com:12360

gelleby commented 8 years ago

@Janhouse all my csgo servers are local, as well as my ebot server.

My csgo war server log now states: L 10/22/2016 - 11:04:07: rcon from "172.16.1.11:33634": command "tv_stoprecord" L 10/22/2016 - 11:04:07: rcon from "172.16.1.11:33634": command "csay_tv_demo_push "28_sd-gaming-csgo-minimal-effort-gaming_de_cbble.dem" "http://172.16.1.11:12360/upload""

But, (!) sometimes (!) I'm not receiving the demo on my ebot server. In other words, cat websocket.log doesn't show that that demo was received. Although, there are demo's that I do have. So, this makes it even harder for me to find out why the demo upload fails sometimes. In any case, there's something going wrong between sending the demo to ebot and receiving it on the ebot server.

/usr/share/eBot-CSGO/logs$ cat websocket.log info: socket.io started Thu Oct 20 2016 17:21:10 GMT+0200 (CEST) Server is listening on port 12360 UDP Server listening on 172.16.1.11:12361 info: socket.io started Thu Oct 20 2016 23:20:43 GMT+0200 (CEST) Server is listening on port 12360 UDP Server listening on 172.16.1.11:12361 info: socket.io started Fri Oct 21 2016 10:01:37 GMT+0200 (CEST) Server is listening on port 12360 UDP Server listening on 172.16.1.11:12361 info: socket.io started Fri Oct 21 2016 20:02:18 GMT+0200 (CEST) Server is listening on port 12360 UDP Server listening on 172.16.1.11:12361 info: socket.io started Fri Oct 21 2016 22:35:55 GMT+0200 (CEST) Server is listening on port 12360 UDP Server listening on 172.16.1.11:12361 Received file Received file Received file Received file info: socket.io started Sat Oct 22 2016 04:37:25 GMT+0200 (CEST) Server is listening on port 12360 UDP Server listening on 172.16.1.11:12361 Received file /usr/share/eBot-CSGO/demos/27_vae-victis-stan_de_nuke.dem.zip Received file /usr/share/eBot-CSGO/demos/37_cokacoke-wolf-pack_de_dust2.dem.zip Received file /usr/share/eBot-CSGO/demos/38_sd-gaming-csgo-minimal-effort-gaming_de_dust2.dem.zip Received file /usr/share/eBot-CSGO/demos/39_kappa123-iv-synergy_de_cache.dem.zip Received file /usr/share/eBot-CSGO/demos/42_iv-fragcats-digital-lions_de_nuke.dem.zip Received file /usr/share/eBot-CSGO/demos/40_maestro-s1-stk_de_cache.dem.zip

FYI, I added some more info to be added in this log for troubleshooting. So, as you can seem I'm receiving several demo's, but not the number 28. Although, the csgo war server gave to command to upload it: L 10/22/2016 - 11:04:07: rcon from "172.16.1.11:33634": command "csay_tv_demo_push "28_sd-gaming-csgo-minimal-effort-gaming_de_cbble.dem" "http://172.16.1.11:12360/upload"" (the demo does exist on the csgo server, http://puu.sh/rRDPl/7617c95316.png)

I'm thinking multiple possible issues:

  1. Maybe at the moment of uploading the demo to ebot, another demo upload was still ongoing from another csgo war server and thus ebot couldn't process both demo transfers at the same time (unlikely, but you never know :) The log's don't show this. Although it's so weird that the csgo war server log shows the csay_tv_demo_push, but ebot didn't receive it.
  2. The ebot server didn't receive the demo because there wasn't enough time to process the transfer in between the csgo war server sending the csay upload command and ebot "closing" the csgo war server. (even more unlikely, but I'm getting paranoid)
  3. The tv_stoprecord didn't process fast enough for csay_tv_demo_push to actually work because of "load" on the csgo server or the websocket was "busy" (I'm guessing here) I don't know from how many csgo war servers, ebot can process all the logs. (is there a limit?) I installed more hardware to test with and it didn't make a difference.
  4. The ebot server didn't receive the file because of linux security issues (not likely). I tried changing the users and security, but that didn't help.

I'm completely out of idea's...

Some of my ebot matches have a downloadable demo from ebot-web, other's don't. But, all the demo's exist on the csgo server and the csay_tv_demo_push is given in the war server.

deStrO commented 8 years ago

Sometimes the websocket is crashing without any reason. I never had any logs about that crash.

What I recommend now with the latest eBot update, you install forever (npm install -g forever) and instead in the config file, you will have NODE_STARTUP_METHOD, and you set it to "none".

After that you start "once" the websocket process: forever start websocket_server.js ip port (the IP and PORT in config.ini for BOT_IP and BOT_PORT).

When the daemon crash, it will be auto-restarted.

nemesis567 commented 4 years ago

Guys, whoever runs their servers on windows and has no way of getting back the demos, here's a simple fix that will work. You have to set both the the remote path(the ebot/demos full path on wherever you run ebot) and the csgo path(the complete path to csgo folder on your server machine).

You also need to install the scp module and set the username and password for your ssh session.

This works well for a server running on windows and bot running on linux:

You'd need to change the authentication strategy if you don't use username and password.

If you login with a specific user to your server, make sure he has permissions to write to the ebot/demos folder.

For this to work if you run your ebot on a remote windows machine you'd need to run an SSH service on it.

To keep it smooth over time delete your old demos from the server machine, or add code to remove them after transfer below, I didn't bother to do so.

Basically in any folder in your windows machine:

  1. Make sure you have installed python and that it is on your environment variables.
  2. Go to directory bar(where the folder address shows)
  3. Type 'cmd' without quotes
  4. Type following command
  5. pip install scp
  6. Create a file named myscript.py in that folder(make sure your extension is .py)
  7. Copy the content below this procedure
  8. Edit gopath, remotepath, username, password and ebotserverip
  9. Back in the terminal type py myscript.py
import os;
from os import path
import time
from zipfile import ZipFile
import paramiko
import getpass

max_time = 120;
gopath = 'C:/csgosl/server/csgo/'
remotepath  = '/usr/share/sv/ebot/demos/'
username = "username"
password = "password"
ebotserverip = 'domainorip.com'
def get_information(directory):
    file_list = []
    for i in os.listdir(directory):
        a = os.stat(os.path.join(directory,i))
        file_list.append([i,a.st_atime,a.st_ctime]) #[file,most_recent_access,created]
    return file_list
while '1' == '1':

    arr = get_information(gopath)
    newarr = list(filter(lambda x: x[0].endswith(".dem") and (time.time()-x[1]) > max_time, arr))
    print(newarr)
    ziplist = []
    for v in newarr:
        if not os.path.exists(v[0]+'.zip'):
            zipObj = ZipFile(v[0]+'.zip', 'w')
            zipObj.write(gopath+v[0], v[0])
            zipObj.close()
        ziplist.append(v[0]+'.zip')

    ssh = paramiko.SSHClient()
    ssh.set_missing_host_key_policy(paramiko.AutoAddPolicy())
    try:
        ssh.connect(ebotserverip, username=username,
            password=password)
        sftp = ssh.open_sftp()
        sftp.chdir(remotepath)
        for file in ziplist:
            try:
                print(sftp.stat(remotepath+file))
                print('file exists')
            except IOError:
                print('copying file')
                sftp.put(file, remotepath+file)
        ssh.close()
    except paramiko.SSHException:
        print("Connection Error")
    time.sleep(120)

If you run both server and ebot on the same machine I'm sure you can simplify what's above and remove the need to use scp. I was not able to run ebot on windows but I run my game server on windows so this fixes the issue and people who play on my server can see the demos properly.