Comments (15)
@programarivm I only played it once and it occurred. The only replication of the error I know is manual :) Inspect the code responsible for playing with a computer and try to catch errors.
from chess-server.
🙏 Thank you @Arturas1989, @CodeMaster7000 @d47081, @Mayank2001kh for the help on this issue, it is very much appreciated! Now all objects implementing the Throwable interface are being catched and logged in the storage/pchess.log
file. Could the "Whoops!" message be reproduced now to see what the log file reports?
from chess-server.
Thank you @Arturas1989 for opening this issue!
Does the error occur frequently? And can it be replicated?
from chess-server.
Most probably this is because Workerman WebSockets were recently added and the recent changes were not pulled.
git pull origin master
remote: Enumerating objects: 20, done.
remote: Counting objects: 100% (20/20), done.
remote: Compressing objects: 100% (2/2), done.
remote: Total 11 (delta 7), reused 11 (delta 7), pack-reused 0
Unpacking objects: 100% (11/11), 777 bytes | 129.00 KiB/s, done.
From https://github.com/chesslablab/chess-server
* branch master -> FETCH_HEAD
cb099c6..d9e9309 master -> origin/master
Updating cb099c6..d9e9309
Fast-forward
cli/ratchet/wss.php | 3 +--
cli/workerman/wss.php | 3 +--
src/Socket/RatchetClientStorage.php | 11 +----------
src/Socket/WorkermanClientStorage.php | 11 +----------
4 files changed, 4 insertions(+), 24 deletions(-)
docker logs chess_server_php_fpm
Welcome to PHP Chess Server
Commands available:
/accept {"jwt":"<string>"} Accepts an invitation to play online with an opponent.
/draw {"action":["accept","decline","propose"]} Allows to offer a draw.
/heuristics {"fen":"<string>","variant":"<string>"} Returns the heuristics of a chess position.
/leave {"action":["accept"]} Allows to leave a game.
/legal {"position":"<string>"} Returns the legal FEN positions of a piece.
/online_games Returns the online games waiting to be accepted.
/play_lan {"color":"<string>","lan":"<string>"} Plays a chess move in long algebraic notation.
/randomizer {"turn":"<string>","items":"<string>"} Starts a random position.
/rematch {"action":["accept","decline","propose"]} Allows to offer a rematch.
/resign {"action":["accept"]} Allows to resign a game.
/restart {"hash":"<string>"} Restarts a game.
/start {"variant":["960","capablanca","capablanca-fischer","classical"],"mode":["fen","san","play","stockfish"],"settings":{"color":["w","b"],"fen":"<string>","movetext":"<string>","settings":"<string>","startPos":"<string>"}} Starts a new game.
/stockfish {"options":{"Skill Level":"int"},"params":{"depth":"int"}} Returns Stockfish's response to the current position.
/stockfish_eval {"fen":"<string>","variant":"<string>"} Returns Stockfish's evaluation for the given position.
/takeback {"action":["accept","decline","propose"]} Allows to takeback a move.
/tutor_fen {"fen":"<string>","variant":"<string>"} Explains a FEN position in terms of chess concepts.
/undo Undoes the last move.
Listening to commands...
Workerman[cli/workerman/wss.php] start in DEBUG mode
------------------------------------------- WORKERMAN --------------------------------------------
Workerman version:4.1.14 PHP version:8.3.2 Event-Loop:\Workerman\Events\Select
-------------------------------------------- WORKERS ---------------------------------------------
proto user worker listen processes status
ssl unknown none websocket://0.0.0.0:8443 1 [OK]
--------------------------------------------------------------------------------------------------
Press Ctrl+C to stop. Start success.
Warning: User unknown not exists
from chess-server.
Thank you @d47081 for reporting this issue, it seems as if the errors are not being logged. See #257
from chess-server.
Opened discussion:
from chess-server.
Fixed bug chesslablab/php-chess#482
from chess-server.
from chess-server.
Thanks, check my trace please
from chess-server.
I think this issue could be related with same problem as fixed here #233 (chesslablab/php-chess#442)
from chess-server.
Same here
from chess-server.
The stack trace is not being logged.
cat pchess.log | grep error
[2024-02-21T19:05:46.230919+00:00] log.ERROR: Occurred an error {"message":"","file":"/usr/share/chess-server/vendor/chesslablab/php-chess/src/Variant/Classical/PGN/Move.php","line":301} []
[2024-02-21T19:05:46.231009+00:00] log.INFO: Sent message {"id":21,"cmd":["error"]} []
Also at the moment only the command names are logged so it remains unknown which move exactly threw the exception.
...
[2024-02-21T19:04:36.453698+00:00] log.INFO: New connection {"id":21,"n":1} []
[2024-02-21T19:04:36.521191+00:00] log.INFO: Sent message {"id":21,"cmd":["/start"]} []
[2024-02-21T19:04:45.723480+00:00] log.INFO: Sent message {"id":21,"cmd":["/start"]} []
[2024-02-21T19:04:46.666906+00:00] log.INFO: Sent message {"id":21,"cmd":["/legal"]} []
[2024-02-21T19:04:47.255247+00:00] log.INFO: Sent message {"id":21,"cmd":["/play_lan"]} []
[2024-02-21T19:04:47.857739+00:00] log.INFO: Sent message {"id":21,"cmd":["/stockfish"]} []
[2024-02-21T19:04:48.264194+00:00] log.INFO: Sent message {"id":21,"cmd":["/legal"]} []
[2024-02-21T19:04:48.828461+00:00] log.INFO: Sent message {"id":21,"cmd":["/play_lan"]} []
[2024-02-21T19:04:49.410408+00:00] log.INFO: Sent message {"id":21,"cmd":["/stockfish"]} []
[2024-02-21T19:04:50.837939+00:00] log.INFO: Sent message {"id":21,"cmd":["/legal"]} []
[2024-02-21T19:04:51.479351+00:00] log.INFO: Sent message {"id":21,"cmd":["/play_lan"]} []
[2024-02-21T19:04:52.102421+00:00] log.INFO: Sent message {"id":21,"cmd":["/stockfish"]} []
[2024-02-21T19:04:55.234495+00:00] log.INFO: Sent message {"id":21,"cmd":["/legal"]} []
[2024-02-21T19:04:58.990147+00:00] log.INFO: Sent message {"id":21,"cmd":["/play_lan"]} []
[2024-02-21T19:04:59.615559+00:00] log.INFO: Sent message {"id":21,"cmd":["/stockfish"]} []
[2024-02-21T19:05:05.031748+00:00] log.INFO: Sent message {"id":21,"cmd":["/legal"]} []
[2024-02-21T19:05:06.015237+00:00] log.INFO: Sent message {"id":21,"cmd":["/play_lan"]} []
[2024-02-21T19:05:06.674021+00:00] log.INFO: Sent message {"id":21,"cmd":["/stockfish"]} []
[2024-02-21T19:05:22.376442+00:00] log.INFO: Sent message {"id":21,"cmd":["/legal"]} []
[2024-02-21T19:05:27.390752+00:00] log.INFO: Sent message {"id":21,"cmd":["/legal"]} []
[2024-02-21T19:05:27.791096+00:00] log.INFO: Sent message {"id":21,"cmd":["/legal"]} []
[2024-02-21T19:05:27.902157+00:00] log.INFO: Sent message {"id":21,"cmd":["/legal"]} []
[2024-02-21T19:05:30.823827+00:00] log.INFO: Sent message {"id":21,"cmd":["/legal"]} []
[2024-02-21T19:05:30.959547+00:00] log.INFO: Sent message {"id":21,"cmd":["/legal"]} []
[2024-02-21T19:05:34.927681+00:00] log.INFO: Sent message {"id":21,"cmd":["/legal"]} []
[2024-02-21T19:05:35.055583+00:00] log.INFO: Sent message {"id":21,"cmd":["/legal"]} []
[2024-02-21T19:05:36.406424+00:00] log.INFO: Sent message {"id":21,"cmd":["/legal"]} []
[2024-02-21T19:05:37.271844+00:00] log.INFO: Sent message {"id":21,"cmd":["/play_lan"]} []
[2024-02-21T19:05:38.093021+00:00] log.INFO: Sent message {"id":21,"cmd":["/stockfish"]} []
[2024-02-21T19:05:40.840354+00:00] log.INFO: Sent message {"id":21,"cmd":["/legal"]} []
[2024-02-21T19:05:41.771949+00:00] log.INFO: Sent message {"id":21,"cmd":["/play_lan"]} []
[2024-02-21T19:05:43.005086+00:00] log.INFO: Sent message {"id":21,"cmd":["/stockfish"]} []
[2024-02-21T19:05:44.731110+00:00] log.INFO: Sent message {"id":21,"cmd":["/legal"]} []
[2024-02-21T19:05:45.395565+00:00] log.INFO: Sent message {"id":21,"cmd":["/play_lan"]} []
[2024-02-21T19:05:46.230919+00:00] log.ERROR: Occurred an error {"message":"","file":"/usr/share/chess-server/vendor/chesslablab/php-chess/src/Variant/Classical/PGN/Move.php","line":301} []
[2024-02-21T19:05:46.231009+00:00] log.INFO: Sent message {"id":21,"cmd":["error"]} []
...
It seems as if src/Variant/Classical/PGN/Move.php needs some fixing.
from chess-server.
The stack trace is being logged now. See #262
from chess-server.
The WebSocket messages need to be logged. See #264
from chess-server.
Related Issues (20)
- PHP Fatal error: Uncaught TypeError: Chess\Piece\K::fen() HOT 1
- List of deprecated warnings
- It's possible to make HTTP requests to server instead of WS?
- Whoops! Something went wrong. HOT 7
- Delete the /inbox command
- Replace Ratchet with AMPHP WebSocket Server HOT 1
- Host the PHP Chess Server on async.chesslablab.net
- Host the PHP Chess Server on async.chesslablab.org
- Replace Ratchet with Workerman HOT 1
- Implement Workerman WebSockets
- Implement Swoole WebSockets
- Implement AMPHP WebSockets
- Errors not being logged
- Write the very first async test
- Installation step in docs
- Is the secure socket required? HOT 8
- Log the stack trace
- Log the WebSocket messages
- PHP Notice: fwrite(): Write of X bytes failed with errno=32 Broken pipe
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 chess-server.