Changedetection: Launch options aren't Base64 encoded #1401

Closed
opened 2025-11-20 05:09:38 -05:00 by saavagebueno · 9 comments
Owner

Originally created by @Denny-89 on GitHub (Jul 1, 2025).

Have you read and understood the above guidelines?

yes

📜 What is the name of the script you are using?

Change Detection

📂 What was the exact command used to execute the script?

bash -c "$(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/ct/changedetection.sh)"

⚙️ What settings are you using?

  • Default Settings
  • Advanced Settings

🖥️ Which Linux distribution are you using?

Debian 12

📝 Provide a clear and concise description of the issue.

For some reason the Playwright Chrome fetcher stopped working if the {"defaultViewport":{"height":720,"width":1280},"headless":false,"stealth":true} portion of PLAYWRIGHT_DRIVER_URL=ws://localhost:3000/chrome?launch={"defaultViewport":{"height":720,"width":1280},"headless":false,"stealth":true}&blockAds=true isn't Base64 encoded.

Anyway, here's the fix that works for me:

Replace
Environment=PLAYWRIGHT_DRIVER_URL=ws://localhost:3000/chrome?launch={"defaultViewport":{"height":720,"width":1280},"headless":false,"stealth":true}&blockAds=true
with
Environment=PLAYWRIGHT_DRIVER_URL=ws://localhost:3000/chrome?launch=eyJkZWZhdWx0Vmlld3BvcnQiOnsiaGVpZ2h0Ijo3MjAsIndpZHRoIjoxMjgwfSwiaGVhZGxlc3MiOmZhbHNlLCJzdGVhbHRoIjp0cnVlfQ==&blockAds=true
inside changedetection-install.sh

The Base64 string can be obtained from any free online Base64 encoder. I've used base64encode.org.

🔄 Steps to reproduce the issue.

Step 1: Make a new Change Detection LXC or update an existing LXC that was made with the script
Step 2: Add a new URL or edit an existing one to use the Playwright fetcher (Edit -> Request -> Save)
Step 3: Recheck the URL from Step 2 and enjoy the error

Paste the full error output (if available).

Exception: BrowserType.connect_over_cdp: WebSocket error: ws://localhost:3000/chrome 400 Bad Request Error parsing launch-options: SyntaxError: Expected property name or '}' in JSON at position 1 (line 1 column 2). Launch options must be a JSON or base64-encoded JSON object Call log: - ws://localhost:3000/chrome - ws://localhost:3000/chrome 400 Bad Request Error parsing launch-options: SyntaxError: Expected property name or '}' in JSON at position 1 (line 1 column 2). Launch options must be a JSON or base64-encoded JSON object - ws://localhost:3000/chrome error WebSocket was closed before the connection was established - ws://localhost:3000/chrome WebSocket was closed before the connection was established - ws://localhost:3000/chrome code=1006 reason=

🖼️ Additional context (optional).

It took me hours of looking through Browserless, Playwright and Changedetection.io commits of the last 14 days without finding out exactly why. Maybe because of Node 22 since they (browserless) recently changed the minimum requirement to 24? No idea. Here's the log from running the script in verbose mode in case it helps:

npm warn EBADENGINE Unsupported engine {
npm warn EBADENGINE   package: '@browserless.io/browserless@2.32.1',
npm warn EBADENGINE   required: { node: '>= 24 < 25' },
npm warn EBADENGINE   current: { node: 'v22.17.0', npm: '11.4.2' }
npm warn EBADENGINE }
Originally created by @Denny-89 on GitHub (Jul 1, 2025). ### ✅ Have you read and understood the above guidelines? yes ### 📜 What is the name of the script you are using? Change Detection ### 📂 What was the exact command used to execute the script? bash -c "$(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/ct/changedetection.sh)" ### ⚙️ What settings are you using? - [x] Default Settings - [ ] Advanced Settings ### 🖥️ Which Linux distribution are you using? Debian 12 ### 📝 Provide a clear and concise description of the issue. For some reason the Playwright Chrome fetcher stopped working if the `{"defaultViewport":{"height":720,"width":1280},"headless":false,"stealth":true}` portion of `PLAYWRIGHT_DRIVER_URL=ws://localhost:3000/chrome?launch={"defaultViewport":{"height":720,"width":1280},"headless":false,"stealth":true}&blockAds=true` isn't Base64 encoded. Anyway, here's the fix that works for me: Replace `Environment=PLAYWRIGHT_DRIVER_URL=ws://localhost:3000/chrome?launch={"defaultViewport":{"height":720,"width":1280},"headless":false,"stealth":true}&blockAds=true` with `Environment=PLAYWRIGHT_DRIVER_URL=ws://localhost:3000/chrome?launch=eyJkZWZhdWx0Vmlld3BvcnQiOnsiaGVpZ2h0Ijo3MjAsIndpZHRoIjoxMjgwfSwiaGVhZGxlc3MiOmZhbHNlLCJzdGVhbHRoIjp0cnVlfQ==&blockAds=true` inside `changedetection-install.sh` The Base64 string can be obtained from any free online Base64 encoder. I've used `base64encode.org`. ### 🔄 Steps to reproduce the issue. Step 1: Make a new Change Detection LXC or update an existing LXC that was made with the script Step 2: Add a new URL or edit an existing one to use the Playwright fetcher (Edit -> Request -> Save) Step 3: Recheck the URL from Step 2 and enjoy the error ### ❌ Paste the full error output (if available). Exception: BrowserType.connect_over_cdp: WebSocket error: ws://localhost:3000/chrome 400 Bad Request Error parsing launch-options: SyntaxError: Expected property name or '}' in JSON at position 1 (line 1 column 2). Launch options must be a JSON or base64-encoded JSON object Call log: - <ws connecting> ws://localhost:3000/chrome - <ws unexpected response> ws://localhost:3000/chrome 400 Bad Request Error parsing launch-options: SyntaxError: Expected property name or '}' in JSON at position 1 (line 1 column 2). Launch options must be a JSON or base64-encoded JSON object - <ws error> ws://localhost:3000/chrome error WebSocket was closed before the connection was established - <ws connect error> ws://localhost:3000/chrome WebSocket was closed before the connection was established - <ws disconnected> ws://localhost:3000/chrome code=1006 reason= ### 🖼️ Additional context (optional). It took me hours of looking through Browserless, Playwright and Changedetection.io commits of the last 14 days without finding out exactly why. Maybe because of Node 22 since they (browserless) recently changed the minimum requirement to 24? No idea. Here's the log from running the script in verbose mode in case it helps: ``` npm warn EBADENGINE Unsupported engine { npm warn EBADENGINE package: '@browserless.io/browserless@2.32.1', npm warn EBADENGINE required: { node: '>= 24 < 25' }, npm warn EBADENGINE current: { node: 'v22.17.0', npm: '11.4.2' } npm warn EBADENGINE } ```
saavagebueno added the bug label 2025-11-20 05:09:38 -05:00
Author
Owner

@Denny-89 commented on GitHub (Jul 1, 2025):

I noticed i forgot to add why i even tried to fix it with Base64:

https://github.com/browserless/browserless/blob/main/MIGRATION-2.0.md#launch-flags

It is highly recommended the parameters after launch= be base64 for proper recognition. Failure to base64 encode will nearly guarantee these parameters are not accepted if they have characters such as curly braces or brackets.

@Denny-89 commented on GitHub (Jul 1, 2025): I noticed i forgot to add why i even tried to fix it with Base64: https://github.com/browserless/browserless/blob/main/MIGRATION-2.0.md#launch-flags > It is highly recommended the parameters after `launch=` be base64 for proper recognition. Failure to base64 encode will nearly guarantee these parameters are not accepted if they have characters such as curly braces or brackets.
Author
Owner

@burgerga commented on GitHub (Jul 2, 2025):

Can reproduce, and your fix also works for me!

@burgerga commented on GitHub (Jul 2, 2025): Can reproduce, and your fix also works for me!
Author
Owner

@xyzulu commented on GitHub (Jul 2, 2025):

While I've fixed it myself (editing the service) the LXC updater script isn't going to fix this for any current uses. Is this something you plan to address?

@xyzulu commented on GitHub (Jul 2, 2025): While I've fixed it myself (editing the service) the LXC updater script isn't going to fix this for any current uses. Is this something you plan to address?
Author
Owner

@MickLesk commented on GitHub (Jul 2, 2025):

And what exactly does it not fix? What should the solution look like? None of us use the script, so it needs proper input. Otherwise it will never work and we will fix the script 100x

@MickLesk commented on GitHub (Jul 2, 2025): And what exactly does it not fix? What should the solution look like? None of us use the script, so it needs proper input. Otherwise it will never work and we will fix the script 100x
Author
Owner

@xyzulu commented on GitHub (Jul 2, 2025):

And what exactly does it not fix? What should the solution look like? None of us use the script, so it needs proper input. Otherwise it will never work and we will fix the script 100x

To fix an existing install:

/etc/systemd/system/changedetection.service needs to be edited to change

Environment=PLAYWRIGHT_DRIVER_URL=ws://localhost:3000/chrome?launch={"defaultViewport":{"height":720,"width":1280},"headless":false,"stealth":true}&blockAds=true

to

Environment=PLAYWRIGHT_DRIVER_URL=ws://localhost:3000/chrome?launch=eyJkZWZhdWx0Vmlld3BvcnQiOnsiaGVpZ2h0Ijo3MjAsIndpZHRoIjoxMjgwfSwiaGVhZGxlc3MiOmZhbHNlLCJzdGVhbHRoIjp0cnVlfQ==&blockAds=true

@xyzulu commented on GitHub (Jul 2, 2025): > And what exactly does it not fix? What should the solution look like? None of us use the script, so it needs proper input. Otherwise it will never work and we will fix the script 100x To fix an existing install: `/etc/systemd/system/changedetection.service` needs to be edited to change `Environment=PLAYWRIGHT_DRIVER_URL=ws://localhost:3000/chrome?launch={"defaultViewport":{"height":720,"width":1280},"headless":false,"stealth":true}&blockAds=true` to `Environment=PLAYWRIGHT_DRIVER_URL=ws://localhost:3000/chrome?launch=eyJkZWZhdWx0Vmlld3BvcnQiOnsiaGVpZ2h0Ijo3MjAsIndpZHRoIjoxMjgwfSwiaGVhZGxlc3MiOmZhbHNlLCJzdGVhbHRoIjp0cnVlfQ==&blockAds=true`
Author
Owner

@MickLesk commented on GitHub (Jul 3, 2025):

We dont change this for existing Installs, maybe an Info in Discussions will be enough, because some Guys Change the service Files and we overwrite this with such changes

@MickLesk commented on GitHub (Jul 3, 2025): We dont change this for existing Installs, maybe an Info in Discussions will be enough, because some Guys Change the service Files and we overwrite this with such changes
Author
Owner

@xyzulu commented on GitHub (Jul 3, 2025):

We dont change this for existing Installs, maybe an Info in Discussions will be enough, because some Guys Change the service Files and we overwrite this with such changes

Done: https://github.com/community-scripts/ProxmoxVE/discussions/5660
Hope it's the right spot etc..

@xyzulu commented on GitHub (Jul 3, 2025): > We dont change this for existing Installs, maybe an Info in Discussions will be enough, because some Guys Change the service Files and we overwrite this with such changes Done: https://github.com/community-scripts/ProxmoxVE/discussions/5660 Hope it's the right spot etc..
Author
Owner

@dgtlmoon commented on GitHub (Jul 3, 2025):

Hello from changedetection.io :) We havent changed anything on our end, everything is automated tested, see our default docker-compose.yml :)

@dgtlmoon commented on GitHub (Jul 3, 2025): Hello from changedetection.io :) We havent changed anything on our end, everything is automated tested, see our default docker-compose.yml :)
Author
Owner

@tremor021 commented on GitHub (Jul 3, 2025):

Yea, but for some reason tteck's script includes launch options for playwright, so we're just fixing the script so changedetection can keep on working without issues :)

@tremor021 commented on GitHub (Jul 3, 2025): Yea, but for some reason tteck's script includes launch options for playwright, so we're just fixing the script so changedetection can keep on working without issues :)
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: SVI/ProxmoxVE#1401