lichess-bot-devs / lichess-bot

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

/engines/stockfish/ #file does not exist #970

Closed realBravo closed 3 weeks ago

realBravo commented 1 month ago
ERROR MESSAGE: /Users/josebravosango/Library/Python/3.9/lib/python/site-packages/urllib3/__init__.py:34: NotOpenSSLWarning: urllib3 v2 only supports OpenSSL 1.1.1+, currently the 'ssl' module is compiled with 'LibreSSL 2.8.3'. See: https://github.com/urllib3/urllib3/issues/3020
  warnings.warn(
[05/30/24 12:06:15] INFO                                                                                               lichess-bot.py:1026
                                 .   _/|                                                                                                  
                                 .  // o\                                                                                                 
                                 .  || ._)  lichess-bot 2024.1.5.1                                                                        
                                 .  //__\                                                                                                 
                                 .  )___(   Play on Lichess with a bot                                                                    

                    ERROR    Quitting lichess-bot due to an error:                                                     lichess-bot.py:1094
                             Traceback (most recent call last):                                                                           
                               File "/Users/josebravosango/code/chess/lichess-bot/venv/lichess-bot/lichess-bot.py",                       
                             line 1091, in <module>                                                                                       
                                 start_lichess_bot()                                                                                      
                               File "/Users/josebravosango/code/chess/lichess-bot/venv/lichess-bot/lichess-bot.py",                       
                             line 1028, in start_lichess_bot                                                                              
                                 CONFIG = load_config(args.config or "./config.yml")                                                      
                               File "/Users/josebravosango/code/chess/lichess-bot/venv/lichess-bot/config.py", line                       
                             380, in load_config                                                                                          
                                 validate_config(CONFIG)                                                                                  
                               File "/Users/josebravosango/code/chess/lichess-bot/venv/lichess-bot/config.py", line                       
                             282, in validate_config                                                                                      
                                 config_assert(os.path.isfile(engine) or CONFIG["engine"]["protocol"] == "homemade",                      
                               File "/Users/josebravosango/code/chess/lichess-bot/venv/lichess-bot/config.py", line                       
                             85, in config_assert                                                                                         
                                 raise Exception(error_message)                                                                           
                             Exception: The engine ./engines/stockfish-android-armv8 file does not exist. 

There seems to be an issues with finding the engine. I was thinking about adding and extention to it but since its Unix thats not a thing

AttackingOrDefending commented 1 month ago

If lichess-bot is in /Users/josebravosango/code/chess/lichess-bot/venv/lichess-bot/lichess-bot.py then the engine should be in /Users/josebravosango/code/chess/lichess-bot/venv/lichess-bot/engines/stockfish-android-armv8.

Some other notes:

realBravo commented 1 month ago

it is there but it like this: /Users/josebravosango/code/chess/lichess-bot/venv/lichess-bot/engines/stockfish/stockfish-android-armv8

realBravo commented 1 month ago

in the config file should i have it like ./engines/stockfish/ and the name as stockfish-android-armv8

AttackingOrDefending commented 1 month ago

in the config file should i have it like ./engines/stockfish/ and the name as stockfish-android-armv8

Yes.

realBravo commented 1 month ago

Then why is it saying the file doesn't exist

AttackingOrDefending commented 1 month ago

Can you upload the logs from /Users/josebravosango/code/chess/lichess-bot/venv/lichess-bot/lichess_bot_auto_logs\recent.log, so we can look into it further?

realBravo commented 1 month ago
2024-05-30 12:06:15,476 __main__ (lichess-bot.py:1026) INFO 
    .   _/|
    .  // o\
    .  || ._)  lichess-bot 2024.1.5.1
    .  //__\
    .  )___(   Play on Lichess with a bot

2024-05-30 12:06:15,496 config (config.py:261) DEBUG Config:
token: logger
url: https://lichess.org/
engine:
  dir: ./engines/
  name: stockfish-android-armv8
  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: 20
  draw_or_resign:
    resign_enabled: false
    resign_score: -1000
    resign_for_egtb_minus_two: true
    resign_moves: 3
    offer_draw_enabled: true
    offer_draw_score: 0
    offer_draw_for_egtb_zero: true
    offer_draw_moves: 10
    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: best
      max_score_difference: 50
      min_depth: 20
      min_knodes: 0
    lichess_opening_explorer:
      enabled: false
      min_time: 20
      source: masters
      player_name: ''
      sort: winrate
      min_games: 10
    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: 4
    Hash: 512
    SyzygyPath: ./syzygy/
    UCI_ShowWDL: true
  silence_stderr: false
abort_time: 30
fake_think_time: false
rate_limiting_delay: 0
move_overhead: 2000
correspondence:
  move_time: 60
  checkin_period: 300
  disconnect_time: 150
  ponder: false
challenge:
  concurrency: 1
  sort_by: best
  accept_bot: true
  only_bot: false
  max_increment: 20
  min_increment: 0
  max_base: 1800
  min_base: 0
  max_days: 14
  min_days: 1
  variants:
  - standard
  time_controls:
  - bullet
  - blitz
  - rapid
  - classical
  modes:
  - casual
  - rated
  bullet_requires_increment: false
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
  - 180
  challenge_increment:
  - 1
  - 2
  opponent_rating_difference: 300
  rating_preference: none
  opponent_allow_tos_violation: false
  challenge_mode: random
  challenge_filter: none

2024-05-30 12:06:15,496 config (config.py:262) DEBUG ====================
2024-05-30 12:06:15,500 config (config.py:261) DEBUG Config:
token: logger
url: https://lichess.org/
engine:
  dir: ./engines/
  name: stockfish-android-armv8
  working_dir: /Users/josebravosango/code/chess/lichess-bot/venv/lichess-bot
  protocol: uci
  ponder: true
  polyglot:
    enabled: false
    book:
      standard:
      - engines/book1.bin
      - engines/book2.bin
    min_weight: 1
    selection: weighted_random
    max_depth: 20
  draw_or_resign:
    resign_enabled: false
    resign_score: -1000
    resign_for_egtb_minus_two: true
    resign_moves: 3
    offer_draw_enabled: true
    offer_draw_score: 0
    offer_draw_for_egtb_zero: true
    offer_draw_moves: 10
    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: best
      max_score_difference: 50
      min_depth: 20
      min_knodes: 0
    lichess_opening_explorer:
      enabled: false
      min_time: 20
      source: masters
      player_name: ''
      sort: winrate
      min_games: 10
    online_egtb:
      enabled: false
      min_time: 20
      max_pieces: 7
      source: lichess
      move_quality: best
    max_depth: .inf
  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: 4
    Hash: 512
    SyzygyPath: ./syzygy/
    UCI_ShowWDL: true
  silence_stderr: false
  uci_ponder: false
abort_time: 30
fake_think_time: false
rate_limiting_delay: 0
move_overhead: 2000
correspondence:
  move_time: 60
  checkin_period: 300
  disconnect_time: 150
  ponder: false
  uci_ponder: false
challenge:
  concurrency: 1
  sort_by: best
  accept_bot: true
  only_bot: false
  max_increment: 20
  min_increment: 0
  max_base: 1800
  min_base: 0
  max_days: 14
  min_days: 1
  variants:
  - standard
  time_controls:
  - bullet
  - blitz
  - rapid
  - classical
  modes:
  - casual
  - rated
  bullet_requires_increment: false
  block_list: []
  allow_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
  - 180
  challenge_increment:
  - 1
  - 2
  opponent_rating_difference: 300
  rating_preference: none
  opponent_allow_tos_violation: false
  challenge_mode: random
  challenge_filter: none
  block_list: []
  challenge_days:
  - null
  opponent_min_rating: 600
  opponent_max_rating: 4000
  overrides: {}
pgn_file_grouping: game

2024-05-30 12:06:15,500 config (config.py:262) DEBUG ====================
2024-05-30 12:06:15,500 __main__ (lichess-bot.py:1094) ERROR Quitting lichess-bot due to an error:
Traceback (most recent call last):
  File "/Users/josebravosango/code/chess/lichess-bot/venv/lichess-bot/lichess-bot.py", line 1091, in <module>
    start_lichess_bot()
  File "/Users/josebravosango/code/chess/lichess-bot/venv/lichess-bot/lichess-bot.py", line 1028, in start_lichess_bot
    CONFIG = load_config(args.config or "./config.yml")
  File "/Users/josebravosango/code/chess/lichess-bot/venv/lichess-bot/config.py", line 380, in load_config
    validate_config(CONFIG)
  File "/Users/josebravosango/code/chess/lichess-bot/venv/lichess-bot/config.py", line 282, in validate_config
    config_assert(os.path.isfile(engine) or CONFIG["engine"]["protocol"] == "homemade",
  File "/Users/josebravosango/code/chess/lichess-bot/venv/lichess-bot/config.py", line 85, in config_assert
    raise Exception(error_message)
Exception: The engine ./engines/stockfish-android-armv8 file does not exist.
AttackingOrDefending commented 1 month ago

In config.yml change dir: ./engines/ to dir: "./engines/stockfish/".

realBravo commented 1 month ago
2024-05-31 06:32:50,452 __main__ (lichess-bot.py:1026) INFO 
    .   _/|
    .  // o\
    .  || ._)  lichess-bot 2024.1.5.1
    .  //__\
    .  )___(   Play on Lichess with a bot

2024-05-31 06:32:50,508 config (config.py:261) DEBUG Config:
token: logger
url: https://lichess.org/
engine:
  dir: ./engines/stockfish
  name: stockfish-android-armv8
  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: 20
  draw_or_resign:
    resign_enabled: false
    resign_score: -1000
    resign_for_egtb_minus_two: true
    resign_moves: 3
    offer_draw_enabled: true
    offer_draw_score: 0
    offer_draw_for_egtb_zero: true
    offer_draw_moves: 10
    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: best
      max_score_difference: 50
      min_depth: 20
      min_knodes: 0
    lichess_opening_explorer:
      enabled: false
      min_time: 20
      source: masters
      player_name: ''
      sort: winrate
      min_games: 10
    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: 4
    Hash: 512
    SyzygyPath: ./syzygy/
    UCI_ShowWDL: true
  silence_stderr: false
abort_time: 30
fake_think_time: false
rate_limiting_delay: 0
move_overhead: 2000
correspondence:
  move_time: 60
  checkin_period: 300
  disconnect_time: 150
  ponder: false
challenge:
  concurrency: 1
  sort_by: best
  accept_bot: true
  only_bot: false
  max_increment: 20
  min_increment: 0
  max_base: 1800
  min_base: 0
  max_days: 14
  min_days: 1
  variants:
  - standard
  time_controls:
  - bullet
  - blitz
  - rapid
  - classical
  modes:
  - casual
  - rated
  bullet_requires_increment: false
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
  - 180
  challenge_increment:
  - 1
  - 2
  opponent_rating_difference: 300
  rating_preference: none
  opponent_allow_tos_violation: false
  challenge_mode: random
  challenge_filter: none

2024-05-31 06:32:50,508 config (config.py:262) DEBUG ====================
2024-05-31 06:32:50,515 config (config.py:261) DEBUG Config:
token: logger
url: https://lichess.org/
engine:
  dir: ./engines/stockfish
  name: stockfish-android-armv8
  working_dir: /Users/josebravosango/code/chess/lichess-bot/venv/lichess-bot
  protocol: uci
  ponder: true
  polyglot:
    enabled: false
    book:
      standard:
      - engines/book1.bin
      - engines/book2.bin
    min_weight: 1
    selection: weighted_random
    max_depth: 20
  draw_or_resign:
    resign_enabled: false
    resign_score: -1000
    resign_for_egtb_minus_two: true
    resign_moves: 3
    offer_draw_enabled: true
    offer_draw_score: 0
    offer_draw_for_egtb_zero: true
    offer_draw_moves: 10
    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: best
      max_score_difference: 50
      min_depth: 20
      min_knodes: 0
    lichess_opening_explorer:
      enabled: false
      min_time: 20
      source: masters
      player_name: ''
      sort: winrate
      min_games: 10
    online_egtb:
      enabled: false
      min_time: 20
      max_pieces: 7
      source: lichess
      move_quality: best
    max_depth: .inf
  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: 4
    Hash: 512
    SyzygyPath: ./syzygy/
    UCI_ShowWDL: true
  silence_stderr: false
  uci_ponder: false
abort_time: 30
fake_think_time: false
rate_limiting_delay: 0
move_overhead: 2000
correspondence:
  move_time: 60
  checkin_period: 300
  disconnect_time: 150
  ponder: false
  uci_ponder: false
challenge:
  concurrency: 1
  sort_by: best
  accept_bot: true
  only_bot: false
  max_increment: 20
  min_increment: 0
  max_base: 1800
  min_base: 0
  max_days: 14
  min_days: 1
  variants:
  - standard
  time_controls:
  - bullet
  - blitz
  - rapid
  - classical
  modes:
  - casual
  - rated
  bullet_requires_increment: false
  block_list: []
  allow_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
  - 180
  challenge_increment:
  - 1
  - 2
  opponent_rating_difference: 300
  rating_preference: none
  opponent_allow_tos_violation: false
  challenge_mode: random
  challenge_filter: none
  block_list: []
  challenge_days:
  - null
  opponent_min_rating: 600
  opponent_max_rating: 4000
  overrides: {}
pgn_file_grouping: game

2024-05-31 06:32:50,516 config (config.py:262) DEBUG ====================
2024-05-31 06:32:50,516 __main__ (lichess-bot.py:1029) INFO Checking engine configuration ...
2024-05-31 06:32:50,520 engine_wrapper (engine_wrapper.py:67) DEBUG Starting engine: ['/Users/josebravosango/code/chess/lichess-bot/venv/lichess-bot/engines/stockfish/stockfish-android-armv8']
2024-05-31 06:32:50,520 asyncio (selector_events.py:59) DEBUG Using selector: KqueueSelector
2024-05-31 06:32:50,521 chess.engine (engine.py:170) DEBUG Using PollingChildWatcher
2024-05-31 06:32:50,524 __main__ (lichess-bot.py:1094) ERROR Quitting lichess-bot due to an error:
Traceback (most recent call last):
  File "/Users/josebravosango/code/chess/lichess-bot/venv/lichess-bot/lichess-bot.py", line 1091, in <module>
    start_lichess_bot()
  File "/Users/josebravosango/code/chess/lichess-bot/venv/lichess-bot/lichess-bot.py", line 1030, in start_lichess_bot
    with engine_wrapper.create_engine(CONFIG):
  File "/Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.9/lib/python3.9/contextlib.py", line 117, in __enter__
    return next(self.gen)
  File "/Users/josebravosango/code/chess/lichess-bot/venv/lichess-bot/engine_wrapper.py", line 68, in create_engine
    engine = Engine(commands, options, stderr, cfg.draw_or_resign, cwd=cfg.working_dir)
  File "/Users/josebravosango/code/chess/lichess-bot/venv/lichess-bot/engine_wrapper.py", line 461, in __init__
    self.engine = chess.engine.SimpleEngine.popen_uci(commands, timeout=10., debug=False, setpgrp=False, stderr=stderr,
  File "/Users/josebravosango/Library/Python/3.9/lib/python/site-packages/chess/engine.py", line 3054, in popen_uci
    return cls.popen(UciProtocol, command, timeout=timeout, debug=debug, setpgrp=setpgrp, **popen_args)
  File "/Users/josebravosango/Library/Python/3.9/lib/python/site-packages/chess/engine.py", line 3046, in popen
    return run_in_background(background, name=f"{cls.__name__} (command={command!r})", debug=debug)
  File "/Users/josebravosango/Library/Python/3.9/lib/python/site-packages/chess/engine.py", line 201, in run_in_background
    return future.result()
  File "/Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.9/lib/python3.9/concurrent/futures/_base.py", line 445, in result
    return self.__get_result()
  File "/Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.9/lib/python3.9/concurrent/futures/_base.py", line 390, in __get_result
    raise self._exception
  File "/Users/josebravosango/Library/Python/3.9/lib/python/site-packages/chess/engine.py", line 195, in background
    asyncio.run(coroutine(future))
  File "/Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.9/lib/python3.9/asyncio/runners.py", line 44, in run
    return loop.run_until_complete(main)
  File "/Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.9/lib/python3.9/asyncio/base_events.py", line 642, in run_until_complete
    return future.result()
  File "/Users/josebravosango/Library/Python/3.9/lib/python/site-packages/chess/engine.py", line 3034, in background
    transport, protocol = await Protocol.popen(command, setpgrp=setpgrp, **popen_args)
  File "/Users/josebravosango/Library/Python/3.9/lib/python/site-packages/chess/engine.py", line 1320, in popen
    return await asyncio.get_running_loop().subprocess_exec(cls, *command, **popen_args)
  File "/Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.9/lib/python3.9/asyncio/base_events.py", line 1661, in subprocess_exec
    transport = await self._make_subprocess_transport(
  File "/Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.9/lib/python3.9/asyncio/unix_events.py", line 197, in _make_subprocess_transport
    transp = _UnixSubprocessTransport(self, protocol, args, shell,
  File "/Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.9/lib/python3.9/asyncio/base_subprocess.py", line 36, in __init__
    self._start(args=args, shell=shell, stdin=stdin, stdout=stdout,
  File "/Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.9/lib/python3.9/asyncio/unix_events.py", line 789, in _start
    self._proc = subprocess.Popen(
  File "/Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.9/lib/python3.9/subprocess.py", line 951, in __init__
    self._execute_child(args, executable, preexec_fn, close_fds,
  File "/Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.9/lib/python3.9/subprocess.py", line 1821, in _execute_child
    raise child_exception_type(errno_num, err_msg, err_filename)
OSError: [Errno 8] Exec format error: '/Users/josebravosango/code/chess/lichess-bot/venv/lichess-bot/engines/stockfish/stockfish-android-armv8'
realBravo commented 1 month ago

format error

realBravo commented 1 month ago

Hello?

MarkZH commented 1 month ago

Are you sure you want to use the ARM version of stockfish (which is for android) and not the one for MacOS? The directories in your log postings look like you're running a Mac.

realBravo commented 1 month ago

i changed to the macos version how do i change my account to a bot

MarkZH commented 1 month ago

Make sure you have a token with the correct permissions:

https://github.com/lichess-bot-devs/lichess-bot/wiki/How-to-create-a-Lichess-OAuth-token

Convert the account into a bot account:

https://github.com/lichess-bot-devs/lichess-bot/wiki/Upgrade-to-a-BOT-account

realBravo commented 1 month ago

i got everything setup but no games are being played

MarkZH commented 1 month ago

You can set enable_matchmaking to true so that your bot will challenge other bots. Otherwise, your bot will wait for another player to challenge it.

MarkZH commented 3 weeks ago

If you still need help, feel free to reopen this issue.