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

deep research docker install error #1190

Open
Fangziyang0910 opened this issue Feb 24, 2025 · 10 comments
Open

deep research docker install error #1190

Fangziyang0910 opened this issue Feb 24, 2025 · 10 comments

Comments

@Fangziyang0910
Copy link

Describe the bug
docker install error

To Reproduce
gpt-researcher-1 | File "/usr/src/app/multi_agents/agents/researcher.py", line 1, in
gpt-researcher-1 | from gpt_researcher import GPTResearcher
gpt-researcher-1 | File "/usr/src/app/gpt_researcher/init.py", line 1, in
gpt-researcher-1 | from .agent import GPTResearcher
gpt-researcher-1 | File "/usr/src/app/gpt_researcher/agent.py", line 16, in
gpt-researcher-1 | from .skills.deep_research import DeepResearchSkill
gpt-researcher-1 | File "/usr/src/app/gpt_researcher/skills/deep_research.py", line 301
gpt-researcher-1 | """
gpt-researcher-1 | ^
gpt-researcher-1 | SyntaxError: f-string expression part cannot include a backslash
gpt-researcher-1 | Traceback (most recent call last):
gpt-researcher-1 | File "/usr/local/bin/uvicorn", line 8, in
gpt-researcher-1 | sys.exit(main())
gpt-researcher-1 | ^^^^^^
gpt-researcher-1 | File "/usr/local/lib/python3.11/site-packages/click/core.py", line 1161, in call
gpt-researcher-1 | return self.main(*args, **kwargs)
gpt-researcher-1 | ^^^^^^^^^^^^^^^^^^^^^^^^^^
gpt-researcher-1 | File "/usr/local/lib/python3.11/site-packages/click/core.py", line 1082, in main
gpt-researcher-1 | rv = self.invoke(ctx)
gpt-researcher-1 | ^^^^^^^^^^^^^^^^
gpt-researcher-1 | File "/usr/local/lib/python3.11/site-packages/click/core.py", line 1443, in invoke
gpt-researcher-1 | return ctx.invoke(self.callback, **ctx.params)
gpt-researcher-1 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
gpt-researcher-1 | File "/usr/local/lib/python3.11/site-packages/click/core.py", line 788, in invoke
gpt-researcher-1 | return __callback(*args, **kwargs)
gpt-researcher-1 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^
gpt-researcher-1 | File "/usr/local/lib/python3.11/site-packages/uvicorn/main.py", line 412, in main
gpt-researcher-1 | run(
gpt-researcher-1 | File "/usr/local/lib/python3.11/site-packages/uvicorn/main.py", line 579, in run
gpt-researcher-1 | server.run()
gpt-researcher-1 | File "/usr/local/lib/python3.11/site-packages/uvicorn/server.py", line 66, in run
gpt-researcher-1 | return asyncio.run(self.serve(sockets=sockets))
gpt-researcher-1 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
gpt-researcher-1 | File "/usr/local/lib/python3.11/asyncio/runners.py", line 190, in run
gpt-researcher-1 | return runner.run(main)
gpt-researcher-1 | ^^^^^^^^^^^^^^^^
gpt-researcher-1 | File "/usr/local/lib/python3.11/asyncio/runners.py", line 118, in run
gpt-researcher-1 | return self._loop.run_until_complete(task)
gpt-researcher-1 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
gpt-researcher-1 | File "/usr/local/lib/python3.11/asyncio/base_events.py", line 653, in run_until_complete
gpt-researcher-1 | return future.result()
gpt-researcher-1 | ^^^^^^^^^^^^^^^
gpt-researcher-1 | File "/usr/local/lib/python3.11/site-packages/uvicorn/server.py", line 70, in serve
gpt-researcher-1 | await self._serve(sockets)
gpt-researcher-1 | File "/usr/local/lib/python3.11/site-packages/uvicorn/server.py", line 77, in _serve
gpt-researcher-1 | config.load()
gpt-researcher-1 | File "/usr/local/lib/python3.11/site-packages/uvicorn/config.py", line 435, in load
gpt-researcher-1 | self.loaded_app = import_from_string(self.app)
gpt-researcher-1 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
gpt-researcher-1 | File "/usr/local/lib/python3.11/site-packages/uvicorn/importer.py", line 19, in import_from_string
gpt-researcher-1 | module = importlib.import_module(module_str)
gpt-researcher-1 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
gpt-researcher-1 | File "/usr/local/lib/python3.11/importlib/init.py", line 126, in import_module
gpt-researcher-1 | return _bootstrap._gcd_import(name[level:], package, level)
gpt-researcher-1 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
gpt-researcher-1 | File "", line 1204, in _gcd_import
gpt-researcher-1 | File "", line 1176, in _find_and_load
gpt-researcher-1 | File "", line 1147, in _find_and_load_unlocked
gpt-researcher-1 | File "", line 690, in _load_unlocked
gpt-researcher-1 | File "", line 940, in exec_module
gpt-researcher-1 | File "", line 241, in _call_with_frames_removed
gpt-researcher-1 | File "/usr/src/app/main.py", line 31, in
gpt-researcher-1 | from backend.server.server import app
gpt-researcher-1 | File "/usr/src/app/backend/init.py", line 1, in
gpt-researcher-1 | from multi_agents import agents
gpt-researcher-1 | File "/usr/src/app/multi_agents/init.py", line 3, in
gpt-researcher-1 | from .agents import (
gpt-researcher-1 | File "/usr/src/app/multi_agents/agents/init.py", line 1, in
gpt-researcher-1 | from .researcher import ResearchAgent
gpt-researcher-1 | File "/usr/src/app/multi_agents/agents/researcher.py", line 1, in
gpt-researcher-1 | from gpt_researcher import GPTResearcher
gpt-researcher-1 | File "/usr/src/app/gpt_researcher/init.py", line 1, in
gpt-researcher-1 | from .agent import GPTResearcher
gpt-researcher-1 | File "/usr/src/app/gpt_researcher/agent.py", line 16, in
gpt-researcher-1 | from .skills.deep_research import DeepResearchSkill
gpt-researcher-1 | File "/usr/src/app/gpt_researcher/skills/deep_research.py", line 301
gpt-researcher-1 | """
gpt-researcher-1 | ^
gpt-researcher-1 | SyntaxError: f-string expression part cannot include a backslash
gpt-researcher-1 exited with code 1

@ElishaKay
Copy link
Collaborator

ElishaKay commented Feb 24, 2025

Welcome @Fangziyang0910

We merged 2 fixes - can you pull master, try again and let me know if the issue persists?

@Fangziyang0910
Copy link
Author

Fangziyang0910 commented Feb 24, 2025

I've tried many times, and the problem still exists.
I tried building this project with Docker on February 22nd without any problems. I've looked at other issues, and it seems like this problem started yesterday?

@ElishaKay
Copy link
Collaborator

ElishaKay commented Feb 24, 2025

k, digging in now.
WIP here: #1191

@galenyip
Copy link

In master@863c4b6, there is an error when start the docker (by docker compose):

next.js report error: Failed to compile: https://nextjs.org/docs/messages/module-not-found
import { CloseIcon } from '@chakra-ui/icons';

related to file below:

import { CloseIcon } from '@chakra-ui/icons';

@ElishaKay
Copy link
Collaborator

Hey @galenyip,

That dependency is in the package.json, so I assume it should work when you run docker compose up --build

Try to stop and remove your gptr-nextjs container and then run the docker compose command again

@Fangziyang0910
Copy link
Author

where is the "Deep Research" in the web interface?
I didn't find it, and I didn't find any difference between this version and the previous one.
How should I enable deep research?
i use docker and use it in 127.0.0.1:8000

Image

@ElishaKay
Copy link
Collaborator

@Fangziyang0910

You can pull this branch and visit localhost:3000

#1191

P.S. the PR is pending merging into master

Deep Research Docs here

Here's how the pip package runs the deep research flow:

researcher = GPTResearcher(
    query="your query",
    report_type="deep"
)

@arsaboo
Copy link
Contributor

arsaboo commented Feb 24, 2025

localhost:3000 doesn't work for me....and the 8000 one is still not working @ElishaKay

With 3000, I see wss://192.168.2.162:3000/ws' failed: in the browser logs. I think we discussed that this is wrong, but I am not sure why does it refer to port 3000 or how to fix it.

@Fangziyang0910
Copy link
Author

I found the entrance to deep research, but a new problem has emerged。
This looks like a WebSocket connection issue. I'm wondering if the problem is with the code, Travily, or my OpenRouter API?

i set
DEEP_RESEARCH_BREADTH=4
DEEP_RESEARCH_DEPTH=4
DEEP_RESEARCH_CONCURRENCY=4
TOTAL_WORDS=10000

here is the terminal output log

gpt-researcher-1 | 2025-02-24 15:39:24,497 - gpt_researcher.skills.deep_research - ERROR - Error processing query '"Hybrid LLM and Traditional Optimization: Automated Problem Formulation and Adaptive Dual-Role Strategies Across Diverse Domains"': Cannot call "send" once a close message has been sent.
gpt-researcher-1 | 2025-02-24 15:39:24,497 - gpt_researcher.skills.deep_research - INFO - Total research execution time: 0:03:47.701954
gpt-researcher-1 | INFO: [15:39:24] ✍️ Writing report for 'Frontier Research on Solving Combinatorial Optimization Problems with the Assistance of Large Language Models'...
gpt-researcher-1 | ERROR: Exception in ASGI application
gpt-researcher-1 | Traceback (most recent call last):
gpt-researcher-1 | File "/usr/local/lib/python3.11/site-packages/uvicorn/protocols/websockets/websockets_impl.py", line 243, in run_asgi
gpt-researcher-1 | result = await self.app(self.scope, self.asgi_receive, self.asgi_send) # type: ignore[func-returns-value]
gpt-researcher-1 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
gpt-researcher-1 | File "/usr/local/lib/python3.11/site-packages/uvicorn/middleware/proxy_headers.py", line 60, in call
gpt-researcher-1 | return await self.app(scope, receive, send)
gpt-researcher-1 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
gpt-researcher-1 | File "/usr/local/lib/python3.11/site-packages/fastapi/applications.py", line 1054, in call
gpt-researcher-1 | await super().call(scope, receive, send)
gpt-researcher-1 | File "/usr/local/lib/python3.11/site-packages/starlette/applications.py", line 112, in call
gpt-researcher-1 | await self.middleware_stack(scope, receive, send)
gpt-researcher-1 | File "/usr/local/lib/python3.11/site-packages/starlette/middleware/errors.py", line 152, in call
gpt-researcher-1 | await self.app(scope, receive, send)
gpt-researcher-1 | File "/usr/local/lib/python3.11/site-packages/starlette/middleware/cors.py", line 77, in call
gpt-researcher-1 | await self.app(scope, receive, send)
gpt-researcher-1 | File "/usr/local/lib/python3.11/site-packages/starlette/middleware/exceptions.py", line 62, in call
gpt-researcher-1 | await wrap_app_handling_exceptions(self.app, conn)(scope, receive, send)
gpt-researcher-1 | File "/usr/local/lib/python3.11/site-packages/starlette/_exception_handler.py", line 53, in wrapped_app
gpt-researcher-1 | raise exc
gpt-researcher-1 | File "/usr/local/lib/python3.11/site-packages/starlette/_exception_handler.py", line 42, in wrapped_app
gpt-researcher-1 | await app(scope, receive, sender)
gpt-researcher-1 | File "/usr/local/lib/python3.11/site-packages/starlette/routing.py", line 715, in call
gpt-researcher-1 | await self.middleware_stack(scope, receive, send)
gpt-researcher-1 | File "/usr/local/lib/python3.11/site-packages/starlette/routing.py", line 735, in app
gpt-researcher-1 | await route.handle(scope, receive, send)
gpt-researcher-1 | File "/usr/local/lib/python3.11/site-packages/starlette/routing.py", line 362, in handle
gpt-researcher-1 | await self.app(scope, receive, send)
gpt-researcher-1 | File "/usr/local/lib/python3.11/site-packages/starlette/routing.py", line 95, in app
gpt-researcher-1 | await wrap_app_handling_exceptions(app, session)(scope, receive, send)
gpt-researcher-1 | File "/usr/local/lib/python3.11/site-packages/starlette/_exception_handler.py", line 53, in wrapped_app
gpt-researcher-1 | raise exc
gpt-researcher-1 | File "/usr/local/lib/python3.11/site-packages/starlette/_exception_handler.py", line 42, in wrapped_app
gpt-researcher-1 | await app(scope, receive, sender)
gpt-researcher-1 | File "/usr/local/lib/python3.11/site-packages/starlette/routing.py", line 93, in app
gpt-researcher-1 | await func(session)
gpt-researcher-1 | File "/usr/local/lib/python3.11/site-packages/fastapi/routing.py", line 383, in app
gpt-researcher-1 | await dependant.call(**solved_result.values)
gpt-researcher-1 | File "/usr/src/app/backend/server/server.py", line 132, in websocket_endpoint
gpt-researcher-1 | await handle_websocket_communication(websocket, manager)
gpt-researcher-1 | File "/usr/src/app/backend/server/server_utils.py", line 251, in handle_websocket_communication
gpt-researcher-1 | await handle_start_command(websocket, data, manager)
gpt-researcher-1 | File "/usr/src/app/backend/server/server_utils.py", line 148, in handle_start_command
gpt-researcher-1 | report = await manager.start_streaming(
gpt-researcher-1 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
gpt-researcher-1 | File "/usr/src/app/backend/server/websocket_manager.py", line 67, in start_streaming
gpt-researcher-1 | report = await run_agent(task, report_type, report_source, source_urls, document_urls, tone, websocket, headers = headers, query_domains = query_domains, config_path = config_path)
gpt-researcher-1 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
gpt-researcher-1 | File "/usr/src/app/backend/server/websocket_manager.py", line 123, in run_agent
gpt-researcher-1 | report = await researcher.run()
gpt-researcher-1 | ^^^^^^^^^^^^^^^^^^^^^^
gpt-researcher-1 | File "/usr/src/app/backend/report_type/basic_report/basic_report.py", line 48, in run
gpt-researcher-1 | report = await researcher.write_report()
gpt-researcher-1 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
gpt-researcher-1 | File "/usr/src/app/gpt_researcher/agent.py", line 192, in write_report
gpt-researcher-1 | report = await self.report_generator.write_report(
gpt-researcher-1 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
gpt-researcher-1 | File "/usr/src/app/gpt_researcher/skills/writer.py", line 56, in write_report
gpt-researcher-1 | await stream_output(
gpt-researcher-1 | File "/usr/src/app/gpt_researcher/actions/utils.py", line 29, in stream_output
gpt-researcher-1 | await websocket.send_json(
gpt-researcher-1 | File "/usr/src/app/backend/server/server_utils.py", line 46, in send_json
gpt-researcher-1 | await self.websocket.send_json(data)
gpt-researcher-1 | File "/usr/local/lib/python3.11/site-packages/starlette/websockets.py", line 175, in send_json
gpt-researcher-1 | await self.send({"type": "websocket.send", "text": text})
gpt-researcher-1 | File "/usr/local/lib/python3.11/site-packages/starlette/websockets.py", line 97, in send
gpt-researcher-1 | raise RuntimeError('Cannot call "send" once a close message has been sent.')
gpt-researcher-1 | RuntimeError: Cannot call "send" once a close message has been sent.

@galenyip
Copy link

Hey @galenyip,

That dependency is in the package.json, so I assume it should work when you run docker compose up --build

Try to stop and remove your gptr-nextjs container and then run the docker compose command again

@ElishaKay

Just do a docker rmi -all to remove all images and docker compose up --build again, and still hitting the same error:

Image

My Environment:

  • Win11
  • master@98cf0f88

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants
@galenyip @ElishaKay @arsaboo @Fangziyang0910 and others