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

Can't running in docker #67

Open
nmuxiang opened this issue Nov 12, 2024 · 1 comment
Open

Can't running in docker #67

nmuxiang opened this issue Nov 12, 2024 · 1 comment

Comments

@nmuxiang
Copy link

I try to use postgres and mariadb in compose.yaml, but none of them can work.
This is my compose.yaml with mariadb:
mysql
and when I'm login with username and password of database, I got 500 Internal error. the log of container:

gnucash  | [2024-11-12 05:19:55 +0000] [1] [INFO] Starting gunicorn 23.0.0
gnucash  | [2024-11-12 05:19:55 +0000] [1] [INFO] Listening at: http://0.0.0.0:8000 (1)
gnucash  | [2024-11-12 05:19:55 +0000] [1] [INFO] Using worker: sync
gnucash  | [2024-11-12 05:19:55 +0000] [7] [INFO] Booting worker with pid: 7
gnucash  | /usr/local/lib/python3.11/site-packages/tzlocal/unix.py:193: UserWarning: Can not find any timezone configuration, defaulting to UTC.
gnucash  |   warnings.warn("Can not find any timezone configuration, defaulting to UTC.")
gnucash  | /srv/encrypted_session/__init__.py:42: SyntaxWarning: "is not" with a literal. Did you mean "!="?
gnucash  |   if (len (itup) is not 4):
gnucash  | [2024-11-12 05:20:20,671] ERROR in app: Exception on /auth/login [POST]
gnucash  | Traceback (most recent call last):
gnucash  |   File "/usr/local/lib/python3.11/site-packages/flask/app.py", line 2529, in wsgi_app
gnucash  |     response = self.full_dispatch_request()
gnucash  |                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
gnucash  |   File "/usr/local/lib/python3.11/site-packages/flask/app.py", line 1825, in full_dispatch_request
gnucash  |     rv = self.handle_user_exception(e)
gnucash  |          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
gnucash  |   File "/usr/local/lib/python3.11/site-packages/flask/app.py", line 1823, in full_dispatch_request
gnucash  |     rv = self.dispatch_request()
gnucash  |          ^^^^^^^^^^^^^^^^^^^^^^^
gnucash  |   File "/usr/local/lib/python3.11/site-packages/flask/app.py", line 1799, in dispatch_request
gnucash  |     return self.ensure_sync(self.view_functions[rule.endpoint])(**view_args)
gnucash  |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
gnucash  |   File "/srv/gnucash_web/auth.py", line 72, in login
gnucash  |     authenticate(request.form['username'], request.form['password'])
gnucash  |   File "/srv/gnucash_web/auth.py", line 31, in authenticate
gnucash  |     with open_book(uri_conn=app.config.DB_URI(username, password),
gnucash  |   File "/usr/local/lib/python3.11/contextlib.py", line 137, in __enter__
gnucash  |     return next(self.gen)
gnucash  |            ^^^^^^^^^^^^^^
gnucash  |   File "/srv/gnucash_web/utils/gnucash.py", line 66, in open_book
gnucash  |     with piecash.open_book(*args, **kwargs) as book:
gnucash  |          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
gnucash  |   File "/usr/local/lib/python3.11/site-packages/piecash/core/session.py", line 408, in open_book
gnucash  |     if check_exists and not database_exists(uri_conn):
gnucash  |                             ^^^^^^^^^^^^^^^^^^^^^^^^^
gnucash  |   File "/usr/local/lib/python3.11/site-packages/sqlalchemy_utils/functions/database.py", line 495, in database_exists
gnucash  |     engine = sa.create_engine(url)
gnucash  |              ^^^^^^^^^^^^^^^^^^^^^
gnucash  |   File "<string>", line 2, in create_engine
gnucash  |   File "/usr/local/lib/python3.11/site-packages/sqlalchemy/util/deprecations.py", line 375, in warned
gnucash  |     return fn(*args, **kwargs)
gnucash  |            ^^^^^^^^^^^^^^^^^^^
gnucash  |   File "/usr/local/lib/python3.11/site-packages/sqlalchemy/engine/create.py", line 544, in create_engine
gnucash  |     dbapi = dialect_cls.dbapi(**dbapi_args)
gnucash  |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
gnucash  |   File "/usr/local/lib/python3.11/site-packages/sqlalchemy/dialects/mysql/mysqldb.py", line 150, in dbapi
gnucash  |     return __import__("MySQLdb")
gnucash  |            ^^^^^^^^^^^^^^^^^^^^^
gnucash  |   File "/usr/local/lib/python3.11/site-packages/MySQLdb/__init__.py", line 17, in <module>
gnucash  |     from . import _mysql
gnucash  | ImportError: Error loading shared library libmariadb.so.3: No such file or directory (needed by /usr/local/lib/python3.11/site-packages/MySQLdb/_mysql.cpython-311-x86_64-linux-musl.so)

END OF LINE

When I use postgres, the compose.yaml:
postgres
When I'm login, I got same 500 Internal error , and the log of container :

gnucash  | [2024-11-12 05:33:28 +0000] [1] [INFO] Starting gunicorn 23.0.0
gnucash  | [2024-11-12 05:33:28 +0000] [1] [INFO] Listening at: http://0.0.0.0:8000 (1)
gnucash  | [2024-11-12 05:33:28 +0000] [1] [INFO] Using worker: sync
gnucash  | [2024-11-12 05:33:28 +0000] [7] [INFO] Booting worker with pid: 7
gnucash  | /usr/local/lib/python3.11/site-packages/tzlocal/unix.py:193: UserWarning: Can not find any timezone configuration, defaulting to UTC.
gnucash  |   warnings.warn("Can not find any timezone configuration, defaulting to UTC.")
gnucash  | /srv/encrypted_session/__init__.py:42: SyntaxWarning: "is not" with a literal. Did you mean "!="?
gnucash  |   if (len (itup) is not 4):
gnucash  | [2024-11-12 05:33:51,230] ERROR in app: Exception on /auth/login [POST]
gnucash  | Traceback (most recent call last):
gnucash  |   File "/usr/local/lib/python3.11/site-packages/flask/app.py", line 2529, in wsgi_app
gnucash  |     response = self.full_dispatch_request()
gnucash  |                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
gnucash  |   File "/usr/local/lib/python3.11/site-packages/flask/app.py", line 1825, in full_dispatch_request
gnucash  |     rv = self.handle_user_exception(e)
gnucash  |          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
gnucash  |   File "/usr/local/lib/python3.11/site-packages/flask/app.py", line 1823, in full_dispatch_request
gnucash  |     rv = self.dispatch_request()
gnucash  |          ^^^^^^^^^^^^^^^^^^^^^^^
gnucash  |   File "/usr/local/lib/python3.11/site-packages/flask/app.py", line 1799, in dispatch_request
gnucash  |     return self.ensure_sync(self.view_functions[rule.endpoint])(**view_args)
gnucash  |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
gnucash  |   File "/srv/gnucash_web/auth.py", line 72, in login
gnucash  |     authenticate(request.form['username'], request.form['password'])
gnucash  |   File "/srv/gnucash_web/auth.py", line 31, in authenticate
gnucash  |     with open_book(uri_conn=app.config.DB_URI(username, password),
gnucash  |   File "/usr/local/lib/python3.11/contextlib.py", line 137, in __enter__
gnucash  |     return next(self.gen)
gnucash  |            ^^^^^^^^^^^^^^
gnucash  |   File "/srv/gnucash_web/utils/gnucash.py", line 66, in open_book
gnucash  |     with piecash.open_book(*args, **kwargs) as book:
gnucash  |          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
gnucash  |   File "/usr/local/lib/python3.11/site-packages/piecash/core/session.py", line 408, in open_book
gnucash  |     if check_exists and not database_exists(uri_conn):
gnucash  |                             ^^^^^^^^^^^^^^^^^^^^^^^^^
gnucash  |   File "/usr/local/lib/python3.11/site-packages/sqlalchemy_utils/functions/database.py", line 479, in database_exists
gnucash  |     dialect_name = url.get_dialect().name
gnucash  |                    ^^^^^^^^^^^^^^^^^
gnucash  |   File "/usr/local/lib/python3.11/site-packages/sqlalchemy/engine/url.py", line 680, in get_dialect
gnucash  |     entrypoint = self._get_entrypoint()
gnucash  |                  ^^^^^^^^^^^^^^^^^^^^^^
gnucash  |   File "/usr/local/lib/python3.11/site-packages/sqlalchemy/engine/url.py", line 662, in _get_entrypoint
gnucash  |     cls = registry.load(name)
gnucash  |           ^^^^^^^^^^^^^^^^^^^
gnucash  |   File "/usr/local/lib/python3.11/site-packages/sqlalchemy/util/langhelpers.py", line 343, in load
gnucash  |     raise exc.NoSuchModuleError(
gnucash  | sqlalchemy.exc.NoSuchModuleError: Can't load plugin: sqlalchemy.dialects:postgres

END OF LINE

I don't know where is wrong, could anyone tell me? Thanks!

@joshuabach
Copy link
Owner

Hi jjjasont,

thanks for your interest. I must admit, I have never actually used the docker integration myself, this was contributed by @Freddo3000 .

I think the docker setup was only ever tested with sqlite and postgres (see the two compose files in the repo), and never with mariadb.

Your error messages look like there is some library missing or at a wrong version inside the container. Your compose snippets seem to be missing definitions for the database services, though I don't know if you just didn't include that in the example.

You could try running one of the compose files from the repo as-is, and see if that work. Otherwise I can only recommend running gnucash web natively without docker. That's how I do it 😉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants