GithubHelp home page GithubHelp logo

Comments (15)

Arturas1989 avatar Arturas1989 commented on June 10, 2024 5

@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.

programarivm avatar programarivm commented on June 10, 2024 4

🙏 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.

programarivm avatar programarivm commented on June 10, 2024 2

Thank you @Arturas1989 for opening this issue!

Does the error occur frequently? And can it be replicated?

See chesslablab/spablab#600

from chess-server.

programarivm avatar programarivm commented on June 10, 2024 2

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.

programarivm avatar programarivm commented on June 10, 2024 2

Thank you @d47081 for reporting this issue, it seems as if the errors are not being logged. See #257

from chess-server.

programarivm avatar programarivm commented on June 10, 2024 2

Opened discussion:

from chess-server.

programarivm avatar programarivm commented on June 10, 2024 2

Fixed bug chesslablab/php-chess#482

from chess-server.

d47081 avatar d47081 commented on June 10, 2024 1

https://ui.chesslablab.org/

image

from chess-server.

d47081 avatar d47081 commented on June 10, 2024 1

Thanks, check my trace please

image

from chess-server.

d47081 avatar d47081 commented on June 10, 2024 1

I think this issue could be related with same problem as fixed here #233 (chesslablab/php-chess#442)

from chess-server.

d47081 avatar d47081 commented on June 10, 2024

Same here

image

from chess-server.

programarivm avatar programarivm commented on June 10, 2024

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.

programarivm avatar programarivm commented on June 10, 2024

The stack trace is being logged now. See #262

from chess-server.

programarivm avatar programarivm commented on June 10, 2024

The WebSocket messages need to be logged. See #264

from chess-server.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.