Just-Some-Bots / MusicBot

:musical_note: The original MusicBot for Discord (formerly SexualRhinoceros/MusicBot)
https://just-some-bots.github.io/MusicBot/
MIT License
3.14k stars 2.36k forks source link

SSL issues when starting bot on Raspberry Pi #1563

Closed bencerda1 closed 6 years ago

bencerda1 commented 6 years ago

Please tick all applicable boxes.

Which version are you using?

What type of issue are you creating?


Description of issue

Followed the Raspberry Pi guide to a T an have been having SSL issues when starting the bot.

Steps to reproduce

Go through the instructions for Raspberry Pi I guess?


Log file

Please attach your MusicBot log file (located at logs/musicbot.log) to this issue. You can do so by dragging and dropping the file here. If you do not include your log file, you WILL be asked to provide one.

musicbot.log

AutumnClove commented 6 years ago

have a look at https://stackoverflow.com/a/45417908

bencerda1 commented 6 years ago

I'll try it, but I wasn't having issues with pip, I was having issues following me launching the bot via 'sudo python3.5 run.py' in the bot dir. Will report back and see how it goes.

On Fri, Mar 30, 2018, 3:33 AM Winter notifications@github.com wrote:

have a look at https://stackoverflow.com/a/45417908

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/Just-Some-Bots/MusicBot/issues/1563#issuecomment-377466758, or mute the thread https://github.com/notifications/unsubscribe-auth/AO8ROY5Wkrz7BuKapMIXSkX-6YxyyuaQks5tjd_agaJpZM4TBZYH .

AutumnClove commented 6 years ago

Oh I just read the ssl error part, thought it might be related.

bencerda1 commented 6 years ago

So, that solution didn't work in my case.

GeoZzNL commented 6 years ago

I am reposting this comment. PIP does not work on pi using python 3.5!

I also had al lot of issues on my pi3. Download Python-3.6.1.tar.xz from https://www.python.org/

Unzip the file and keep the folder in home directory.

Open terminal in that directory and perform the following commands: ./configure make make test sudo make install This will install Python 3.6 but pip3 may not be working.Install necessary modules using: sudo apt-get install libreadline-gplv2-dev libncursesw5-dev libssl-dev libsqlite3-dev tk-dev libgdbm-dev libc6-dev libbz2-dev

Now write the following to re run the installation (EDIT: USE -j4 FOR ALL CORES, WHICH IS ACTUALLY JUST 50% CPU): sudo make sudo make install

Now this, even if its again... (If pip3 is not working try pip) sudo pip3 install numpy sudo apt-get install libreadline-gplv2-dev libncursesw5-dev libssl-dev libsqlite3-dev tk-dev libgdbm-dev libc6-dev libbz2-dev

If not working, do not uninstall a thing but follow the ubuntu 16 guide.

Then try some of my codes again.

I do not have a really good guide because i tried installing the bot and it tooks more than 3 days. Some of these codes fixed it for me. Running 3 bots using python3.6

MattBSG commented 6 years ago

@GeoZzNL We do currently support using python3.6.x due to a few incompatibilities. Instead of doing what you said, why not just install pip separately? https://pip.pypa.io/en/stable/installing/

MattBSG commented 6 years ago

@bencerda1 Please try updating your dependencies + bot and let me know if that fixes it for you

GeoZzNL commented 6 years ago

Pip command does not work on pi3 with python3.5. Installing pip on python3.6 will work.

# Build Python from scratch
cd ~
wget https://www.python.org/ftp/python/3.6.1/Python-3.6.1.tgz
tar -zxvf Python-3.6.1.tgz
cd Python-3.6.1
./configure
sudo make  # add -j4 to the end of this if you have a quad-core Raspberry Pi
sudo make install

# Install pip
cd ~
wget https://bootstrap.pypa.io/get-pip.py
sudo python3.6 get-pip.py

You can try this for pip ssl error on PI

bencerda1 commented 6 years ago

@MattBSG Updated dependencies and bot, no change @GeoZzNL The issue isn't with pip, pip runs just fine with python3.5 in my case and successfully completes the required tasks in the Raspberry Pi guide without issue.

GeoZzNL commented 6 years ago

Allright. I just got a SSL error using python 3.5. If still so, please try 3.6.

AleanaA commented 6 years ago

281 seems to have a similar issue, with a solution.

You can try installing this SSL certificate and seeing if it makes a difference: https://support.comodo.com/index.php?/Knowledgebase/Article/GetAttachment/969/821026

bencerda1 commented 6 years ago

Any idea how I can install the certificate?

AleanaA commented 6 years ago

https://askubuntu.com/questions/73287/how-do-i-install-a-root-certificate This has a pretty decent guide on how to install certs, and should work perfectly fine on RPi

bencerda1 commented 6 years ago

Unfortunately installing the certificate did not change the result on either 3.5 or 3.6. I included another logfile in case the errors have changed since I posted the issue. musicbot.log

EDIT: Just for clarification for everyone, SSL is not an issue with other things, I can run chromium, get to the discord website, and login just fine. I also run flight tracking that syncs to online services like FlightRadar24 and Flightaware and those no doubt use SSL. And, to reiterate, pip works just fine.

ImthePeach commented 6 years ago

If this is still an issue for you, it's probably because you are having an issue with pip. Try installing via the methods listed here: https://pip.pypa.io/en/stable/installing/ note: ensure you are using python 3.5 due to 3.6 having dependency issues with the music bot.

also, flight radar is pretty neat used it on occasion when flying helicopters

bencerda1 commented 6 years ago

Still an issue, and pip does not have any issues on 3.5. Issue occurs when I attempt to launch the bot with "sudo python3.5 run.py" the SSL issue occurs.

bencerda1 commented 6 years ago

So, just an update. It seems to have been an issue with the way the guide had you building from source that didn't include SSL support. I notice the guide no longer tries to build it from source and assumes Python3.x is installed (was not by default on Stretch full). Figured this out when trying to get something else working that required Python's SSL feature and it didn't work. So, basically I nuked any instance of Python from Raspbian (including 2.7 which comes with Stretch) and reinstalled it via apt-get (which installs 3.5.3). This happened a month or so ago, and only now got around to updating this, so I don't remember the name of the package I used specifically.