Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Python problems when deploying the container fresh #80

Open
Samurai1201 opened this issue Feb 21, 2023 · 5 comments
Open

Python problems when deploying the container fresh #80

Samurai1201 opened this issue Feb 21, 2023 · 5 comments
Labels
bug Something isn't working

Comments

@Samurai1201
Copy link

When I set up Metatube completly fresh, I experienced this error and couldnt figure out why it comes up.
I used this docker run command:

docker run \
  -d \
  --name metatube \
  --restart always \
  -p 6376:5000 \
  -e PORT=5000 \
  -e HOST=0.0.0.0 \
  -v /(exchanged path)/metatube/downloads:/downloads:rw \
  -v /(exchanged path)/metatube/database:/database:rw \
  -v /(exchanged path)/metatube/migrations:/config/migrations \
  jvt038/metatube:latest

This is the error message I always got:

Traceback (most recent call last):

  File "//config/metatube.py", line 9, in <module>

    app = create_app()

  File "/config/metatube/__init__.py", line 46, in create_app

    init_db(app)

  File "/config/metatube/init/__init__.py", line 11, in init

    default.init_db()

  File "/config/metatube/init/create.py", line 72, in init_db

    self.migrations()

  File "/config/metatube/init/create.py", line 80, in migrations

    stamp(directory)

  File "/usr/local/lib/python3.9/site-packages/flask_migrate/__init__.py", line 111, in wrapped

    f(*args, **kwargs)

  File "/usr/local/lib/python3.9/site-packages/flask_migrate/__init__.py", line 259, in stamp

    command.stamp(config, revision, sql=sql, tag=tag)

  File "/usr/local/lib/python3.9/site-packages/alembic/command.py", line 671, in stamp

    script.run_env()

  File "/usr/local/lib/python3.9/site-packages/alembic/script/base.py", line 569, in run_env

    util.load_python_file(self.dir, "env.py")

  File "/usr/local/lib/python3.9/site-packages/alembic/util/pyfiles.py", line 98, in load_python_file

    raise ImportError("Can't find Python file %s" % path)

ImportError: Can't find Python file /config/migrations/env.py

I hope you can help me find my mistake, thanks

@hydrogendos
Copy link

For me, a workaround would be to set INIT_DB to False, then run these two commands
flask -A metatube.py db init
flask -A metatube.py db revision --rev-id e935a3b14ca8
and finally restart the container with INIT_DB equals to True.

I don't know exactly why this happens, but most likely there being a bug somewhere in the init process

@Dan6erbond
Copy link

Hey @hydrogendos! I came across the same issue, and wanted to run these steps. Where did you get the rev-id from? I'd like to make sure the DB is at the latest revision.

@hktari
Copy link

hktari commented May 14, 2023

same issue here

@JVT038
Copy link
Owner

JVT038 commented May 14, 2023

My apologies for the lack of maintenance and the vast amount of bugs.
I have been struggling to find sufficient motivation to fix these issues, and I can't promise anything.
I'll try to fix this and close these issues.

@JVT038 JVT038 added enhancement New feature or request bug Something isn't working and removed enhancement New feature or request labels May 15, 2023
@hktari
Copy link

hktari commented May 16, 2023 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

5 participants