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] 1.7.1 Using Document Store with metadata corrupts chat flow #2352

Open
OY-Linkin opened this issue May 7, 2024 · 12 comments
Open

[BUG] 1.7.1 Using Document Store with metadata corrupts chat flow #2352

OY-Linkin opened this issue May 7, 2024 · 12 comments
Labels
bug Something isn't working

Comments

@OY-Linkin
Copy link

OY-Linkin commented May 7, 2024

Describe the bug
With the new Document Store feature in 1.7.1, I have set up a Document Store with a plain text document loader. When I used the Document Store in my chat flow and upserted the resulting Documents into an In-Memory Vector Store for testing it, the chat flow got corrupted and does not open anymore. There is some JSON syntax error in the upserted data. The chat flow is broken and cannot be recovered by duplicating or exporting.

To Reproduce
Steps to reproduce the behavior:

  1. Create a new Document Store and add a Plain Text Document Loader
  2. Add a longer text formatted in markdown (with headlines, quotes, bullet lists, etc.)
  3. Use the Document Store node in the chat flow and link it to any vector store node
  4. Upsert fails with "SyntaxError: Unterminated string in JSON at position 65527"
  5. With the node in the chat flow it is corrupt and does not open anymore.

Expected behavior
Linking the node works and the chat flow does not get corrupted.

Screenshots
Screenshot 2024-05-07 at 20 33 13
Screenshot 2024-05-07 at 20 33 25
Screenshot 2024-05-07 at 20 26 43

Flow
Not accessible anymore.

Setup

  • Installation Docker image deployed on AWS EC2 instance
  • Flowise Version 1.7.1, also occurs in 1.6.6 with a plain text node containing the markdown data
  • OS: macOS
  • Browser Chrome

Additional context
Upserting is not necessary; just linking the Document Store to any VectorStore node corrupts the chat flow.

Trying to access the flow via API throws the same error:
{
"statusCode": 500,
"success": false,
"message": "Error: predictionsServices.buildChatflow - Unterminated string in JSON at position 65527",
"stack": {}
}

@OY-Linkin OY-Linkin changed the title [BUG] 1.7.1 Document Store upsert corrupts chat flow [BUG] 1.7.1 Linking Document Store to VectorStore Node corrupts chat flow May 7, 2024
@OY-Linkin
Copy link
Author

Investigating further shows it also happens when just linking a plain text node with the markdown data with Output Document to any Vector Store node! Just connecting is enough.

@OY-Linkin
Copy link
Author

OY-Linkin commented May 8, 2024

After more trial and error I assume it is about the metadata-tag. Adding it causes the crash and kills the chat flow. If I leave it out, everything works fine. When the chatflow is being built (loaded) there is a JSON syntax error, some comma or closing tag missing, so the flow is lost.

@OY-Linkin OY-Linkin changed the title [BUG] 1.7.1 Linking Document Store to VectorStore Node corrupts chat flow [BUG] 1.7.1 Using Document Store with metadata corrupts chat flow May 8, 2024
@HenryHengZJ
Copy link
Contributor

@OY-Linkin can you give a me dummy plain text to replicate?

@HenryHengZJ HenryHengZJ added the bug Something isn't working label May 8, 2024
@OY-Linkin
Copy link
Author

OY-Linkin commented May 8, 2024

Screenshot 2024-05-08 at 20 36 58
OY-DEBUG Chatflow (2).json

So, to reproduce... there is a plain text node in the upper right corner. Connect it to the InMemory Vector Store right underneath, save the chat flow and reload the page (CMD+R). If it works, duplicate the node and repeat until a few of these are connected. After 2-3 times it crashes.

I noticed, it only happens when the node output is set to "Document", so when the metadata json is built in the output. When "Text" is used, it doesn't occur.

@HenryHengZJ
Copy link
Contributor

Ive tried duplicating few nodes and connect to in-memory vector store, it still save fine:
image

@OY-Linkin
Copy link
Author

Oh no, that's not good.

I just tried again, it crashed again after connecting 5 of them.

I was investigating further and I found that I am getting the crash also when just adding other nodes to the flow. Just getting it when having added a new ChatHuggingFace node to the flow. It seems like it happens when there is some odd numbers of total nodes?
If I remove the old LLM node before adding the new one (so the total number of nodes remains the same) it does not crash.
If I add another LLM node with leaving the old on on the canvas (so the total number of nodes increases by 1) it does crash.

@OY-Linkin
Copy link
Author

OY-Linkin commented May 9, 2024

I have Flowise running deployed on AWS on EC2 instance where the crashes happen.

To cross verify if this is only happening in this instance to some configuration issues, I tried to reproduce it locally on my machine and I am not getting any crashes :(

While I do understand that this makes looking at this bug for you guys not a high priority anymore, can you hint to any clues to trouble shoot this?

Completely uninstalling and reinstalling I did already do, no effect.

@HenryHengZJ
Copy link
Contributor

this might be due to the instance size of EC2? Curious to see if higher tier of instance faces the same issue?

@OY-Linkin
Copy link
Author

I'll try it out and report back here... thx!

@edesalve
Copy link

I had a similar issue: any document loader that involved the upload of a file, once the file was uploaded caused issues to the flow. I was running flowise on macOS as well. However it seems that running it on an EC2 with linux as OS fixes the problem. So it could be something OS related.

@OY-Linkin
Copy link
Author

@HenryHengZJ We increased the size (tier-micro to tier-small) of the EC2 instance, but the crashes still happen.

@OY-Linkin
Copy link
Author

Just found this one: #2386

Could this be related? It is the same error... issue 2386 has only the effect that the chat flow does not run, but it does not corrupt it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants