Open cazar86 opened 2 months ago
@cazar86 what are you using for your bot's database and how did you generate the value for HARAMBOT_KEY? We've introduced encryption for the access_token and refresh_token columns in v0.4.0, HARAMBOT_KEY is what stores the key the bot will use to encrypt and decrypt these values. From the stack trace it looks like it might be an issue with your key. You can use the following command in bash to generate a key that fits the requirements:
head -c 32 /dev/urandom | base64 | tr -d '=' | tr '+/' '-_'
I am using linuxserver/mariadb container. Ver 15.1 Distrib 10.11.8-MariaDB. I tried to use the key provided from your command and still no luck, it doesn't create the tables in my harambot database, it is empty. The first lines I see in the log when launching the harambot container:
[2024-09-06 03:02:08] [WARNING ] discord.ext.commands.bot: Privileged message content intent is missing, commands may not work as expected.
[2024-09-06 03:02:08] [INFO ] discord.client: logging in using static token
[2024-09-06 03:02:10] [INFO ] discord.gateway: Shard ID None has connected to Gateway (Session ID: a76e61264f976799f45505402001b7ba).
[2024-09-06 03:02:12] [ERROR ] discord.client: Ignoring exception in on_ready
Traceback (most recent call last):
File "/usr/local/lib/python3.10/site-packages/peewee.py", line 3322, in execute_sql
cursor.execute(sql, params or ())
File "/usr/local/lib/python3.10/site-packages/MySQLdb/cursors.py", line 179, in execute
res = self._query(mogrified_query)
File "/usr/local/lib/python3.10/site-packages/MySQLdb/cursors.py", line 330, in _query
db.query(q)
File "/usr/local/lib/python3.10/site-packages/MySQLdb/connections.py", line 261, in query
_mysql.connection.query(self, query)
MySQLdb.OperationalError: (4161, "Unknown data type: 'NOT'")
My container variables:
-e HOST_OS="Unraid"
-e HOST_HOSTNAME="Unraid_Hostname"
-e HOST_CONTAINERNAME="Harambot"
-e 'DISCORD_TOKEN'='Discord Token'
-e 'YAHOO_KEY'='Yahoo Key'
-e 'YAHOO_SECRET'='Yahoo Secret'
-e 'DATABASE_URL'='mysql://user:password@IP:Port/harambot'
-e 'LOGLEVEL'='DEBUG'
-e 'HARAMBOT_KEY'='Key provided from command'
-e 'PORT'='10000'
-l net.unraid.docker.managed=dockerman
-l net.unraid.docker.icon='https://raw.githubusercontent.com/DMcP89/harambot/main/assests/harambot-1.jpg' 'dmcp89/harambot:latest'
Can you try generating the key using this python script?
from cryptography.fernet import Fernet fernet_key = Fernet.generate_key() print(fernet_key.decode())
Hello, this is a nice bot, and I have enjoyed using it in the past. Harambot was running last year when I configured it on Unraid. I was able to add a container and add the environment variables manually. I see there are some new variables for HARAMBOT_KEY, and it wanted a port. I was able to get the guild configured but now when I run the commands I see the following in the logs of the container: