Skip to content

Instantly share code, notes, and snippets.

@SirNanos
Last active April 5, 2023 10:55
Show Gist options
  • Save SirNanos/ec749af1f0aaeedeb0f711fd41c541a8 to your computer and use it in GitHub Desktop.
Save SirNanos/ec749af1f0aaeedeb0f711fd41c541a8 to your computer and use it in GitHub Desktop.
SirNano's Guide to Fixing Red Dashboard Errors

SirNano's Guide to Fixing Red Dashboard Errors

Before We Start

Links to keep in mind:

CogCreators/Red-DiscordBot

CogCreators/Red-Dashboard

Red Discord Bot’s documentation

Red Dashboard's documentation

Fix Norwegian Bokmål language code by psharma04 · Pull Request #72 ...

Other

This guide was tested on Ubuntu 22.04 LTS on Google Cloud.

Thanks to @XxInvictus for a better locale fix than what I had in mind :)

Guide

After the Dashboard installation (see Red Dashboard's documentation) you'll need to run a few commands not stated in the docs so that some python modules import properly. Run the following while in your Dashboard virtual enviroment:

Set proper dependency versions:

foo@bar:~$ python -m pip install "jinja2<3.1.0" werkzeug==2.0.3 flask==1.1.2 itsdangerous==2.0.1 requests==2.23.0 cryptography==3.3.2 websocket_client==0.57.0 waitress==1.4.3 rich==1.3.1 fuzzywuzzy==0.18.0 python-Levenshtein==0.12.0 flask-babel==1.0.0 pyjwt==1.7.1 appdirs==1.4.4

And the locale fix (This is for the latest Red install guides, you may need to change your python version or dashboard data directory in the command):

foo@bar:~$ cd reddashenv && grep -rl "no_NO" ./lib/python3.9/site-packages/reddash/ | xargs sed -i 's/no_NO/nb_NO/g' && mv ./lib/python3.9/site-packages/reddash/app/translations/no_NO ./lib/python3.9/site-packages/reddash/app/translations/nb_NO
@XxInvictus
Copy link

XxInvictus commented Apr 5, 2023

For completeness, this is my full flow:

$ python -m venv /dashdata && source /dashdata/bin/activate
$ python -m pip install -U pip setuptools wheel
$ python -m pip install -U Red-Dashboard
$ python -m pip install -U "jinja2<3.1.0" werkzeug==2.0.3 flask==1.1.2 itsdangerous==2.0.1 requests==2.23.0 cryptography==3.2 websocket_client==0.57.0 waitress==1.4.3 rich==1.3.1 fuzzywuzzy==0.18.0 "python-Levenshtein==0.12.0" "flask-babel==1.0.0" pyjwt==1.7.1 appdirs==1.4.4
$ cd /dashdata && grep -rl "no_NO" ./lib/python3.8/site-packages/reddash/ | xargs sed -i 's/no_NO/nb_NO/g' && mv ./lib/python3.8/site-packages/reddash/app/translations/no_NO ./lib/python3.8/site-packages/reddash/app/translations/nb_NO

@SirNanos
Copy link
Author

SirNanos commented Apr 5, 2023

For completeness, this is my full flow:

$ python -m venv /dashdata && source /dashdata/bin/activate
$ python -m pip install -U pip setuptools wheel
$ python -m pip install -U Red-Dashboard
$ python -m pip install -U "jinja2<3.1.0" werkzeug==2.0.3 flask==1.1.2 itsdangerous==2.0.1 requests==2.23.0 cryptography==3.2 websocket_client==0.57.0 waitress==1.4.3 rich==1.3.1 fuzzywuzzy==0.18.0 "python-Levenshtein==0.12.0" "flask-babel==1.0.0" pyjwt==1.7.1 appdirs==1.4.4
$ cd /dashdata && grep -rl "no_NO" ./lib/python3.8/site-packages/reddash/ | xargs sed -i 's/no_NO/nb_NO/g' && mv ./lib/python3.8/site-packages/reddash/app/translations/no_NO ./lib/python3.8/site-packages/reddash/app/translations/nb_NO

@XxInvictus I'll test this now and add it to the guide if it works :)

@SirNanos
Copy link
Author

SirNanos commented Apr 5, 2023

@XxInvictus Can confirm, your solution works way better than the one I had in mind. I'll chuck it in the gist now, thanks for your input!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment