FTP error

General forum for discussions regarding UTStatsDB
Dragonsys
Posts: 27
Joined: Mon Dec 17, 2007 3:49 pm

FTP error

Postby Dragonsys » Fri May 06, 2011 10:08 pm

When I try to parse logs I get the following:
Initializing ftp file transfer.

Warning: ftp_login() [function.ftp-login]: User 'user' or password is not valid. in /home/.../public_html/utstatsdb/logs.php on line 452
Unable to login to ftp server 'server' on port '21' for user 'user'.
Setting permissions in directory './Logs/' for 'Stats_*':
Processing directory './Logs/' for 'Stats_*':
No log files to process.
I know that all the ftp info, including user & password, are correct, as I can manually connect & log in with it.
any ideas I might try?

Also, the server query doesn't seem to be working, it just shows the server as offline. It works for gametracker.com (http://www.gametracker.com/server_info/ ... 3.10:7777/).
http://dragons-server.com/utstatsdb

UTStatsDB version - 3.0.6
Operating system and version - CentOS (unknown version)
Database type and version - mySQL 5.0.92-community
PHP version - 5.2.16
Web server and version - Apache 2.2.17
Unreal Tournament version - UT3 patch 5 (2.1)
Stat logger type and version - UT3Stats 1.04
Last edited by Dragonsys on Sat May 07, 2011 12:18 am, edited 1 time in total.

Dragonsys
Posts: 27
Joined: Mon Dec 17, 2007 3:49 pm

Re: FTP error

Postby Dragonsys » Fri May 06, 2011 10:37 pm

I figured out the FTP issue, in the DB for utstatsdb the FTP password is set to varchar(30), I raised it to 50 and now FTP works.

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

Re: FTP error

Postby Panther » Sat May 07, 2011 2:45 am

That's a long password! Trying for the Guinness Book of World Records?

You need to set the "game port" to 6500, since for the UT3 protocol this field is actually set to the query port. The default query port for UT3 is 6500, but it can actually be something else if that port is already in use. It's normally best to set the query port in the startup line. Previous versions of UT set a query port that was relative to the game port.

Dragonsys
Posts: 27
Joined: Mon Dec 17, 2007 3:49 pm

Re: FTP error

Postby Dragonsys » Sat May 07, 2011 12:09 pm

yeah it is pretty long, but it was what my host assigned to me, and I have not figured out how to change it yet.

Ok, so I set the Game Port to 6500 (which is the current Query Port), but it still shows as offline. Also, when I add my UT2004 Server to the query list I get a bunch of fwrite & fclose errors

Code: Select all

Warning: fwrite(): 27 is not a valid stream resource in /home/dragserv/public_html/utstatsdb/serverquery.php on line 59 Warning: fclose(): 27 is not a valid stream resource in /home/dragserv/public_html/utstatsdb/serverquery.php on line 60 Warning: fwrite(): 27 is not a valid stream resource in /home/dragserv/public_html/utstatsdb/serverquery.php on line 59 Warning: fclose(): 27 is not a valid stream resource in /home/dragserv/public_html/utstatsdb/serverquery.php on line 60 Warning: fclose(): 27 is not a valid stream resource in /home/dragserv/public_html/utstatsdb/serverquery.php on line 884
I actually get these for anything I choose other than UT3, as the Query Type.

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

Re: FTP error

Postby Panther » Sat May 07, 2011 1:24 pm

Try the current SVN version of serverquery.php:
http://www.utstatsdb.com/websvn/dl.php? ... hp&rev=135

Dragonsys
Posts: 27
Joined: Mon Dec 17, 2007 3:49 pm

Re: FTP error

Postby Dragonsys » Sat May 07, 2011 2:11 pm

Try the current SVN version of serverquery.php:
http://www.utstatsdb.com/websvn/dl.php? ... hp&rev=135
I did, got the same error, only different line numbers.

Code: Select all

Warning: fwrite(): 27 is not a valid stream resource in /home/dragserv/public_html/utstatsdb/serverquery.php on line 68 Warning: fclose(): 27 is not a valid stream resource in /home/dragserv/public_html/utstatsdb/serverquery.php on line 69 Warning: fwrite(): 27 is not a valid stream resource in /home/dragserv/public_html/utstatsdb/serverquery.php on line 68 Warning: fclose(): 27 is not a valid stream resource in /home/dragserv/public_html/utstatsdb/serverquery.php on line 69 Warning: fclose(): 27 is not a valid stream resource in /home/dragserv/public_html/utstatsdb/serverquery.php on line 989
I'm also getting this when FTPing the logs:

Code: Select all

Downloading log 'Stats-7777-20110507.031019.log'....successful Warning: ftp_delete() [function.ftp-delete]: Closing data connection. in /home/dragserv/public_html/utstatsdb/logs.php on line 523 - deletion failed! Downloading log 'Stats-7777-20110507.031030.log'.... Warning: ftp_get() [function.ftp-get]: Closing data connection. in /home/dragserv/public_html/utstatsdb/logs.php on line 517 failed! Downloading log 'Stats-7777-20110507.173611.log'.... Warning: ftp_get() [function.ftp-get]: Closing data connection. in /home/dragserv/public_html/utstatsdb/logs.php on line 517 failed! Downloading log 'Stats-7777-20110507.173854.log'.... Warning: ftp_get() [function.ftp-get]: Closing data connection. in /home/dragserv/public_html/utstatsdb/logs.php on line 517 failed!
I set permissions to 777 on the folder & files and still get the errors.

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

Re: FTP error

Postby Panther » Sat May 07, 2011 4:22 pm

Using a stock version of UTStatsDB 3.05 (I also tried the newer version of utserverquery.php with the same results) I didn't have any problem displaying your 2004 or UT3 server stats:
http://www.utstatsdb.com/demo/

Does your PHP configuration include sockets support? You can check by creating a PHP file containing the following:
<?php phpinfo(); ?>

You should see a category called "sockets" that shows:
Sockets Support enabled

As for the FTP deletes, it's also possible the the files themselves do not have permission for the ftp user to delete them.

Dragonsys
Posts: 27
Joined: Mon Dec 17, 2007 3:49 pm

Re: FTP error

Postby Dragonsys » Sat May 07, 2011 4:57 pm

Using a stock version of UTStatsDB 3.05 (I also tried the newer version of utserverquery.php with the same results) I didn't have any problem displaying your 2004 or UT3 server stats:
http://www.utstatsdb.com/demo/

Does your PHP configuration include sockets support? You can check by creating a PHP file containing the following:
<?php phpinfo(); ?>

You should see a category called "sockets" that shows:
Sockets Support enabled

As for the FTP deletes, it's also possible the the files themselves do not have permission for the ftp user to delete them.
I'm not real worried about the ftp files, since I can still get them.
As for Sockets - Sockets Support enabled
It is set & enabled.

I installed an unmodified 3.0.6 and I got the same errors, so it seems there is something with 3.0.6 that has a problem (maybe?). Then I installed an unmodified 3.0.5 and the errors went away, but it shows them both as offline - http://dragons-server.com/utstatsdb.old/index.php
could it be a problem on my host's side with a blocked port or something?

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

Re: FTP error

Postby Panther » Sat May 07, 2011 10:34 pm

It's possible that there's a firewall blocking the outgoing ports from the webserver. Check with your host provider.

Dragonsys
Posts: 27
Joined: Mon Dec 17, 2007 3:49 pm

Re: FTP error

Postby Dragonsys » Sun May 08, 2011 11:30 pm

It's possible that there's a firewall blocking the outgoing ports from the webserver. Check with your host provider.
looks like that is part of the problem. According to my webhost, they block all ports, by default, and only allow/open the ones required. I have asked if they can open the UT3 & UT2004 Query ports for me.

It still seems there is an issue with 3.0.6 though, as it gives me the fwrite() & fclose() errors, but 3.0.5 does not.



BTW I have made a patch file for 3.0.6 with the changes I have made for the style & random character images I have on my website, if anyone is interested in it.

Dragonsys
Posts: 27
Joined: Mon Dec 17, 2007 3:49 pm

Re: FTP error

Postby Dragonsys » Mon May 09, 2011 1:25 am

my webhost has opened outbound ports of 7777, 6500 & 7787 (TCP) but it's still not working. I just realized they are UDP... lol

and my UT2004 stats are working perfectly now :)
Only problem left is the automated uploading of UT3 logs, but I understand it's still in development, so I manually FTP the logs for now.

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

Re: FTP error

Postby Panther » Mon May 09, 2011 3:28 am

The libraries that were written for handling HTTP requests through UT3 don't seem to work reliably and as far as I know nothing has been done with them for ages so I wouldn't hold my breath on the automated method. If you can, set up a cron script to retrieve the logs for you.

Dragonsys
Posts: 27
Joined: Mon Dec 17, 2007 3:49 pm

Re: FTP error

Postby Dragonsys » Mon May 09, 2011 4:45 am

The libraries that were written for handling HTTP requests through UT3 don't seem to work reliably and as far as I know nothing has been done with them for ages so I wouldn't hold my breath on the automated method. If you can, set up a cron script to retrieve the logs for you.
seems like most things for UT3 are that way. A cron script is a good idea though.

Dragonsys
Posts: 27
Joined: Mon Dec 17, 2007 3:49 pm

Re: FTP error

Postby Dragonsys » Mon May 09, 2011 11:28 am

My host opened up the ports for UDP and it's all good now. Looks like the fwrite() & fclose() errors went away as well.
Thanks for all your help!

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

Re: FTP error

Postby Panther » Mon May 09, 2011 2:56 pm

I will look into improving the error handling so that it informs you if it wasn't able to connect to the server. Currently it only throws the correct error if it's not able to initialize the socket on the local system.


Return to “UTStatsDB”