memgraph / mgclient Goto Github PK
View Code? Open in Web Editor NEWC/C++ Memgraph Client
License: Apache License 2.0
C/C++ Memgraph Client
License: Apache License 2.0
Issue is described on GQLAlchemy repository.
Hi,
When I try to compile mgclient on my pc (Fedora 37 x64 bit NOT ARM) i get this cmake error:
Here is the log file:
CMakeOutput.log
SOURCE: https://discord.com/channels/842007348272169002/842008652377751582/1191840879812554834
export CC="zig cc"
export CXX="zig c++"
cmake ..
make
zig.build
exe.linkLibC();
exe.linkSystemLibrary("mgclient");
TODO: Add under examples
const mgclient = @cImport(
@cInclude("mgclient.h"),
);
pub fn main() !void {
const initialization = mgclient.mg_init();
std.debug.print("we initialized mgclient? {d}\n", .{initialization});
const mg_client_version = mgclient.mg_client_version();
std.debug.print("Here is the mgclient version from zig: {s}\n", .{mg_client_version});
}
macos-11
macos-12
macos-13
windows-2019
-> microsoft/vcpkg#15035windows-2022
Everything is described on Discourse: https://discourse.memgraph.com/t/query-times-in-memgraph-lab-vs-other-methods/355
Note added: Memgraph is running on another machine in the building, in the local network and Memgraph Lab on a local machine.
Hi, this looks like its synchronous blocking functions am I right? Then if I wish to make many calls, can I
Memgraph version Which version did you use?
2.6
Environment Some information about the environment you are using Memgraph
on: operating system, how do you connect, with or without docker, which driver
etc.
Operating System: Amazon Linux 2.
Use Docker w/ default settings.
Describe the bug A clear and concise description of what the bug is.
I have a Python Flask web application. One of the pages has a form that when submitted, calls Memgraph.exceute_and_fetch() to query the Memgraph database using data in the form. The returned data will then be used to populate a Memgraph Orb graph and render it to the user on new page.
Sometimes, instead of receiving node/edge data from the query, a Database Error will be returned, typically on users' first session or first session in a while. Specifically, this is an mgclient error that say "failed to send chunk data". Upon page refresh/form resubmission, the query is successful and the results render as normal and the error is not encountered again (until a future session, typically hours or day(s) later).
To Reproduce Steps to reproduce the behavior:
- Have Memgraph instance running and connect to that Memgraph instance using GQLAlchemy in a Python Flask Application.
- Have a page in the Flask Application with a form in it, and upon form submission, will run a query using GQL Alchemy's Memgraph.execute_and_fetch() method.
- If successful, the query will run as normal and return intended results/redirect users to the right page. However, on occasion (for a reason I can't quite narrow down), the mgclient error will be thrown. (Picture below)
- If the error is thrown, refreshing page and resubmitting form should always result in query being successful.
Expected behavior A clear and concise description of what you expected to
happen.
I expect the query to be successful on the first try, rather than upon a form resubmission (or repeating the excecute_and_fetch() call on the backend to ensure users don't see the error. This has "solved" the problem currently from a user standpoint, but we still see the error printed in the terminal logs. )
Logs If applicable, add logs of Memgraph, CLI output or screenshots to help
explain your problem.
Additional context Add any other context about the problem here.
DB and Query are initialized/run like this:
from gqlalchemy import Node, Field, Relationship, Memgraph, Path db = Memgraph(host='host-link.net', port=7687) query_result = db.execute_and_fetch(query=query, connection=db) results = list(query_result)
- Currently, the Flask app is being run in the same server as the Memgraph database.
- Error text/throw seems to be found here:
Line 168 in d57df8a
Hello! Thank you VERY much for the great tool and, especially, for all the great docs & examples!
I'm trying to perform a query like:
MATCH p=(from)-[rel *1..3]->(to) WHERE from.name = "Bob" AND to.name = "Frank" RETURN p
I.e. All paths of length 1..3
from "Bob" to "Frank" regardless of the relation type. I see how to do a variable length query with certain relationships, but not with all. Am I missing something in the docs? I have all the relationship types, so I could just build a string (:FRIENDS_WITH:RELATED_TO:DATED
) and add the *1..3
at the end. But I just want to see if I'm missing something before I add that complexity. THANK YOU!
I build this project in CentOS 7 and I want to take use of it in Rust.
However, it reported this error that I can not handle. I am not familiar with cmake so it is hard to solve it.
= note: /usr/bin/ld: /usr/lib/gcc/x86_64-redhat-linux/8/../../../../lib64/libmgclient.a(mgclient.c.o): relocation R_X86_64_32 against `.rodata.str1.1' can not be used when making a PIE object; recompile with -fPIE
/usr/bin/ld: /usr/lib/gcc/x86_64-redhat-linux/8/../../../../lib64/libmgclient.a(mgmessage.c.o): relocation R_X86_64_32S against `.rodata' can not be used when making a PIE object; recompile with -fPIE
/usr/bin/ld: /usr/lib/gcc/x86_64-redhat-linux/8/../../../../lib64/libmgclient.a(mgsession.c.o): relocation R_X86_64_32 against `.rodata.str1.1' can not be used when making a PIE object; recompile with -fPIE
/usr/bin/ld: /usr/lib/gcc/x86_64-redhat-linux/8/../../../../lib64/libmgclient.a(mgsession-decoder.c.o): relocation R_X86_64_32 against `.rodata.str1.1' can not be used when making a PIE object; recompile with -fPIE
/usr/bin/ld: /usr/lib/gcc/x86_64-redhat-linux/8/../../../../lib64/libmgclient.a(mgsession-encoder.c.o): relocation R_X86_64_32 against `.rodata.str1.1' can not be used when making a PIE object; recompile with -fPIE
/usr/bin/ld: /usr/lib/gcc/x86_64-redhat-linux/8/../../../../lib64/libmgclient.a(mgtransport.c.o): relocation R_X86_64_32 against `.rodata.str1.1' can not be used when making a PIE object; recompile with -fPIE
/usr/bin/ld: /usr/lib/gcc/x86_64-redhat-linux/8/../../../../lib64/libmgclient.a(mgvalue.c.o): relocation R_X86_64_32 against symbol `mg_system_allocator' can not be used when making a PIE object; recompile with -fPIE
/usr/bin/ld: /usr/lib/gcc/x86_64-redhat-linux/8/../../../../lib64/libmgclient.a(mgsocket.c.o): relocation R_X86_64_32 against `.rodata.str1.1' can not be used when making a PIE object; recompile with -fPIE
/usr/bin/ld: /usr/lib/gcc/x86_64-redhat-linux/8/../../../../lib64/libmgclient.a(mgallocator.c.o): relocation R_X86_64_32 against `.rodata.str1.8' can not be used when making a PIE object; recompile with -fPIE
collect2: error: ld returned 1 exit status
I try to add "-no-pie" option but it did not help at all.
set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fPIE -no-pie")
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIE -no-pie")
# Set default build type to 'Release'
if(NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE "Release")
endif()
message(STATUS "CMake build type: ${CMAKE_BUILD_TYPE}")
https://github.com/memgraph/mgclient/blob/master/examples/advanced.cpp#L16
when type = mg::Value::Type::Date
value.ValueDate().days();
return -8191
, instead it should return days since Unix epoch.
GQL is hard to install for usage on AWS Lambdas because of the dependencies, probably because OS environment is striped compared to conventional Linux images, so it probably requires a bit more steps.
The user tried to create an identical environment in custom docker image, running amazonlinux:2
:
pip3 install -t python gqlalchamy
First, the typical issues with OpenSSL not being visible popped out:
CMake Error at /usr/share/cmake3/Modules/FindPackageHandleStandardArgs.cmake:137 (message): Could NOT find OpenSSL, try to set the path to OpenSSL root folder in the system variable OPENSSL_ROOT_DIR (missing: OPENSSL_CRYPTO_LIBRARY) (found version "1.0.2k")
After installing OpenSSL-static, zlib, and zlib-static, the OpenSSL issue disappeared, and a strange linker failure was hit:
The user moved to the Neo4j Python driver.
Full context: https://discord.com/channels/842007348272169002/842338690109931520/1146269544118227054
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.