Cog-Creators / Red-DiscordBot

A multi-function Discord bot
https://docs.discord.red
GNU General Public License v3.0
4.84k stars 2.31k forks source link

[Heroku] Audio cog not working #1126

Closed Shugabuga closed 7 years ago

Shugabuga commented 7 years ago

Type: Bug

Brief description of the problem

On a Heroku instance, Opus will not load on the default audio cog. My requirements.txt and Aptfile (using the apt build-pack) are below, and I am running python 3.5.2 with discord.py 0.16.12:

requirements.txt

git+git://github.com/Rapptz/discord.py.git#egg=discord.py[voice]
youtube_dl
imgurpython
moviepy
praw
datetime
PyNaCl
opuslib

Aptfile

libopus-dev
libssl-dev
libffi-dev
build-essential
git
ffmpeg
unzip

Expected behavior

Opus would load and the cog will function.

Actual behavior

When (re)loading the audio cog, the following error is produced:

2017-11-29T02:55:21.934272+00:00 app[shugabotdiscord.1]:   File "/app/.heroku/python/lib/python3.5/site-packages/discord/ext/commands/core.py", line 50, in wrapped
2017-11-29T02:55:21.934272+00:00 app[shugabotdiscord.1]:     ret = yield from coro(*args, **kwargs)
2017-11-29T02:55:21.934273+00:00 app[shugabotdiscord.1]:   File "/app/cogs/owner.py", line 156, in _reload
2017-11-29T02:55:21.934275+00:00 app[shugabotdiscord.1]:     self._load_cog(module)
2017-11-29T02:55:21.934276+00:00 app[shugabotdiscord.1]:   File "/app/cogs/owner.py", line 1017, in _load_cog
2017-11-29T02:55:21.934276+00:00 app[shugabotdiscord.1]:     self.bot.load_extension(mod_obj.__name__)
2017-11-29T02:55:21.934277+00:00 app[shugabotdiscord.1]:   File "/app/.heroku/python/lib/python3.5/site-packages/discord/ext/commands/bot.py", line 738, in load_extension
2017-11-29T02:55:21.934278+00:00 app[shugabotdiscord.1]:     lib.setup(self)
2017-11-29T02:55:21.934279+00:00 app[shugabotdiscord.1]:   File "/app/cogs/audio.py", line 2226, in setup
2017-11-29T02:55:21.934280+00:00 app[shugabotdiscord.1]:     "Your opus library's bitness must match your python installation's"
2017-11-29T02:55:21.934281+00:00 app[shugabotdiscord.1]: RuntimeError: Your opus library's bitness must match your python installation's bitness. They both must be either 32bit or 64bit.In other words, Opus isn't working properly. Is it installed?

Any help would be appreciated.

Electromaster232 commented 7 years ago

I'm not sure if this is still relevant, and I imagine you have heard this before, but: (From SaltBot)

Take advice at your own risk. Red isn't built for Heroku. This is due to the fact that our data structure isn't setup for it, and it won't be for a long time. It's a security risk by not commiting the token data to a env var.

One Heroku user (jamfarts) wrote: I had to set it all up first locally so that I HAD the settings TO commit. Then I had to commit the settings. I cloned the repo and committed to my own, with the /data folder and all its contents. I can't rely on it for anything time related overnight. Any changes I need to do I have to pull it down, do them locally, commit it, and restart the bot. So if I want to add to the filter list, or custom commands, I have to do that.

Basically im saying there's not a ton of support for Heroku, I'm not sure if this has anything to do with your issue, but I thought I might say it anyway

Shugabuga commented 7 years ago

@Electromaster232 I am aware of all of that, and have only had issues in regards to the audio cog (some issues, such as data persistence, is not a concern as I have most of the default cogs disabled in my instance, and don't keep any other data).

tekulvw commented 7 years ago

This is an unsupported platform for V2, as much as we'd like to help, it's not in the scope of this project atm. If you end up figuring out what's happening please post here again for other users who may run into the same issue.