TLE: Fatal crash on first startup, ./run.sh. "ERROR:root:Token required"

I followed all the instructions in README but still get problems when starting. I tested this on a new Digital Ocean droplet running Ubuntu Focal. I have installed all the dependencies and setup python to run as python 3.8.5. All the packages and extra Ubuntu dependencies have been installed as well.

./run.sh:

Already up to date.
Installing dependencies from lock file

No dependencies to install or update

Installing the current project: TLE (0.1.0)
ujson module not found, using json
msgpack not installed, MsgPackSerializer unavailable
10-10-2020 13:27:30:WARNING:discord.client:PyNaCl is not installed, voice will NOT be supported
10-10-2020 13:27:30:INFO:root:Cogs loaded: Graphs, Contests, Logging, CacheControl, Dueling, Starboard, CSES, Codeforces, Handles, Meta
10-10-2020 13:27:30:INFO:discord.client:logging in using static token
10-10-2020 13:27:31:INFO:discord.gateway:Created websocket connected to wss://gateway.discord.gg?encoding=json&v=6&compress=zlib-stream
10-10-2020 13:27:31:INFO:discord.gateway:Shard ID None has sent the IDENTIFY payload.
10-10-2020 13:27:31:INFO:discord.gateway:Shard ID None has connected to Gateway: ["gateway-prd-main-18ck",{"micros":69422,"calls":["discord-sessions-prd-2-32",{"micros":67670,"calls":["start_session",{"micros":51521,"calls":["api-prd-main-rgc6",{"micros":48946,"calls":["get_user",{"micros":3578},"add_authorized_ip",{"micros":4647},"get_guilds",{"micros":6731},"coros_wait",{"micros":1}]}]},"guilds_connect",{"micros":1,"calls":[]},"presence_connect",{"micros":10648,"calls":[]}]}]}] (Session ID: 58103df54cbcc9ac5ad1645f4681a2dd).
10-10-2020 13:27:33:INFO:RatingChangesCache:Ratings for 0 handles cached
10-10-2020 13:27:33:WARNING:RatingChangesCache:Rating changes cache on disk is empty. This must be populated manually before use.
10-10-2020 13:27:33:INFO:Task:Starting up task `RatingChangesCacheUpdate`.
10-10-2020 13:27:33:INFO:Task:Starting up task `RanklistCacheUpdate`.
10-10-2020 13:27:33:INFO:ContestCache:1364 contests fetched from disk
10-10-2020 13:27:33:INFO:EventSystem:Dispatching event `ContestListRefresh`
10-10-2020 13:27:33:INFO:Task:Starting up task `ContestCacheUpdate`.
10-10-2020 13:27:33:INFO:ProblemCache:5947 problems fetched from disk
10-10-2020 13:27:33:INFO:Task:Starting up task `ProblemCacheUpdate`.
10-10-2020 13:27:33:INFO:Task:Starting up task `ProblemsetCacheUpdate`.
10-10-2020 13:27:33:WARNING:tle.util.codeforces_common:JSON file containing contest writers not found
10-10-2020 13:27:33:INFO:Task:Starting up task `ContestCogUpdate`.
10-10-2020 13:27:33:INFO:Task:Starting up task `WatchRatedVCs`.
10-10-2020 13:27:33:Level 100:Logging:`*******************************************************************************`
10-10-2020 13:27:33:Level 100:Logging:`***                               Bot running                               ***`
10-10-2020 13:27:33:Level 100:Logging:`*******************************************************************************`
10-10-2020 13:27:33:INFO:Task:Starting up task `ProblemsetCacheUpdate`.
10-10-2020 13:27:33:INFO:Task:Starting up task `SetExUsersInactive`.
10-10-2020 13:27:33:INFO:tle.util.codeforces_api:Querying CF API at https://codeforces.com/api/contest.list with {}
10-10-2020 13:27:33:INFO:tle.util.codeforces_api:Querying CF API at https://codeforces.com/api/problemset.problems with {}
10-10-2020 13:27:33:INFO:ProblemsetCache:Saved 0 problems to database.
10-10-2020 13:27:33:INFO:ProblemsetCache:0 new problems saved and 0 saved problems updated.
10-10-2020 13:27:34:INFO:ContestCache:1364 contests fetched from API
10-10-2020 13:27:34:INFO:ContestCache:1364 contests stored in database
10-10-2020 13:27:34:INFO:EventSystem:Dispatching event `ContestListRefresh`
10-10-2020 13:27:34:INFO:Task:Starting up task `RanklistCacheUpdate.MonitorActiveContests`.
10-10-2020 13:27:34:INFO:Contests:Refreshed cache
10-10-2020 13:27:34:INFO:Contests:Tasks for guild 758035380057407548 cleared
10-10-2020 13:27:34:INFO:tle.util.codeforces_api:Querying CF API at https://codeforces.com/api/contest.standings with {'contestId': 1308, 'showUnofficial': 'true'}
10-10-2020 13:27:34:INFO:tle.util.codeforces_api:Querying CF API at https://codeforces.com/api/contest.standings with {'contestId': 1308}
10-10-2020 13:27:35:INFO:ProblemCache:6417 problems fetched from API
10-10-2020 13:27:35:INFO:ProblemCache:Keeping 5947 problems
10-10-2020 13:27:35:INFO:ProblemCache:5947 problems stored in database
10-10-2020 13:27:35:INFO:tle.util.codeforces_api:Querying CF API at https://codeforces.com/api/user.ratedList with {'activeOnly': 'false'}
./run.sh: line 18: 194045 Killed                  FONTCONFIG_FILE=$PWD/extra/fonts.conf poetry run python -m tle

And when running FONTCONFIG_FILE=$PWD/extra/fonts.conf poetry run python -m tle:

ujson module not found, using json
msgpack not installed, MsgPackSerializer unavailable
ERROR:root:Token required

If the last line is referring to the bot token in environment, then something has to be wrong with the bot itself since I’ve included both the bot token and the logging channel ID.

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Comments: 18 (1 by maintainers)

Most upvoted comments

Why don’t you fix that bug in the script? On sidenote that script will magically start working again after a few hrs.

Also, you should be fine with 1G of swap, 4G is pretty overkill. In any case, try running the bot itself. If the issue was memory running out it should be fine now.