lichess-bot-devs / lichess-bot

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

"301 Moved Permanently" when trying to upgrade to bot #851

Closed Jaqb-Janicqi closed 11 months ago

Jaqb-Janicqi commented 11 months ago

Hello, I have created a new account and have not touched anything outside of creating an api token. When i input the api token in "token" field in config.yml (i have created config.yml by copying and renaming default), I get a console printout "Nie mo", which i assume is "Could not" in english but the output appears to be cut. When i instead run the following command in windows cmd: curl -d '' lichess.org/api/bot/account/upgrade -H "Authorization: Bearer TOKEN" I get:

<html>
<head><title>301 Moved Permanently</title></head>
<body>
<center><h1>301 Moved Permanently</h1></center>
<hr><center>nginx</center>
</body>
</html>

Steps to reproduce the behavior:

  1. run: python3 lichess-bot.py -u
  2. output "Nie mo" ("Could not" maybe) or
  3. curl -d '' lichess.org/api/bot/account/upgrade -H "Authorization: Bearer TOKEN"
  4. output: 301 Moved Permanently

Expected behavior {"ok":true}

Logs there are no logs

Desktop (please complete the following information):

Additional context As I have said, I have created a fresh account. I dont believe there was ever an account under the email address I used. Thank You for your work and help in advance :)

Images:

curl_error python3_error config_used
MarkZH commented 11 months ago

Do you have logs available in the lichess_bot_auto_logs folder in your lichess-bot directory? Those might have more information. Post the contents of the log files here.

Jaqb-Janicqi commented 11 months ago

Hi, there is no such folder in lichess-bot directory.

Jaqb-Janicqi commented 11 months ago

Hi, I have managed to solve it by specifying https before lichess domain in curl. Guess copying commands straight from forums isn't great. Anyhow I don't see why I wasn't able to upgrade with the "python3 lichess-bot.py -u" method.

MarkZH commented 11 months ago

It seems like "Nie mo" is a python error message that gets printed when something in a virtual environment fails. Can you run python by itself on the command line in an interactive session? Are you using the virtual environment when you run lichess-bot?

Jaqb-Janicqi commented 11 months ago

Hi, sorry for a delayed response. I am using an anaconda environment and have also tried running the upgrade command on base python without any environment. I can start start an interactive session in both cases.

MarkZH commented 11 months ago

What happens if you run lichess-bot with these commands?

  1. venv\Scripts\activate
  2. python3 lichess-bot.py
Jaqb-Janicqi commented 11 months ago

Hi, when I run: python3 lichess-bot.py or python3 lichess-bot.py -u i get "Nie mo". However, if I run: python lichess-bot.py or python lichess-bot.py -u i get "Exception: The engine ./engines/engine_name file does not exist.". Didn't know I needed to have an engine to upgrade the account with the repo. Thanks for Your help and have a great day!