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

[v1.0.0b] - Missing libldap_r-2.4.so.2 library for LDAP #1774

Closed
5 tasks done
ERLKDev opened this issue Oct 26, 2022 · 3 comments · Fixed by #2107
Closed
5 tasks done

[v1.0.0b] - Missing libldap_r-2.4.so.2 library for LDAP #1774

ERLKDev opened this issue Oct 26, 2022 · 3 comments · Fixed by #2107

Comments

@ERLKDev
Copy link
Contributor

ERLKDev commented Oct 26, 2022

First Check

  • This is not a feature request
  • I added a very descriptive title to this issue.
  • I used the GitHub search to find a similar issue and didn't find it.
  • I searched the Mealie documentation, with the integrated search.
  • I already read the docs and didn't find an answer.

What is the issue you are experiencing?

When using LDAP as authentication method, the following error is given in the log:

ImportError: libldap_r-2.4.so.2: cannot open shared object file: No such file or directory File "/opt/pysetup/.venv/lib/python3.10/site-packages/starlette/middleware/gzip.py", line 24, in __call__ await responder(scope, receive, send) File "/opt/pysetup/.venv/lib/python3.10/site-packages/starlette/middleware/gzip.py", line 43, in __call__ await self.app(scope, receive, self.send_with_gzip) File "/opt/pysetup/.venv/lib/python3.10/site-packages/starlette/middleware/exceptions.py", line 75, in __call__ raise exc File "/opt/pysetup/.venv/lib/python3.10/site-packages/starlette/middleware/exceptions.py", line 64, in __call__ await self.app(scope, receive, sender) File "/opt/pysetup/.venv/lib/python3.10/site-packages/fastapi/middleware/asyncexitstack.py", line 21, in __call__ raise e File "/opt/pysetup/.venv/lib/python3.10/site-packages/fastapi/middleware/asyncexitstack.py", line 18, in __call__ await self.app(scope, receive, send) File "/opt/pysetup/.venv/lib/python3.10/site-packages/starlette/routing.py", line 680, in __call__ await route.handle(scope, receive, send) File "/opt/pysetup/.venv/lib/python3.10/site-packages/starlette/routing.py", line 275, in handle await self.app(scope, receive, send) File "/opt/pysetup/.venv/lib/python3.10/site-packages/starlette/routing.py", line 65, in app response = await func(request) File "/opt/pysetup/.venv/lib/python3.10/site-packages/fastapi/routing.py", line 231, in app raw_response = await run_endpoint_function( File "/opt/pysetup/.venv/lib/python3.10/site-packages/fastapi/routing.py", line 162, in run_endpoint_function return await run_in_threadpool(dependant.call, **values) File "/opt/pysetup/.venv/lib/python3.10/site-packages/starlette/concurrency.py", line 41, in run_in_threadpool return await anyio.to_thread.run_sync(func, *args) File "/opt/pysetup/.venv/lib/python3.10/site-packages/anyio/to_thread.py", line 31, in run_sync return await get_asynclib().run_sync_in_worker_thread( File "/opt/pysetup/.venv/lib/python3.10/site-packages/anyio/_backends/_asyncio.py", line 937, in run_sync_in_worker_thread return await future File "/opt/pysetup/.venv/lib/python3.10/site-packages/anyio/_backends/_asyncio.py", line 867, in run result = context.run(func, *args) File "/app/./mealie/routes/auth/auth.py", line 58, in get_token user = authenticate_user(session, email, password) # type: ignore File "/app/./mealie/core/security/security.py", line 120, in authenticate_user return user_from_ldap(db, email, password) File "/app/./mealie/core/security/security.py", line 51, in user_from_ldap import ldap File "/opt/pysetup/.venv/lib/python3.10/site-packages/ldap/__init__.py", line 34, in <module> import _ldap ImportError: libldap_r-2.4.so.2: cannot open shared object file: No such file or directory

Due to the error, LDAP authentication always leads to an error and makes it impossible to login.

The problem seems to be that the package libldap-2.4-2 is missing.

After installing the package using the following command, the issue is resolved:
apt-get update && apt-get install -y libldap-2.4-2

Unfortunately, due to additional bugs within the LDAP authentication, it is still not possible to login after the change. I will create a separate bug report for those, since they are code based.

Deployment

Docker (Linux)

Deployment Details

Docker install using a portainer stack on an unraid system.

@proffalken
Copy link
Contributor

Can confirm - seeing this on the latest beta release:

mealie-api | File "/app/./mealie/core/security/security.py", line 51, in user_from_ldap
mealie-api | import ldap
mealie-api | File "/opt/pysetup/.venv/lib/python3.10/site-packages/ldap/init.py", line 34, in
mealie-api | import _ldap
mealie-api | ImportError: libldap_r-2.4.so.2: cannot open shared object file: No such file or directory

@pete-mcneill
Copy link

Can also confirm I am seeing this issue.

@parkerreno
Copy link

parkerreno commented Jan 16, 2023

Also seeing this (Docker on Ubuntu 22.04) and can't install libldap-2.4-2 - are there any known workarounds for this issue or should I move to 20.04 (my reading suggests it's supported on that version of Ubuntu)?

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