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

[BUG] : undefined symbol: EVP_PKEY_base_id (in mgclient.cpython-39-x86_64-linux-gnu.so) #285

Open
Tim-K-DFW opened this issue Sep 25, 2023 · 19 comments
Assignees
Labels
bug bug community community Effort - Low Effort - Low Frequency - Monthly Frequency - Monthly Priority - Later Priority - Later Reach - Some Reach - Some Severity - S3 Severity - S3

Comments

@Tim-K-DFW
Copy link

Memgraph version

v2.11.0

Environment

  • Linux 20.04 LTS,
  • conda with pip, clean environment with the only thing installed being gqlalchemy (using pip install gqlalchemy)
  • memgraph running in docker (docker run --name memgraph -p 7687:7687 -p 7444:7444 -p 3000:3000 memgraph/memgraph-platform)

Describe the bug

Fail to import, see log below; same thing happens whether memgraph is running or not.

To Reproduce

import gqlalchemy

Expected behavior

To import.

Logs

---------------------------------------------------------------------------
ImportError                               Traceback (most recent call last)
Cell In[4], line 1
----> 1 import gqlalchemy

File ~/miniconda3/envs/memgraph/lib/python3.9/site-packages/gqlalchemy/__init__.py:34
     19 from gqlalchemy.models import (  # noqa F401
     20     MemgraphConstraintExists,
     21     MemgraphConstraintUnique,
   (...)
     31     Field,
     32 )
     33 from gqlalchemy.disk_storage import SQLitePropertyDatabase  # noqa F401
---> 34 from gqlalchemy.instance_runner import (  # noqa F401
     35     DockerImage,
     36     MemgraphInstanceBinary,
     37     MemgraphInstanceDocker,
     38     wait_for_docker_container,
     39     wait_for_port,
     40 )
     41 from gqlalchemy.exceptions import GQLAlchemyError, GQLAlchemyWarning  # noqa F401
     43 from gqlalchemy.query_builders import (  # noqa F401
     44     neo4j_query_builder,
     45     memgraph_query_builder,
     46     memgraph_query_builder as query_builder,
     47 )

File ~/miniconda3/envs/memgraph/lib/python3.9/site-packages/gqlalchemy/instance_runner.py:35
     27 import psutil
     29 from gqlalchemy.exceptions import (
     30     GQLAlchemyWaitForConnectionError,
     31     GQLAlchemyWaitForDockerError,
     32     GQLAlchemyWaitForPortError,
     33     raise_if_not_imported,
     34 )
---> 35 from gqlalchemy.vendors.memgraph import Memgraph
     38 MEMGRAPH_DEFAULT_BINARY_PATH = "/usr/lib/memgraph/memgraph"
     39 MEMGRAPH_DEFAULT_PORT = 7687

File ~/miniconda3/envs/memgraph/lib/python3.9/site-packages/gqlalchemy/vendors/memgraph.py:19
     16 import sqlite3
     17 from typing import List, Optional, Union
---> 19 from gqlalchemy.connection import Connection, MemgraphConnection
     20 from gqlalchemy.disk_storage import OnDiskPropertyDatabase
     21 from gqlalchemy.exceptions import (
     22     GQLAlchemyError,
     23     GQLAlchemyFileNotFoundError,
     24     GQLAlchemyOnDiskPropertyDatabaseNotDefinedError,
     25     GQLAlchemyUniquenessConstraintError,
     26 )

File ~/miniconda3/envs/memgraph/lib/python3.9/site-packages/gqlalchemy/connection.py:18
     15 from abc import ABC, abstractmethod
     16 from typing import Any, Dict, Iterator, Optional
---> 18 import mgclient
     19 from neo4j import GraphDatabase
     20 from neo4j.graph import Node as Neo4jNode

ImportError: /home/t/miniconda3/envs/memgraph/lib/python3.9/site-packages/mgclient.cpython-39-x86_64-linux-gnu.so: undefined symbol: EVP_PKEY_base_id

Additional context Add any other context about the problem here.

@katarinasupe
Copy link
Contributor

Hi @Tim-K-DFW, can you try pip install GQLAlchemy==1.4.1 until we detect if this is a bug related to latest release?
Btw as far as I can see, you're using Python 3.9?

@Tim-K-DFW
Copy link
Author

Hi Katarina, thank you for the quick response!

  • Same result with 1.4.1
  • Yes, python 3.9.16.

@katarinasupe
Copy link
Contributor

Did you experience any issues when installing with pip?
Also when you installed can you confirm installation is okay by running pip show gqlalchemy and provide output?
P.S. I see you are using Linux OS but is this a virtual machine or not? Wondering about your device architecture, is it ARM or AMD?

@Tim-K-DFW
Copy link
Author

Tim-K-DFW commented Sep 26, 2023

  1. The only issue first time was pip complaining of cmake missing, so I installed that, and then gqlalchemy installed with no problems.

  2. pip show gqlalchemy gives:

Python 3.9.16
(memgraph) t@DESKTOP-KHJBONB:~/ro5_wsl/memgraph$ pip show gqlalchemy
Name: gqlalchemy
Version: 1.4.1
Summary: GQLAlchemy is a library developed to assist with writing and running queries in Memgraph.
Home-page: https://github.com/memgraph/gqlalchemy
Author: Bruno Sacaric
Author-email: bruno.sacaric@memgraph.com
License: Apache-2.0
Location: /home/t/miniconda3/envs/memgraph/lib/python3.9/site-packages
Requires: adlfs, dacite, docker, neo4j, networkx, numpy, psutil, pydantic, pymgclient
Required-by:
(memgraph) t@DESKTOP-KHJBONB:~/ro5_wsl/memgraph$
  1. This is WSL2 on a Windows 10 machine, standard Intel CPU (AMD architecture as I understand).

@katarinasupe
Copy link
Contributor

Can you remove that installation, install all necessary prerequisites for GQLAlchemy (that is, pymgclient) and then try reinstalling it?

@Tim-K-DFW
Copy link
Author

Tim-K-DFW commented Sep 26, 2023

I did:

  • new conda env with python 3.9.16
  • sudo apt install python3-dev cmake make gcc g++ libssl-dev (from your link)
  • pip3 install --user pymgclient (from your link)
  • pip install GQLAlchemy==1.4.1

Same result:

$ python
Python 3.9.16 (main, May 15 2023, 23:46:34)
[GCC 11.2.0] :: Anaconda, Inc. on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import gqlalchemy
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/t/miniconda3/envs/memgraph/lib/python3.9/site-packages/gqlalchemy/__init__.py", line 34, in <module>
    from gqlalchemy.instance_runner import (  # noqa F401
  File "/home/t/miniconda3/envs/memgraph/lib/python3.9/site-packages/gqlalchemy/instance_runner.py", line 31, in <module>
    from gqlalchemy.vendors.memgraph import Memgraph
  File "/home/t/miniconda3/envs/memgraph/lib/python3.9/site-packages/gqlalchemy/vendors/memgraph.py", line 19, in <module>
    from gqlalchemy.connection import Connection, MemgraphConnection
  File "/home/t/miniconda3/envs/memgraph/lib/python3.9/site-packages/gqlalchemy/connection.py", line 18, in <module>
    import mgclient
ImportError: /home/t/.local/lib/python3.9/site-packages/mgclient.cpython-39-x86_64-linux-gnu.so: undefined symbol: EVP_PKEY_base_id
>>>

@katarinasupe
Copy link
Contributor

I think that might be related to the mismatch of the OpenSSL version. Can you tell me which version you have?

@Tim-K-DFW
Copy link
Author

image

@katarinasupe
Copy link
Contributor

Are you sure that conda env uses that OpenSSL by default? This reminds me of the closed issue on the pymgclient repository.

@Tim-K-DFW
Copy link
Author

Do you happen to know how I can check this?

@Tim-K-DFW
Copy link
Author

(I mean, pip show openssl in this environment doesn't show any versions of openssl installed).

image

@katarinasupe
Copy link
Contributor

Can you try installing the pymgclient prerequisites in conda env with pip? The steps in conda env would be:

pip3 install python3-dev cmake make gcc g++ libssl-dev
pip3 install pymgclient
pip3 install gqlalchemy==1.4.1

@Tim-K-DFW
Copy link
Author

ERROR: Invalid requirement: 'g++' 😬 I googled a few solution options but not sure what exactly you had in mind.

@katarinasupe
Copy link
Contributor

katarinasupe commented Sep 26, 2023

My mistake on pip side. But the issue you're facing should be related to conda. I will do more research on what happened tomorrow and get back to you. Meanwhile, I recommend you read the issue I provided that might help and see why OpenSSL is not visible in your conda env.

@katarinasupe
Copy link
Contributor

Can you try installing gqlalchemy without conda, to verify the assumption?

@Tim-K-DFW
Copy link
Author

YES! In vanilla python, it's importing with no issues. This has to be some Conda stuff. Thank you so much!

@katarinasupe
Copy link
Contributor

No problem, I'm glad to help and happy it's working for you now! I will leave this issue open to resolve conda issues 😄

@as51340
Copy link
Contributor

as51340 commented Dec 21, 2023

Investigated the issue, you are probably having locally old version of pymgclient. Clean pymgclient from global path (pip uninstall pymgclient gqlalchemy), activate your conda environmen and install ONLY gqlalchemy (pip install gqlalchemy). You should see that pymgclient 1.3.1 is being built while installing gqlalchemy. No need to install pymgclient before gqlalchemy, we have wrong instructions in README, we will fix it.

@katarinasupe
Copy link
Contributor

@Tim-K-DFW let us know if you decide to try out Conda env again and verify if what @as51340 provided fixes the issue 😄 Thanks!

@katarinasupe katarinasupe added Importance - I3 Importance - I3 Severity - S3 Severity - S3 bug bug community community Effort - Unknown Effort - Unknown labels Dec 28, 2023
@imilinovic imilinovic added Effort - Low Effort - Low and removed Effort - Unknown Effort - Unknown labels Feb 22, 2024
@hal-eisen-MG hal-eisen-MG added the Priority - Next Priority - Next label Feb 22, 2024
@hal-eisen-MG hal-eisen-MG added Priority - Later Priority - Later Priority - Next Priority - Next and removed Priority - Next Priority - Next Priority - Later Priority - Later labels Feb 25, 2024
@katarinasupe katarinasupe added Frequency - Monthly Frequency - Monthly Reach - Some Reach - Some and removed Importance - I3 Importance - I3 labels Feb 27, 2024
@hal-eisen-MG hal-eisen-MG added Priority - Later Priority - Later and removed Priority - Next Priority - Next labels Mar 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug bug community community Effort - Low Effort - Low Frequency - Monthly Frequency - Monthly Priority - Later Priority - Later Reach - Some Reach - Some Severity - S3 Severity - S3
Projects
Development

No branches or pull requests

6 participants