assafelovic / gpt-researcher

GPT based autonomous agent that does online comprehensive research on any given topic
https://gptr.dev
MIT License
13.05k stars 1.61k forks source link

OSError: [Errno 36] File name too long #487

Closed mike12432 closed 3 weeks ago

mike12432 commented 1 month ago

Running in a MAC Docker Container at the end of researching I receive an error related to file name length.

workaround is to make shorter quarries.

ine 348, in app gpt-researcher-1 | await dependant.call(*values) gpt-researcher-1 | File "/usr/src/app/backend/server.py", line 58, in websocket_endpoint gpt-researcher-1 | md_path = await write_text_to_md(report, filename) gpt-researcher-1 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ gpt-researcher-1 | File "/usr/src/app/backend/utils.py", line 32, in write_text_to_md gpt-researcher-1 | await write_to_file(file_path, text) gpt-researcher-1 | File "/usr/src/app/backend/utils.py", line 19, in write_to_file gpt-researcher-1 | async with aiofiles.open(filename, "w", encoding='utf-8') as file: gpt-researcher-1 | File "/usr/local/lib/python3.11/site-packages/aiofiles/base.py", line 98, in aenter gpt-researcher-1 | self._obj = await self._coro gpt-researcher-1 | ^^^^^^^^^^^^^^^^ gpt-researcher-1 | File "/usr/local/lib/python3.11/site-packages/aiofiles/threadpool/init.py", line 94, in _open gpt-researcher-1 | f = yield from loop.run_in_executor(executor, cb) gpt-researcher-1 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ gpt-researcher-1 | File "/usr/local/lib/python3.11/concurrent/futures/thread.py", line 58, in run gpt-researcher-1 | result = self.fn(self.args, **self.kwargs) gpt-researcher-1 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ gpt-researcher-1 | OSError: [Errno 36] File name too long: 'outputs/task1715258626/this is my quarry which I have removed and replaced with this string that is still not as long as my quarry xxxxxxxxxx more xxxxxx you get the idea, this md file should be a file name that is not the same as the original quarry. .md' gpt-researcher-1 | INFO: connection closed

assafelovic commented 1 month ago

Hey @mike12432 have you pulled the latest release?

mike12432 commented 1 month ago

yes, built fresh from source this morning.

On Thu, May 9, 2024 at 4:40 PM Assaf Elovic @.***> wrote:

Hey @mike12432 https://github.com/mike12432 have you pulled the latest release?

— Reply to this email directly, view it on GitHub https://github.com/assafelovic/gpt-researcher/issues/487#issuecomment-2102796934, or unsubscribe https://github.com/notifications/unsubscribe-auth/A6ILDCLHJTMUND55MFOWHQDZBODE3AVCNFSM6AAAAABHOYPMO2VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCMBSG44TMOJTGQ . You are receiving this because you were mentioned.Message ID: @.***>

assafelovic commented 1 month ago

@mike12432 fixed in latest version

mike12432 commented 1 month ago

thanks, testing now. FYI this was for In-Depth Research Report

On Fri, May 10, 2024 at 5:55 PM Assaf Elovic @.***> wrote:

@mike12432 https://github.com/mike12432 fixed in latest version

— Reply to this email directly, view it on GitHub https://github.com/assafelovic/gpt-researcher/issues/487#issuecomment-2104847368, or unsubscribe https://github.com/notifications/unsubscribe-auth/A6ILDCKZ75KJRDCV7COSEYTZBTUYBAVCNFSM6AAAAABHOYPMO2VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCMBUHA2DOMZWHA . You are receiving this because you were mentioned.Message ID: @.***>

mike12432 commented 1 month ago

I pulled the latest repo, cleared out all images and files in Docker and rebuilt. I am still having the issue on both the research and detailed reports, do I need to wait for the next release before this will work?

smjure commented 1 month ago

Same here, cloned the latest version, the too-long-file-name problem still present. It seems the research is finished but then cannot download the PDF file, which is eventually my intention.

assafelovic commented 1 month ago

@smjure can you please share the query and/or error log?

smjure commented 1 month ago

@assafelovic I've tried to reproduce it, but strangely cannot.... if it happens again, will post it here.

klimentij commented 1 month ago

SCR-20240515-kri

Same here, all default settings, latest Docker

assafelovic commented 1 month ago

Hey all, fixed here: https://github.com/assafelovic/gpt-researcher/commit/bd75c9b6f04bc36ac026923e474e08a2b846672e

Please pull latest and try again. Should be good now!

assafelovic commented 1 month ago

@klimentij @smjure @mike12432 fyi

mike12432 commented 1 month ago

Thank you, seems to be fixed. But I noticed the print PDF button is not on the Detailed report page, not sure if it was ever there or the remediation removed it. Anyway I wont open a ticket on it as its not a feature important to me. Thanks for your work and thanks for updating to GPT-4o, total run of detailed report was 37 cents.