Comments (2)
Habe soeben festgestellt das in den Fehlerlogs des Forums folgendes steht:
Sun, 21 Jan 2018 08:14:14 +0000
Message: Could not execute statement 'DELETE FROM wcf1_user_storage
WHERE field = ?'
PHP version: 5.6.33-1+0~20180105151759.9+jessie~1.gbp0deeda
WoltLab Suite version: 3.0.11 pl 1
Request URI: /samp.php?action=5&playerid=2&index=0&key=ZENSIERT
Referrer: http://sa-mp.com
User Agent: SAMP/0.3
Peak Memory Usage: 4102872/536870912
======
Error Class: wcf\system\database\exception\DatabaseQueryExecutionException
Error Message: Could not execute statement 'DELETE FROM wcf1_user_storage
WHERE field = ?'
Error Code: 40001
File: /var/www/virtual/valion-gaming.de/forum/htdocs/lib/system/database/statement/PreparedStatement.class.php (105)
Extra Information: YToxOntpOjA7YToyOntpOjA7czoxNzoiUXVlcnkgUGFyYW1ldGVyIDEiO2k6MTtzOjg6Imdyb3VwSURzIjt9fQ==
Stack Trace: [{"file":"\/var\/www\/virtual\/valion-gaming.de\/forum\/htdocs\/lib\/system\/user\/storage\/UserStorageHandler.class.php","line":215,"function":"execute","class":"wcf\\system\\database\\statement\\PreparedStatement","type":"->","args":[["[redacted]"]]},{"file":"\/var\/www\/virtual\/valion-gaming.de\/forum\/htdocs\/lib\/system\/session\/SessionHandler.class.php","line":1031,"function":"resetAll","class":"wcf\\system\\user\\storage\\UserStorageHandler","type":"->","args":["groupIDs"]},{"file":"\/var\/www\/virtual\/valion-gaming.de\/forum\/htdocs\/lib\/data\/user\/UserEditor.class.php","line":284,"function":"resetSessions","class":"wcf\\system\\session\\SessionHandler","type":"::","args":[]},{"file":"\/var\/www\/virtual\/valion-gaming.de\/forum\/htdocs\/lib\/data\/user\/UserAction.class.php","line":458,"function":"resetCache","class":"wcf\\data\\user\\UserEditor","type":"::","args":[]},{"function":"addToGroups","class":"wcf\\data\\user\\UserAction","type":"->","args":[],"file":"[internal function]","line":"?"},{"file":"\/var\/www\/virtual\/valion-gaming.de\/forum\/htdocs\/lib\/data\/AbstractDatabaseObjectAction.class.php","line":204,"function":"call_user_func","args":[["[redacted]","[redacted]"]],"class":"","type":""},{"file":"\/var\/www\/virtual\/valion-gaming.de\/forum\/htdocs\/samp.php","line":244,"function":"executeAction","class":"wcf\\data\\AbstractDatabaseObjectAction","type":"->","args":[]},{"file":"\/var\/www\/virtual\/valion-gaming.de\/forum\/htdocs\/samp.php","line":110,"function":"wbbAddToGroups","class":"SAMPCore","type":"->","args":[]},{"file":"\/var\/www\/virtual\/valion-gaming.de\/forum\/htdocs\/samp.php","line":692,"function":"__construct","class":"SAMPCore","type":"->","args":[]}]
======
Error Class: PDOException
Error Message: SQLSTATE[40001]: Serialization failure: 1213 Deadlock found when trying to get lock; try restarting transaction
Error Code: 40001
File: /var/www/virtual/valion-gaming.de/forum/htdocs/lib/system/database/statement/PreparedStatement.class.php (93)
Extra Information: -
Stack Trace: [{"file":"\/var\/www\/virtual\/valion-gaming.de\/forum\/htdocs\/lib\/system\/database\/statement\/PreparedStatement.class.php","line":93,"function":"execute","class":"PDOStatement","type":"->","args":[["[redacted]"]]},{"file":"\/var\/www\/virtual\/valion-gaming.de\/forum\/htdocs\/lib\/system\/user\/storage\/UserStorageHandler.class.php","line":215,"function":"execute","class":"wcf\\system\\database\\statement\\PreparedStatement","type":"->","args":[["[redacted]"]]},{"file":"\/var\/www\/virtual\/valion-gaming.de\/forum\/htdocs\/lib\/system\/session\/SessionHandler.class.php","line":1031,"function":"resetAll","class":"wcf\\system\\user\\storage\\UserStorageHandler","type":"->","args":["groupIDs"]},{"file":"\/var\/www\/virtual\/valion-gaming.de\/forum\/htdocs\/lib\/data\/user\/UserEditor.class.php","line":284,"function":"resetSessions","class":"wcf\\system\\session\\SessionHandler","type":"::","args":[]},{"file":"\/var\/www\/virtual\/valion-gaming.de\/forum\/htdocs\/lib\/data\/user\/UserAction.class.php","line":458,"function":"resetCache","class":"wcf\\data\\user\\UserEditor","type":"::","args":[]},{"function":"addToGroups","class":"wcf\\data\\user\\UserAction","type":"->","args":[],"file":"[internal function]","line":"?"},{"file":"\/var\/www\/virtual\/valion-gaming.de\/forum\/htdocs\/lib\/data\/AbstractDatabaseObjectAction.class.php","line":204,"function":"call_user_func","args":[["[redacted]","[redacted]"]],"class":"","type":""},{"file":"\/var\/www\/virtual\/valion-gaming.de\/forum\/htdocs\/samp.php","line":244,"function":"executeAction","class":"wcf\\data\\AbstractDatabaseObjectAction","type":"->","args":[]},{"file":"\/var\/www\/virtual\/valion-gaming.de\/forum\/htdocs\/samp.php","line":110,"function":"wbbAddToGroups","class":"SAMPCore","type":"->","args":[]},{"file":"\/var\/www\/virtual\/valion-gaming.de\/forum\/htdocs\/samp.php","line":692,"function":"__construct","class":"SAMPCore","type":"->","args":[]}]
from pwbb4.
Dafür gibt es keinen Fix oder besser gesagt es geht nicht zu fixen.
Erstmal: Im Prinzip konnte ich den Fehler reproduzieren und ich hab jetzt auch extra eine Sicherheitsabfrage mit dazu gebaut, die aber nicht umbedingt dein Problem löst.
Dein Problem ist, du sendest an das Forum mehrere Requests mit Gruppe hinzufügen und entfernen.
Nun versucht das Forum nach und nach deine Requests zu verarbeiten.
Er fügt die Nutzergruppe hinzu, entfernt sie, fügt sie hinzu und so weiter...
Wo ich mir jetzt nicht zu 100% sicher bin ist, ob SA:MP die Requests nach der Reihe durchgeht oder diese einfach direkt ausführt.
Gehen wir davon aus SA:MP schickt die Requests nicht der Reihe nach:
Wenn ein Request mal schneller sein sollte als der andere kommt es zu diesem Fehler.
WSC versucht den Nutzer in die Gruppe zu stecken, hat funktioniert, im nächsten Request wird es erneut probiert und weiß aber zu diesem Moment noch nicht dass der Nutzer überhaupt schon in der Gruppe ist und versucht es erneut.
Nun kommt SQL und sagt nein ist nicht, denn der Nutzer existiert bereits mit der jeweiligen GruppenID.
Was ich damit sagen will: bau deine Funktion um
Beispiel:
if(SpielerInfo[playerid][ForumID] != -255) {
WBB_RemoveFromGroups(SpielerInfo[playerid][ForumID], "5,11,6,10,4,12", playerid);
if(SpielerInfo[playerid][Admin] == 1) {
WBB_AddToGroups(SpielerInfo[playerid][ForumID], "5", playerid);
}
if(SpielerInfo[playerid][Admin] == 2) {
WBB_AddToGroups(SpielerInfo[playerid][ForumID], "11", playerid);
}
if(SpielerInfo[playerid][Admin] == 3) {
WBB_AddToGroups(SpielerInfo[playerid][ForumID], "6", playerid);
}
if(SpielerInfo[playerid][Admin] == 4) {
WBB_AddToGroups(SpielerInfo[playerid][ForumID], "10", playerid);
}
if(SpielerInfo[playerid][Admin] == 5) {
WBB_AddToGroups(SpielerInfo[playerid][ForumID], "4", playerid);
}
if(SpielerInfo[playerid][Supporter] == 1) {
WBB_AddToGroups(SpielerInfo[playerid][ForumID], "12", playerid);
}
}
Du solltest das ganze mit einem Ruck machen.
Erst entfernen und dann hinzufügen, natürlich wärs schöner erst zu removen und den Callback abzufangen und dann erst hinzuzufügen, dass sichert dir wirklich ab dass der Nutzer aus allen Gruppen entfernt wurde und nicht aus der erst hinzugefügten Gruppe entfernt wurde, weil ein HTTP Request mal schneller war.
Ich hoffe es ist etwas verständlich.
from pwbb4.
Related Issues (3)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pwbb4.