Some members can't upload profiles... get blank pages

CharacterProfiler.lua file uploading issues

Some members can't upload profiles... get blank pages

Postby Wildstar » Sun Mar 11, 2007 10:15 pm

Certain members of my guild get a blank page in firefox & IE7 when they try to upload their character profiles.

I am able to recreate this.

They have deleted & recreated their CP.lua

The have the latest version of CP.

I performed the alternate temp directory modification.

It happens without fail 10 seconds after I click upload.

I think its a timeout setting somewhere, but I can't figure out where. All the php timeout settings I can find are 30 seconds or more.

Thanks,

-Wildstar
Wildstar
WR.net Apprentice
WR.net Apprentice
 
Posts: 11
Joined: Sat Aug 05, 2006 8:08 pm

Some members can't upload profiles... get blank pages

Postby zanix » Sun Mar 11, 2007 10:57 pm

Probably an addon's trigger file
Try to remove all your Roster addons, then upload again
Read the Forum Rules, the WiKi, and Search before posting!
WoWRoster v2.1 - SigGen v0.3.3.523 - WoWRosterDF
User avatar
zanix
Admin
Admin
WoWRoster.net Dev Team
WoWRoster.net Dev Team
UA/UU Developer
UA/UU Developer
 
Posts: 5546
Joined: Mon Jul 03, 2006 8:29 am
Location: Idaho Falls, Idaho
Realm: Doomhammer (PvE) - US

Re: Some members can't upload profiles... get blank pages

Postby Wildstar » Mon Mar 12, 2007 1:05 am

zanix wrote:Probably an addon's trigger file
Try to remove all your Roster addons, then upload again


Removed all my addons. No change.
Wildstar
WR.net Apprentice
WR.net Apprentice
 
Posts: 11
Joined: Sat Aug 05, 2006 8:08 pm

Some members can't upload profiles... get blank pages

Postby zanix » Mon Mar 12, 2007 1:15 am

The only thing left is that they may have bad CP.lua files
Have them clear the old CP.lua and CP.lua.bak files, disable all addons except rpgo-characterprofiler and try again
Read the Forum Rules, the WiKi, and Search before posting!
WoWRoster v2.1 - SigGen v0.3.3.523 - WoWRosterDF
User avatar
zanix
Admin
Admin
WoWRoster.net Dev Team
WoWRoster.net Dev Team
UA/UU Developer
UA/UU Developer
 
Posts: 5546
Joined: Mon Jul 03, 2006 8:29 am
Location: Idaho Falls, Idaho
Realm: Doomhammer (PvE) - US

Re: Some members can't upload profiles... get blank pages

Postby Wildstar » Mon Mar 12, 2007 1:31 am

zanix wrote:The only thing left is that they may have bad CP.lua files
Have them clear the old CP.lua and CP.lua.bak files, disable all addons except rpgo-characterprofiler and try again


In addition to the other guildmembers suffering this, I suffer this problem.

I have done all that. One of the other officers that has this problem has done it too.

Same results.

I've even gone so far as to delete the CP.lua files and generate the data for each character and update it individually. (I.E. delete CP.lua files, generate CP.lua data for Character #1. Upload. Delete CP.lua files, generate CP.lua data for Character #2. Upload. etc.)
All the accounts that are suffering are full of actively played characters. A lua file one of these accounts is over a megabyte.

Its definitely an issue of php timeout or file size. I haven't been able to figure out whats set wrong.

I don't think this is a bad code or bug issue on wowroster's part. I'm just hoping that either y'all or somebody reading this thread has had this problem in the past and can point me to the solution. I can't figure it out, and I've been beating my head against this all weekend.

Thanks,

Wildstar
Wildstar
WR.net Apprentice
WR.net Apprentice
 
Posts: 11
Joined: Sat Aug 05, 2006 8:08 pm

Re: Some members can't upload profiles... get blank pages

Postby Wildstar » Tue Mar 13, 2007 4:29 pm

Its not a timeout issue. Its a file size issue of sorts. It only happens with CP.lua's that are at or over 1mb.


I added some error reporting lines in the update.php script, and this is what I got:

Fatal error: Allowed memory size of 8388608 bytes exhausted (tried to allocate 40 bytes) in roster/lib/luaparser.php on line 127

Line 127 is:

$stack[$stack_pos] = array($name, array())

I'm running the stock value of 8mb in my php.ini. Should I need more?
Wildstar
WR.net Apprentice
WR.net Apprentice
 
Posts: 11
Joined: Sat Aug 05, 2006 8:08 pm

Some members can't upload profiles... get blank pages

Postby Lanaera » Tue Mar 13, 2007 6:30 pm

I think I'm getting a similar issue. Addons seem to have no effect on the problem. IE reports a page unavailable, Firefox tries to open a blank .php file with wordpad. Have tried deleteing and recreating the .lua file, and my file is about 1.3 MB...
User avatar
Lanaera
WR.net Apprentice
WR.net Apprentice
 
Posts: 3
Joined: Sat Oct 28, 2006 9:50 pm

Some members can't upload profiles... get blank pages

Postby Lanaera » Tue Mar 13, 2007 6:43 pm

I think there's something to that 1mb file limit too -- deleting and keeping the .lua file under 1mb causes it to work... just confirmed that. If it grows over 1mb, it goes bad again.
User avatar
Lanaera
WR.net Apprentice
WR.net Apprentice
 
Posts: 3
Joined: Sat Oct 28, 2006 9:50 pm

Re: Some members can't upload profiles... get blank pages

Postby Wildstar » Tue Mar 13, 2007 10:58 pm

I bumped my memory allocation for php to 12mb, and it solved the problem for me. But one of my guildies has a 2mb cp.lua, and he's still suffering.
Wildstar
WR.net Apprentice
WR.net Apprentice
 
Posts: 11
Joined: Sat Aug 05, 2006 8:08 pm

Re: Some members can't upload profiles... get blank pages

Postby Wildstar » Wed Mar 14, 2007 1:06 pm

The problem is in luaparser.php.

I added the following line to the various points of update.php and right after line 127 in luaparser.php:

echo "I'm at point X using " . memory_get_usage() / 1024 . "KB of memory<br>";

I updated my roster with a 1180kb cp.lua file.

Here is the report I got:
I'm at begining update.php using 139.5234375KB of memory
I'm starting luaparser using 1229.5625KB of memory
I'm exiting luaparser using 1229.5625KB of memory
I'm parsing luapareser line #127 using 4399.5546875KB of memory
I'm parsing luapareser line #127 using 4400.15625KB of memory
I'm parsing luapareser line #127 using 4401.34375KB of memory
I'm parsing luapareser line #127 using 4401.453125KB of memory
I'm parsing luapareser line #127 using 4401.59375KB of memory
I'm parsing luapareser line #127 using 4401.6875KB of memory
I'm parsing luapareser line #127 using 4402.234375KB of memory
I'm parsing luapareser line #127 using 4402.34375KB of memory
I'm parsing luapareser line #127 using 4402.7421875KB of memory
I'm parsing luapareser line #127 using 4403.1171875KB of memory


It increments like this for a while. Towards the end I get:

I'm parsing luapareser line #127 using 9458.875KB of memory
I'm parsing luapareser line #127 using 9459.0859375KB of memory
I'm parsing luapareser line #127 using 9459.4375KB of memory
I'm parsing luapareser line #127 using 9459.8046875KB of memory
I'm parsing luapareser line #127 using 9460.296875KB of memory
I'm parsing luapareser line #127 using 9460.40625KB of memory
I'm parsing luapareser line #127 using 9460.59375KB of memory
I'm parsing luapareser line #127 using 9460.8046875KB of memory
I've finished update.php uploading and parsing using 3828.5390625KB of memory
I've finished update.php function processPvP using 4837.8671875KB of memory
I've finished update.php function processMyProfile using 4837.8671875KB of memory
I've finished update.php function processGuildProfile using 4837.8671875KB of memory
Wildstar
WR.net Apprentice
WR.net Apprentice
 
Posts: 11
Joined: Sat Aug 05, 2006 8:08 pm

Re: Some members can't upload profiles... get blank pages

Postby aniodon » Wed Mar 14, 2007 1:16 pm

Same problem for some of my guildmates, since a while.

I tried many things, don't know how to fix this.
The only way to make it work was for me to clear the file, and save for only one character. That works in every case, but when there are more data, for more characters, we always get the error (timeout).

I don't think it is a 1.7.3 specific problem, since I get it for some months.
Last edited by aniodon on Wed Mar 14, 2007 1:21 pm, edited 1 time in total.
aniodon
WR.net Journeyman
WR.net Journeyman
 
Posts: 108
Joined: Mon Dec 18, 2006 8:09 pm

Re: Some members can't upload profiles... get blank pages

Postby shaun.voysey » Wed Mar 14, 2007 4:47 pm

It looks like a resource problem that is listed in the PHP.ini file.

Those who run your own servers can do this, also those who have a PHP.ini file listed for your own sites.

under :

Code: Select all
;;;;;;;;;;;;;;;;;;;
; Resource Limits ;
;;;;;;;;;;;;;;;;;;;


There is a line of : memory_limit = 8M

This is for the Maximum amount of memory a script may consume (8MB default)

Increase to something like 20M

Fixed it for me.
User avatar
shaun.voysey
WR.net Apprentice
WR.net Apprentice
 
Posts: 70
Joined: Thu Aug 10, 2006 12:50 pm
Location: Berkshire, England

Some members can't upload profiles... get blank pages

Postby aniodon » Thu Mar 15, 2007 12:43 am

As my host won't allow me to modify this setting, my only hope is that someone take a look if there is any code optimisation possible... :(

Be aware however, that it is a frequent issue for some of my guild mates, maybe would it be great to have a look at it =))

Aniodon
aniodon
WR.net Journeyman
WR.net Journeyman
 
Posts: 108
Joined: Mon Dec 18, 2006 8:09 pm

Some members can't upload profiles... get blank pages

Postby PleegWat » Thu Mar 15, 2007 11:26 pm

I know dracula uses a custom uploaded that splits his CP data into separate files for each char and the guild data. I don't think it's published anywhere, but I'll ask him for it next time I see him.
I <3 /bin/bash
User avatar
PleegWat
WoWRoster.net Dev Team
WoWRoster.net Dev Team
 
Posts: 1636
Joined: Tue Jul 04, 2006 1:43 pm

Some members can't upload profiles... get blank pages

Postby PleegWat » Fri Mar 16, 2007 7:50 pm

I've taken a closer look at the lua parser. I think the high memory usage is because of overallocation in the php arrays. I've cut down the memory usage significantly by having the lua parser read directly from the uploaded file, rather than caching it in memory.

in lib/luaparser.php, find:
Code: Select all
/**
* Wrapper function so that you can parse a file instead of an array.
* @author six
*/
function ParseLuaFile$file_name $file_type=null )
{
    if( 
file_exists($file_name) && is_readable($file_name) )
    {
        if( 
$file_type == 'gz' )
        {
            
$file_as_array gzfile($file_name);
        }
        else
        {
            
$file_as_array file($file_name);
        }

        return(
ParseLuaArray($file_as_array));
    }
    return(
false);
}

/**
* Main LUA parsing function
* @author six, originally mordon
*/
function ParseLuaArray( &$file_as_array )
{
    if( !
is_array($file_as_array) )
    {
        
// return false if not presented with an array
        
return(false);
    }
    else
    {
        
// Parse the contents of the array
        
$stack = array( array( '',  array() ) );
        
$stack_pos 0;
        
$last_line '';
        foreach( 
$file_as_array as $line )
        {
            
// join lines ending in \\ together
            
if( substr$line, -2) == '\\' )
            {
                
$last_line .= substr($line0, -2) . "\n";
                continue;
            }
            if(
$last_line!='')
            {
                
$line trim($last_line $line);
                
$last_line '';
            }
            else
            {
                
$line trim($line);
            }
 


Replace by:

Code: Select all
/**
 * Main LUA parsing function
 * @author six, originally mordon
 */
function ParseLuaFile$file_name )
{
    if( 
file_exists($file_name) && is_readable($file_name) )
    {
        
$stack = array( array( '',  array() ) );
        
$stack_pos 0;
        
$last_line '';
        
        
$file gzopen($file_name,'r');
        
        while( !
gzeof($file) )
        {
            
$line gzgets($file);
            
$line trim($line);
 


Near the bottom of the same file, find:

Code: Select all
        return($stack[0][1]);
 


Add before:

Code: Select all

        gzclose
($file);
 


in update.php, find:

Code: Select all

                    $data 
ParseLuaFile$file['tmp_name'],$file_type );
 


Replace by:

Code: Select all

                    $data 
ParseLuaFile$file['tmp_name'] );
 


This works for both plain-text and gzipped uploads.
I <3 /bin/bash
User avatar
PleegWat
WoWRoster.net Dev Team
WoWRoster.net Dev Team
 
Posts: 1636
Joined: Tue Jul 04, 2006 1:43 pm

Next

Return to Uploading

Who is online

Users browsing this forum: No registered users and 1 guest

cron