pejter / dockerfiles

My Dockerfiles
0 stars 1 forks source link

upgrading removes cog dependencies #2

Closed aberrix closed 5 years ago

aberrix commented 6 years ago

Whenever I upgrade the docker image I have to reinstall cog dependencies. I have my /data and /cogs variables set and it retains my cogs, but not the pip dependencies. any ideas how to fix this?

example cogs: cryptoprice karma xkcd

aberrix commented 6 years ago

errors logs:

Traceback (most recent call last):
File "/app/cogs/owner.py", line 65, in load
self._load_cog(module)
File "/app/cogs/owner.py", line 948, in _load_cog
self.bot.load_extension(mod_obj.__name__)
File "/usr/local/lib/python3.6/site-packages/discord/ext/commands/bot.py", line 738, in load_extension
lib.setup(self)
File "/app/cogs/cryptoprice.py", line 84, in setup
raise RuntimeError("You are missing reqirements. Please run:\n"
RuntimeError: You are missing reqirements. Please run:
`pip3 install beautifulsoup4`
`pip3 install tabulate`

I can go into the docker and resolve the dependencies, but it would be nice if i didn't have to every time I upgrade the image.

pejter commented 6 years ago

Red uses it's own mechanism for keeping track of dependencies. I'll fix this sometime this week.

On Thu, 22 Mar 2018, 15:14 aberrix, notifications@github.com wrote:

errors logs:

Traceback (most recent call last): File "/app/cogs/owner.py", line 65, in load self._load_cog(module) File "/app/cogs/owner.py", line 948, in _load_cog self.bot.load_extension(mod_obj.name) File "/usr/local/lib/python3.6/site-packages/discord/ext/commands/bot.py", line 738, in load_extension lib.setup(self) File "/app/cogs/cryptoprice.py", line 84, in setup raise RuntimeError("You are missing reqirements. Please run:\n" RuntimeError: You are missing reqirements. Please run: pip3 install beautifulsoup4 pip3 install tabulate

I can go into the docker and resolve the dependencies, but it would be nice if i didn't have to every time I upgrade the image.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/pejter/dockerfiles/issues/2#issuecomment-375321017, or mute the thread https://github.com/notifications/unsubscribe-auth/ABrKma7MwBlPwFOz_0NYWsiRl8LDNZUfks5tg7G8gaJpZM4Su28I .

aberrix commented 6 years ago

I updated my docker, but the problem still exists.

aberrix commented 6 years ago

error log:

Official server: https://discord.gg/red
Make sure to keep your bot updated. Select the 'Update' option from the launcher.
[23/03/2018 08:36] ERROR owner load 74: Run `pip install tabulate` to use Karma.

Traceback (most recent call last):
File "/app/cogs/owner.py", line 65, in load
self._load_cog(module)
File "/app/cogs/owner.py", line 948, in _load_cog
self.bot.load_extension(mod_obj.__name__)
File "/usr/local/lib/python3.6/site-packages/discord/ext/commands/bot.py", line 738, in load_extension
lib.setup(self)
File "/app/cogs/karma.py", line 185, in setup
raise RuntimeError("Run `pip install tabulate` to use Karma.")
RuntimeError: Run `pip install tabulate` to use Karma.
[23/03/2018 08:37] ERROR owner load 74: You are missing reqirements. Please run:

`pip3 install beautifulsoup4`
`pip3 install tabulate`
Traceback (most recent call last):
File "/app/cogs/owner.py", line 65, in load
self._load_cog(module)
File "/app/cogs/owner.py", line 948, in _load_cog
self.bot.load_extension(mod_obj.__name__)
File "/usr/local/lib/python3.6/site-packages/discord/ext/commands/bot.py", line 738, in load_extension
lib.setup(self)
File "/app/cogs/cryptoprice.py", line 84, in setup
raise RuntimeError("You are missing reqirements. Please run:\n"
RuntimeError: You are missing reqirements. Please run:
`pip3 install beautifulsoup4`
`pip3 install tabulate`
pejter commented 6 years ago

Should be fixed now, I've made sure that the run script installs all cog dependencies found in info.json files.
Let me know if the issue appears again.

pejter commented 6 years ago

Unless you're building from the Dockerfile directly, the updated image needs time to build on docker registry. 😄 All variants just finished building and you can update now.

aberrix commented 6 years ago

unfortunately these errors are still happening. where can I verify the dependencies are listed to make sure its not the cog itself causing this?

On Fri, Mar 23, 2018 at 9:19 AM, Piotr Łuczak notifications@github.com wrote:

Unless you're building from the Dockerfile directly, the updated image needs time to build on docker registry. 😄 All variants just finished building and you can update now.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/pejter/dockerfiles/issues/2#issuecomment-375679903, or mute the thread https://github.com/notifications/unsubscribe-auth/ATDMkXDq8lQj7VUj39gClmxjE492MlSwks5thQRegaJpZM4Su28I .

aberrix commented 6 years ago

updated again, still errors

[27/03/2018 13:50] ERROR owner load 74: You are missing reqirements. Please run:

`pip3 install beautifulsoup4`
`pip3 install tabulate`
Traceback (most recent call last):
File "/app/cogs/owner.py", line 65, in load
self._load_cog(module)
File "/app/cogs/owner.py", line 948, in _load_cog
self.bot.load_extension(mod_obj.__name__)
File "/usr/local/lib/python3.6/site-packages/discord/ext/commands/bot.py", line 738, in load_extension
lib.setup(self)
File "/app/cogs/cryptoprice.py", line 84, in setup
raise RuntimeError("You are missing reqirements. Please run:\n"
RuntimeError: You are missing reqirements. Please run:
`pip3 install beautifulsoup4`
`pip3 install tabulate`
pejter commented 6 years ago

I'll investigate further, unfortunately I'm sick right now so it can take a bit.

aberrix commented 6 years ago

no rush, its not a huge issue but obnoxious none the less. hope you feel better soon!

aberrix commented 6 years ago

just checking in, any update on this? thanks in advance.

aberrix commented 6 years ago

?

pejter commented 6 years ago

I didn't get to the bottom of this and lately I haven't had time to investigate further.

pejter commented 6 years ago

Hopefully e06fbfad resolves the issue.

zelezack commented 6 years ago

new problem since updating to e06fbfa: Starting docker container shows the following error in logs:

Installing cog dependencies... Traceback (most recent call last): File "/scripts/run.py", line 46, in main() File "/scripts/run.py", line 36, in main with open(info_file) as f: NameError: name 'info_file' is not defined

Docker fails to start the container after that.

pejter commented 6 years ago

My bad, made a typo while refactoring. Fixed by 41bcf01.

zelezack commented 6 years ago

made it past there but now its:

Traceback (most recent call last): File "/scripts/run.py", line 45, in main() File "/scripts/run.py", line 32, in main if cog['INSTALLED']: TypeError: string indices must be integers

pejter commented 6 years ago

Could you send me your repos.json file? I can't reproduce the error without it as it doesn't seem to happen on my end. The file is located inside your data/downloader/ directory.

zelezack commented 6 years ago

my repo contain a couple repos that had nothing installed. I deleted them out of there so I had just an empty repos.json and now I get:

Traceback (most recent call last): File "./red.py", line 611, in bot = initialize() File "./red.py", line 241, in initialize bot = bot_class(formatter=formatter, description=description, pm_help=None) File "./red.py", line 63, in init self.logger = set_logger(self) File "./red.py", line 480, in set_logger if bot.settings.debug: AttributeError: 'Settings' object has no attribute 'debug' Installing cog dependencies...

zelezack commented 6 years ago

was all working fine until the update earlier today.

pejter commented 6 years ago

TypeError: string indices must be integers

This has been resolved by 762bb5f. However this new issue seems to be within Red itself.