Error when parsing

General forum for discussions regarding UTStatsDB
Jago
Posts: 7
Joined: Tue Jan 20, 2009 5:20 pm

Error when parsing

Postby Jago » Tue Jan 20, 2009 5:46 pm

UTStatsDB version 3.06
Operating system and version:
Linux, don't know the version. It's rental.
(copied from phpmyadmin):
Web server
Apache/2
MySQL client version: 5.1.30
PHP extension: mysqli

Hey, I'm trying to setup UTStatsDB for an UT2004 server, and have logs from ServerExt. I've set it to download the files through FTP from the gameserver, and when I click on "Parse logs" it will give the error below. This is the second time i try to setup UTStatsDB (removed all files/database and tried again), and I'm getting exactly the same error. I guess i must've missed something in the readme, or be doing something dumb :P.

I thought it might've something to do with permissions, so chmodded the files to 777, but i guess that wasn't the case.

Any ideas what i've done wrong/haven't done?


Initializing ftp file transfer.
Connected to '' on port '21' for user ''.
Enabling passive mode.
Successfully changed ftp directory to '/UserLogs'.
Downloading log 'Stats_7777_2009_01_17_00_31_44.log'....
Warning: ftp_get(./Logs/Stats_7777_2009_01_17_00_31_44.log) [function.ftp-get]: failed to open stream: No such file or directory in /home/w9910568/domains/thepicwhorez.com/public_html/utstatsdb/logs.php on line 517

Warning: ftp_get() [function.ftp-get]: Error opening ./Logs/Stats_7777_2009_01_17_00_31_44.log in /home/w9910568/domains/thepicwhorez.com/public_html/utstatsdb/logs.php on line 517
failed!
Downloading log 'Stats_7777_2009_01_17_00_36_58.log'....
Warning: ftp_get(./Logs/Stats_7777_2009_01_17_00_36_58.log) [function.ftp-get]: failed to open stream: No such file or directory in /home/w9910568/domains/thepicwhorez.com/public_html/utstatsdb/logs.php on line 517

etc. etc. etc. till the end:

Warning: ftp_get() [function.ftp-get]: Error opening ./Logs/Stats_7777_2009_01_21_01_22_36.log in /home/w9910568/domains/thepicwhorez.com/public_html/utstatsdb/logs.php on line 517
failed!

Setting permissions in directory './Logs/' for 'Stats_*':
Processing directory './Logs/' for 'Stats_*':

Warning: opendir(./Logs/) [function.opendir]: failed to open dir: No such file or directory in /home/w9910568/domains/thepicwhorez.com/public_html/utstatsdb/logs.php on line 709

Warning: readdir(): supplied argument is not a valid Directory resource in /home/w9910568/domains/thepicwhorez.com/public_html/utstatsdb/logs.php on line 710

Warning: closedir(): supplied argument is not a valid Directory resource in /home/w9910568/domains/thepicwhorez.com/public_html/utstatsdb/logs.php on line 729
No log files to process.

Jago
Posts: 7
Joined: Tue Jan 20, 2009 5:20 pm

Re: Error when parsing

Postby Jago » Wed Jan 21, 2009 4:24 am

The error was caused because i set the wrong folder in Logs Config. Fixed now.
http://www.thepicwhorez.com/utstatsdb/index.php 8-)

Jago
Posts: 7
Joined: Tue Jan 20, 2009 5:20 pm

Re: Error when parsing

Postby Jago » Wed Jan 21, 2009 5:19 am

I do still have some questions now though...
is this the correct cron job? it doesn't seem to download the logs automatically:
php /home/w9910568/domains/thepicwhorez.com/public_html/utstatsdb/logs.php pass=xxx

does serverext log all information, also kills w/ wich weapons? I see many kills don't show up on the stats :(

pbgBrockHead
Posts: 37
Joined: Tue Mar 25, 2008 6:52 pm

Re: Error when parsing

Postby pbgBrockHead » Wed Jan 21, 2009 9:56 am

your cron job may very with your host as I just found out, My cron job for utstatsdb on 2k4 looks like this

Code: Select all

/usr/bin/wget -O - -q http://pbg.my :D site.com/utstatsdb/logs.php?pass=MyPass
they tell me this is because of the password on the end

server ext does pretty good as far as I personally am concerned, Panther has said on several occasions OLStats, has more info. My only issue with OLStats is it comes with somewhat of a hit on the server at game end.

here is a couple links for you to see what info server ext sends

http://pbg.infectedcranium.com/ut2k4/ this one is several years old (archives)
http://pbg.infectedcranium.com/2k4stats/ this one just got finalized last night but there should be games posted.
Last edited by pbgBrockHead on Fri Jan 23, 2009 2:32 am, edited 1 time in total.

Jago
Posts: 7
Joined: Tue Jan 20, 2009 5:20 pm

Re: Error when parsing

Postby Jago » Wed Jan 21, 2009 4:19 pm

i found the right cron job:
/usr/local/bin/php /home/w9910568/domains/thepicwhorez.com/public_html/utstatsdb/logs.php pass=...

For the cron job it will give the same error again though :shock:

Code: Select all

Initializing ftp file transfer.<br /> Connected to '81.26.221.180' on port '21' for user '------'.<br /> Enabling passive mode.<br /> Successfully changed ftp directory to '/UserLogs'.<br /> Downloading log 'Stats_7777_2009_01_21_20_11_53.log'.... Warning: ftp_get(Logs/Stats_7777_2009_01_21_20_11_53.log): failed to open stream: No such file or directory in /home/w9910568/domains/thepicwhorez.com/public_html/utstatsdb/logs.php on line 517 Warning: ftp_get(): Error opening Logs/Stats_7777_2009_01_21_20_11_53.log in /home/w9910568/domains/thepicwhorez.com/public_html/utstatsdb/logs.php on line 517 failed!<br /> Downloading log 'Stats_7777_2009_01_21_23_38_55.log'.... Warning: ftp_get(Logs/Stats_7777_2009_01_21_23_38_55.log): failed to open stream: No such file or directory in /home/w9910568/domains/thepicwhorez.com/public_html/utstatsdb/logs.php on line 517 Warning: ftp_get(): Error opening Logs/Stats_7777_2009_01_21_23_38_55.log in /home/w9910568/domains/thepicwhorez.com/public_html/utstatsdb/logs.php on line 517 failed!<br /> <br /> <b>Setting permissions in directory 'Logs/' for 'Stats_*':</b><br /> <b>Processing directory 'Logs/' for 'Stats_*':</b><br /> Warning: opendir(Logs/): failed to open dir: No such file or directory in /home/w9910568/domains/thepicwhorez.com/public_html/utstatsdb/logs.php on line 709 Warning: readdir(): supplied argument is not a valid Directory resource in /home/w9910568/domains/thepicwhorez.com/public_html/utstatsdb/logs.php on line 710 Warning: closedir(): supplied argument is not a valid Directory resource in /home/w9910568/domains/thepicwhorez.com/public_html/utstatsdb/logs.php on line 729 <b>No log files to process.</b><br />
and after that i ran it from the admin.php and that did work :!: :shock:

Code: Select all

Initializing ftp file transfer. Connected to '81.26.221.180' on port '21' for user '------'. Enabling passive mode. Successfully changed ftp directory to '/UserLogs'. Downloading log 'Stats_7777_2009_01_21_20_11_53.log'....successful - deleted. Downloading log 'Stats_7777_2009_01_21_23_38_55.log'....successful - deleted. Setting permissions in directory 'Logs/' for 'Stats_*': Processing directory 'Logs/' for 'Stats_*': Processing log 'Stats_7777_2009_01_21_20_11_53.log'...match 53 successfully processed. Processing log 'Stats_7777_2009_01_21_23_38_55.log'...match 54 successfully processed. 2 of 2 logs processed.

Panther
Site Admin
Posts: 500
Joined: Sat Dec 08, 2007 12:51 am
Contact:

Re: Error when parsing

Postby Panther » Wed Jan 21, 2009 4:53 pm

I would guess that the user the cron job is running doesn't have the same permissions as your web user and isn't able to access the files.

Jago
Posts: 7
Joined: Tue Jan 20, 2009 5:20 pm

Re: Error when parsing

Postby Jago » Wed Jan 21, 2009 5:15 pm

I read somewhere a php file executed from a cronjob doesn't know on wich site it's running, $_SERVER['SERVER-NAME'] is unknown.

This is the given solution for that, i wouldn't know how to add it to the cronjob though.

$pad = "/home//domains//public_html";

$_SERVER['SERVER_NAME'] = 'yourdomain.xx';

$_SERVER['DOCUMENT_ROOT'] = $pad;
set_include_path($pad . PATH_SEPARATOR . ini_get("include_path"));

Panther
Site Admin
Posts: 500
Joined: Sat Dec 08, 2007 12:51 am
Contact:

Re: Error when parsing

Postby Panther » Wed Jan 21, 2009 6:18 pm

I realize now that you're running it via wget through the web server. It would be better to run it directly from the PHP script if possible.

pbgBrockHead
Posts: 37
Joined: Tue Mar 25, 2008 6:52 pm

Re: Error when parsing

Postby pbgBrockHead » Wed Jan 21, 2009 11:05 pm

I realize now that you're running it via wget through the web server. It would be better to run it directly from the PHP script if possible.
if you were referring to me I had my host set this up due to it not taking my command. It kept adding a colon: to the end of the command and would error so I called them and they set it up for me basically.

In regards to Jago, I thought you said you were using server_ext? if so then you dont need the ftp stuff it is done automagically by the RemoteLogDump.php and it will report the logs without your ftp-ing them. This is how mine is set up and is one of the reasons I like it so much.

I am not sure about the cronjob

If you are using server_ext you can find the RemoteLogDump.php in the help/ServerExt folder

open it with a text editor and add in some info

by default the case in elMuertes Log path is lower, Panthers default case is upper and by the looks of it your log directory is also upper. All this editing is done at the top of the file BTW, First 10-20 lines or so.
so edit this

Code: Select all

directory where to write the log files, must be writable by the webserver user (include the trailing slash) */ $logpath = "./logs/";

to be this

Code: Select all

/** directory where to write the log files, must be writable by the webserver user (include the trailing slash) */ $logpath = "./Logs/";
below that is this which needs to match your ut2004.ini, I will explain in a sec.

Code: Select all

/** name of the secret field */ $SecretName = "secret";//must match value/name you choose in your ut2004.ini /** the value of the secret field, if it doesn't match the log file will be ignored */ $SecretValue = "MySecret"; //must match value/name you choose in your ut2004.ini
that is all you need to do to RemoteLogDump.php save it and upload it to example your-site/utstatsdb directory

In your ut2004.ini you would need to add in two things

in the section [Engine.GameInfo] change

GameStatsClass=IpDrv.MasterServerGameStats

to

GameStatsClass=ServerExt.RemoteStats

and finally add in this at the bottom of the ut2004.ini

Code: Select all

[ServerExt.RStatsLink] BufferSize=2048 PostURL=http://www.your-site.com/utstatsdb/RemoteLogDump.php fRetryDelay=30 SecretName=//must match RemoteLodDump.php SecretName SecretValue=//must match RemoteLodDump.php SecretValue
if you are using serverExt as you had said, you can load all of the files for ut2004\system in and there is nothing more to do. You don't have to push this as a mutator it is server side so unless you want to use another method try all of this and pay very very close attention to Case because that will break the link.


as far as my admin LogsConfig all the ftp area is blank

I have the path to logs set to be
Log Path= ./logs/ <- Note the case, I made the change here and My site 'logs'folder rather then in the RemoteLogDump
in your case it is easier to just change the RemoteLogDump
Backup Path= ./blogs/

otherwise everything else in that panel is default, I am pulling files from two servers currently without issue.
hope this helps to solve this for you.
dave ;)


edit__________________________________________________________

edited because I had made some comments to some direct paths in jago's site and I had only done that to be as clear as possible for him. His issue is solved so I think it more respectful to make it more general. :D
Last edited by pbgBrockHead on Fri Jan 23, 2009 2:29 am, edited 1 time in total.

Jago
Posts: 7
Joined: Tue Jan 20, 2009 5:20 pm

Re: Error when parsing

Postby Jago » Thu Jan 22, 2009 7:31 am

Hey, that almost did the trick, Thanks for taking the time to write that all down :D
Now, the logs are uploaded into the /logs folder after every match. It doesn't process them yet, though.

$UTStatsDBProcLog = true;

by default...

/**
if you set this to true the script will call UTStatsDB's log processor
after it received an endgame stats line. For this the script assumes it's
located in the UTStatsDB directory.
*/

It's not in UTStatsDB, but utstatsdb. Looking at that php file i don't think that would make the difference though

pbgBrockHead
Posts: 37
Joined: Tue Mar 25, 2008 6:52 pm

Re: Error when parsing

Postby pbgBrockHead » Thu Jan 22, 2009 6:09 pm

It doesn't process them yet, though.
what exactly do you mean by this?

are you saying if you go to your admin panel it will not parse?

or are you saying your cron command is not working?

Jago
Posts: 7
Joined: Tue Jan 20, 2009 5:20 pm

Re: Error when parsing

Postby Jago » Thu Jan 22, 2009 6:32 pm

It doesn't process them yet, though.
what exactly do you mean by this?

are you saying if you go to your admin panel it will not parse?

or are you saying your cron command is not working?
/**
if you set this to true the script will call UTStatsDB's log processor
after it received an endgame stats line. For this the script assumes it's
located in the UTStatsDB directory.
*/

I'd think it's supposed to add the logs to the database aswell, so stats appear on the actual site? :o

edit:
it's working, i used a cronjob for the logs.php :P
for the Log Path i used /home/w9910568/domains/thepicwhorez.com/public_html/utstatsdb//Logs
wich did work, so i guess exact links are indeed needed for cronjobs

pbgBrockHead
Posts: 37
Joined: Tue Mar 25, 2008 6:52 pm

Re: Error when parsing

Postby pbgBrockHead » Fri Jan 23, 2009 12:44 am

cool glad you have it figured :)


Return to “UTStatsDB”