Forums  ›  Cheetah  ›  Support
 

PDOException Error Triggered

Thanks Dean.  Now take the rest of the day off and enjoy Thanksgiving.

I was able to reproduce it on a test site.

It does not matter if the profile is using avatars or photos. It does it with both. Hard to notice that because it does not do it every time. So it has nothing to do with the avatars. It also does not matter which template you switch to. Seems to do it at random for all of the templates.

It seems to be related to the profile sounds block. If you go to the profile page in the page builders and drag out the profile sounds block, the problem goes away.

I am going to keep testing and see if i can find the problem. Something is querying for a token twice and i need to try and find it. If i can't, i will just solve it with a insert ignore or a on duplicate key update. I have plans to replace the MP3 player anyway as part of my flash removal project. The current mp3 player calls functions in the flash folder which is going to change. So it will get fixed anyway when that is all replaced with my own code.

 

Is this will's site?

Yes, I am the sys admin for Will.  If you like, I can PM you the control panel login as well as admin and regular user accounts.  I cleared the /cache and the cache in the admin panel.  

 

Now some of the profiles have not uploaded an avatar; those profiles without an avatar are showing the profile photo they uploaded.

That should not be happening. If the site is set to avatar, it should use the avatar and if one is not found, then it should show a letter icon. It should not be showing a profile photo at all. So i need to run some more tests.

Also noted that in your trace, #0 and #1 the insert is getting called twice within the same 1 second time frame thus the reason for the error.

Is this will's site? The one where he reported in this forum https://www.cheetahwsb.com/forum/topic/Cheetah-1-2-0-Final-has-been-released-.htm that the switch to user uploaded a avatar to everyone's profile.

I am wondering if something is wrong on that site, so i am going to do some tests and see if i can replicate it on one of my test sites. This may take a while.

In the mean time try this.

Edit flash\modules\mp3\inc\functions.inc.php

Look for this at line 220

        getResult("INSERT INTO `" . $sDBModule . "Tokens`(`ID`, `Token`, `Date`) VALUES('" . $sId . "', '" . $sToken . "', '" . $iCurrentTime . "')");


Change to this.

        getResult("INSERT IGNORE INTO `" . $sDBModule . "Tokens`(`ID`, `Token`, `Date`) VALUES('" . $sId . "', '" . $sToken . "', '" . $iCurrentTime . "')");






I have done some tests with different profiles.  No, even profiles with no mp3 I get the error; with an exception.  The exception is if they have an avatar set.  We switched the site from using profile photos for the thumbnails to avatar.  That is where we noted some issues.  Now some of the profiles have not uploaded an avatar; those profiles without an avatar are showing the profile photo they uploaded.  If I switch the template on a profile that doesn't have an avatar, then the PDO Exception does not occur.  It is only occurring on profiles with an avatar.

Profile Sounds item is on the  Profile page; but why would only those profile with an avatar trigger the PDO Exception?

An uncaught exception was thrown

Details

Type PDOException

Message SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry '32-5dfdf0d67658de1844af0200fc62954f' for key 'PRIMARY'

File /public_html/inc/classes/ChWsbDb.php

Line 169

Trace

#0 /public_html/inc/classes/ChWsbDb.php(169): query('INSERT INTO `RayMp3Tokens`(`ID`, `Token`, `Date`) VALUES('32', '5dfdf0d67658de1844af0200fc62954f', '1637814138')')

#1 /public_html/flash/modules/global/inc/db.inc.php(15): res('INSERT INTO `RayMp3Tokens`(`ID`, `Token`, `Date`) VALUES('32', '5dfdf0d67658de1844af0200fc62954f', '1637814138')')

#2 /public_html/flash/modules/global/inc/db.inc.php(49): getResult('INSERT INTO `RayMp3Tokens`(`ID`, `Token`, `Date`) VALUES('32', '5dfdf0d67658de1844af0200fc62954f', '1637814138')')

#3 /public_html/flash/modules/mp3/inc/functions.inc.php(220): getResult('INSERT INTO `RayMp3Tokens`(`ID`, `Token`, `Date`) VALUES('32', '5dfdf0d67658de1844af0200fc62954f', '1637814138')')

#4 /public_html/modules/cheetah/html5av/classes/ChH5avModule.php(293): getMp3Token(32)

#5 /public_html/modules/cheetah/html5av/classes/ChH5avModule.php(248): getAudioPlayer(32)

#6 /public_html/inc/classes/ChWsbRequest.php(112): serviceResponseAudioPlayer(ChWsbAlerts)

#7 /public_html/inc/classes/ChWsbRequest.php(61): _perform(Array, 'ChH5avModule', 'serviceResponseAudioPlayer', Array, false)

#8 /public_html/inc/classes/ChWsbService.php(41): processAsService(Array, 'serviceResponseAudioPlayer', Array, 'Module')

#9 /public_html/inc/classes/ChWsbAlerts.php(96) : eval()'d code(1): call('h5av', 'response_audio_player', Array)

#10 /public_html/inc/classes/ChWsbAlerts.php(96): eval()

#11 /public_html/modules/cheetah/sounds/classes/ChSoundsTemplate.php(21): alert()

#12 /public_html/modules/cheetah/sounds/classes/ChSoundsSearch.php(265): getFileConcept(32)

#13 /public_html/inc/classes/ChWsbRequest.php(112): serviceProfileSoundBlock(6)

#14 /public_html/inc/classes/ChWsbRequest.php(61): _perform(Array, 'ChSoundsSearch', 'serviceProfileSoundBlock', Array, false)

#15 /public_html/inc/classes/ChWsbService.php(41): processAsService(Array, 'serviceProfileSoundBlock', Array, 'Search')

#16 /public_html/inc/classes/ChWsbPageView.php(769) : eval()'d code(1): call('sounds', 'profile_sound_block', Array, 'Search')

#17 /public_html/inc/classes/ChWsbPageView.php(769): eval()

#18 /public_html/inc/classes/ChWsbPageView.php(404): getBlockCode_PHP(364, 'return ChWsbService::call('sounds', 'profile_sound_block', array($this->oProfileGen->_iProfileID), 'Search');')

#19 /public_html/templates/base/scripts/ChBaseProfileView.php(48): genBlock(364, Array, true, 'tab')

#20 /public_html/inc/classes/ChWsbPageView.php(316): genBlock(364, Array)

#21 /public_html/inc/classes/ChWsbPageView.php(224): genColumn(2)

#22 /public_html/inc/classes/ChWsbPageView.php(264): gen()

#23 /public_html/profile.php(77): getCode()

Yea. I need the trace. It does not make sense. There should be no reason a template switch would attempt to insert a audio token into the database.

Are there any mp3 or other audio files on that profile page?

 

I am seeing a PDOException error being triggered when I switch templates while viewing a profile. It does not appear to happen elsewhere on the site. 

SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry '4-93e86f6f7dadf8dfd3082603555b3b68' for key 'PRIMARY' 

/public_html/inc/classes/ChWsbDb.php(169): query('INSERT INTO `RayMp3Tokens`(`ID`, `Token`, `Date`) VALUES('4', '93e86f6f7dadf8dfd3082603555b3b68', '1637782250')')

I can provide the entire trace if needed.

Forums  ›  Cheetah  ›  Support