lichess-bot-devs / lichess-bot

A bridge between Lichess bots and chess engines
GNU Affero General Public License v3.0
764 stars 448 forks source link

Engine error when more or equal than 2048 mb of ram engine crashes #746

Closed Oqarshi closed 1 year ago

Oqarshi commented 1 year ago

Describe the bug When allocating more than 2048 mb of ram to engine, example if i allocate 2048 mb ram an error occurs and the engine doesent play. I am not running out of ram as i still have an extra 8 gb of ram

To Reproduce Steps to reproduce the behavior:

  1. Allocat equal to or more than 2048 mb of ram
  2. Run lichess-bot like normal
  3. See error

Expected behavior The engine plays normally

Logs image

Desktop (please complete the following information):

Additional context The book moves play normally the engine is only affected so book moves from book.bin play normally only after when all book moves are finished the engine crashes. Does not crash when allocating less than 2048 mb of ram

AttackingOrDefending commented 1 year ago

My first thought is that the engine you are using is 32 bits. Can you download the latest version of lichess-bot and when you close it, upload the logs from the lichess_bot_auto_logs folder?

Oqarshi commented 1 year ago

should i upload the entire thing?

Oqarshi commented 1 year ago
2023-06-19 13:02:30,977 __main__ (lichess-bot.py:964) INFO 
    .   _/|
    .  // o\
    .  || ._)  lichess-bot 2023.6.19.1
    .  //__\
    .  )___(   Play on Lichess with a bot

2023-06-19 13:02:31,001 config (config.py:235) DEBUG Config:
token: logger
url: https://lichess.org/
engine:
  dir: ./engines/
  name: example_engine.exe
  working_dir: ''
  protocol: uci
  ponder: true
  polyglot:
    enabled: false
    book:
      standard:
      - engines/book1.bin
      - engines/book2.bin
    min_weight: 1
    selection: weighted_random
    max_depth: 8
  draw_or_resign:
    resign_enabled: false
    resign_score: -1000
    resign_for_egtb_minus_two: true
    resign_moves: 3
    offer_draw_enabled: false
    offer_draw_score: 0
    offer_draw_for_egtb_zero: true
    offer_draw_moves: 5
    offer_draw_pieces: 10
  online_moves:
    max_out_of_book_moves: 10
    max_retries: 2
    chessdb_book:
      enabled: false
      min_time: 20
      move_quality: good
      min_depth: 20
    lichess_cloud_analysis:
      enabled: false
      min_time: 20
      move_quality: good
      max_score_difference: 50
      min_depth: 20
      min_knodes: 0
    online_egtb:
      enabled: false
      min_time: 20
      max_pieces: 7
      source: lichess
      move_quality: best
  lichess_bot_tbs:
    syzygy:
      enabled: false
      paths:
      - engines/syzygy
      max_pieces: 7
      move_quality: best
    gaviota:
      enabled: false
      paths:
      - engines/gaviota
      max_pieces: 5
      min_dtm_to_consider_as_wdl_1: 120
      move_quality: best
  homemade_options: null
  uci_options:
    Move Overhead: 100
    Threads: 2
    Hash: 2048
    SyzygyPath: ./syzygy/
  silence_stderr: false
abort_time: 20
fake_think_time: false
rate_limiting_delay: 0
move_overhead: 2000
correspondence:
  move_time: 60
  checkin_period: 600
  disconnect_time: 300
  ponder: false
challenge:
  concurrency: 1
  sort_by: best
  accept_bot: false
  only_bot: false
  max_increment: 180
  min_increment: 0
  max_base: 315360000
  min_base: 0
  max_days: 14
  min_days: 1
  variants:
  - standard
  time_controls:
  - bullet
  - blitz
  - rapid
  modes:
  - casual
  - rated
greeting:
  hello: Hi! I'm {me}. Good luck! Type !help for a list of commands I can respond
    to.
  goodbye: Good game!
  hello_spectators: Hi! I'm {me}. Type !help for a list of commands I can respond
    to.
  goodbye_spectators: Thanks for watching!
matchmaking:
  allow_matchmaking: false
  challenge_variant: random
  challenge_timeout: 30
  challenge_initial_time:
  - 60
  - 120
  challenge_increment:
  - 1
  - 2
  opponent_rating_difference: 100
  opponent_allow_tos_violation: true
  challenge_mode: random
  challenge_filter: none

2023-06-19 13:02:31,001 config (config.py:236) DEBUG ====================
2023-06-19 13:02:31,007 config (config.py:235) DEBUG Config:
token: logger
url: https://lichess.org/
engine:
  dir: ./engines/
  name: example_engine.exe
  working_dir: C:\Users\deena\Desktop\engine\lichess-bot-master
  protocol: uci
  ponder: true
  polyglot:
    enabled: false
    book:
      standard:
      - engines/book1.bin
      - engines/book2.bin
    min_weight: 1
    selection: weighted_random
    max_depth: 8
  draw_or_resign:
    resign_enabled: false
    resign_score: -1000
    resign_for_egtb_minus_two: true
    resign_moves: 3
    offer_draw_enabled: false
    offer_draw_score: 0
    offer_draw_for_egtb_zero: true
    offer_draw_moves: 5
    offer_draw_pieces: 10
  online_moves:
    max_out_of_book_moves: 10
    max_retries: 2
    chessdb_book:
      enabled: false
      min_time: 20
      move_quality: good
      min_depth: 20
    lichess_cloud_analysis:
      enabled: false
      min_time: 20
      move_quality: good
      max_score_difference: 50
      min_depth: 20
      min_knodes: 0
    online_egtb:
      enabled: false
      min_time: 20
      max_pieces: 7
      source: lichess
      move_quality: best
  lichess_bot_tbs:
    syzygy:
      enabled: false
      paths:
      - engines/syzygy
      max_pieces: 7
      move_quality: best
    gaviota:
      enabled: false
      paths:
      - engines/gaviota
      max_pieces: 5
      min_dtm_to_consider_as_wdl_1: 120
      move_quality: best
  homemade_options: null
  uci_options:
    Move Overhead: 100
    Threads: 2
    Hash: 2048
    SyzygyPath: ./syzygy/
  silence_stderr: false
  uci_ponder: false
abort_time: 20
fake_think_time: false
rate_limiting_delay: 0
move_overhead: 2000
correspondence:
  move_time: 60
  checkin_period: 600
  disconnect_time: 300
  ponder: false
  uci_ponder: false
challenge:
  concurrency: 1
  sort_by: best
  accept_bot: false
  only_bot: false
  max_increment: 180
  min_increment: 0
  max_base: 315360000
  min_base: 0
  max_days: 14
  min_days: 1
  variants:
  - standard
  time_controls:
  - bullet
  - blitz
  - rapid
  modes:
  - casual
  - rated
  block_list: []
greeting:
  hello: Hi! I'm {me}. Good luck! Type !help for a list of commands I can respond
    to.
  goodbye: Good game!
  hello_spectators: Hi! I'm {me}. Type !help for a list of commands I can respond
    to.
  goodbye_spectators: Thanks for watching!
matchmaking:
  allow_matchmaking: false
  challenge_variant: random
  challenge_timeout: 30
  challenge_initial_time:
  - 60
  - 120
  challenge_increment:
  - 1
  - 2
  opponent_rating_difference: 100
  opponent_allow_tos_violation: true
  challenge_mode: random
  challenge_filter: none
  block_list: []
  challenge_days:
  - null
  opponent_min_rating: 600
  opponent_max_rating: 4000

2023-06-19 13:02:31,007 config (config.py:236) DEBUG ====================
2023-06-19 13:02:31,010 urllib3.connectionpool (connectionpool.py:1048) DEBUG Starting new HTTPS connection (1): lichess.org:443
2023-06-19 13:02:31,534 urllib3.connectionpool (connectionpool.py:546) DEBUG https://lichess.org:443 "POST /api/token/test HTTP/1.1" 200 None
2023-06-19 13:02:31,707 urllib3.connectionpool (connectionpool.py:546) DEBUG https://lichess.org:443 "GET /api/account HTTP/1.1" 200 None
2023-06-19 13:02:31,707 __main__ (lichess-bot.py:973) INFO Welcome Chessler-V3!
2023-06-19 13:02:31,712 __main__ (lichess-bot.py:215) INFO You're now connected to https://lichess.org/ and awaiting challenges.
2023-06-19 13:02:32,415 urllib3.connectionpool (connectionpool.py:546) DEBUG https://lichess.org:443 "GET /api/account/playing HTTP/1.1" 200 17
2023-06-19 13:02:32,416 matchmaking (matchmaking.py:248) INFO Next challenge will be created after 13:32:32 (0 challenges in last 24 hours)
2023-06-19 13:02:45,901 __main__ (lichess-bot.py:377) DEBUG Event: {'type': 'gameStart', 'game': {'fullId': 'NEe1TOCmyJdc', 'gameId': 'NEe1TOCm', 'fen': 'rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR w KQkq - 0 1', 'color': 'black', 'lastMove': '', 'source': 'ai', 'status': {'id': 20, 'name': 'started'}, 'variant': {'key': 'standard', 'name': 'Standard'}, 'speed': 'ultraBullet', 'perf': 'ultraBullet', 'rated': False, 'hasMoved': False, 'opponent': {'id': None, 'username': 'Stockfish level 8', 'ai': 8}, 'isMyTurn': False, 'secondsLeft': 15, 'compat': {'bot': False, 'board': False}, 'id': 'NEe1TOCm'}}
2023-06-19 13:02:45,901 __main__ (lichess-bot.py:261) INFO --- Process Used. Count: 1. IDs: {'NEe1TOCm'}
2023-06-19 13:02:45,917 urllib3.connectionpool (connectionpool.py:1048) DEBUG Starting new HTTPS connection (1): lichess.org:443
2023-06-19 13:02:46,444 urllib3.connectionpool (connectionpool.py:546) DEBUG https://lichess.org:443 "GET /api/bot/game/stream/NEe1TOCm HTTP/1.1" 400 56
2023-06-19 13:02:46,444 __mp_main__ (lichess-bot.py:567) DEBUG Initial state: {'error': 'This game cannot be played with the Bot API.'}
2023-06-19 13:02:46,445 backoff (_common.py:105) INFO Backing off play_game(...) for 0.8s (KeyError: 'id')
2023-06-19 13:02:46,445 lichess (lichess.py:62) DEBUG Backing off 0.8 seconds after 1 tries calling function <function play_game at 0x0000028A598C8FE0> with args () and kwargs {'li': <lichess.Lichess object at 0x0000028A598CDB90>, 'control_queue': <AutoProxy[Queue] object, typeid 'Queue' at 0x28a599274d0>, 'user_profile': {'id': 'chessler-v3', 'username': 'Chessler-V3', 'perfs': {'blitz': {'games': 4, 'rating': 2235, 'rd': 258, 'prog': 0, 'prov': True}, 'bullet': {'games': 0, 'rating': 2000, 'rd': 500, 'prog': 0, 'prov': True}, 'correspondence': {'games': 0, 'rating': 2000, 'rd': 500, 'prog': 0, 'prov': True}, 'classical': {'games': 0, 'rating': 2000, 'rd': 500, 'prog': 0, 'prov': True}, 'rapid': {'games': 0, 'rating': 2000, 'rd': 500, 'prog': 0, 'prov': True}}, 'title': 'BOT', 'createdAt': 1686442191791, 'profile': {'country': 'US', 'bio': "ChesslerV3 NNUE! I accept two games and run on 1024MB RAM. Rated ~2900 ~2.1M n/s, I use an AMD Ryzen 3 4300U with Radeon Graphics, clocked at 2.70 GHz. I'm fast for a chess engine. No tablebase, but I have an opening database. Offline means my owner is busy. I play rapid, blitz, and bullet games."}, 'seenAt': 1687204426251, 'playTime': {'total': 6811, 'tv': 0}, 'url': 'https://lichess.org/@/Chessler-V3', 'count': {'all': 22, 'rated': 4, 'ai': 0, 'draw': 1, 'drawH': 1, 'loss': 11, 'lossH': 11, 'win': 10, 'winH': 10, 'bookmark': 0, 'playing': 0, 'import': 0, 'me': 0}, 'followable': True, 'following': False, 'blocking': False, 'followsYou': False}, 'config': <config.Configuration object at 0x0000028A59934DD0>, 'challenge_queue': <ListProxy object, typeid 'list' at 0x28a59936f90>, 'correspondence_queue': <AutoProxy[Queue] object, typeid 'Queue' at 0x28a59937190>, 'logging_queue': <AutoProxy[Queue] object, typeid 'Queue' at 0x28a599373d0>, 'game_id': 'NEe1TOCm'}
2023-06-19 13:02:46,446 lichess (lichess.py:64) DEBUG Exception: Traceback (most recent call last):
  File "C:\Users\deena\Desktop\engine\lichess-bot-master\.venv\Lib\site-packages\backoff\_sync.py", line 105, in retry
    ret = target(*args, **kwargs)
          ^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\deena\Desktop\engine\lichess-bot-master\lichess-bot.py", line 569, in play_game
    game = model.Game(initial_state, user_profile["username"], li.baseUrl, abort_time)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\deena\Desktop\engine\lichess-bot-master\model.py", line 143, in __init__
    self.id: str = game_info["id"]
                   ~~~~~~~~~^^^^^^
KeyError: 'id'

2023-06-19 13:02:47,250 urllib3.connectionpool (connectionpool.py:1048) DEBUG Starting new HTTPS connection (1): lichess.org:443
2023-06-19 13:02:47,776 urllib3.connectionpool (connectionpool.py:546) DEBUG https://lichess.org:443 "GET /api/bot/game/stream/NEe1TOCm HTTP/1.1" 400 56
2023-06-19 13:02:47,777 __mp_main__ (lichess-bot.py:567) DEBUG Initial state: {'error': 'This game cannot be played with the Bot API.'}
2023-06-19 13:02:47,777 backoff (_common.py:105) INFO Backing off play_game(...) for 0.1s (KeyError: 'id')
2023-06-19 13:02:47,778 lichess (lichess.py:62) DEBUG Backing off 0.1 seconds after 2 tries calling function <function play_game at 0x0000028A598C8FE0> with args () and kwargs {'li': <lichess.Lichess object at 0x0000028A598CDB90>, 'control_queue': <AutoProxy[Queue] object, typeid 'Queue' at 0x28a599274d0>, 'user_profile': {'id': 'chessler-v3', 'username': 'Chessler-V3', 'perfs': {'blitz': {'games': 4, 'rating': 2235, 'rd': 258, 'prog': 0, 'prov': True}, 'bullet': {'games': 0, 'rating': 2000, 'rd': 500, 'prog': 0, 'prov': True}, 'correspondence': {'games': 0, 'rating': 2000, 'rd': 500, 'prog': 0, 'prov': True}, 'classical': {'games': 0, 'rating': 2000, 'rd': 500, 'prog': 0, 'prov': True}, 'rapid': {'games': 0, 'rating': 2000, 'rd': 500, 'prog': 0, 'prov': True}}, 'title': 'BOT', 'createdAt': 1686442191791, 'profile': {'country': 'US', 'bio': "ChesslerV3 NNUE! I accept two games and run on 1024MB RAM. Rated ~2900 ~2.1M n/s, I use an AMD Ryzen 3 4300U with Radeon Graphics, clocked at 2.70 GHz. I'm fast for a chess engine. No tablebase, but I have an opening database. Offline means my owner is busy. I play rapid, blitz, and bullet games."}, 'seenAt': 1687204426251, 'playTime': {'total': 6811, 'tv': 0}, 'url': 'https://lichess.org/@/Chessler-V3', 'count': {'all': 22, 'rated': 4, 'ai': 0, 'draw': 1, 'drawH': 1, 'loss': 11, 'lossH': 11, 'win': 10, 'winH': 10, 'bookmark': 0, 'playing': 0, 'import': 0, 'me': 0}, 'followable': True, 'following': False, 'blocking': False, 'followsYou': False}, 'config': <config.Configuration object at 0x0000028A59934DD0>, 'challenge_queue': <ListProxy object, typeid 'list' at 0x28a59936f90>, 'correspondence_queue': <AutoProxy[Queue] object, typeid 'Queue' at 0x28a59937190>, 'logging_queue': <AutoProxy[Queue] object, typeid 'Queue' at 0x28a599373d0>, 'game_id': 'NEe1TOCm'}
2023-06-19 13:02:47,779 lichess (lichess.py:64) DEBUG Exception: Traceback (most recent call last):
  File "C:\Users\deena\Desktop\engine\lichess-bot-master\.venv\Lib\site-packages\backoff\_sync.py", line 105, in retry
    ret = target(*args, **kwargs)
          ^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\deena\Desktop\engine\lichess-bot-master\lichess-bot.py", line 569, in play_game
    game = model.Game(initial_state, user_profile["username"], li.baseUrl, abort_time)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\deena\Desktop\engine\lichess-bot-master\model.py", line 143, in __init__
    self.id: str = game_info["id"]
                   ~~~~~~~~~^^^^^^
KeyError: 'id'

2023-06-19 13:02:47,840 urllib3.connectionpool (connectionpool.py:1048) DEBUG Starting new HTTPS connection (1): lichess.org:443
2023-06-19 13:02:48,348 urllib3.connectionpool (connectionpool.py:546) DEBUG https://lichess.org:443 "GET /api/bot/game/stream/NEe1TOCm HTTP/1.1" 400 56
2023-06-19 13:02:48,349 __mp_main__ (lichess-bot.py:567) DEBUG Initial state: {'error': 'This game cannot be played with the Bot API.'}
2023-06-19 13:02:48,349 backoff (_common.py:105) INFO Backing off play_game(...) for 1.3s (KeyError: 'id')
2023-06-19 13:02:48,350 lichess (lichess.py:62) DEBUG Backing off 1.3 seconds after 3 tries calling function <function play_game at 0x0000028A598C8FE0> with args () and kwargs {'li': <lichess.Lichess object at 0x0000028A598CDB90>, 'control_queue': <AutoProxy[Queue] object, typeid 'Queue' at 0x28a599274d0>, 'user_profile': {'id': 'chessler-v3', 'username': 'Chessler-V3', 'perfs': {'blitz': {'games': 4, 'rating': 2235, 'rd': 258, 'prog': 0, 'prov': True}, 'bullet': {'games': 0, 'rating': 2000, 'rd': 500, 'prog': 0, 'prov': True}, 'correspondence': {'games': 0, 'rating': 2000, 'rd': 500, 'prog': 0, 'prov': True}, 'classical': {'games': 0, 'rating': 2000, 'rd': 500, 'prog': 0, 'prov': True}, 'rapid': {'games': 0, 'rating': 2000, 'rd': 500, 'prog': 0, 'prov': True}}, 'title': 'BOT', 'createdAt': 1686442191791, 'profile': {'country': 'US', 'bio': "ChesslerV3 NNUE! I accept two games and run on 1024MB RAM. Rated ~2900 ~2.1M n/s, I use an AMD Ryzen 3 4300U with Radeon Graphics, clocked at 2.70 GHz. I'm fast for a chess engine. No tablebase, but I have an opening database. Offline means my owner is busy. I play rapid, blitz, and bullet games."}, 'seenAt': 1687204426251, 'playTime': {'total': 6811, 'tv': 0}, 'url': 'https://lichess.org/@/Chessler-V3', 'count': {'all': 22, 'rated': 4, 'ai': 0, 'draw': 1, 'drawH': 1, 'loss': 11, 'lossH': 11, 'win': 10, 'winH': 10, 'bookmark': 0, 'playing': 0, 'import': 0, 'me': 0}, 'followable': True, 'following': False, 'blocking': False, 'followsYou': False}, 'config': <config.Configuration object at 0x0000028A59934DD0>, 'challenge_queue': <ListProxy object, typeid 'list' at 0x28a59936f90>, 'correspondence_queue': <AutoProxy[Queue] object, typeid 'Queue' at 0x28a59937190>, 'logging_queue': <AutoProxy[Queue] object, typeid 'Queue' at 0x28a599373d0>, 'game_id': 'NEe1TOCm'}
2023-06-19 13:02:48,350 lichess (lichess.py:64) DEBUG Exception: Traceback (most recent call last):
  File "C:\Users\deena\Desktop\engine\lichess-bot-master\.venv\Lib\site-packages\backoff\_sync.py", line 105, in retry
    ret = target(*args, **kwargs)
          ^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\deena\Desktop\engine\lichess-bot-master\lichess-bot.py", line 569, in play_game
    game = model.Game(initial_state, user_profile["username"], li.baseUrl, abort_time)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\deena\Desktop\engine\lichess-bot-master\model.py", line 143, in __init__
    self.id: str = game_info["id"]
                   ~~~~~~~~~^^^^^^
KeyError: 'id'

2023-06-19 13:02:49,687 urllib3.connectionpool (connectionpool.py:1048) DEBUG Starting new HTTPS connection (1): lichess.org:443
2023-06-19 13:02:50,187 urllib3.connectionpool (connectionpool.py:546) DEBUG https://lichess.org:443 "GET /api/bot/game/stream/NEe1TOCm HTTP/1.1" 400 56
2023-06-19 13:02:50,188 __mp_main__ (lichess-bot.py:567) DEBUG Initial state: {'error': 'This game cannot be played with the Bot API.'}
2023-06-19 13:02:50,188 backoff (_common.py:105) INFO Backing off play_game(...) for 6.0s (KeyError: 'id')
2023-06-19 13:02:50,188 lichess (lichess.py:62) DEBUG Backing off 6.0 seconds after 4 tries calling function <function play_game at 0x0000028A598C8FE0> with args () and kwargs {'li': <lichess.Lichess object at 0x0000028A598CDB90>, 'control_queue': <AutoProxy[Queue] object, typeid 'Queue' at 0x28a599274d0>, 'user_profile': {'id': 'chessler-v3', 'username': 'Chessler-V3', 'perfs': {'blitz': {'games': 4, 'rating': 2235, 'rd': 258, 'prog': 0, 'prov': True}, 'bullet': {'games': 0, 'rating': 2000, 'rd': 500, 'prog': 0, 'prov': True}, 'correspondence': {'games': 0, 'rating': 2000, 'rd': 500, 'prog': 0, 'prov': True}, 'classical': {'games': 0, 'rating': 2000, 'rd': 500, 'prog': 0, 'prov': True}, 'rapid': {'games': 0, 'rating': 2000, 'rd': 500, 'prog': 0, 'prov': True}}, 'title': 'BOT', 'createdAt': 1686442191791, 'profile': {'country': 'US', 'bio': "ChesslerV3 NNUE! I accept two games and run on 1024MB RAM. Rated ~2900 ~2.1M n/s, I use an AMD Ryzen 3 4300U with Radeon Graphics, clocked at 2.70 GHz. I'm fast for a chess engine. No tablebase, but I have an opening database. Offline means my owner is busy. I play rapid, blitz, and bullet games."}, 'seenAt': 1687204426251, 'playTime': {'total': 6811, 'tv': 0}, 'url': 'https://lichess.org/@/Chessler-V3', 'count': {'all': 22, 'rated': 4, 'ai': 0, 'draw': 1, 'drawH': 1, 'loss': 11, 'lossH': 11, 'win': 10, 'winH': 10, 'bookmark': 0, 'playing': 0, 'import': 0, 'me': 0}, 'followable': True, 'following': False, 'blocking': False, 'followsYou': False}, 'config': <config.Configuration object at 0x0000028A59934DD0>, 'challenge_queue': <ListProxy object, typeid 'list' at 0x28a59936f90>, 'correspondence_queue': <AutoProxy[Queue] object, typeid 'Queue' at 0x28a59937190>, 'logging_queue': <AutoProxy[Queue] object, typeid 'Queue' at 0x28a599373d0>, 'game_id': 'NEe1TOCm'}
2023-06-19 13:02:50,189 lichess (lichess.py:64) DEBUG Exception: Traceback (most recent call last):
  File "C:\Users\deena\Desktop\engine\lichess-bot-master\.venv\Lib\site-packages\backoff\_sync.py", line 105, in retry
    ret = target(*args, **kwargs)
          ^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\deena\Desktop\engine\lichess-bot-master\lichess-bot.py", line 569, in play_game
    game = model.Game(initial_state, user_profile["username"], li.baseUrl, abort_time)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\deena\Desktop\engine\lichess-bot-master\model.py", line 143, in __init__
    self.id: str = game_info["id"]
                   ~~~~~~~~~^^^^^^
KeyError: 'id'

2023-06-19 13:02:53,331 __main__ (lichess-bot.py:377) DEBUG Event: {'type': 'gameFinish', 'game': {'fullId': 'NEe1TOCmyJdc', 'gameId': 'NEe1TOCm', 'fen': 'rnbqkbnr/pppppppp/8/8/4P3/8/PPPP1PPP/RNBQKBNR b KQkq - 0 1', 'color': 'black', 'lastMove': 'e2e4', 'source': 'ai', 'status': {'id': 25, 'name': 'aborted'}, 'variant': {'key': 'standard', 'name': 'Standard'}, 'speed': 'ultraBullet', 'perf': 'ultraBullet', 'rated': False, 'hasMoved': False, 'opponent': {'id': None, 'username': 'Stockfish level 8', 'ai': 8}, 'isMyTurn': False, 'secondsLeft': 15, 'compat': {'bot': False, 'board': False}, 'id': 'NEe1TOCm'}}
2023-06-19 13:02:53,332 matchmaking (matchmaking.py:248) INFO Next challenge will be created after 13:32:53 (0 challenges in last 24 hours)
2023-06-19 13:02:53,337 __main__ (lichess-bot.py:261) INFO +++ Process Freed. Count: 0. IDs: None
2023-06-19 13:02:56,178 urllib3.connectionpool (connectionpool.py:1048) DEBUG Starting new HTTPS connection (1): lichess.org:443
2023-06-19 13:02:56,697 urllib3.connectionpool (connectionpool.py:546) DEBUG https://lichess.org:443 "GET /api/bot/game/stream/NEe1TOCm HTTP/1.1" 400 56
2023-06-19 13:02:56,698 __mp_main__ (lichess-bot.py:567) DEBUG Initial state: {'error': 'This game cannot be played with the Bot API.'}
2023-06-19 13:02:56,698 backoff (_common.py:105) INFO Backing off play_game(...) for 2.6s (KeyError: 'id')
2023-06-19 13:02:56,698 lichess (lichess.py:62) DEBUG Backing off 2.6 seconds after 5 tries calling function <function play_game at 0x0000028A598C8FE0> with args () and kwargs {'li': <lichess.Lichess object at 0x0000028A598CDB90>, 'control_queue': <AutoProxy[Queue] object, typeid 'Queue' at 0x28a599274d0>, 'user_profile': {'id': 'chessler-v3', 'username': 'Chessler-V3', 'perfs': {'blitz': {'games': 4, 'rating': 2235, 'rd': 258, 'prog': 0, 'prov': True}, 'bullet': {'games': 0, 'rating': 2000, 'rd': 500, 'prog': 0, 'prov': True}, 'correspondence': {'games': 0, 'rating': 2000, 'rd': 500, 'prog': 0, 'prov': True}, 'classical': {'games': 0, 'rating': 2000, 'rd': 500, 'prog': 0, 'prov': True}, 'rapid': {'games': 0, 'rating': 2000, 'rd': 500, 'prog': 0, 'prov': True}}, 'title': 'BOT', 'createdAt': 1686442191791, 'profile': {'country': 'US', 'bio': "ChesslerV3 NNUE! I accept two games and run on 1024MB RAM. Rated ~2900 ~2.1M n/s, I use an AMD Ryzen 3 4300U with Radeon Graphics, clocked at 2.70 GHz. I'm fast for a chess engine. No tablebase, but I have an opening database. Offline means my owner is busy. I play rapid, blitz, and bullet games."}, 'seenAt': 1687204426251, 'playTime': {'total': 6811, 'tv': 0}, 'url': 'https://lichess.org/@/Chessler-V3', 'count': {'all': 22, 'rated': 4, 'ai': 0, 'draw': 1, 'drawH': 1, 'loss': 11, 'lossH': 11, 'win': 10, 'winH': 10, 'bookmark': 0, 'playing': 0, 'import': 0, 'me': 0}, 'followable': True, 'following': False, 'blocking': False, 'followsYou': False}, 'config': <config.Configuration object at 0x0000028A59934DD0>, 'challenge_queue': <ListProxy object, typeid 'list' at 0x28a59936f90>, 'correspondence_queue': <AutoProxy[Queue] object, typeid 'Queue' at 0x28a59937190>, 'logging_queue': <AutoProxy[Queue] object, typeid 'Queue' at 0x28a599373d0>, 'game_id': 'NEe1TOCm'}
2023-06-19 13:02:56,699 lichess (lichess.py:64) DEBUG Exception: Traceback (most recent call last):
  File "C:\Users\deena\Desktop\engine\lichess-bot-master\.venv\Lib\site-packages\backoff\_sync.py", line 105, in retry
    ret = target(*args, **kwargs)
          ^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\deena\Desktop\engine\lichess-bot-master\lichess-bot.py", line 569, in play_game
    game = model.Game(initial_state, user_profile["username"], li.baseUrl, abort_time)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\deena\Desktop\engine\lichess-bot-master\model.py", line 143, in __init__
    self.id: str = game_info["id"]
                   ~~~~~~~~~^^^^^^
KeyError: 'id'

2023-06-19 13:02:59,334 urllib3.connectionpool (connectionpool.py:1048) DEBUG Starting new HTTPS connection (1): lichess.org:443
2023-06-19 13:02:59,837 urllib3.connectionpool (connectionpool.py:546) DEBUG https://lichess.org:443 "GET /api/bot/game/stream/NEe1TOCm HTTP/1.1" 400 56
2023-06-19 13:02:59,839 __mp_main__ (lichess-bot.py:567) DEBUG Initial state: {'error': 'This game cannot be played with the Bot API.'}
2023-06-19 13:02:59,839 backoff (_common.py:105) INFO Backing off play_game(...) for 10.3s (KeyError: 'id')
2023-06-19 13:02:59,839 lichess (lichess.py:62) DEBUG Backing off 10.3 seconds after 6 tries calling function <function play_game at 0x0000028A598C8FE0> with args () and kwargs {'li': <lichess.Lichess object at 0x0000028A598CDB90>, 'control_queue': <AutoProxy[Queue] object, typeid 'Queue' at 0x28a599274d0>, 'user_profile': {'id': 'chessler-v3', 'username': 'Chessler-V3', 'perfs': {'blitz': {'games': 4, 'rating': 2235, 'rd': 258, 'prog': 0, 'prov': True}, 'bullet': {'games': 0, 'rating': 2000, 'rd': 500, 'prog': 0, 'prov': True}, 'correspondence': {'games': 0, 'rating': 2000, 'rd': 500, 'prog': 0, 'prov': True}, 'classical': {'games': 0, 'rating': 2000, 'rd': 500, 'prog': 0, 'prov': True}, 'rapid': {'games': 0, 'rating': 2000, 'rd': 500, 'prog': 0, 'prov': True}}, 'title': 'BOT', 'createdAt': 1686442191791, 'profile': {'country': 'US', 'bio': "ChesslerV3 NNUE! I accept two games and run on 1024MB RAM. Rated ~2900 ~2.1M n/s, I use an AMD Ryzen 3 4300U with Radeon Graphics, clocked at 2.70 GHz. I'm fast for a chess engine. No tablebase, but I have an opening database. Offline means my owner is busy. I play rapid, blitz, and bullet games."}, 'seenAt': 1687204426251, 'playTime': {'total': 6811, 'tv': 0}, 'url': 'https://lichess.org/@/Chessler-V3', 'count': {'all': 22, 'rated': 4, 'ai': 0, 'draw': 1, 'drawH': 1, 'loss': 11, 'lossH': 11, 'win': 10, 'winH': 10, 'bookmark': 0, 'playing': 0, 'import': 0, 'me': 0}, 'followable': True, 'following': False, 'blocking': False, 'followsYou': False}, 'config': <config.Configuration object at 0x0000028A59934DD0>, 'challenge_queue': <ListProxy object, typeid 'list' at 0x28a59936f90>, 'correspondence_queue': <AutoProxy[Queue] object, typeid 'Queue' at 0x28a59937190>, 'logging_queue': <AutoProxy[Queue] object, typeid 'Queue' at 0x28a599373d0>, 'game_id': 'NEe1TOCm'}
2023-06-19 13:02:59,840 lichess (lichess.py:64) DEBUG Exception: Traceback (most recent call last):
  File "C:\Users\deena\Desktop\engine\lichess-bot-master\.venv\Lib\site-packages\backoff\_sync.py", line 105, in retry
    ret = target(*args, **kwargs)
          ^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\deena\Desktop\engine\lichess-bot-master\lichess-bot.py", line 569, in play_game
    game = model.Game(initial_state, user_profile["username"], li.baseUrl, abort_time)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\deena\Desktop\engine\lichess-bot-master\model.py", line 143, in __init__
    self.id: str = game_info["id"]
                   ~~~~~~~~~^^^^^^
KeyError: 'id'

2023-06-19 13:02:59,948 __main__ (lichess-bot.py:377) DEBUG Event: {'type': 'gameStart', 'game': {'fullId': 'pJRDYo7ogyy7', 'gameId': 'pJRDYo7o', 'fen': 'rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR w KQkq - 0 1', 'color': 'black', 'lastMove': '', 'source': 'ai', 'status': {'id': 20, 'name': 'started'}, 'variant': {'key': 'standard', 'name': 'Standard'}, 'speed': 'bullet', 'perf': 'bullet', 'rated': False, 'hasMoved': False, 'opponent': {'id': None, 'username': 'Stockfish level 8', 'ai': 8}, 'isMyTurn': False, 'secondsLeft': 120, 'compat': {'bot': True, 'board': False}, 'id': 'pJRDYo7o'}}
2023-06-19 13:02:59,948 __main__ (lichess-bot.py:261) INFO --- Process Used. Count: 1. IDs: {'pJRDYo7o'}
2023-06-19 13:02:59,963 urllib3.connectionpool (connectionpool.py:1048) DEBUG Starting new HTTPS connection (1): lichess.org:443
2023-06-19 13:03:00,484 urllib3.connectionpool (connectionpool.py:546) DEBUG https://lichess.org:443 "GET /api/bot/game/stream/pJRDYo7o HTTP/1.1" 200 None
2023-06-19 13:03:00,492 __mp_main__ (lichess-bot.py:567) DEBUG Initial state: {'id': 'pJRDYo7o', 'variant': {'key': 'standard', 'name': 'Standard', 'short': 'Std'}, 'speed': 'bullet', 'perf': {'name': 'Bullet'}, 'rated': False, 'createdAt': 1687204980168, 'white': {'aiLevel': 8}, 'black': {'id': 'chessler-v3', 'name': 'Chessler-V3', 'title': 'BOT', 'rating': 2000, 'provisional': True}, 'initialFen': 'startpos', 'clock': {'initial': 120000, 'increment': 0}, 'type': 'gameFull', 'state': {'type': 'gameState', 'moves': '', 'wtime': 120000, 'btime': 120000, 'winc': 0, 'binc': 0, 'status': 'started'}}
2023-06-19 13:03:00,492 engine_wrapper (engine_wrapper.py:63) DEBUG Starting engine: ['C:\\Users\\deena\\Desktop\\engine\\lichess-bot-master\\engines\\example_engine.exe']
2023-06-19 13:03:00,498 asyncio (proactor_events.py:633) DEBUG Using proactor: IocpProactor
2023-06-19 13:03:00,530 chess.engine (engine.py:1001) DEBUG <UciProtocol (pid=5380)>: Connection made
2023-06-19 13:03:00,531 chess.engine (engine.py:1023) DEBUG <UciProtocol (pid=5380)>: << uci
2023-06-19 13:03:00,555 chess.engine (engine.py:1049) DEBUG <UciProtocol (pid=5380)>: >> Stockfish 10 by T. Romstad, M. Costalba, J. Kiiski, G. Linscott
2023-06-19 13:03:00,614 chess.engine (engine.py:1049) DEBUG <UciProtocol (pid=5380)>: >> id name Stockfish 10
2023-06-19 13:03:00,614 chess.engine (engine.py:1049) DEBUG <UciProtocol (pid=5380)>: >> id author T. Romstad, M. Costalba, J. Kiiski, G. Linscott
2023-06-19 13:03:00,614 chess.engine (engine.py:1049) DEBUG <UciProtocol (pid=5380)>: >> 
2023-06-19 13:03:00,614 chess.engine (engine.py:1049) DEBUG <UciProtocol (pid=5380)>: >> option name Debug Log File type string default 
2023-06-19 13:03:00,615 chess.engine (engine.py:1049) DEBUG <UciProtocol (pid=5380)>: >> option name Contempt type spin default 24 min -100 max 100
2023-06-19 13:03:00,615 chess.engine (engine.py:1049) DEBUG <UciProtocol (pid=5380)>: >> option name Analysis Contempt type combo default Both var Off var White var Black var Both
2023-06-19 13:03:00,615 chess.engine (engine.py:1049) DEBUG <UciProtocol (pid=5380)>: >> option name Threads type spin default 1 min 1 max 512
2023-06-19 13:03:00,615 chess.engine (engine.py:1049) DEBUG <UciProtocol (pid=5380)>: >> option name Hash type spin default 16 min 1 max 2048
2023-06-19 13:03:00,615 chess.engine (engine.py:1049) DEBUG <UciProtocol (pid=5380)>: >> option name Clear Hash type button
2023-06-19 13:03:00,615 chess.engine (engine.py:1049) DEBUG <UciProtocol (pid=5380)>: >> option name Ponder type check default false
2023-06-19 13:03:00,615 chess.engine (engine.py:1049) DEBUG <UciProtocol (pid=5380)>: >> option name MultiPV type spin default 1 min 1 max 500
2023-06-19 13:03:00,615 chess.engine (engine.py:1049) DEBUG <UciProtocol (pid=5380)>: >> option name Skill Level type spin default 20 min 0 max 20
2023-06-19 13:03:00,616 chess.engine (engine.py:1049) DEBUG <UciProtocol (pid=5380)>: >> option name Move Overhead type spin default 30 min 0 max 5000
2023-06-19 13:03:00,616 chess.engine (engine.py:1049) DEBUG <UciProtocol (pid=5380)>: >> option name Minimum Thinking Time type spin default 20 min 0 max 5000
2023-06-19 13:03:00,616 chess.engine (engine.py:1049) DEBUG <UciProtocol (pid=5380)>: >> option name Slow Mover type spin default 84 min 10 max 1000
2023-06-19 13:03:00,616 chess.engine (engine.py:1049) DEBUG <UciProtocol (pid=5380)>: >> option name nodestime type spin default 0 min 0 max 10000
2023-06-19 13:03:00,616 chess.engine (engine.py:1049) DEBUG <UciProtocol (pid=5380)>: >> option name UCI_Chess960 type check default false
2023-06-19 13:03:00,616 chess.engine (engine.py:1049) DEBUG <UciProtocol (pid=5380)>: >> option name UCI_AnalyseMode type check default false
2023-06-19 13:03:00,617 chess.engine (engine.py:1049) DEBUG <UciProtocol (pid=5380)>: >> option name SyzygyPath type string default <empty>
2023-06-19 13:03:00,617 chess.engine (engine.py:1049) DEBUG <UciProtocol (pid=5380)>: >> option name SyzygyProbeDepth type spin default 1 min 1 max 100
2023-06-19 13:03:00,617 chess.engine (engine.py:1049) DEBUG <UciProtocol (pid=5380)>: >> option name Syzygy50MoveRule type check default true
2023-06-19 13:03:00,617 chess.engine (engine.py:1049) DEBUG <UciProtocol (pid=5380)>: >> option name SyzygyProbeLimit type spin default 7 min 0 max 7
2023-06-19 13:03:00,617 chess.engine (engine.py:1049) DEBUG <UciProtocol (pid=5380)>: >> uciok
2023-06-19 13:03:00,619 chess.engine (engine.py:1023) DEBUG <UciProtocol (pid=5380)>: << setoption name Move Overhead value 100
2023-06-19 13:03:00,619 chess.engine (engine.py:1023) DEBUG <UciProtocol (pid=5380)>: << setoption name Threads value 2
2023-06-19 13:03:00,620 chess.engine (engine.py:1023) DEBUG <UciProtocol (pid=5380)>: << setoption name Hash value 2048
2023-06-19 13:03:00,620 chess.engine (engine.py:1023) DEBUG <UciProtocol (pid=5380)>: << setoption name SyzygyPath value ./syzygy/
2023-06-19 13:03:00,620 __mp_main__ (lichess-bot.py:573) DEBUG The engine for game pJRDYo7o has pid=5380
2023-06-19 13:03:00,620 __mp_main__ (lichess-bot.py:576) INFO +++ https://lichess.org/pJRDYo7o/black Bullet vs AI level 8 (pJRDYo7o)
2023-06-19 13:03:00,638 chess.engine (engine.py:1020) DEBUG <UciProtocol (pid=5380)>: Process exited
2023-06-19 13:03:00,639 chess.engine (engine.py:1007) DEBUG <UciProtocol (pid=5380)>: Connection lost (exit code: 1, error: None)
2023-06-19 13:03:01,960 __mp_main__ (lichess-bot.py:689) DEBUG Game state: {'type': 'gameState', 'moves': 'f2f4', 'wtime': 120000, 'btime': 120000, 'winc': 0, 'binc': 0, 'status': 'started'}
2023-06-19 13:03:01,962 conversation (conversation.py:84) INFO *** https://lichess.org/pJRDYo7o/black [player] Chessler-V3: Hi! I'm Chessler-V3. Good luck! Type !help for a list of commands I can respond to.
2023-06-19 13:03:01,963 urllib3.connectionpool (connectionpool.py:1048) DEBUG Starting new HTTPS connection (1): lichess.org:443
2023-06-19 13:03:02,467 urllib3.connectionpool (connectionpool.py:546) DEBUG https://lichess.org:443 "POST /api/bot/game/pJRDYo7o/chat HTTP/1.1" 200 11
2023-06-19 13:03:02,468 conversation (conversation.py:84) INFO *** https://lichess.org/pJRDYo7o/black [spectator] Chessler-V3: Hi! I'm Chessler-V3. Type !help for a list of commands I can respond to.
2023-06-19 13:03:02,635 urllib3.connectionpool (connectionpool.py:546) DEBUG https://lichess.org:443 "POST /api/bot/game/pJRDYo7o/chat HTTP/1.1" 200 11
2023-06-19 13:03:02,636 __mp_main__ (lichess-bot.py:680) INFO 
2023-06-19 13:03:02,636 __mp_main__ (lichess-bot.py:681) INFO move: 1
2023-06-19 13:03:02,637 engine_wrapper (engine_wrapper.py:646) INFO Searching for time 10000 for game pJRDYo7o
2023-06-19 13:03:02,637 chess.engine (engine.py:1023) DEBUG <UciProtocol (pid=5380)>: << stop
2023-06-19 13:03:02,642 backoff (_common.py:105) INFO Backing off play_game(...) for 0.5s (chess.engine.EngineTerminatedError: engine event loop dead)
2023-06-19 13:03:02,643 lichess (lichess.py:62) DEBUG Backing off 0.5 seconds after 1 tries calling function <function play_game at 0x0000016D8CF38FE0> with args () and kwargs {'li': <lichess.Lichess object at 0x0000016D8CF3DB90>, 'control_queue': <AutoProxy[Queue] object, typeid 'Queue' at 0x16d8cf974d0>, 'user_profile': {'id': 'chessler-v3', 'username': 'Chessler-V3', 'perfs': {'blitz': {'games': 4, 'rating': 2235, 'rd': 258, 'prog': 0, 'prov': True}, 'bullet': {'games': 0, 'rating': 2000, 'rd': 500, 'prog': 0, 'prov': True}, 'correspondence': {'games': 0, 'rating': 2000, 'rd': 500, 'prog': 0, 'prov': True}, 'classical': {'games': 0, 'rating': 2000, 'rd': 500, 'prog': 0, 'prov': True}, 'rapid': {'games': 0, 'rating': 2000, 'rd': 500, 'prog': 0, 'prov': True}}, 'title': 'BOT', 'createdAt': 1686442191791, 'profile': {'country': 'US', 'bio': "ChesslerV3 NNUE! I accept two games and run on 1024MB RAM. Rated ~2900 ~2.1M n/s, I use an AMD Ryzen 3 4300U with Radeon Graphics, clocked at 2.70 GHz. I'm fast for a chess engine. No tablebase, but I have an opening database. Offline means my owner is busy. I play rapid, blitz, and bullet games."}, 'seenAt': 1687204426251, 'playTime': {'total': 6811, 'tv': 0}, 'url': 'https://lichess.org/@/Chessler-V3', 'count': {'all': 22, 'rated': 4, 'ai': 0, 'draw': 1, 'drawH': 1, 'loss': 11, 'lossH': 11, 'win': 10, 'winH': 10, 'bookmark': 0, 'playing': 0, 'import': 0, 'me': 0}, 'followable': True, 'following': False, 'blocking': False, 'followsYou': False}, 'config': <config.Configuration object at 0x0000016D8CFA4DD0>, 'challenge_queue': <ListProxy object, typeid 'list' at 0x16d8cfa6f90>, 'correspondence_queue': <AutoProxy[Queue] object, typeid 'Queue' at 0x16d8cfa7190>, 'logging_queue': <AutoProxy[Queue] object, typeid 'Queue' at 0x16d8cfa73d0>, 'game_id': 'pJRDYo7o'}
2023-06-19 13:03:02,645 lichess (lichess.py:64) DEBUG Exception: Traceback (most recent call last):
  File "C:\Users\deena\Desktop\engine\lichess-bot-master\engine_wrapper.py", line 66, in create_engine
    yield engine
  File "C:\Users\deena\Desktop\engine\lichess-bot-master\lichess-bot.py", line 616, in play_game
    engine.play_move(board,
  File "C:\Users\deena\Desktop\engine\lichess-bot-master\engine_wrapper.py", line 186, in play_move
    best_move = self.search(board, time_limit, can_ponder, draw_offered, best_move)
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\deena\Desktop\engine\lichess-bot-master\engine_wrapper.py", line 252, in search
    result = self.engine.play(board,
             ^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\deena\Desktop\engine\lichess-bot-master\.venv\Lib\site-packages\chess\engine.py", line 2790, in play
    with self._not_shut_down():
  File "C:\Users\deena\AppData\Local\Programs\Python\Python311\Lib\contextlib.py", line 137, in __enter__
    return next(self.gen)
           ^^^^^^^^^^^^^^
  File "C:\Users\deena\Desktop\engine\lichess-bot-master\.venv\Lib\site-packages\chess\engine.py", line 2754, in _not_shut_down
    raise EngineTerminatedError("engine event loop dead")
chess.engine.EngineTerminatedError: engine event loop dead

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "C:\Users\deena\Desktop\engine\lichess-bot-master\.venv\Lib\site-packages\backoff\_sync.py", line 105, in retry
    ret = target(*args, **kwargs)
          ^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\deena\Desktop\engine\lichess-bot-master\lichess-bot.py", line 571, in play_game
    with engine_wrapper.create_engine(config) as engine:
  File "C:\Users\deena\AppData\Local\Programs\Python\Python311\Lib\contextlib.py", line 155, in __exit__
    self.gen.throw(typ, value, traceback)
  File "C:\Users\deena\Desktop\engine\lichess-bot-master\engine_wrapper.py", line 69, in create_engine
    engine.ping()
  File "C:\Users\deena\Desktop\engine\lichess-bot-master\engine_wrapper.py", line 413, in ping
    self.engine.ping()
  File "C:\Users\deena\Desktop\engine\lichess-bot-master\.venv\Lib\site-packages\chess\engine.py", line 2784, in ping
    with self._not_shut_down():
  File "C:\Users\deena\AppData\Local\Programs\Python\Python311\Lib\contextlib.py", line 137, in __enter__
    return next(self.gen)
           ^^^^^^^^^^^^^^
  File "C:\Users\deena\Desktop\engine\lichess-bot-master\.venv\Lib\site-packages\chess\engine.py", line 2754, in _not_shut_down
    raise EngineTerminatedError("engine event loop dead")
chess.engine.EngineTerminatedError: engine event loop dead

2023-06-19 13:03:03,105 urllib3.connectionpool (connectionpool.py:1048) DEBUG Starting new HTTPS connection (1): lichess.org:443
2023-06-19 13:03:03,605 urllib3.connectionpool (connectionpool.py:546) DEBUG https://lichess.org:443 "GET /api/bot/game/stream/pJRDYo7o HTTP/1.1" 200 None
2023-06-19 13:03:03,608 __mp_main__ (lichess-bot.py:567) DEBUG Initial state: {'id': 'pJRDYo7o', 'variant': {'key': 'standard', 'name': 'Standard', 'short': 'Std'}, 'speed': 'bullet', 'perf': {'name': 'Bullet'}, 'rated': False, 'createdAt': 1687204980168, 'white': {'aiLevel': 8}, 'black': {'id': 'chessler-v3', 'name': 'Chessler-V3', 'title': 'BOT', 'rating': 2000, 'provisional': True}, 'initialFen': 'startpos', 'clock': {'initial': 120000, 'increment': 0}, 'type': 'gameFull', 'state': {'type': 'gameState', 'moves': 'f2f4', 'wtime': 120000, 'btime': 120000, 'winc': 0, 'binc': 0, 'status': 'started'}}
2023-06-19 13:03:03,609 engine_wrapper (engine_wrapper.py:63) DEBUG Starting engine: ['C:\\Users\\deena\\Desktop\\engine\\lichess-bot-master\\engines\\example_engine.exe']
2023-06-19 13:03:03,610 asyncio (proactor_events.py:633) DEBUG Using proactor: IocpProactor
2023-06-19 13:03:03,620 chess.engine (engine.py:1001) DEBUG <UciProtocol (pid=2612)>: Connection made
2023-06-19 13:03:03,621 chess.engine (engine.py:1023) DEBUG <UciProtocol (pid=2612)>: << uci
2023-06-19 13:03:03,625 chess.engine (engine.py:1049) DEBUG <UciProtocol (pid=2612)>: >> Stockfish 10 by T. Romstad, M. Costalba, J. Kiiski, G. Linscott
2023-06-19 13:03:03,679 chess.engine (engine.py:1049) DEBUG <UciProtocol (pid=2612)>: >> id name Stockfish 10
2023-06-19 13:03:03,681 chess.engine (engine.py:1049) DEBUG <UciProtocol (pid=2612)>: >> id author T. Romstad, M. Costalba, J. Kiiski, G. Linscott
2023-06-19 13:03:03,681 chess.engine (engine.py:1049) DEBUG <UciProtocol (pid=2612)>: >> 
2023-06-19 13:03:03,681 chess.engine (engine.py:1049) DEBUG <UciProtocol (pid=2612)>: >> option name Debug Log File type string default 
2023-06-19 13:03:03,681 chess.engine (engine.py:1049) DEBUG <UciProtocol (pid=2612)>: >> option name Contempt type spin default 24 min -100 max 100
2023-06-19 13:03:03,681 chess.engine (engine.py:1049) DEBUG <UciProtocol (pid=2612)>: >> option name Analysis Contempt type combo default Both var Off var White var Black var Both
2023-06-19 13:03:03,681 chess.engine (engine.py:1049) DEBUG <UciProtocol (pid=2612)>: >> option name Threads type spin default 1 min 1 max 512
2023-06-19 13:03:03,682 chess.engine (engine.py:1049) DEBUG <UciProtocol (pid=2612)>: >> option name Hash type spin default 16 min 1 max 2048
2023-06-19 13:03:03,682 chess.engine (engine.py:1049) DEBUG <UciProtocol (pid=2612)>: >> option name Clear Hash type button
2023-06-19 13:03:03,682 chess.engine (engine.py:1049) DEBUG <UciProtocol (pid=2612)>: >> option name Ponder type check default false
2023-06-19 13:03:03,682 chess.engine (engine.py:1049) DEBUG <UciProtocol (pid=2612)>: >> option name MultiPV type spin default 1 min 1 max 500
2023-06-19 13:03:03,682 chess.engine (engine.py:1049) DEBUG <UciProtocol (pid=2612)>: >> option name Skill Level type spin default 20 min 0 max 20
2023-06-19 13:03:03,683 chess.engine (engine.py:1049) DEBUG <UciProtocol (pid=2612)>: >> option name Move Overhead type spin default 30 min 0 max 5000
2023-06-19 13:03:03,683 chess.engine (engine.py:1049) DEBUG <UciProtocol (pid=2612)>: >> option name Minimum Thinking Time type spin default 20 min 0 max 5000
2023-06-19 13:03:03,683 chess.engine (engine.py:1049) DEBUG <UciProtocol (pid=2612)>: >> option name Slow Mover type spin default 84 min 10 max 1000
2023-06-19 13:03:03,683 chess.engine (engine.py:1049) DEBUG <UciProtocol (pid=2612)>: >> option name nodestime type spin default 0 min 0 max 10000
2023-06-19 13:03:03,683 chess.engine (engine.py:1049) DEBUG <UciProtocol (pid=2612)>: >> option name UCI_Chess960 type check default false
2023-06-19 13:03:03,683 chess.engine (engine.py:1049) DEBUG <UciProtocol (pid=2612)>: >> option name UCI_AnalyseMode type check default false
2023-06-19 13:03:03,683 chess.engine (engine.py:1049) DEBUG <UciProtocol (pid=2612)>: >> option name SyzygyPath type string default <empty>
2023-06-19 13:03:03,683 chess.engine (engine.py:1049) DEBUG <UciProtocol (pid=2612)>: >> option name SyzygyProbeDepth type spin default 1 min 1 max 100
2023-06-19 13:03:03,684 chess.engine (engine.py:1049) DEBUG <UciProtocol (pid=2612)>: >> option name Syzygy50MoveRule type check default true
2023-06-19 13:03:03,684 chess.engine (engine.py:1049) DEBUG <UciProtocol (pid=2612)>: >> option name SyzygyProbeLimit type spin default 7 min 0 max 7
2023-06-19 13:03:03,684 chess.engine (engine.py:1049) DEBUG <UciProtocol (pid=2612)>: >> uciok
2023-06-19 13:03:03,684 chess.engine (engine.py:1023) DEBUG <UciProtocol (pid=2612)>: << setoption name Move Overhead value 100
2023-06-19 13:03:03,685 chess.engine (engine.py:1023) DEBUG <UciProtocol (pid=2612)>: << setoption name Threads value 2
2023-06-19 13:03:03,685 chess.engine (engine.py:1023) DEBUG <UciProtocol (pid=2612)>: << setoption name Hash value 2048
2023-06-19 13:03:03,685 chess.engine (engine.py:1023) DEBUG <UciProtocol (pid=2612)>: << setoption name SyzygyPath value ./syzygy/
2023-06-19 13:03:03,686 __mp_main__ (lichess-bot.py:573) DEBUG The engine for game pJRDYo7o has pid=2612
2023-06-19 13:03:03,686 __mp_main__ (lichess-bot.py:576) INFO +++ https://lichess.org/pJRDYo7o/black Bullet vs AI level 8 (pJRDYo7o)
2023-06-19 13:03:03,686 conversation (conversation.py:84) INFO *** https://lichess.org/pJRDYo7o/black [player] Chessler-V3: Hi! I'm Chessler-V3. Good luck! Type !help for a list of commands I can respond to.
2023-06-19 13:03:03,703 chess.engine (engine.py:1020) DEBUG <UciProtocol (pid=2612)>: Process exited
2023-06-19 13:03:03,705 chess.engine (engine.py:1007) DEBUG <UciProtocol (pid=2612)>: Connection lost (exit code: 1, error: None)
2023-06-19 13:03:03,853 urllib3.connectionpool (connectionpool.py:546) DEBUG https://lichess.org:443 "POST /api/bot/game/pJRDYo7o/chat HTTP/1.1" 200 11
2023-06-19 13:03:03,854 conversation (conversation.py:84) INFO *** https://lichess.org/pJRDYo7o/black [spectator] Chessler-V3: Hi! I'm Chessler-V3. Type !help for a list of commands I can respond to.
2023-06-19 13:03:04,022 urllib3.connectionpool (connectionpool.py:546) DEBUG https://lichess.org:443 "POST /api/bot/game/pJRDYo7o/chat HTTP/1.1" 200 11
2023-06-19 13:03:04,023 __mp_main__ (lichess-bot.py:680) INFO 
2023-06-19 13:03:04,023 __mp_main__ (lichess-bot.py:681) INFO move: 1
2023-06-19 13:03:04,023 engine_wrapper (engine_wrapper.py:646) INFO Searching for time 10000 for game pJRDYo7o
2023-06-19 13:03:04,023 chess.engine (engine.py:1023) DEBUG <UciProtocol (pid=2612)>: << stop
2023-06-19 13:03:04,024 backoff (_common.py:105) INFO Backing off play_game(...) for 0.3s (chess.engine.EngineTerminatedError: engine event loop dead)
2023-06-19 13:03:04,024 lichess (lichess.py:62) DEBUG Backing off 0.3 seconds after 2 tries calling function <function play_game at 0x0000016D8CF38FE0> with args () and kwargs {'li': <lichess.Lichess object at 0x0000016D8CF3DB90>, 'control_queue': <AutoProxy[Queue] object, typeid 'Queue' at 0x16d8cf974d0>, 'user_profile': {'id': 'chessler-v3', 'username': 'Chessler-V3', 'perfs': {'blitz': {'games': 4, 'rating': 2235, 'rd': 258, 'prog': 0, 'prov': True}, 'bullet': {'games': 0, 'rating': 2000, 'rd': 500, 'prog': 0, 'prov': True}, 'correspondence': {'games': 0, 'rating': 2000, 'rd': 500, 'prog': 0, 'prov': True}, 'classical': {'games': 0, 'rating': 2000, 'rd': 500, 'prog': 0, 'prov': True}, 'rapid': {'games': 0, 'rating': 2000, 'rd': 500, 'prog': 0, 'prov': True}}, 'title': 'BOT', 'createdAt': 1686442191791, 'profile': {'country': 'US', 'bio': "ChesslerV3 NNUE! I accept two games and run on 1024MB RAM. Rated ~2900 ~2.1M n/s, I use an AMD Ryzen 3 4300U with Radeon Graphics, clocked at 2.70 GHz. I'm fast for a chess engine. No tablebase, but I have an opening database. Offline means my owner is busy. I play rapid, blitz, and bullet games."}, 'seenAt': 1687204426251, 'playTime': {'total': 6811, 'tv': 0}, 'url': 'https://lichess.org/@/Chessler-V3', 'count': {'all': 22, 'rated': 4, 'ai': 0, 'draw': 1, 'drawH': 1, 'loss': 11, 'lossH': 11, 'win': 10, 'winH': 10, 'bookmark': 0, 'playing': 0, 'import': 0, 'me': 0}, 'followable': True, 'following': False, 'blocking': False, 'followsYou': False}, 'config': <config.Configuration object at 0x0000016D8CFA4DD0>, 'challenge_queue': <ListProxy object, typeid 'list' at 0x16d8cfa6f90>, 'correspondence_queue': <AutoProxy[Queue] object, typeid 'Queue' at 0x16d8cfa7190>, 'logging_queue': <AutoProxy[Queue] object, typeid 'Queue' at 0x16d8cfa73d0>, 'game_id': 'pJRDYo7o'}
2023-06-19 13:03:04,026 lichess (lichess.py:64) DEBUG Exception: Traceback (most recent call last):
  File "C:\Users\deena\Desktop\engine\lichess-bot-master\engine_wrapper.py", line 66, in create_engine
    yield engine
  File "C:\Users\deena\Desktop\engine\lichess-bot-master\lichess-bot.py", line 616, in play_game
    engine.play_move(board,
  File "C:\Users\deena\Desktop\engine\lichess-bot-master\engine_wrapper.py", line 186, in play_move
    best_move = self.search(board, time_limit, can_ponder, draw_offered, best_move)
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\deena\Desktop\engine\lichess-bot-master\engine_wrapper.py", line 252, in search
    result = self.engine.play(board,
             ^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\deena\Desktop\engine\lichess-bot-master\.venv\Lib\site-packages\chess\engine.py", line 2790, in play
    with self._not_shut_down():
  File "C:\Users\deena\AppData\Local\Programs\Python\Python311\Lib\contextlib.py", line 137, in __enter__
    return next(self.gen)
           ^^^^^^^^^^^^^^
  File "C:\Users\deena\Desktop\engine\lichess-bot-master\.venv\Lib\site-packages\chess\engine.py", line 2754, in _not_shut_down
    raise EngineTerminatedError("engine event loop dead")
chess.engine.EngineTerminatedError: engine event loop dead

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "C:\Users\deena\Desktop\engine\lichess-bot-master\.venv\Lib\site-packages\backoff\_sync.py", line 105, in retry
    ret = target(*args, **kwargs)
          ^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\deena\Desktop\engine\lichess-bot-master\lichess-bot.py", line 571, in play_game
    with engine_wrapper.create_engine(config) as engine:
  File "C:\Users\deena\AppData\Local\Programs\Python\Python311\Lib\contextlib.py", line 155, in __exit__
    self.gen.throw(typ, value, traceback)
  File "C:\Users\deena\Desktop\engine\lichess-bot-master\engine_wrapper.py", line 69, in create_engine
    engine.ping()
  File "C:\Users\deena\Desktop\engine\lichess-bot-master\engine_wrapper.py", line 413, in ping
    self.engine.ping()
  File "C:\Users\deena\Desktop\engine\lichess-bot-master\.venv\Lib\site-packages\chess\engine.py", line 2784, in ping
    with self._not_shut_down():
  File "C:\Users\deena\AppData\Local\Programs\Python\Python311\Lib\contextlib.py", line 137, in __enter__
    return next(self.gen)
           ^^^^^^^^^^^^^^
  File "C:\Users\deena\Desktop\engine\lichess-bot-master\.venv\Lib\site-packages\chess\engine.py", line 2754, in _not_shut_down
    raise EngineTerminatedError("engine event loop dead")
chess.engine.EngineTerminatedError: engine event loop dead

2023-06-19 13:03:04,291 urllib3.connectionpool (connectionpool.py:1048) DEBUG Starting new HTTPS connection (1): lichess.org:443
2023-06-19 13:03:04,807 urllib3.connectionpool (connectionpool.py:546) DEBUG https://lichess.org:443 "GET /api/bot/game/stream/pJRDYo7o HTTP/1.1" 200 None
2023-06-19 13:03:04,807 __mp_main__ (lichess-bot.py:567) DEBUG Initial state: {'id': 'pJRDYo7o', 'variant': {'key': 'standard', 'name': 'Standard', 'short': 'Std'}, 'speed': 'bullet', 'perf': {'name': 'Bullet'}, 'rated': False, 'createdAt': 1687204980168, 'white': {'aiLevel': 8}, 'black': {'id': 'chessler-v3', 'name': 'Chessler-V3', 'title': 'BOT', 'rating': 2000, 'provisional': True}, 'initialFen': 'startpos', 'clock': {'initial': 120000, 'increment': 0}, 'type': 'gameFull', 'state': {'type': 'gameState', 'moves': 'f2f4', 'wtime': 120000, 'btime': 120000, 'winc': 0, 'binc': 0, 'status': 'started'}}
2023-06-19 13:03:04,807 engine_wrapper (engine_wrapper.py:63) DEBUG Starting engine: ['C:\\Users\\deena\\Desktop\\engine\\lichess-bot-master\\engines\\example_engine.exe']
2023-06-19 13:03:04,808 asyncio (proactor_events.py:633) DEBUG Using proactor: IocpProactor
2023-06-19 13:03:04,818 chess.engine (engine.py:1001) DEBUG <UciProtocol (pid=8320)>: Connection made
2023-06-19 13:03:04,819 chess.engine (engine.py:1023) DEBUG <UciProtocol (pid=8320)>: << uci
2023-06-19 13:03:04,826 chess.engine (engine.py:1049) DEBUG <UciProtocol (pid=8320)>: >> Stockfish 10 by T. Romstad, M. Costalba, J. Kiiski, G. Linscott
2023-06-19 13:03:04,881 chess.engine (engine.py:1049) DEBUG <UciProtocol (pid=8320)>: >> id name Stockfish 10
2023-06-19 13:03:04,882 chess.engine (engine.py:1049) DEBUG <UciProtocol (pid=8320)>: >> id author T. Romstad, M. Costalba, J. Kiiski, G. Linscott
2023-06-19 13:03:04,882 chess.engine (engine.py:1049) DEBUG <UciProtocol (pid=8320)>: >> 
2023-06-19 13:03:04,882 chess.engine (engine.py:1049) DEBUG <UciProtocol (pid=8320)>: >> option name Debug Log File type string default 
2023-06-19 13:03:04,882 chess.engine (engine.py:1049) DEBUG <UciProtocol (pid=8320)>: >> option name Contempt type spin default 24 min -100 max 100
2023-06-19 13:03:04,883 chess.engine (engine.py:1049) DEBUG <UciProtocol (pid=8320)>: >> option name Analysis Contempt type combo default Both var Off var White var Black var Both
2023-06-19 13:03:04,883 chess.engine (engine.py:1049) DEBUG <UciProtocol (pid=8320)>: >> option name Threads type spin default 1 min 1 max 512
2023-06-19 13:03:04,883 chess.engine (engine.py:1049) DEBUG <UciProtocol (pid=8320)>: >> option name Hash type spin default 16 min 1 max 2048
2023-06-19 13:03:04,883 chess.engine (engine.py:1049) DEBUG <UciProtocol (pid=8320)>: >> option name Clear Hash type button
2023-06-19 13:03:04,883 chess.engine (engine.py:1049) DEBUG <UciProtocol (pid=8320)>: >> option name Ponder type check default false
2023-06-19 13:03:04,883 chess.engine (engine.py:1049) DEBUG <UciProtocol (pid=8320)>: >> option name MultiPV type spin default 1 min 1 max 500
2023-06-19 13:03:04,883 chess.engine (engine.py:1049) DEBUG <UciProtocol (pid=8320)>: >> option name Skill Level type spin default 20 min 0 max 20
2023-06-19 13:03:04,883 chess.engine (engine.py:1049) DEBUG <UciProtocol (pid=8320)>: >> option name Move Overhead type spin default 30 min 0 max 5000
2023-06-19 13:03:04,884 chess.engine (engine.py:1049) DEBUG <UciProtocol (pid=8320)>: >> option name Minimum Thinking Time type spin default 20 min 0 max 5000
2023-06-19 13:03:04,884 chess.engine (engine.py:1049) DEBUG <UciProtocol (pid=8320)>: >> option name Slow Mover type spin default 84 min 10 max 1000
2023-06-19 13:03:04,884 chess.engine (engine.py:1049) DEBUG <UciProtocol (pid=8320)>: >> option name nodestime type spin default 0 min 0 max 10000
2023-06-19 13:03:04,884 chess.engine (engine.py:1049) DEBUG <UciProtocol (pid=8320)>: >> option name UCI_Chess960 type check default false
2023-06-19 13:03:04,884 chess.engine (engine.py:1049) DEBUG <UciProtocol (pid=8320)>: >> option name UCI_AnalyseMode type check default false
2023-06-19 13:03:04,884 chess.engine (engine.py:1049) DEBUG <UciProtocol (pid=8320)>: >> option name SyzygyPath type string default <empty>
2023-06-19 13:03:04,885 chess.engine (engine.py:1049) DEBUG <UciProtocol (pid=8320)>: >> option name SyzygyProbeDepth type spin default 1 min 1 max 100
2023-06-19 13:03:04,885 chess.engine (engine.py:1049) DEBUG <UciProtocol (pid=8320)>: >> option name Syzygy50MoveRule type check default true
2023-06-19 13:03:04,887 chess.engine (engine.py:1049) DEBUG <UciProtocol (pid=8320)>: >> option name SyzygyProbeLimit type spin default 7 min 0 max 7
2023-06-19 13:03:04,887 chess.engine (engine.py:1049) DEBUG <UciProtocol (pid=8320)>: >> uciok
2023-06-19 13:03:04,887 chess.engine (engine.py:1023) DEBUG <UciProtocol (pid=8320)>: << setoption name Move Overhead value 100
2023-06-19 13:03:04,888 chess.engine (engine.py:1023) DEBUG <UciProtocol (pid=8320)>: << setoption name Threads value 2
2023-06-19 13:03:04,888 chess.engine (engine.py:1023) DEBUG <UciProtocol (pid=8320)>: << setoption name Hash value 2048
2023-06-19 13:03:04,888 chess.engine (engine.py:1023) DEBUG <UciProtocol (pid=8320)>: << setoption name SyzygyPath value ./syzygy/
2023-06-19 13:03:04,888 __mp_main__ (lichess-bot.py:573) DEBUG The engine for game pJRDYo7o has pid=8320
2023-06-19 13:03:04,888 __mp_main__ (lichess-bot.py:576) INFO +++ https://lichess.org/pJRDYo7o/black Bullet vs AI level 8 (pJRDYo7o)
2023-06-19 13:03:04,889 conversation (conversation.py:84) INFO *** https://lichess.org/pJRDYo7o/black [player] Chessler-V3: Hi! I'm Chessler-V3. Good luck! Type !help for a list of commands I can respond to.
2023-06-19 13:03:04,906 chess.engine (engine.py:1020) DEBUG <UciProtocol (pid=8320)>: Process exited
2023-06-19 13:03:04,906 chess.engine (engine.py:1007) DEBUG <UciProtocol (pid=8320)>: Connection lost (exit code: 1, error: None)
2023-06-19 13:03:05,055 urllib3.connectionpool (connectionpool.py:546) DEBUG https://lichess.org:443 "POST /api/bot/game/pJRDYo7o/chat HTTP/1.1" 200 11
2023-06-19 13:03:05,056 conversation (conversation.py:84) INFO *** https://lichess.org/pJRDYo7o/black [spectator] Chessler-V3: Hi! I'm Chessler-V3. Type !help for a list of commands I can respond to.
2023-06-19 13:03:05,218 urllib3.connectionpool (connectionpool.py:546) DEBUG https://lichess.org:443 "POST /api/bot/game/pJRDYo7o/chat HTTP/1.1" 200 11
2023-06-19 13:03:05,219 __mp_main__ (lichess-bot.py:680) INFO 
2023-06-19 13:03:05,219 __mp_main__ (lichess-bot.py:681) INFO move: 1
2023-06-19 13:03:05,220 engine_wrapper (engine_wrapper.py:646) INFO Searching for time 10000 for game pJRDYo7o
2023-06-19 13:03:05,220 chess.engine (engine.py:1023) DEBUG <UciProtocol (pid=8320)>: << stop
2023-06-19 13:03:05,221 backoff (_common.py:105) INFO Backing off play_game(...) for 3.7s (chess.engine.EngineTerminatedError: engine event loop dead)
2023-06-19 13:03:05,222 lichess (lichess.py:62) DEBUG Backing off 3.7 seconds after 3 tries calling function <function play_game at 0x0000016D8CF38FE0> with args () and kwargs {'li': <lichess.Lichess object at 0x0000016D8CF3DB90>, 'control_queue': <AutoProxy[Queue] object, typeid 'Queue' at 0x16d8cf974d0>, 'user_profile': {'id': 'chessler-v3', 'username': 'Chessler-V3', 'perfs': {'blitz': {'games': 4, 'rating': 2235, 'rd': 258, 'prog': 0, 'prov': True}, 'bullet': {'games': 0, 'rating': 2000, 'rd': 500, 'prog': 0, 'prov': True}, 'correspondence': {'games': 0, 'rating': 2000, 'rd': 500, 'prog': 0, 'prov': True}, 'classical': {'games': 0, 'rating': 2000, 'rd': 500, 'prog': 0, 'prov': True}, 'rapid': {'games': 0, 'rating': 2000, 'rd': 500, 'prog': 0, 'prov': True}}, 'title': 'BOT', 'createdAt': 1686442191791, 'profile': {'country': 'US', 'bio': "ChesslerV3 NNUE! I accept two games and run on 1024MB RAM. Rated ~2900 ~2.1M n/s, I use an AMD Ryzen 3 4300U with Radeon Graphics, clocked at 2.70 GHz. I'm fast for a chess engine. No tablebase, but I have an opening database. Offline means my owner is busy. I play rapid, blitz, and bullet games."}, 'seenAt': 1687204426251, 'playTime': {'total': 6811, 'tv': 0}, 'url': 'https://lichess.org/@/Chessler-V3', 'count': {'all': 22, 'rated': 4, 'ai': 0, 'draw': 1, 'drawH': 1, 'loss': 11, 'lossH': 11, 'win': 10, 'winH': 10, 'bookmark': 0, 'playing': 0, 'import': 0, 'me': 0}, 'followable': True, 'following': False, 'blocking': False, 'followsYou': False}, 'config': <config.Configuration object at 0x0000016D8CFA4DD0>, 'challenge_queue': <ListProxy object, typeid 'list' at 0x16d8cfa6f90>, 'correspondence_queue': <AutoProxy[Queue] object, typeid 'Queue' at 0x16d8cfa7190>, 'logging_queue': <AutoProxy[Queue] object, typeid 'Queue' at 0x16d8cfa73d0>, 'game_id': 'pJRDYo7o'}
2023-06-19 13:03:05,223 lichess (lichess.py:64) DEBUG Exception: Traceback (most recent call last):
  File "C:\Users\deena\Desktop\engine\lichess-bot-master\engine_wrapper.py", line 66, in create_engine
    yield engine
  File "C:\Users\deena\Desktop\engine\lichess-bot-master\lichess-bot.py", line 616, in play_game
    engine.play_move(board,
  File "C:\Users\deena\Desktop\engine\lichess-bot-master\engine_wrapper.py", line 186, in play_move
    best_move = self.search(board, time_limit, can_ponder, draw_offered, best_move)
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\deena\Desktop\engine\lichess-bot-master\engine_wrapper.py", line 252, in search
    result = self.engine.play(board,
             ^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\deena\Desktop\engine\lichess-bot-master\.venv\Lib\site-packages\chess\engine.py", line 2790, in play
    with self._not_shut_down():
  File "C:\Users\deena\AppData\Local\Programs\Python\Python311\Lib\contextlib.py", line 137, in __enter__
    return next(self.gen)
           ^^^^^^^^^^^^^^
  File "C:\Users\deena\Desktop\engine\lichess-bot-master\.venv\Lib\site-packages\chess\engine.py", line 2754, in _not_shut_down
    raise EngineTerminatedError("engine event loop dead")
chess.engine.EngineTerminatedError: engine event loop dead

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "C:\Users\deena\Desktop\engine\lichess-bot-master\.venv\Lib\site-packages\backoff\_sync.py", line 105, in retry
    ret = target(*args, **kwargs)
          ^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\deena\Desktop\engine\lichess-bot-master\lichess-bot.py", line 571, in play_game
    with engine_wrapper.create_engine(config) as engine:
  File "C:\Users\deena\AppData\Local\Programs\Python\Python311\Lib\contextlib.py", line 155, in __exit__
    self.gen.throw(typ, value, traceback)
  File "C:\Users\deena\Desktop\engine\lichess-bot-master\engine_wrapper.py", line 69, in create_engine
    engine.ping()
  File "C:\Users\deena\Desktop\engine\lichess-bot-master\engine_wrapper.py", line 413, in ping
    self.engine.ping()
  File "C:\Users\deena\Desktop\engine\lichess-bot-master\.venv\Lib\site-packages\chess\engine.py", line 2784, in ping
    with self._not_shut_down():
  File "C:\Users\deena\AppData\Local\Programs\Python\Python311\Lib\contextlib.py", line 137, in __enter__
    return next(self.gen)
           ^^^^^^^^^^^^^^
  File "C:\Users\deena\Desktop\engine\lichess-bot-master\.venv\Lib\site-packages\chess\engine.py", line 2754, in _not_shut_down
    raise EngineTerminatedError("engine event loop dead")
chess.engine.EngineTerminatedError: engine event loop dead
MarkZH commented 1 year ago

I see two errors in the logs. The first is easy.

2023-06-19 13:02:47,777 __mp_main__ (lichess-bot.py:567) DEBUG Initial state: {'error': 'This game cannot be played with the Bot API.'}
2023-06-19 13:02:47,777 backoff (_common.py:105) INFO Backing off play_game(...) for 0.1s (KeyError: 'id')

Lichess does not allow bots to play ultrabullet games.

The second error (and the one that's relevant to this issue) seems to happen right after the configuration parameters are sent to stockfish.

2023-06-19 13:03:04,887 chess.engine (engine.py:1049) DEBUG <UciProtocol (pid=8320)>: >> uciok
2023-06-19 13:03:04,887 chess.engine (engine.py:1023) DEBUG <UciProtocol (pid=8320)>: << setoption name Move Overhead value 100
2023-06-19 13:03:04,888 chess.engine (engine.py:1023) DEBUG <UciProtocol (pid=8320)>: << setoption name Threads value 2
2023-06-19 13:03:04,888 chess.engine (engine.py:1023) DEBUG <UciProtocol (pid=8320)>: << setoption name Hash value 2048
2023-06-19 13:03:04,888 chess.engine (engine.py:1023) DEBUG <UciProtocol (pid=8320)>: << setoption name SyzygyPath value ./syzygy/
2023-06-19 13:03:04,888 __mp_main__ (lichess-bot.py:573) DEBUG The engine for game pJRDYo7o has pid=8320
2023-06-19 13:03:04,888 __mp_main__ (lichess-bot.py:576) INFO +++ https://lichess.org/pJRDYo7o/black Bullet vs AI level 8 (pJRDYo7o)
2023-06-19 13:03:04,889 conversation (conversation.py:84) INFO *** https://lichess.org/pJRDYo7o/black [player] Chessler-V3: Hi! I'm Chessler-V3. Good luck! Type !help for a list of commands I can respond to.
2023-06-19 13:03:04,906 chess.engine (engine.py:1020) DEBUG <UciProtocol (pid=8320)>: Process exited
2023-06-19 13:03:04,906 chess.engine (engine.py:1007) DEBUG <UciProtocol (pid=8320)>: Connection lost (exit code: 1, error: None)

The engine process dies right after the setoption lines and the lichess-bot errors occurs when the dead engine is asked for a move.

I see that you are using Stockfish 10. Does this happen on later versions of Stockfish? The current version is 15.

Try the following script with your engine and let us know if the problem still occurs. The script plays a game with your engine with your config settings. If the engine dies with the script, maybe a better error message will be printed. In any case, post the debugging messages here.

import chess
import chess.engine
import logging

logging.basicConfig(level=logging.DEBUG)

engine = chess.engine.SimpleEngine.popen_uci("./path/to/your/engine")
engine.configure({
    "Move Overhead": 100,
    "Threads": 2,
    "Hash": 2048,
    "SyzygyPath": ./syzygy/})

board = chess.Board()
while not board.is_game_over():
    result = engine.play(board, chess.engine.Limit(time=0.1))
    board.push(result.move)

engine.quit()
Oqarshi commented 1 year ago

For some reason when i try it with later versions of stockfish 14 and up it has not problem allocating the ram. It must be some issue with the older versions. Thanks for the help with this error!