Torom / BotLi

Lichess Bot
GNU Affero General Public License v3.0
46 stars 82 forks source link

Any idea what this means? #107

Closed EmptikBest closed 1 year ago

EmptikBest commented 1 year ago

Hi, just started a new bot on a raspberry pi 4 model b 8gb ram and when I started it up, I got this after Book. 1.e4:

Exception in thread Thread-5:
Traceback (most recent call last):
  File "/usr/lib/python3.11/threading.py", line 1038, in _bootstrap_inner
    self.run()
  File "/home/emptikbest/EmptikBot247/BotLi/game.py", line 44, in run
    self._make_move()
  File "/home/emptikbest/EmptikBot247/BotLi/game.py", line 99, in _make_move
    uci_move, offer_draw, resign = self.lichess_game.make_move()
                                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/emptikbest/EmptikBot247/BotLi/lichess_game.py", line 91, in make_move
    self.start_pondering()
  File "/home/emptikbest/EmptikBot247/BotLi/lichess_game.py", line 129, in start_pondering
    self.engine.analysis(self.board)
  File "/home/emptikbest/EmptikBot247/BotLi/env/lib/python3.11/site-packages/chess/engine.py", line 2817, in analysis
    return SimpleAnalysisResult(self, future.result())
                                      ^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/concurrent/futures/_base.py", line 456, in result
    return self.__get_result()
           ^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/concurrent/futures/_base.py", line 401, in __get_result
    raise self._exception
TimeoutError
ERROR:asyncio:Exception in callback Protocol._line_received('readyok')
handle: <Handle Protocol._line_received('readyok')>
Traceback (most recent call last):
  File "/usr/lib/python3.11/asyncio/events.py", line 80, in _run
    self._context.run(self._callback, *self._args)
  File "/home/emptikbest/EmptikBot247/BotLi/env/lib/python3.11/site-packages/chess/engine.py", line 1054, in _line_received
    self.command._line_received(self, line)
  File "/home/emptikbest/EmptikBot247/BotLi/env/lib/python3.11/site-packages/chess/engine.py", line 1305, in _line_received
    self.line_received(engine, line)
  File "/home/emptikbest/EmptikBot247/BotLi/env/lib/python3.11/site-packages/chess/engine.py", line 1716, in line_received
    self._readyok(engine)
  File "/home/emptikbest/EmptikBot247/BotLi/env/lib/python3.11/site-packages/chess/engine.py", line 1729, in _readyok
    self.result.set_result(self.analysis)
asyncio.exceptions.InvalidStateError: invalid state

Any idea what it means?

Torom commented 1 year ago

Do you have a Raspberry Pi compatible version of the engine? The architecture is ARMv8 not x86-64.

EmptikBest commented 1 year ago

Yes, I compiled it with make -j profile-build ARCH=armv8 COMP=gcc.

Torom commented 1 year ago

What happens when you run the engine in the command line and enter go?

Torom commented 1 year ago

Can u post the output of uname -a?

EmptikBest commented 1 year ago

When I run go, it gives me a lot of lines that start with info depth. When I run uname -a (outside of stockfish I'm guessing, since it doesn't work inside stockfish), I get Linux emptikbest-desktop 6.2.0-1004-raspi #5-Ubuntu SMP PREEMPT Mon Apr 3 11:15:14 UTC 2023 aarch64 aarch64 aarch64 GNU/Linux

Torom commented 1 year ago

Hm, that sounds right. I'm not sure why there are problems with BotLi. BotLi and stockfish works fine for me on RaspFish.

EmptikBest commented 1 year ago

Is it the fact that I am using ssh?

Torom commented 1 year ago

You are using ssh to connect to the Raspberry Pi? That's normal. Or do you use ssh for something else? The engine and BotLi are both on the Pi?

Please post your config with the token removed.

EmptikBest commented 1 year ago

Yes, they are both on the Pi. Here is my config with the token removed:

token: "plz find it yourself lol"         # Lichess OAuth2 Token.

engine:                                   # Engine settings.
  dir: "/home/emptikbest/EmptikBot247/BotLi/engines"                        # Directory containing the engine.
  name: "./stockfish"                       # Binary name of the engine to use.
  ponder: true                            # Think on opponent's time.
  silence_stderr: false                   # Suppresses stderr output.
  syzygy:
    enabled: false                        # Activate local syzygy endgame tablebases.
    paths:                                # Paths to local syzygy endgame tablebases.
      - "/home/emptikbest/Syzygy"
    max_pieces: 6                         # Count of max pieces in the local syzygy endgame tablebases.
    instant_play: true                    # Whether the bot should play directly from syzygy without engine if possible.
  gaviota:
    enabled: false                        # Activate local gaviota endgame tablebases.
    paths:                                # Paths to local gaviota endgame tablebases.
      - "/path/to/gaviota"
    max_pieces: 5                         # Count of max pieces in the local gaviota endgame tablebases.
  uci_options:                            # Arbitrary UCI options passed to the engine. (Commenting allowed)
    Move Overhead: 1000                   # Increase if your bot flags games too often.
    Threads: 4                            # Max CPU threads the engine can use.
    Hash: 6144                            # Max memory (in megabytes) the engine can allocate.
  variants:
    enabled: false                        # Activate seperate engine for other chess variants than standard and chess960.
    dir: "./engines"                      # Directory containing the engine.
    name: "fairy-stockfish"               # Binary name of the engine to use.
    ponder: true                          # Think on opponent's time.
    silence_stderr: false                 # Suppresses stderr output.
    uci_options:                          # Arbitrary UCI options passed to the engine. (Commenting allowed)
      Move Overhead: 1000                 # Increase if your bot flags games too often.
      Threads: 4                          # Max CPU threads the engine can use.
      Hash: 6144                          # Max memory (in megabytes) the engine can allocate.
  opening_books:
    enabled: true                         # Activate opening books.
    books:
#     white:                              # List of names of books to use as white.
#       - "WhiteBook"
#     black:                              # List of names of books to use as black.
#       - "BlackBook"
      standard:                           # List of names of books to use if there is no specific book for white, black or chess960.
        - "OlisFish"
#     chess960:                           # List of names of books to use for chess960.
#       - "Chess960Book"
#     Use the same pattern for 'antichess', 'atomic', 'crazyhouse', 'horde', 'kingofthehill', 'racingkings' and '3check' as well.
    selection: "best_move"          # Move selection is one of "weighted_random", "uniform_random" or "best_move".
#   max_depth: 16                         # Half move max depth. (Comment this line for max depth)
  online_moves:
    opening_explorer:
      enabled: false                      # Activate online moves from Lichess opening explorer. The move that has performed best for this bot is played.
      use_for_variants: false             # Whether the Lichess opening explorer should be used for other variants than standard and chess960.
      min_time: 20                        # Time the bot must have at least to use the online move.
      timeout: 5                          # Time the server has to respond.
      min_games: 5                        # Minimum number of games in which the position must have occurred.
      only_with_wins: false               # Whether to play only moves that have won before.
      selection: "performance"            # Move selection is "performance" or "win_rate".
      anti: false                         # Whether to play the moves in which the opponent performs the worst.
#     max_depth: 16                       # Half move max depth. (Comment this line for max depth)
#     max_moves: 1                        # Max number of moves played from Lichess opening explorer. (Comment this line for max moves)
    chessdb:
      enabled: false                      # Activate online moves from https://chessdb.cn/queryc_en/
      min_eval_depth: 10                  # Minimum evaluation depth.
      min_time: 20                        # Time the bot must have at least to use the online move.
      timeout: 5                          # Time the server has to respond.
#     max_depth: 16                       # Half move max depth. (Comment this line for max depth)
#     max_moves: 1                        # Max number of moves played from chessdb. (Comment this line for max moves)
    lichess_cloud:
      enabled: false                      # Activate online moves from Lichess cloud eval.
      only_without_book: false            # Whether the cloud should only be used if there is no matching book.
      min_eval_depth: 10                  # Minimum evaluation depth.
      min_time: 20                        # Time the bot must have at least to use the online move.
      timeout: 5                          # Time the server has to respond.
#     max_depth: 16                       # Half move max depth. (Comment this line for max depth)
#     max_moves: 1                        # Max number of moves played from Lichess cloud eval. (Comment this line for max moves)
    online_egtb:
      enabled: false                      # Activate online endgame tablebases from Lichess.
      min_time: 10                        # Time the bot must have at least to use the online move.
      timeout: 3                          # Time the server has to respond.
  offer_draw:
    enabled: true                         # Activate whether the bot should offer draw.
    score: 10                             # If the absolute value of the score is less than or equal to this value, the bot offers/accepts draw (in cp)
    consecutive_moves: 10                 # How many moves in a row the absolute value of the score has to be below the draw value
    min_game_length: 35                   # Earliest move in which draw is offered.
  resign:
    enabled: false                        # Activate whether the bot should resign games.
    score: -1000                          # If the score is less than or equal to this value, the bot resigns (in cp).
    consecutive_moves: 5                  # How many moves in a row the score has to be below the resign value.

move_overhead_multiplier: 1.1             # Increase if your bot flags games too often. Default move overhead is 1 second per 1 minute initital time.

challenge:                                # Incoming challenges. (Commenting allowed)
  concurrency: 1                          # Number of games to play simultaneously.
  bullet_with_increment_only: true        # Whether bullet games against BOTs should only be accepted with increment.
# min_increment: 0                        # Minimum amount of increment to accept a challenge.
# max_increment: 180                      # Maximum amount of increment to accept a challenge.
# min_initial: 0                          # Minimum amount of initial time to accept a challenge.
# max_initial: 315360000                  # Maximum amount of initial time to accept a challenge.
  variants:                               # Chess variants to accept (https://lichess.org/variant).
    - standard
    - chess960
#   - fromPosition
#   - antichess
#   - atomic
#   - crazyhouse
#   - horde
#   - kingOfTheHill
#   - racingKings
#   - threeCheck
  time_controls:                          # Time controls to accept.
    - bullet
    - blitz
    - rapid
    - classical
  bot_modes:                              # Game modes to accept against BOTs.
#   - casual                              # Unrated games.
    - rated                               # Rated games
  human_modes:                            # Game modes to accept against humans.
#   - casual                              # Unrated games.
    - rated                               # Rated games

matchmaking:
  initial_time: 60                        # Initial time for matchmaking mode.
  increment: 1                            # Increment time for matchmaking mode.
  rated: true                             # Activate rated games in matchmaking mode.
  timeout: 30                             # Time until a challenge is canceled.
  variants:                               # Chess variants (https://lichess.org/variant) to challenge.
    - standard
#   - chess960
#   - antichess
#   - atomic
#   - crazyhouse
#   - horde
#   - kingOfTheHill
#   - racingKings
#   - threeCheck
# min_rating_diff: 0                      # Minimum rating distance to opponent. (Commenting allowed)
# max_rating_diff: 300                    # Maximum rating distance to opponent. (Commenting allowed)
  delay: 10                               # Time in seconds the bot must be idle before a new challenge is started.
  multiplier: 1                           # Multiplier for calculating timeouts in matchmaking. Higher values lead to a wider range of opponents.

messages:
  # Optional substitution keywords (include curly braces):
  #   {opponent} to insert the opponent's name
  #   {me} to insert our name
  #   {engine} to insert engine name
  #   {cpu} to insert CPU information
  #   {ram} to insert RAM size
  # Any other words in curly braces will be removed.
  greeting: "Hey, I'm running {engine} on a Raspberry Pi 4 Model B and 6GiB of RAM. Good luck! Type !help for a list of commands." # Message sent to the opponent at the beginning of a game.
  goodbye: "Good game, see you next time."                                             # Message sent to the opponent after the end of a game.
  greeting_spectators: "Hey, I'm running {engine} on a Raspberry Pi 4 Model B and 6GiB of RAM. Type !help for a list of commands." # Message sent to the spectators at the beginning of a game.
  goodbye_spectators: "Thanks for watching."                                           # Message sent to the spectators after the end of a game.

blacklist:                              # List of users who are not challenged and whose challenges are declined.
    - chessfyBOT
    - Elmichess
    - Annie_archy
    - dark_angel_777
    - OldStockfish
    - ProteusSF-Open
    - ProteusSF-Turbo
    - caissa-ai
    - caissa-test
    - MedipolUniversity

books:                                    # Names of the opening books (to be used above in the opening_books section) and paths to the opening books.
  OlisFish: "/home/emptikbest/EmptikBot247/BotLi/OlisFish.bin"
Torom commented 1 year ago

Do you have the 8 GB RAM version of the Raspberry Pi? If not 6 GB of hash is too much.

EmptikBest commented 1 year ago

Yes, it is the 8GB version

Torom commented 1 year ago

Okay, try the following commands one after another:

cd /home/emptikbest/EmptikBot247/BotLi/engines
./stockfish
setoption name Threads value 4
setoption name Hash value 6144
go
EmptikBest commented 1 year ago

Okay, before trying that I tried running user interface again and now I only get this:

Exception in thread Thread-5:
Traceback (most recent call last):
  File "/usr/lib/python3.11/threading.py", line 1038, in _bootstrap_inner
    self.run()
  File "/home/emptikbest/EmptikBot247/BotLi/game.py", line 44, in run
    self._make_move()
  File "/home/emptikbest/EmptikBot247/BotLi/game.py", line 99, in _make_move
    uci_move, offer_draw, resign = self.lichess_game.make_move()
                                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/emptikbest/EmptikBot247/BotLi/lichess_game.py", line 91, in make_move
    self.start_pondering()
  File "/home/emptikbest/EmptikBot247/BotLi/lichess_game.py", line 129, in start_pondering
    self.engine.analysis(self.board)
  File "/home/emptikbest/EmptikBot247/BotLi/env/lib/python3.11/site-packages/chess/engine.py", line 2817, in analysis
    return SimpleAnalysisResult(self, future.result())
                                      ^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/concurrent/futures/_base.py", line 456, in result
    return self.__get_result()
           ^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/concurrent/futures/_base.py", line 401, in __get_result
    raise self._exception
TimeoutError

Trying the commands you sent now

EmptikBest commented 1 year ago

Oh, I see, it's probably a error with the engine but I don't know why, anyway here's what I get after running go:

Stockfish dev-20230613-7922e07a by the Stockfish developers (see AUTHORS file)
setoption name Threads value 4
setoption name Hash value 6144
go
Killed

I did not 'kill' it by the way

Torom commented 1 year ago

Probably the hash. Try the same with a smaller hash. Let's say 4096.

EmptikBest commented 1 year ago

Yeah, after setting hash to 4096, am getting info depth outputs now, so should I start BotLi after editing the config to set Hash to 4096? Anyway, why doesn't it work with 6144? My Pi has 8GB of RAM, and as indicated in system monitor only 1.1 GiB is used

Torom commented 1 year ago

Yes do that. I'm not sure. It's probably just a little bit too much. But it doesn't matter, a Raspberry Pi is so slow that 4 GB of hash is way more then needed.

EmptikBest commented 1 year ago

Okay, will try after Fairy-Stockfish finishes compiling

EmptikBest commented 1 year ago

Thank you, it worked!

EmptikBest commented 1 year ago

Same error, this time two times in a row. Any idea how to permanently fix this? Do I need to reduce hash even more to something like 2048?

Torom commented 1 year ago

What means same error? Please post the config you're running and the error you're receiving.

EmptikBest commented 1 year ago

Same config.yml that I posted above except for hash 4096. The error I got now out of nowhere is this:

ID: nyY4Ss8B     BOT EmptikBot247 (2855?)   -   BOT RaspFish (2866)     TC: ¼+1     Rated     Variant: Standard
‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾
Book:    1.   e4           70 %
Exception in thread Thread-41:
Traceback (most recent call last):
  File "/usr/lib/python3.11/threading.py", line 1038, in _bootstrap_inner
    self.run()
  File "/home/emptikbest/EmptikBot247/BotLi/game.py", line 44, in run
    self._make_move()
  File "/home/emptikbest/EmptikBot247/BotLi/game.py", line 99, in _make_move
    uci_move, offer_draw, resign = self.lichess_game.make_move()
                                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/emptikbest/EmptikBot247/BotLi/lichess_game.py", line 91, in make_move
    self.start_pondering()
  File "/home/emptikbest/EmptikBot247/BotLi/lichess_game.py", line 129, in start_pondering
    self.engine.analysis(self.board)
  File "/home/emptikbest/EmptikBot247/BotLi/env/lib/python3.11/site-packages/chess/engine.py", line 2817, in analysis
    return SimpleAnalysisResult(self, future.result())
                                      ^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/concurrent/futures/_base.py", line 456, in result
    return self.__get_result()
           ^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/concurrent/futures/_base.py", line 401, in __get_result
    raise self._exception
TimeoutError
ERROR:asyncio:Exception in callback Protocol._line_received('readyok')
handle: <Handle Protocol._line_received('readyok')>
Traceback (most recent call last):
  File "/usr/lib/python3.11/asyncio/events.py", line 80, in _run
    self._context.run(self._callback, *self._args)
  File "/home/emptikbest/EmptikBot247/BotLi/env/lib/python3.11/site-packages/chess/engine.py", line 1054, in _line_received
    self.command._line_received(self, line)
  File "/home/emptikbest/EmptikBot247/BotLi/env/lib/python3.11/site-packages/chess/engine.py", line 1305, in _line_received
    self.line_received(engine, line)
  File "/home/emptikbest/EmptikBot247/BotLi/env/lib/python3.11/site-packages/chess/engine.py", line 1716, in line_received
    self._readyok(engine)
  File "/home/emptikbest/EmptikBot247/BotLi/env/lib/python3.11/site-packages/chess/engine.py", line 1729, in _readyok
    self.result.set_result(self.analysis)
asyncio.exceptions.InvalidStateError: invalid state
________________________________________________________________________________________________________________________________
ID: PO3cOToY     Challenger: BOT chessbot2880 (2871)     TC: 1+0     Rated     Color: Random     Variant: Standard
Bullet against bots is only allowed with increment according to config.
‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾
________________________________________________________________________________________________________________________________
ID: 4u7B0XdO     Challenger: BOT chessbot2880 (2871)     TC: 1+0     Rated     Color: White     Variant: Standard
Bullet against bots is only allowed with increment according to config.
‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾
________________________________________________________________________________________________________________________________
ID: 4Eaz7Iyv     Challenger: BOT StrongMagnusCarlsen (2869)     TC: 2+0     Rated     Color: Random     Variant: Standard
Bullet against bots is only allowed with increment according to config.
‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾
________________________________________________________________________________________________________________________________
ID: whzejVZ1     Challenger: BOT RaspFish (2866)     TC: 1+1     Rated     Color: White     Variant: Standard
Challenge added to queue.
‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾
Challenging raspfish ...
________________________________________________________________________________________________________________________________
ID: nlVREBau     Challenger: BOT chessbot2880 (2882)     TC: 1+0     Rated     Color: White     Variant: Standard
Bullet against bots is only allowed with increment according to config.
‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾
Challenge against raspfish has timed out.
Challenges against raspfish removed from queue.

ID: whzejVZ1     BOT RaspFish (2866)   -   BOT EmptikBot247 (2855?)     TC: 1+1     Rated     Variant: Standard
‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾
Exception in thread Thread-44:
Traceback (most recent call last):
  File "/usr/lib/python3.11/threading.py", line 1038, in _bootstrap_inner
    self.run()
  File "/home/emptikbest/EmptikBot247/BotLi/game.py", line 46, in run
    self.lichess_game.start_pondering()
  File "/home/emptikbest/EmptikBot247/BotLi/lichess_game.py", line 129, in start_pondering
    self.engine.analysis(self.board)
  File "/home/emptikbest/EmptikBot247/BotLi/env/lib/python3.11/site-packages/chess/engine.py", line 2817, in analysis
    return SimpleAnalysisResult(self, future.result())
                                      ^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/concurrent/futures/_base.py", line 456, in result
    return self.__get_result()
           ^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/concurrent/futures/_base.py", line 401, in __get_result
    raise self._exception
TimeoutError
ERROR:asyncio:Exception in callback Protocol._line_received('readyok')
handle: <Handle Protocol._line_received('readyok')>
Traceback (most recent call last):
  File "/usr/lib/python3.11/asyncio/events.py", line 80, in _run
    self._context.run(self._callback, *self._args)
  File "/home/emptikbest/EmptikBot247/BotLi/env/lib/python3.11/site-packages/chess/engine.py", line 1054, in _line_received
    self.command._line_received(self, line)
  File "/home/emptikbest/EmptikBot247/BotLi/env/lib/python3.11/site-packages/chess/engine.py", line 1305, in _line_received
    self.line_received(engine, line)
  File "/home/emptikbest/EmptikBot247/BotLi/env/lib/python3.11/site-packages/chess/engine.py", line 1716, in line_received
    self._readyok(engine)
  File "/home/emptikbest/EmptikBot247/BotLi/env/lib/python3.11/site-packages/chess/engine.py", line 1729, in _readyok
    self.result.set_result(self.analysis)
asyncio.exceptions.InvalidStateError: invalid state
________________________________________________________________________________________________________________________________
ID: FG7HHwZi     Challenger: BOT EmptikBot (2932)     TC: ½+0     Rated     Color: White     Variant: Standard
Bullet against bots is only allowed with increment according to config.
‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾

Should I decrease the hash to 2048 now?

Torom commented 1 year ago

Did you increase concurrency above 1?

This is the engine section of RaspFish, runs for a long time without any problems:

engine:                                   # Engine settings.
  dir: "/home/ubuntu/chess"               # Directory containing the engine.
  name: "stockfish"                       # Binary name of the engine to use.
  ponder: true                            # Think on opponent's time.
  silence_stderr: false                   # Suppresses stderr output.
  syzygy:
    enabled: true                         # Activate local syzygy endgame tablebases.
    paths:                                # Paths to local syzygy endgame tablebases.
      - "/home/ubuntu/chess/syzygy"
    max_pieces: 5                         # Count of max pieces in the local syzygy endgame tablebases.
    instant_play: true                    # Whether the bot should play directly from syzygy without engine if possible.
  gaviota:
    enabled: true                         # Activate local gaviota endgame tablebases.
    paths:                                # Paths to local gaviota endgame tablebases.
      - "/home/ubuntu/chess/gaviota"
    max_pieces: 5                         # Count of max pieces in the local gaviota endgame tablebases.
  uci_options:                            # Arbitrary UCI options passed to the engine. (Commenting allowed)
    Move Overhead: 100                    # Increase if your bot flags games too often.
    Threads: 4                            # Max CPU threads the engine can use.
    Hash: 2048                            # Max memory (in megabytes) the engine can allocate.
  variants:
    enabled: true                         # Activate seperate engine for other chess variants than standard and chess960.
    dir: "/home/ubuntu/chess"             # Directory containing the engine.
    name: "fairy-stockfish"               # Binary name of the engine to use.
    ponder: true                          # Think on opponent's time.
    silence_stderr: false                 # Suppresses stderr output.
    uci_options:                          # Arbitrary UCI options passed to the engine. (Commenting allowed)
      Move Overhead: 100                  # Increase if your bot flags games too often.
      Threads: 4                          # Max CPU threads the engine can use.
      Hash: 2048                          # Max memory (in megabytes) the engine can allocate.
      EvalFile: "3check-313cc226a173.nnue:antichess-689c016df8e0.nnue:atomic-2cf13ff256cc.nnue:crazyhouse-8ebf84784ad2.nnue:horde-28173ddccabe.nnue:kingofthehill-978b86d0e6a4.nnue:racingkings-636b95f085e3.nnue"

But I can't imagine 4096 being too much hash unless it runs with concurrency greater 1.

EmptikBest commented 1 year ago

No, concurrency is one.

Torom commented 1 year ago

You could check the journalctl after the crash happened. If there is something with OOM, then the hash is too big. Maybe there are other reasons for the crashes.

EmptikBest commented 1 year ago

When I run journalctl, I do not understand what the output means and if it includes OOM or not, here is the output:

Apr 18 03:58:27 localhost.localdomain kernel: Booting Linux on physical CPU 0x0000000000 [0x410fd083]
Apr 18 03:58:27 localhost.localdomain kernel: Linux version 6.2.0-1004-raspi (buildd@bos02-arm64-005) (aarch64-linux-gn>Apr 18 03:58:27 localhost.localdomain kernel: random: crng init done
Apr 18 03:58:27 localhost.localdomain kernel: Machine model: Raspberry Pi 4 Model B Rev 1.5
Apr 18 03:58:27 localhost.localdomain kernel: efi: UEFI not found.
Apr 18 03:58:27 localhost.localdomain kernel: Reserved memory: created CMA memory pool at 0x000000000d800000, size 512 >Apr 18 03:58:27 localhost.localdomain kernel: OF: reserved mem: initialized node linux,cma, compatible id shared-dma-po>Apr 18 03:58:27 localhost.localdomain kernel: Zone ranges:
Apr 18 03:58:27 localhost.localdomain kernel:   DMA      [mem 0x0000000000000000-0x000000003fffffff]
Apr 18 03:58:27 localhost.localdomain kernel:   DMA32    [mem 0x0000000040000000-0x00000000ffffffff]
Apr 18 03:58:27 localhost.localdomain kernel:   Normal   [mem 0x0000000100000000-0x00000001ffffffff]
Apr 18 03:58:27 localhost.localdomain kernel: Movable zone start for each node
Apr 18 03:58:27 localhost.localdomain kernel: Early memory node ranges
Apr 18 03:58:27 localhost.localdomain kernel:   node   0: [mem 0x0000000000000000-0x000000003b3fffff]
Apr 18 03:58:27 localhost.localdomain kernel:   node   0: [mem 0x0000000040000000-0x00000000fbffffff]
Apr 18 03:58:27 localhost.localdomain kernel:   node   0: [mem 0x0000000100000000-0x00000001ffffffff]
Apr 18 03:58:27 localhost.localdomain kernel: Initmem setup node 0 [mem 0x0000000000000000-0x00000001ffffffff]
Apr 18 03:58:27 localhost.localdomain kernel: On node 0, zone DMA32: 19456 pages in unavailable ranges
Apr 18 03:58:27 localhost.localdomain kernel: On node 0, zone Normal: 16384 pages in unavailable ranges
Apr 18 03:58:27 localhost.localdomain kernel: percpu: Embedded 30 pages/cpu s82024 r8192 d32664 u122880
Apr 18 03:58:27 localhost.localdomain kernel: pcpu-alloc: s82024 r8192 d32664 u122880 alloc=30*4096
Apr 18 03:58:27 localhost.localdomain kernel: pcpu-alloc: [0] 0 [0] 1 [0] 2 [0] 3
Apr 18 03:58:27 localhost.localdomain kernel: Detected PIPT I-cache on CPU0
Apr 18 03:58:27 localhost.localdomain kernel: CPU features: detected: Spectre-v2
Apr 18 03:58:27 localhost.localdomain kernel: CPU features: detected: Spectre-v3a
Apr 18 03:58:27 localhost.localdomain kernel: CPU features: detected: Spectre-v4
Apr 18 03:58:27 localhost.localdomain kernel: CPU features: detected: Spectre-BHB
Apr 18 03:58:27 localhost.localdomain kernel: CPU features: kernel page table isolation forced ON by KASLR
Apr 18 03:58:27 localhost.localdomain kernel: CPU features: detected: Kernel page table isolation (KPTI)
Apr 18 03:58:27 localhost.localdomain kernel: CPU features: detected: ARM erratum 1742098
Apr 18 03:58:27 localhost.localdomain kernel: CPU features: detected: ARM errata 1165522, 1319367, or 1530923
Apr 18 03:58:27 localhost.localdomain kernel: alternatives: applying boot alternatives
Apr 18 03:58:27 localhost.localdomain kernel: Built 1 zonelists, mobility grouping on.  Total pages: 2028848
Apr 18 03:58:27 localhost.localdomain kernel: Kernel command line: coherent_pool=1M 8250.nr_uarts=0 snd_bcm2835.enable_>Apr 18 03:58:27 localhost.localdomain kernel: Unknown kernel command line parameters "fixrtc splash", will be passed to>Apr 18 03:58:27 localhost.localdomain kernel: Dentry cache hash table entries: 1048576 (order: 11, 8388608 bytes, linea>Apr 18 03:58:27 localhost.localdomain kernel: Inode-cache hash table entries: 524288 (order: 10, 4194304 bytes, linear)
Apr 18 03:58:27 localhost.localdomain kernel: mem auto-init: stack:off, heap alloc:off, heap free:off
Apr 18 03:58:27 localhost.localdomain kernel: software IO TLB: area num 4.
Apr 18 03:58:27 localhost.localdomain kernel: software IO TLB: mapped [mem 0x0000000037400000-0x000000003b400000] (64MB)Apr 18 03:58:27 localhost.localdomain kernel: Memory: 7444724K/8245248K available (13376K kernel code, 2472K rwdata, 42>Apr 18 03:58:27 localhost.localdomain kernel: SLUB: HWalign=64, Order=0-3, MinObjects=0, CPUs=4, Nodes=1
Apr 18 03:58:27 localhost.localdomain kernel: ftrace: allocating 40687 entries in 159 pages
Apr 18 03:58:27 localhost.localdomain kernel: ftrace: allocated 159 pages with 6 groups
Apr 18 03:58:27 localhost.localdomain kernel: trace event string verifier disabled
Apr 18 03:58:27 localhost.localdomain kernel: rcu: Preemptible hierarchical RCU implementation.
Apr 18 03:58:27 localhost.localdomain kernel: rcu:         RCU restricting CPUs from NR_CPUS=256 to nr_cpu_ids=4.
Apr 18 03:58:27 localhost.localdomain kernel:         Trampoline variant of Tasks RCU enabled.
Apr 18 03:58:27 localhost.localdomain kernel:         Rude variant of Tasks RCU enabled.
EmptikBest commented 1 year ago

@Torom seems to be working fine now I didn't make any adjustments. Hopefully runs fine for a few days like @RaspFish does for you!