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 : 401 UNAUTHORIZED #1627

Closed
lionelhorn opened this issue Jun 14, 2023 · 4 comments
Closed

Browser Steps : 401 UNAUTHORIZED #1627

lionelhorn opened this issue Jun 14, 2023 · 4 comments
Assignees
Labels

Comments

@lionelhorn
Copy link

Describe the bug
Using browser steps, and clicking "Click here to start", I'm getting an alert box with "'Response' object is not subscriptable"

Version
v0.42.3

To Reproduce

Steps to reproduce the behavior:

  1. Go to Browser steps
  2. Click "Click here to start"
  3. See error "Response' object is not subscriptable" in screenshots

Expected behavior
Website to load.

Screenshots
image

Desktop (please complete the following information):

  • OS: Windows
  • Browser : Chrome
  • Version 114.0.5735.110 (Official build) (64 bits)

Additional context
Running on docker using the following docker-compose

version: '3.2'
services:
    changedetection:
      image: dgtlmoon/changedetection.io:dev
      container_name: changedetection
      volumes:
        - 'C:\VMs\DockerVolumes\changedetection\datastore:/datastore'
      environment:
        - PLAYWRIGHT_DRIVER_URL="ws://browserless:3000"
        - BASE_URL=http://localhost:5000
      ports:
        - 5000:5000
      restart: unless-stopped
      depends_on:
          browserless:
              condition: service_started

    browserless:
      hostname: browserless
      image: browserless/chrome:latest
      shm_size: 2gb
      environment:
          - SCREEN_WIDTH=1920
          - SCREEN_HEIGHT=1080
          - SCREEN_DEPTH=24
          - CONNECTION_TIMEOUT=300000
      restart: unless-stopped
      ports:
        - 3000:3000

401 error

POST /browser-steps/browsersteps_update?uuid=313f0de0-c069-4933-9729-573079484426&browsersteps_session_id=b3bdde59-cedc-4ce6-97d4-1e5834f23421 HTTP/1.1
Accept: */*
Accept-Encoding: gzip, deflate, br
Accept-Language: en-US,en;q=0.9,fr-FR;q=0.8,fr;q=0.7
Cache-Control: no-cache
Connection: keep-alive
Content-Length: 72
Content-Type: application/x-www-form-urlencoded; charset=UTF-8
Cookie: session=eyJjc3JmX3Rva2VuIjoiYWM2NzJkYWIwYWVmNGI0ZWNmZTJhZGU4MGIwNmNmMzQ3ZDRhNDQ1MSJ9.ZImlkg.TvpRGUlO683xoOGGFJwpBd-hwyM
Host: localhost:5000
Origin: http://localhost:5000
Pragma: no-cache
Referer: http://localhost:5000/edit/313f0de0-c069-4933-9729-573079484426
Sec-Fetch-Dest: empty
Sec-Fetch-Mode: cors
Sec-Fetch-Site: same-origin
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/114.0.0.0 Safari/537.36
X-CSRFToken: ImFjNjcyZGFiMGFlZjRiNGVjZmUyYWRlODBiMDZjZjM0N2Q0YTQ0NTEi.ZImlkg.SAtS1mqBG01J-nxN7Ust1K6J190
X-Requested-With: XMLHttpRequest
sec-ch-ua: "Not.A/Brand";v="8", "Chromium";v="114", "Google Chrome";v="114"
sec-ch-ua-mobile: ?0
sec-ch-ua-platform: "Windows"
HTTP/1.1 401 UNAUTHORIZED
Content-Type: text/html; charset=utf-8
Content-Length: 38
Vary: Accept-Encoding, Cookie
Date: Wed, 14 Jun 2023 11:30:59 GMT
Connection: keep-alive
'Response' object is not subscriptable

@dgtlmoon
Copy link
Owner

HTTP/1.1 401 UNAUTHORIZED is not from the app, you might have some other custom setup? can you explain anything about that situation?

@lionelhorn
Copy link
Author

I'm not sure to follow your answer as the 401 is from localhost:5000 which is the port or the dgtlmoon/changedetection.io:dev container.

image

@lionelhorn
Copy link
Author

Using the following docker-compose got it working a bit better.

version: '3.8'
name: changedetection-original
services:
    changedetection:
      image: ghcr.io/dgtlmoon/changedetection.io
      container_name: changedetection
      hostname: changedetection
      volumes:
        - changedetection-data:/datastore
      environment:
        - PORT=5000
        - PLAYWRIGHT_DRIVER_URL=ws://playwright-chrome:3000/?stealth=1&--disable-web-security=true
      ports:
        - 5000:5000
      restart: unless-stopped
      depends_on:
          playwright-chrome:
              condition: service_started
    playwright-chrome:
        hostname: playwright-chrome
        image: browserless/chrome
        restart: unless-stopped
        environment:
            - SCREEN_WIDTH=1920
            - SCREEN_HEIGHT=1024
            - SCREEN_DEPTH=16
            - ENABLE_DEBUGGER=false
            - PREBOOT_CHROME=true
            - CONNECTION_TIMEOUT=300000
            - MAX_CONCURRENT_SESSIONS=10
            - CHROME_REFRESH_TIME=600000
            - DEFAULT_BLOCK_ADS=true
            - DEFAULT_STEALTH=true
            - DEFAULT_IGNORE_HTTPS_ERRORS=true
        ports:
          - 3000:3000

volumes:
  changedetection-data:

@lionelhorn
Copy link
Author

But now getting xpath errors even on the most simple //div[1] selector.

When tested in devconsole, it returns 64 results.
image

Exception when calling step operation Wait for text in element DOMException: Failed to execute 'querySelector' on 'Document': '//div[1]' is not a valid selector.
2023-06-27 00:22:15 at eval (eval at predicate (eval at evaluate (:191:30)), :1:10)
2023-06-27 00:22:15 at eval ()
2023-06-27 00:22:15 at predicate (eval at evaluate (:191:30), :8:27)
2023-06-27 00:22:15 at eval (eval at evaluate (:191:30), :22:82)
2023-06-27 00:22:15 at next (:4411:27)
2023-06-27 00:22:15 at :4421:7
2023-06-27 00:22:15 at Object.run (:4465:22)
2023-06-27 00:22:15 at eval (eval at evaluate (:191:30), :1:14)
2023-06-27 00:22:15 at UtilityScript.evaluate (:193:17)
2023-06-27 00:22:15 at UtilityScript. (:1:44)

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

2 participants