svn 1418:SVN 1295 Bug "cannot use string offset" still there

Posts from previous Beta sessions

svn 1418:SVN 1295 Bug "cannot use string offset" still there

Postby Derex » Sat Nov 03, 2007 7:22 am

Linking to a prior thread I found:
http://www.wowroster.net/Forums/viewtopic/t=4159.html

I wanted to quickly reply to this:

I am also getting this in: SVN 1418 (WoW Roster Reports: WoWRoster v1.9.9.1418 as the version number).

Completely fresh installation, new database, new directory on the host. Ran through installation, set my Upload Rule and went to upload my newly created LUA File (from this morning, 2.2.0 version of CP) and kaboom.

Fatal error: Cannot use string offset as an array in /home/content/t/e/n/tenebraecor/html/roster2/lib/update.lib.php on line 453

Just like the prior user I assume that if I were to blow away and re-create my profile that all would be fine.

One item that might help: When I go to upload data prior to updating the Guild for the first time (i.e. I try to upload PVP data along with uploading character data but NOT guild data...a bad password was set) it was complaining about my character not having it's data updated to the 2.2.0 version of CP (which is odd since I did, in fact, save that character via 2.2.0).

However if I go down and put NO password in (just try to upload character data) it picks up 2 characters of mine just fine...and allows them to load...even WITHOUT guild data uploaded...unless some data is uploaded and other data is not. However, when I go back and try to get a characters view they're not there.

Not sure if any of this helps but there it is. I'll go ahead and attach my CP to the message here just in case you guys want to play with it.

Cuts from Roster Diag Below:

Basic Server Info
OS Linux
Server Software Apache
MySQL Version 5.0.45-log

PHP Settings
PHP Version 5.1.4
PHP API Type cgi-fcgi
safe_mode Off
open_basedir Off
allow_url_fopen On
file_uploads On
upload_max_filesize 8M

Config Values
version 1.9.9.1418
db_version 6
db_prefix roster_TC
debug_mode On
roster_lang enUS
img_url img/
interface_url img/
img_suffix jpg
use_update_triggers On
rs_mode On
Attachments
characterprofiler.lua
(1.04 MiB) Downloaded 219 times
Last edited by Derex on Sat Nov 03, 2007 7:32 am, edited 3 times in total.
Derex
WR.net Apprentice
WR.net Apprentice
 
Posts: 6
Joined: Sat Sep 02, 2006 2:42 am

Re: svn 1418:SVN 1295 Bug "cannot use string offset" still t

Postby tuigii » Sun Nov 04, 2007 5:41 am

I'll bet that when you wipe your CP.lua again :wink: things might go better.
Because the CP.lua you included here is full with members using CP 2.1.0 and even 2.0.5 (!!)
Only 2 are up to date with 2.2.0

Btw : I thought it was a memory problem, but even my private 64Mb php server can't handle your CP.lua.
User avatar
tuigii
WR.net Master
WR.net Master
 
Posts: 891
Joined: Wed Dec 27, 2006 12:57 pm
Location: Somewhere in the South Ouest of France

svn 1418:SVN 1295 Bug "cannot use string offset" still there

Postby Derex » Tue Nov 06, 2007 2:55 am

*nod* thats what I figured, and as I expected, once I blew away the roster database, reinstalled and re-uploaded a copy with ONLY 2.2.0 saved information, all seems to have uploaded fine.

So I guess this is just another "old data still won't properly convert/be recognized as old".

I expect either there will be a note that everyone will need to delete their CharacterProfiler.lua file before moving to the 2.0 version of roster, or some identification by the uploader code that the data is old with a proper message stating so. :)

Excellent job on this guys...it looks really good.

--Derex
Derex
WR.net Apprentice
WR.net Apprentice
 
Posts: 6
Joined: Sat Sep 02, 2006 2:42 am

Re: svn 1418:SVN 1295 Bug "cannot use string offset" still there

Postby tuigii » Tue Nov 06, 2007 3:38 am

Derex wrote:I expect either there will be a note that everyone will need to delete their CharacterProfiler.lua file before moving to the 2.0 version of roster, or some identification by the uploader code that the data is old with a proper message stating so. :)


With your permission, I keep your charcterprofiler.lua file, and toy with it a little bit so see where things go wako.
It's normal that the parser evolves with the CP/GP lua versions, but it should recognize old versions as well – so it can reject them safely.
Right now, the LUA to PHP array blows something up.

A way to detect this is needed.
At worst, use a quick ASCI file scan (this file, an uploaded copy of characterprofiler.lua, can be more then 1 Mb, I know), to look for CPversion, GPversion and DBversion and the text right after it - the version number, might be a simple solution.
This option could be put off be default, because time consuming, but activated with a "Trouble-shooting" button in the admin or public section.


Btw : remove your cp.lua in the post above, no need to leave it 'wide open for public' neither :wink:
Just edit it and say : resolved - please read on....
Last edited by tuigii on Tue Nov 06, 2007 3:40 am, edited 1 time in total.
User avatar
tuigii
WR.net Master
WR.net Master
 
Posts: 891
Joined: Wed Dec 27, 2006 12:57 pm
Location: Somewhere in the South Ouest of France

svn 1418:SVN 1295 Bug "cannot use string offset" still there

Postby zanix » Tue Nov 06, 2007 4:22 am

Please leave the CP file here so the dev team can work on this issue as well

One of the dev team members had this issue as well but they deleted their CP file before we could get all the kinks out
Last edited by zanix on Tue Nov 06, 2007 4:24 am, edited 1 time in total.
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: svn 1418:SVN 1295 Bug "cannot use string offset" still there

Postby tuigii » Tue Nov 06, 2007 4:46 am

zanix wrote:Please leave the CP file here ....


You're right.

Sorry :(
User avatar
tuigii
WR.net Master
WR.net Master
 
Posts: 891
Joined: Wed Dec 27, 2006 12:57 pm
Location: Somewhere in the South Ouest of France

Re: svn 1418:SVN 1295 Bug "cannot use string offset" still there

Postby tuigii » Tue Nov 06, 2007 11:25 am

First results :

Your characterprofiler.lua contains four Guilds:
start on line 34 : Realm Alleria - Guild "Tenebrae Cór"
start on line 26483 : Realm Thorium Brotherhood - Guild "Tenebrae Cor"
start on line 30183 : Realm Windrunner - Guild "AX Corps"
start on line 30699 : Realm Arygos - No Guild - Char Derexya

First test : removing the last 3 Realms, the CP loads - with Guild password.
Leaving one or more of them in (of these 3), the CP load blows up.

It seems that only one realm works, adding others won't work...

Next test : I'm using the complet CP here (as present on forum)
Harcode : replace this (line 455 - update.lib.php )
Code: Select all
   if( isset($guild['timestamp']['init']['datakey']) )
   {
      list($region) = explode(':',$guild['timestamp']['init']['datakey']);
      $region = strtoupper($region);
   }
   else
   {
      $region = 'US';
   }

for a simple
Code: Select all
$region = 'US';

Because all chars are US anyway.
Now, Guild import doesn't blow up anymore - and some interresting details show up.
The roster spits out many remarks about a tye called "Fordrack".
But what this really means to me is that the $realm array is overwritten by its own continue while build. Indicated (!?!) to me that the luaparser does a bad job here.

I'll better dive in bed before opening the luaparser..

Keep posted.
User avatar
tuigii
WR.net Master
WR.net Master
 
Posts: 891
Joined: Wed Dec 27, 2006 12:57 pm
Location: Somewhere in the South Ouest of France

Re: svn 1418:SVN 1295 Bug "cannot use string offset" still t

Postby tuigii » Wed Nov 07, 2007 11:54 am

I woke up with the luaparser in my head.....

Studied this bugger and have a single conclusion "This is one hell of a good piece of code" 8)

Back to update.lib.php.

And then, things went fast.

The 'real' problem:
Look what is produced with GPversion = 2.2.0 (tabs are respected here !)
Code: Select all
   ["Alleria"] = {
      ["Guild"] = {
         ["Tenebrae Cór"] = {
            ["GPprovider"] = "rpgo",
            ["DBversion"] = "2.0.0",
            ["GPversion"] = "2.2.0",
....

And now an old GPversion = 1.6.0
Code: Select all
   ["Thorium Brotherhood"] = {
      ["Guild"] = {
         ["Guild"] = "Tenebrae Cor",
         ["DBversion"] = "1.6.0",
         ["GPversion"] = "1.6.0",
...



Got it ? Start slapping head is allowed now.

Note that the Guild names are nearly the same, but they reside on different realms.

To make the story short :
Insert this on line 449:
Code: Select all
      if (isset($guild['GPversion']))
      {

and a closing block around line 578:
Code: Select all
      else
      {
         $output .= '<span class="red">'."Someone is throwing realy old stuff at me - I don't like that !!".'</span>'."<br />\n";
      }


This, of course, this need to be localized ^^

The characterprofiler.lua, proposed above, loads fine now.

Of course, this peace of code could give some more info about the 'error', because we know the layout of GPversion 1.6.0 (now).
User avatar
tuigii
WR.net Master
WR.net Master
 
Posts: 891
Joined: Wed Dec 27, 2006 12:57 pm
Location: Somewhere in the South Ouest of France

svn 1418:SVN 1295 Bug "cannot use string offset" still there

Postby PleegWat » Wed Nov 07, 2007 2:22 pm

THere have been other data structure changes since CP/GP 2.0. We've never done supporting old versions of them, since the data format doesn't change all that fast.

Oh, and the luaparser is indeed a bugger to wrap your head around.
Last edited by PleegWat on Wed Nov 07, 2007 2:22 pm, edited 1 time in total.
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


Return to Archived

Who is online

Users browsing this forum: No registered users and 1 guest

cron