-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Mermaid Crashes If trying to draw a large pipeline #8089
Comments
hey @CarlosFerLo what do you suspect is the issue here? The payload we send to Mermaid is roughly speaking too long, gets truncated somehow and graph generation fails? Or perhaps something else? I'd love to see what's up here but would love to hear your reasoning about the root cause as well. |
hey @vblagoje I believe it is a truncation issue. I am not really experienced with Mermaid, but I believe that is the case. |
Yes @CarlosFerLo, I investigated this a bit and apparently get request has a common maximum URL length of around 2,000 to 2,048 characters. Most likely smaller graphs fit into this size and when we make a get request it works up until certain graph size, until it doesn't. All the code for this stuff is in |
@vblagoje I am currently involved in a project that takes on a lot of my time, if you do not mind assing your self to this issue. |
Our intuition was right @CarlosFerLo This is a know limitation that I now confirmed. Here is the script:
If you run this script you'll get an image for this arbitrary chatgpt generated graph. However, if you connect the So how do we mitigate this?
Perhaps there are some other options? I'll talk internally about this and we'll come up with some game plan. Thanks for raising this @CarlosFerLo 🙏 |
cc @julian-risch moving this one to backlog again as a known limitation. Will consult on possible mitigation routes internally. |
Just ran across the issue as well. Should have probably Googled the error message sooner because I spent quite a while trying to draw the pipeline on a whiteboard to see if the issue was with how I designed my pipeline. Since there doesn't seem to be a workaround, I'll probably have to do some hack to make it work with mermaid-cli or something. |
It's ugly but if someone wants to mess with npm inside their project, here is how I did it: add an offline function to draw.py
replace the _to_mermaid_image call in draw (base.py)
+1 for a true offline replacement to be integrated into Haystack somehow |
I just ran into the same issue - is there another way to solve this? |
Do you have code that I can run to replicate your issue? I am testing an alternative fix using mermaid-py and want to test more before making a PR. |
Thanks in advance for your help :)
Describe the bug
I was building a huge pipeline, 30 components and 35 connections, and for debugging proposes I wanted to display the diagram, but both .draw() and .show() methods failed. It still works with small pipelines by the way.
Error message
Expected behavior
I expect the .show() and .draw() methods to work for all pipelines, no matter the size.
This might be a Mermaid problem and not strictly haystacks, but we would need to work to implement a local diagram generator as said in #7896
To Reproduce
I will not add all the 200 lines of add_component, connect statements, but you can imagine how it goes.
System:
The text was updated successfully, but these errors were encountered: