[GH-ISSUE #318] Text documents that contain a single quote fail to upload. #185

Closed
opened 2026-02-22 18:18:17 -05:00 by yindo · 5 comments
Owner

Originally created by @Britman72 on GitHub (Nov 1, 2023).
Original GitHub issue: https://github.com/Mintplex-Labs/anything-llm/issues/318

I have .TXT file that only contains this sentence:

Fence(s) and Gate(s) must be of white aluminum rail at heights in 4’ or 5’.

Uploading gives the following error:

Error uploading file. Response can not be completed.

Removing the quotes fixes the issue.

Originally created by @Britman72 on GitHub (Nov 1, 2023). Original GitHub issue: https://github.com/Mintplex-Labs/anything-llm/issues/318 I have .TXT file that only contains this sentence: Fence(s) and Gate(s) must be of white aluminum rail at heights in 4’ or 5’. Uploading gives the following error: Error uploading file. Response can not be completed. Removing the quotes fixes the issue.
yindo added the possible bug label 2026-02-22 18:18:17 -05:00
yindo closed this issue 2026-02-22 18:18:17 -05:00
Author
Owner

@timothycarambat commented on GitHub (Nov 1, 2023):

I am unable to replicate this error
File: sample.txt
content: Fence(s) and Gate(s) must be of white aluminum rail at heights in 4’ or 5’.
DB: lancedb
LLM: openai

I create a workspace. Select the workspace & open its setting panel.
I upload the file via the workspace document uploader -> File is parsed properly and appears in picker
I then move file over to embed and am able to embed the file.
I send a chat successfully.

commit: ab1e9d66b5bd6bb9ff3b8f460c83e2b7daa9979c

@timothycarambat commented on GitHub (Nov 1, 2023): I am unable to replicate this error File: `sample.txt` content: `Fence(s) and Gate(s) must be of white aluminum rail at heights in 4’ or 5’.` DB: `lancedb` LLM: `openai` I create a workspace. Select the workspace & open its setting panel. I upload the file via the workspace document uploader -> File is parsed properly and appears in picker I then move file over to embed and am able to embed the file. I send a chat successfully. commit: `ab1e9d66b5bd6bb9ff3b8f460c83e2b7daa9979c`
Author
Owner

@timothycarambat commented on GitHub (Nov 1, 2023):

I tested again on a commit that is over 8 hours old (since posted) and still unable to replicate.

@timothycarambat commented on GitHub (Nov 1, 2023): I tested again on a commit that is over 8 hours old (since posted) and still unable to replicate.
Author
Owner

@Britman72 commented on GitHub (Nov 2, 2023):

I did a fresh pull and rebuilt the instance. Still getting the error. Recorded a video below. Also attached the actual file.

https://youtu.be/anbYCqGb0zI

Rules and Regulations Community copy.txt

Sorry, I am kinda new to Docker and didn't realize there was a console output! Here's what it's throwing:

2023-11-02 08:32:07 anything-llm | [2023-11-02 12:32:07,636] ERROR in app: Exception on /process [POST]
2023-11-02 08:32:07 anything-llm | Traceback (most recent call last):
2023-11-02 08:32:07 anything-llm | File "/app/collector/v-env/lib/python3.10/site-packages/flask/app.py", line 2190, in wsgi_app
2023-11-02 08:32:07 anything-llm | response = self.full_dispatch_request()
2023-11-02 08:32:07 anything-llm | File "/app/collector/v-env/lib/python3.10/site-packages/flask/app.py", line 1486, in full_dispatch_request
2023-11-02 08:32:07 anything-llm | rv = self.handle_user_exception(e)
2023-11-02 08:32:07 anything-llm | File "/app/collector/v-env/lib/python3.10/site-packages/flask/app.py", line 1484, in full_dispatch_request
2023-11-02 08:32:07 anything-llm | rv = self.dispatch_request()
2023-11-02 08:32:07 anything-llm | File "/app/collector/v-env/lib/python3.10/site-packages/flask/app.py", line 1469, in dispatch_request
2023-11-02 08:32:07 anything-llm | return self.ensure_sync(self.view_functions[rule.endpoint])(**view_args)
2023-11-02 08:32:07 anything-llm | File "/app/collector/api.py", line 13, in process_file
2023-11-02 08:32:07 anything-llm | success, reason = process_single(WATCH_DIRECTORY, target_filename)
2023-11-02 08:32:07 anything-llm | File "/app/collector/scripts/watch/process_single.py", line 30, in process_single
2023-11-02 08:32:07 anything-llm | return FILETYPES[fileext](
2023-11-02 08:32:07 anything-llm | File "/app/collector/scripts/watch/convert/as_text.py", line 13, in as_text
2023-11-02 08:32:07 anything-llm | content = open(fullpath).read()
2023-11-02 08:32:07 anything-llm | File "/usr/lib/python3.10/codecs.py", line 322, in decode
2023-11-02 08:32:07 anything-llm | (result, consumed) = self._buffer_decode(data, self.errors, final)
2023-11-02 08:32:07 anything-llm | UnicodeDecodeError: 'utf-8' codec can't decode byte 0xd5 in position 67: invalid continuation byte
2023-11-02 08:32:07 anything-llm | Response could not be completed

@Britman72 commented on GitHub (Nov 2, 2023): I did a fresh pull and rebuilt the instance. Still getting the error. Recorded a video below. Also attached the actual file. https://youtu.be/anbYCqGb0zI [Rules and Regulations Community copy.txt](https://github.com/Mintplex-Labs/anything-llm/files/13238349/Rules.and.Regulations.Community.copy.txt) Sorry, I am kinda new to Docker and didn't realize there was a console output! Here's what it's throwing: 2023-11-02 08:32:07 anything-llm | [2023-11-02 12:32:07,636] ERROR in app: Exception on /process [POST] 2023-11-02 08:32:07 anything-llm | Traceback (most recent call last): 2023-11-02 08:32:07 anything-llm | File "/app/collector/v-env/lib/python3.10/site-packages/flask/app.py", line 2190, in wsgi_app 2023-11-02 08:32:07 anything-llm | response = self.full_dispatch_request() 2023-11-02 08:32:07 anything-llm | File "/app/collector/v-env/lib/python3.10/site-packages/flask/app.py", line 1486, in full_dispatch_request 2023-11-02 08:32:07 anything-llm | rv = self.handle_user_exception(e) 2023-11-02 08:32:07 anything-llm | File "/app/collector/v-env/lib/python3.10/site-packages/flask/app.py", line 1484, in full_dispatch_request 2023-11-02 08:32:07 anything-llm | rv = self.dispatch_request() 2023-11-02 08:32:07 anything-llm | File "/app/collector/v-env/lib/python3.10/site-packages/flask/app.py", line 1469, in dispatch_request 2023-11-02 08:32:07 anything-llm | return self.ensure_sync(self.view_functions[rule.endpoint])(**view_args) 2023-11-02 08:32:07 anything-llm | File "/app/collector/api.py", line 13, in process_file 2023-11-02 08:32:07 anything-llm | success, reason = process_single(WATCH_DIRECTORY, target_filename) 2023-11-02 08:32:07 anything-llm | File "/app/collector/scripts/watch/process_single.py", line 30, in process_single 2023-11-02 08:32:07 anything-llm | return FILETYPES[fileext]( 2023-11-02 08:32:07 anything-llm | File "/app/collector/scripts/watch/convert/as_text.py", line 13, in as_text 2023-11-02 08:32:07 anything-llm | content = open(fullpath).read() 2023-11-02 08:32:07 anything-llm | File "/usr/lib/python3.10/codecs.py", line 322, in decode 2023-11-02 08:32:07 anything-llm | (result, consumed) = self._buffer_decode(data, self.errors, final) 2023-11-02 08:32:07 anything-llm | UnicodeDecodeError: 'utf-8' codec can't decode byte 0xd5 in position 67: invalid continuation byte 2023-11-02 08:32:07 anything-llm | Response could not be completed
Author
Owner

@Britman72 commented on GitHub (Nov 2, 2023):

I was able to fix this by re-exporting my PDFs to text using UTF-8 encoding. Not sure what it was defaulting to.

I will close this out. Thanks for looking into it though.

@Britman72 commented on GitHub (Nov 2, 2023): I was able to fix this by re-exporting my PDFs to text using UTF-8 encoding. Not sure what it was defaulting to. I will close this out. Thanks for looking into it though.
Author
Owner

@timothycarambat commented on GitHub (Nov 2, 2023):

Oh wow this is useful to know. Will use those files as a reference - definitely seems like an encoding issue. Will mark this and may re-open an issue later on it

@timothycarambat commented on GitHub (Nov 2, 2023): Oh wow this is useful to know. Will use those files as a reference - definitely seems like an encoding issue. Will mark this and may re-open an issue later on it
yindo changed title from Text documents that contain a single quote fail to upload. to [GH-ISSUE #318] Text documents that contain a single quote fail to upload. 2026-06-05 14:33:56 -04:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: Mintplex-Labs/anything-llm#185