memgraph / memgraph

Open-source graph database, tuned for dynamic analytics environments. Easy to adopt, scale and own.
https://memgraph.com
Other
2.36k stars 109 forks source link

Session shutdown failed: Transport endpoint is not connected [system:107] #1852

Open votanasrey opened 6 months ago

votanasrey commented 6 months ago

Memgraph version v2.15.0

Environment I am using the memgraph with docker. currently, I am building the rules and using graph data screens to define rules. there is an API connected to Memgraph. whenever there is any request, it will bring those requests to Memgraph for computing.

Describe the bug it's a query to run to get the 3 levels of my data. this is the graph data model.

(user1)-[own]->(account1)-[from]->(transaction1)-[to]->(acounnt2)<-[own]-(user2)

while executing, the RAM used kept increasing, and then it stuck. but it's quickly back online. This is what we wanna see from the query but it's not worked.

image

To Reproduce Steps to reproduce the behavior:

  1. Run the following query
MATCH (U:USER{id:'3222338'}) - [O:OWN] -> (N:ACCOUNT) 
OPTIONAL MATCH (N) - [F:FROM] - > (TR:TRANSACTION_RECORD) - [T:TO] -> (N1:ACCOUNT), (U1:USER) - [O1:OWN] -> (N1) 
WHERE TR.TRN_DT >= LOCALDATETIME('2024-01-01T08:00:00') AND TR.TRN_DT <= LOCALDATETIME('2024-03-21T08:00:00') 
CALL { 
  WITH U1 
  OPTIONAL MATCH (U1) - [O2:OWN] -> (N4:ACCOUNT) - [F1:FROM] - > (TR1:TRANSACTION_RECORD) - [T1:TO] -> (N7:ACCOUNT), (U2:USER) - [O_3:OWN] -> (N7) 
  WHERE TR1.TRN_DT >= LOCALDATETIME('2024-01-01T08:00:00') AND TR1.TRN_DT <= LOCALDATETIME('2024-03-21T08:00:00') 
  RETURN U2,O2,N4,F1,TR1,T1,N7,O_3 
  } 
  CALL { 
    WITH U2 
    OPTIONAL MATCH (U2) - [O3:OWN] -> (N5:ACCOUNT) - [F2:FROM] - > (TR2:TRANSACTION_RECORD) - [T2:TO] -> (N8:ACCOUNT), (U3:USER) - [O_4:OWN] -> (N8) 
    WHERE TR2.TRN_DT >= LOCALDATETIME('2024-01-01T08:00:00') AND TR2.TRN_DT <= LOCALDATETIME('2024-03-21T08:00:00') 
    RETURN U3,O3,N5,F2,TR2,T2,N8,O_4 
  } 
RETURN COLLECT(U) + COLLECT(U1) + COLLECT(N) + COLLECT(N1) + COLLECT(TR) +COLLECT(U2) + COLLECT(N4) + COLLECT(N7) + COLLECT(TR1) +COLLECT(U3) + COLLECT(N5) + COLLECT(N8) + COLLECT(TR2) as nodes, 
COLLECT(O) + COLLECT(F) + COLLECT(T) + COLLECT(O1) + COLLECT(O2) + COLLECT(F1) + COLLECT(T1) + COLLECT(O_3) + COLLECT(O3) + COLLECT(F2) + COLLECT(T2) + COLLECT(O_4) as edges
  1. Click on Run Query (from Memgraph Lab)
  2. Then it keeps running until the instance is stuck.

Logs Since I am using Memgraph with docker, I can provide the logs of docker here:

<--- Last few GCs --->
[218:0x74e73a0] 64503274 ms: Mark-sweep 4002.5 (4141.6) -> 3987.8 (4142.8) MB, 3530.0 / 0.0 ms  (average mu = 0.149, current mu = 0.012) allocation failure; scavenge might not succeed
[218:0x74e73a0] 64509005 ms: Mark-sweep 4001.3 (4143.3) -> 3989.0 (4144.1) MB, 5678.5 / 0.0 ms  (average mu = 0.067, current mu = 0.009) task; scavenge might not succeed
FATAL ERROR: Reached heap limit Allocation failed - JavaScript heap out of memory
 1: 0xb83f50 node::Abort() [node]
 2: 0xa94834  [node]
 3: 0xd647c0 v8::Utils::ReportOOMFailure(v8::internal::Isolate, char const, bool) [node]
 4: 0xd64b67 v8::internal::V8::FatalProcessOutOfMemory(v8::internal::Isolate, char const, bool) [node]
 5: 0xf42265  [node]
 6: 0xf5474d v8::internal::Heap::CollectGarbage(v8::internal::AllocationSpace, v8::internal::GarbageCollectionReason, v8::GCCallbackFlags) [node]
 7: 0xfc37a4 v8::internal::ScavengeJob::Task::RunInternal() [node]
 8: 0xe33efb non-virtual thunk to v8::internal::CancelableTask::Run() [node]
 9: 0xbee4b4  [node]
10: 0xbf191e node::PerIsolatePlatformData::FlushForegroundTasksInternal() [node]
11: 0x1666a36  [node]
12: 0x1678f74  [node]
13: 0x166739e uv_run [node]
14: 0xac5a6d node::SpinEventLoop(node::Environment) [node]
15: 0xbc8d14 node::NodeMainInstance::Run() [node]
16: 0xb3ec18 node::LoadSnapshotDataAndRun(node::SnapshotData const**, node::InitializationResult const) [node]
17: 0xb4272f node::Start(int, char**) [node]
18: 0x7f9f398e0d0a __libc_start_main [/lib/x86_64-linux-gnu/libc.so.6]
19: 0xac1fee _start [node]
2024-03-22 03:21:34,668 INFO exited: lab (terminated by SIGABRT (core dumped); not expected)
2024-03-22 03:21:35,675 INFO spawned: 'lab' with pid 612
2024-03-22 03:21:36,678 INFO success: lab entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
[2024-03-22 03:21:36.866] INFO: [lab] Lab is running at http://localhost:3000/ in platform mode
[2024-03-22 03:21:37.263] ERROR: [lab] Web Socket connection failed

Logs from Memgraph instance

[2024-03-25 10:18:06.889] [memgraph_log] [error] Session error: Broken pipe
[2024-03-25 10:18:06.889] [memgraph_log] [error] Session shutdown failed: Transport endpoint is not connected [system:107]
[2024-03-25 10:18:23.346] [memgraph_log] [trace] Couldn't send query summary!
[2024-03-25 10:18:23.346] [memgraph_log] [error] Exception was thrown while processing an event in Bolt session associated with 10.6.8.48:51802

Could you please check on this and replicate my work here? Your inputs are very useful for me.

matea16 commented 6 months ago

Hi @votanasrey, thank you for reporting this and opening the issue. Just for the context, this is related to the previous Discord conversation

votanasrey commented 6 months ago

Hi Dear,

Yes, it is related to that issue I alr talked in the discord, may you please check it?

Best Regards, Votana

On Tue, Mar 26, 2024 at 3:40 PM Matea Pesic @.***> wrote:

Hi @votanasrey https://github.com/votanasrey, thank you for reporting this and opening the issue. Just for the context, this is related to the previous Discord conversation https://discord.com/channels/842007348272169002/1220238542303924274/1221839207685820527

— Reply to this email directly, view it on GitHub https://github.com/memgraph/memgraph/issues/1852#issuecomment-2019828061, or unsubscribe https://github.com/notifications/unsubscribe-auth/APQ3OGIBLDRHJZKUH2BVEYTY2EQ5BAVCNFSM6AAAAABFHGIIM2VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDAMJZHAZDQMBWGE . You are receiving this because you were mentioned.Message ID: @.***>