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

browser.newContext: Target page, context or browser has been closed #492

Open
yuexingliang opened this issue Mar 21, 2025 · 7 comments · Fixed by #498
Open

browser.newContext: Target page, context or browser has been closed #492

yuexingliang opened this issue Mar 21, 2025 · 7 comments · Fixed by #498
Assignees
Labels
Status: Work In Progess This issue/PR is actively being worked on Type: Bug Something isn't working

Comments

@yuexingliang
Copy link

Image

机器人开始抓取数据的时候,创建浏览器异常了,是什么原因?

报错信息如下:
[0] /app/node_modules/playwright-extra/src/extra.ts:267
[0] const context = await originalMethod.call(ctx, contextOptions)
[0] ^
[0] browser.newContext: Target page, context or browser has been closed
[0] at async Browser.newContext (/app/node_modules/playwright-extra/src/extra.ts:267:25)
[0] at async RemoteBrowser.initialize (/app/server/src/browser-management/classes/RemoteBrowser.ts:295:24)
[0] at /app/async /app/server/src/browser-management/controller.ts:37:9
[0] [nodemon] app crashed - waiting for file changes before starting...

@amhsirak
Copy link
Member

@yuexingliang can you confirm does this happen everytime or just sometimes?

@RohitR311 look into this

@amhsirak amhsirak added Type: Bug Something isn't working Status: Needs more info Requires more context labels Mar 21, 2025
@yuexingliang
Copy link
Author

@yuexingliang can you confirm does this happen everytime or just sometimes?

@RohitR311 look into this

每次都这样,我的浏览器启动不起来,不能使用数据抓取功能

@amhsirak
Copy link
Member

@yuexingliang Thanks for the quick response. We do not see this happening on every local setup. Could you share more about your configuration

  1. Operating System
  2. Are you behind a proxy/firewall?
  3. Local or Docker installation?
  4. Docker logs
  5. Browser console logs (if any)

@yuexingliang
Copy link
Author

@yuexingliang Thanks for the quick response. We do not see this happening on every local setup. Could you share more about your configuration

  1. Operating System
  2. Are you behind a proxy/firewall?
  3. Local or Docker installation?
  4. Docker logs
  5. Browser console logs (if any)

Operating System
Image

.env

App Setup

NODE_ENV=production # Set to 'development' or 'production' as required
JWT_SECRET=HtMemaPiDfHfFRp0YASfTZOWgGqKPMwDFbq1ITnS # Replace with a secure JWT secret key
DB_NAME=maxun # Your PostgreSQL database name
DB_USER=maxun # PostgreSQL username
DB_PASSWORD=maxun # PostgreSQL password
DB_HOST=postgres # Host for PostgreSQL in Docker
DB_PORT=5432 # Port for PostgreSQL (default: 5432)
ENCRYPTION_KEY=f4d5e6a7b8c9d0e1f23456789abcdef01234567890abcdef123456789abcdef0 # Key for encrypting sensitive data (passwords and proxies)
MINIO_ENDPOINT=minio # MinIO endpoint in Docker
MINIO_PORT=9000 # Port for MinIO (default: 9000)
MINIO_CONSOLE_PORT=9001 # Web UI Port for MinIO (default: 9001)
MINIO_ACCESS_KEY=minioadmin # MinIO access key
MINIO_SECRET_KEY=minioadmin # MinIO secret key
REDIS_HOST=maxun-redis-1 # Redis host in Docker
REDIS_PORT=6379 # Redis port (default: 6379)
#REDIS_PASSWORD= # Redis password (This is optional. Needed to authenticate with a password-protected Redis instance; if not set, Redis will connect without authentication.)

Backend and Frontend URLs and Ports

BACKEND_PORT=8080 # Port to run backend on. Needed for Docker setup
FRONTEND_PORT=5173 # Port to run frontend on. Needed for Docker setup
BACKEND_URL=http://localhost:8080 # URL on which the backend runs. You can change it based on your needs.
PUBLIC_URL=http://localhost:5173 # URL on which the frontend runs. You can change it based on your needs.
VITE_BACKEND_URL=http://localhost:8080 # URL used by frontend to connect to backend. It should always have the same value as BACKEND_URL
VITE_PUBLIC_URL=http://localhost:5173 # URL used by backend to connect to frontend. It should always have the same value as PUBLIC_URL

Optional Google OAuth settings for Google Sheet Integration

GOOGLE_CLIENT_ID=your_google_client_id
GOOGLE_CLIENT_SECRET=your_google_client_secret
GOOGLE_REDIRECT_URI=your_google_redirect_uri

Optional Airtable OAuth settings for Airtable Integration

AIRTABLE_CLIENT_ID=your_airtable_client_id
AIRTABLE_REDIRECT_URI=http://localhost:8080/auth/airtable/callback

Telemetry Settings - Please keep it enabled. Keeping it enabled helps us understand how the product is used and assess the impact of any new changes.

MAXUN_TELEMETRY=true

3、Docker install, command docker-compose up -d

4、docker logs -f maxun-backend-1

/app/node_modules/playwright-extra/src/extra.ts:267
[0] const context = await originalMethod.call(ctx, contextOptions)
[0] ^
[0] browser.newContext: Target page, context or browser has been closed
[0] at async Browser.newContext (/app/node_modules/playwright-extra/src/extra.ts:267:25)
[0] at async RemoteBrowser.initialize (/app/server/src/browser-management/classes/RemoteBrowser.ts:295:24)
[0] at /app/async /app/server/src/browser-management/controller.ts:37:9
[0] [nodemon] app crashed - waiting for file changes before starting...

5、I couldn't find dockerlog

@yuexingliang
Copy link
Author

@RohitR311 Could you please let me know when this issue is expected to be resolved?

@amhsirak
Copy link
Member

@yuexingliang This is being fixed in #498 and will be available in the next release - which will be this week.

@yuexingliang
Copy link
Author

@yuexingliang This is being fixed in #498 and will be available in the next release - which will be this week.

thanks

@amhsirak amhsirak reopened this Mar 27, 2025
@amhsirak amhsirak added Status: Work In Progess This issue/PR is actively being worked on and removed Status: Needs more info Requires more context labels Mar 27, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: Work In Progess This issue/PR is actively being worked on Type: Bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants