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 Steps gives "Response object is not subscriptable" when theres a configuration error - improve error handling #1823

Closed
dgtlmoon opened this issue Sep 27, 2023 Discussed in #1813 · 14 comments
Labels

Comments

@dgtlmoon
Copy link
Owner

Discussed in #1813

Originally posted by FhenrisGit September 25, 2023
Describe the bug
If I try to use Browser Steps, It doesn't work and I have a popup :
'Response" object is not subscriptable

Version
0.45.2

To Reproduce

Steps to reproduce the behavior:

  1. Go to Browser Steps
  2. Click on "click here to start"
  3. See error

Expected behavior
A clear and concise description of what you expected to happen.

Screenshots
Browser Steps Error

Desktop (please complete the following information):

  • Windows 10
  • Chrome
  • Version 116.0.5845.188

Smartphone (please complete the following information):

  • No

Additional context
Docker install on TrueNas Scale, using browserless-chrome

@dgtlmoon
Copy link
Owner Author

             if step_operation == 'Goto site':
+              #  if browsersteps_sessions[browsersteps_session_id] != 200:
+              #      return make_response("Browser Steps failed to connect to Playwright correctly.\n\n"+browsersteps_sessions[browsersteps_session_id].data.decode('utf8'), 401)
+

something like this, the problem is when browser steps cant connect to playwright, it doesnt cleanly report the situation/exception (cant resolve hostname, etc)

@dgtlmoon
Copy link
Owner Author

        try:
            browsersteps_start_session['browser'] = io_interface_context.chromium.connect_over_cdp(
                os.getenv('PLAYWRIGHT_DRIVER_URL', '') + keepalive)
        except Exception as e:
            if 'ECONNREFUSED' in str(e):
                return make_response('Unable to start the Playwright Browser session, is it running?', 401)
            else:
                return make_response(str(e), 401)

probably this stuff is not catching

@dgtlmoon dgtlmoon changed the title Browser Steps gives "Response object is not subscriptable" - improve error handling Browser Steps gives "Response object is not subscriptable" when theres a configuration error - improve error handling Oct 4, 2023
@techc0de
Copy link

techc0de commented Nov 2, 2023

Hi,

I got the same error with the version v0.45.5.
How do I fix it?

@techc0de
Copy link

techc0de commented Nov 2, 2023

I'm trying to use v0.45.4 by cleared the cache, but encountered the same issue!

@techc0de
Copy link

With the current v0.45.7.3, this error is persist.
New error occurred:

page closed =========================== logs =========================== navigating to "https://portal.website.com/login", waiting until "load" ============================================================

@dgtlmoon
Copy link
Owner Author

network error?

@techc0de
Copy link

I don't think so.
With trial and error, I was able to find a working version: v0.45.3.
By the way, the URL is password-protected.

@dgtlmoon
Copy link
Owner Author

This discussion is about the error message "Response object is not subscriptable"

please dont cross-contaminate the comments on threads, its best to start a new discussion

title: Browser Steps gives "Response object is not subscriptable" when theres a configuration error - improve error handling

@techc0de
Copy link

With the latest version, It still giving the same error along with the new error.

@Adrianni
Copy link

I am experiencing the same error. Freshly pulled from project

@sph3rex
Copy link

sph3rex commented Nov 26, 2023

This is probably because of some updates in browserless/chrome. For me it works locally (with some minor issues that I'm not sure are related) like this:

  • latest version of changedetection.io via docker and with env -e PLAYWRIGHT_DRIVER_URL="ws://browserless:3000/" where browserless is the ip or host of your browserless chrome
  • using latest version of browserless/chrome

@techc0de
Copy link

I'm using this env: PLAYWRIGHT_DRIVER_URL=ws://playwright-chrome:3000/?stealth=1&--disable-web-security=true

@mrnoisytiger
Copy link

Also having this issue using the same environmental variable as @techc0de.

Running the latest docker container on both ends (ChangeDetection and Playwright) as of today.

@dgtlmoon
Copy link
Owner Author

Its often because the network (your container, container hostname of the chrome browser etc) is configured wrong

dgtlmoon added a commit that referenced this issue Jan 10, 2024
dgtlmoon added a commit that referenced this issue Jan 11, 2024
… quotes were used in connection URL - Quote wrapped URL for browserstep url was breaking the connection #1627 #1823 #2099 (#2100)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants