forum.webdiplomacy.net

webDip dev coordination forum / public access todo list
It is currently Sun Nov 19, 2017 7:29 pm

All times are UTC




Post new topic Reply to topic  [ 14 posts ]  Go to page 1, 2  Next
Author Message
PostPosted: Wed Jan 25, 2012 10:01 pm 
Offline

Joined: Wed Jan 25, 2012 9:58 pm
Posts: 7
Hello,
I checked the code out of GIT and am working on installing it on a clean Apache instance. Everything seems to work ok until I run the DATC tests. I fixed this error by modifying the table but there seemed to be other database issues besides this one. Do I just have the wrong DB version somehow? I ran the update.sqls in the subfolders from version 1.0 to version 1.4. Thanks in advance!

I get the following error:

Error triggered: Data truncated for column 'pressType' at row 1

Error: "Data truncated for column 'pressType' at row 1"
Raised: "C:\Program Files\Apache Software Foundation\Apache2.2\htdocs\webdiplomacy\objects\database.php"
Line: "376"
userID = 5Variable dump: sql => INSERT INTO wD_Games
SET variantID=1,
name = 'DATC-Adjudicator-Test',
potType = 'Winner-takes-all',
pot = 0, /* This will receive the first player's bet soon */
minimumBet = 5,
anon = 'No',
pressType = 'Normal',
processTime = 1327010700,
phaseMinutes = 30
User => Array: (
silenceID =>
id => 5
username => epios
password => dd2081cba61efcde0bf861caf7d49fe6
email => kevingscott@yahoo.com
type => Array: (
System =>
Banned =>
User => 1
Moderator => 1
Guest =>
Admin => 1
Donator =>
DonatorBronze =>
DonatorSilver =>
DonatorGold =>
DonatorPlatinum =>
ForumModerator =>
)
notifications => Array: (
updated =>
)
comment =>
homepage =>
hideEmail => Yes
timeJoined => 1327008714
locale => English
timeLastSessionEnded => 1327008714
online => 1
points => 100
lastMessageIDViewed => 0
muteReports => No
)
timeStart => 1327008782.3012


Trace:
0 => Array: (
function => error_handler
args => Array: (
0 => 1024
1 => Data truncated for column 'pressType' at row 1
2 => C:\Program Files\Apache Software Foundation\Apache2.2\htdocs\webdiplomacy\objects\database.php
3 => 376
4 => Array: (
sql => INSERT INTO wD_Games
SET variantID=1,
name = 'DATC-Adjudicator-Test',
potType = 'Winner-takes-all',
pot = 0, /* This will receive the first player's bet soon */
minimumBet = 5,
anon = 'No',
pressType = 'Normal',
processTime = 1327010700,
phaseMinutes = 30
User => Array: (
silenceID =>
id => 5
username => epios
password => dd2081cba61efcde0bf861caf7d49fe6
email => kevingscott@yahoo.com
type => Array: (
System =>
Banned =>
User => 1
Moderator => 1
Guest =>
Admin => 1
Donator =>
DonatorBronze =>
DonatorSilver =>
DonatorGold =>
DonatorPlatinum =>
ForumModerator =>
)
notifications => Array: (
updated =>
)
comment =>
homepage =>
hideEmail => Yes
timeJoined => 1327008714
locale => English
timeLastSessionEnded => 1327008714
online => 1
points => 100
lastMessageIDViewed => 0
muteReports => No
)
timeStart => 1327008782.3012
)
)
)
1 => Array: (
file => C:\Program Files\Apache Software Foundation\Apache2.2\htdocs\webdiplomacy\objects\database.php
line => 376
function => trigger_error
args => Array: (
0 => Data truncated for column 'pressType' at row 1
)
)
2 => Array: (
file => C:\Program Files\Apache Software Foundation\Apache2.2\htdocs\webdiplomacy\gamemaster\game.php
line => 328
function => sql_put
class => Database
object => Array: (
putqueries => 4
getqueries => 7
)
type => ->
args => Array: (
0 => INSERT INTO wD_Games
SET variantID=1,
name = 'DATC-Adjudicator-Test',
potType = 'Winner-takes-all',
pot = 0, /* This will receive the first player's bet soon */
minimumBet = 5,
anon = 'No',
pressType = 'Normal',
processTime = 1327010700,
phaseMinutes = 30
)
)
3 => Array: (
file => C:\Program Files\Apache Software Foundation\Apache2.2\htdocs\webdiplomacy\datc\datcGame.php
line => 60
function => create
class => processGame
type => ::
args => Array: (
0 => 1
1 => DATC-Adjudicator-Test
2 =>
3 => 5
4 => Winner-takes-all
5 => 30
6 => 30
7 => No
8 => Normal
)
)
4 => Array: (
file => C:\Program Files\Apache Software Foundation\Apache2.2\htdocs\webdiplomacy\datc\interactive.php
line => 161
function => __construct
class => datcGame
object => Array: (
id =>
variantID =>
Variant =>
password =>
turn =>
phase =>
attempts =>
processTime =>
private =>
name =>
gameOver =>
pot =>
phaseMinutes =>
Members =>
potType =>
processStatus =>
pauseTimeRemaining =>
minimumBet =>
anon =>
pressType =>
lockMode =>
missingPlayerPolicy =>
)
type => ->
args => Array: (
0 => 101
)
)
5 => Array: (
file => C:\Program Files\Apache Software Foundation\Apache2.2\htdocs\webdiplomacy\datc.php
line => 33
args => Array: (
0 => C:\Program Files\Apache Software Foundation\Apache2.2\htdocs\webdiplomacy\datc\interactive.php
)
function => require_once
)


Top
 Profile  
 
PostPosted: Fri Jan 27, 2012 1:34 pm 
Offline
Site Admin

Joined: Sat Jun 28, 2008 6:24 am
Posts: 892
Hmm, it does look like you're using a somehow different database version, which is odd. You might have skipped an update script, unless I've made some odd mistake

Where did you get the initial install.sql from, and can you take a screenshot in phpMyAdmin of your wD_Games table?

Here is mine:


Attachments:
Untitled picture.png
Untitled picture.png [ 158.88 KiB | Viewed 2921 times ]
Top
 Profile  
 
PostPosted: Fri Jan 27, 2012 3:56 pm 
Offline

Joined: Wed Jan 25, 2012 9:58 pm
Posts: 7
Somewhat surprisingly (to me at least) it looks like my DB is the same, but the DATC is trying to insert the wrong value for the enum.

Here is my WD_Games

Thanks!


Attachments:
Screen shot 2012-01-27 at 10.53.43 AM.png
Screen shot 2012-01-27 at 10.53.43 AM.png [ 63.06 KiB | Viewed 2916 times ]
Top
 Profile  
 
PostPosted: Sat Jan 28, 2012 1:26 am 
Offline
Site Admin

Joined: Sat Jun 28, 2008 6:24 am
Posts: 892
You're right, there's a bug in datc/datcGame.php :
Code:
         $Game = processGame::create(1, 'DATC-Adjudicator-Test', '', 5,'Winner-takes-all', 30,30,'No','Normal');

That 'Normal' should be 'Regular'.. what's bizarre is that it still works fine for me :|

Anyway make that change yourself and I'll fix it in the official code


Top
 Profile  
 
PostPosted: Sat Jan 28, 2012 2:11 am 
Offline

Joined: Wed Jan 25, 2012 9:58 pm
Posts: 7
I get another error now. Do you think this is a problem just with the datcGame script? Can I just go through and adjust all the SQL to match my database? If you are sure the issues are in the script, I can get it to run again my database and submit the patch.


Top
 Profile  
 
PostPosted: Sat Jan 28, 2012 10:32 am 
Offline
Site Admin

Joined: Sat Jun 28, 2008 6:24 am
Posts: 892
What other error do you now get?


Top
 Profile  
 
PostPosted: Sat Jan 28, 2012 3:27 pm 
Offline

Joined: Wed Jan 25, 2012 9:58 pm
Posts: 7
Sorry now I get the below. Also I checked and the newMessagesFrom field doesn't currently have a default on my side, although I'm guessing it should be zero

Error: "Field 'newMessagesFrom' doesn't have a default value"
Raised: "C:\Program Files\Apache Software Foundation\Apache2.2\htdocs\webdiplomacy\objects\database.php"
Line: "376"
userID = 5, gameID = 1Variable dump: sql => INSERT INTO wD_Members (gameID, userID, countryID, bet, timeLoggedIn)
VALUES (1, 2, 1, 5, 1327716302),(1, 2, 2, 5, 1327716302),(1, 2, 3, 5, 1327716302),(1, 2, 4, 5, 1327716302),(1, 2, 5, 5, 1327716302),(1, 2, 6, 5, 1327716302),(1, 2, 7, 5, 1327716302)
User => Array: (
silenceID =>
id => 5
username => epios
password => dd2081cba61efcde0bf861caf7d49fe6
email => kevingscott@yahoo.com
type => Array: (
System =>
Banned =>
User => 1
Moderator => 1
Guest =>
Admin => 1
Donator =>
DonatorBronze =>
DonatorSilver =>
DonatorGold =>
DonatorPlatinum =>
ForumModerator =>
)
notifications => Array: (
updated =>
)
comment =>
homepage =>
hideEmail => Yes
timeJoined => 1327008714
locale => English
timeLastSessionEnded => 1327008714
online => 1
points => 100
lastMessageIDViewed => 0
muteReports => No
)
timeStart => 1327716302.7694


Trace:
0 => Array: (
function => error_handler
args => Array: (
0 => 1024
1 => Field 'newMessagesFrom' doesn't have a default value
2 => C:\Program Files\Apache Software Foundation\Apache2.2\htdocs\webdiplomacy\objects\database.php
3 => 376
4 => Array: (
sql => INSERT INTO wD_Members (gameID, userID, countryID, bet, timeLoggedIn)
VALUES (1, 2, 1, 5, 1327716302),(1, 2, 2, 5, 1327716302),(1, 2, 3, 5, 1327716302),(1, 2, 4, 5, 1327716302),(1, 2, 5, 5, 1327716302),(1, 2, 6, 5, 1327716302),(1, 2, 7, 5, 1327716302)
User => Array: (
silenceID =>
id => 5
username => epios
password => dd2081cba61efcde0bf861caf7d49fe6
email => kevingscott@yahoo.com
type => Array: (
System =>
Banned =>
User => 1
Moderator => 1
Guest =>
Admin => 1
Donator =>
DonatorBronze =>
DonatorSilver =>
DonatorGold =>
DonatorPlatinum =>
ForumModerator =>
)
notifications => Array: (
updated =>
)
comment =>
homepage =>
hideEmail => Yes
timeJoined => 1327008714
locale => English
timeLastSessionEnded => 1327008714
online => 1
points => 100
lastMessageIDViewed => 0
muteReports => No
)
timeStart => 1327716302.7694
)
)
)
1 => Array: (
file => C:\Program Files\Apache Software Foundation\Apache2.2\htdocs\webdiplomacy\objects\database.php
line => 376
function => trigger_error
args => Array: (
0 => Field 'newMessagesFrom' doesn't have a default value
)
)
2 => Array: (
file => C:\Program Files\Apache Software Foundation\Apache2.2\htdocs\webdiplomacy\datc\datcGame.php
line => 73
function => sql_put
class => Database
object => Array: (
putqueries => 13
getqueries => 9
)
type => ->
args => Array: (
0 => INSERT INTO wD_Members (gameID, userID, countryID, bet, timeLoggedIn)
VALUES (1, 2, 1, 5, 1327716302),(1, 2, 2, 5, 1327716302),(1, 2, 3, 5, 1327716302),(1, 2, 4, 5, 1327716302),(1, 2, 5, 5, 1327716302),(1, 2, 6, 5, 1327716302),(1, 2, 7, 5, 1327716302)
)
)
3 => Array: (
file => C:\Program Files\Apache Software Foundation\Apache2.2\htdocs\webdiplomacy\datc\interactive.php
line => 161
function => __construct
class => datcGame
object => Array: (
id =>
variantID =>
Variant =>
password =>
turn =>
phase =>
attempts =>
processTime =>
private =>
name =>
gameOver =>
pot =>
phaseMinutes =>
Members =>
potType =>
processStatus =>
pauseTimeRemaining =>
minimumBet =>
anon =>
pressType =>
lockMode =>
missingPlayerPolicy =>
)
type => ->
args => Array: (
0 => 101
)
)
4 => Array: (
file => C:\Program Files\Apache Software Foundation\Apache2.2\htdocs\webdiplomacy\datc.php
line => 33
args => Array: (
0 => C:\Program Files\Apache Software Foundation\Apache2.2\htdocs\webdiplomacy\datc\interactive.php
)
function => require_once
)


Top
 Profile  
 
PostPosted: Sun Jan 29, 2012 6:16 am 
Offline
Site Admin

Joined: Sat Jun 28, 2008 6:24 am
Posts: 892
Weird, I wonder if your MySQL install has warnings turned up or something? What OS, PHP and MySQL versions are you running?


Top
 Profile  
 
PostPosted: Sun Jan 29, 2012 3:26 pm 
Offline

Joined: Wed Jan 25, 2012 9:58 pm
Posts: 7
This is a completely clean install on a little test server. It's MySql 5.5.20 running on XP Sp3. The Web Server is Apache/2.2.21 (Win32) PHP/5.3.9


Top
 Profile  
 
PostPosted: Mon Jan 30, 2012 4:52 am 
Offline
Site Admin

Joined: Sat Jun 28, 2008 6:24 am
Posts: 892
Very odd, not so much that you're getting that error but that I don't.. try running this:
Code:
ALTER TABLE `wD_Members` CHANGE `newMessagesFrom` `newMessagesFrom` SET( '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '10', '11', '12', '13', '14', '15', '16', '17', '18', '19', '20', '21', '22', '23', '24', '25', '26', '27', '28', '29', '30', '31', '32', '33', '34', '35', '36', '37', '38', '39', '40', '41', '42', '43', '44', '45', '46', '47', '48', '49', '50', '51', '52', '53', '54', '55', '56', '57', '58', '59', '60', '61', '62', '63' ) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '',
CHANGE `votes` `votes` SET( 'Draw', 'Pause', 'Cancel' ) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT ''


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 14 posts ]  Go to page 1, 2  Next

All times are UTC


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB® Forum Software © phpBB Group