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

WARN HTTPError/42: Response code 400 (Bad Request) #195

Closed
tmyflyte opened this issue Dec 17, 2021 · 27 comments
Closed

WARN HTTPError/42: Response code 400 (Bad Request) #195

tmyflyte opened this issue Dec 17, 2021 · 27 comments
Labels
bug Something isn't working

Comments

@tmyflyte
Copy link

Hi, I'm running in unraid, checked for latest docker version
yesterday worked fine, today I got this error. clues?
Thanks for the support!

[2021-12-16 21:46:25.166 -0300] INFO (42 on 86af86cfbfce): Unpurchased free games
user: "edited"
purchasableGames: [
"Shenmue III - Standard Edition"
]
[2021-12-16 21:46:25.166 -0300] INFO (42 on 86af86cfbfce): Purchasing Shenmue III - Standard Edition
[2021-12-16 21:46:28.581 -0300] WARN (HTTPError/42 on 86af86cfbfce): Response code 400 (Bad Request)
HTTPError: Response code 400 (Bad Request)
at Request. (/usr/app/node_modules/got/dist/source/as-promise/index.js:117:42)
at processTicksAndRejections (internal/process/task_queues.js:95:5)
[2021-12-16 21:46:28.583 -0300] WARN (42 on 86af86cfbfce): API purchase experienced an error, trying puppeteer purchase

@claabs
Copy link
Owner

claabs commented Dec 17, 2021

Epic recently added captchas to the checkout, so the API-based checkout fails. It's designed to fallback to a Puppeteer (browser automation) based checkout.

I'd recommend pulling the latest image and running again.

If you still get API purchase experienced an error, trying puppeteer purchase showing as the last log line, you may be seeing the hangup that occurs to some people. Try out the Debian image (info here) and try again.

@tmyflyte
Copy link
Author

tmyflyte commented Dec 17, 2021

Hi and thanks for the prompt response. I tried the latest image and the debian image, both failed :(

Here's the log from debian version

[2021-12-17 08:46:39.275 -0300] INFO (49 on 788ca9a0b0bd): Purchasing Shenmue III - Standard Edition
[2021-12-17 08:46:39.275 -0300] INFO (49 on 788ca9a0b0bd): Unpurchased free games
user: "redacted"
purchasableGames: [
"Shenmue III - Standard Edition"
]
[2021-12-17 08:46:39.275 -0300] INFO (49 on 788ca9a0b0bd): Purchasing Shenmue III - Standard Edition
[2021-12-17 08:46:41.989 -0300] WARN (HTTPError/49 on 788ca9a0b0bd): Response code 400 (Bad Request)
HTTPError: Response code 400 (Bad Request)
at Request. (/usr/app/node_modules/got/dist/source/as-promise/index.js:117:42)
at processTicksAndRejections (internal/process/task_queues.js:95:5)
[2021-12-17 08:46:41.991 -0300] WARN (49 on 788ca9a0b0bd): API purchase experienced an error, trying puppeteer purchase

@claabs
Copy link
Owner

claabs commented Dec 17, 2021

If you've got time, could you set the log level to trace and run it again? It's hard to know exactly where it's failing/hanging from the info logs.

@tmyflyte
Copy link
Author

Ok here you go

epicgames-freegames-node@4.0.0 entrypoint-config /usr/app
node dist/src/entrypoint-config.js

Setting timezone: America/Sao_Paulo
Run on startup: true
[2021-12-17 14:42:26.780 -0300] INFO (38 on 788ca9a0b0bd): Checking free games for xxx
[2021-12-17 14:42:26.963 -0300] DEBUG (38 on 788ca9a0b0bd): Refreshing login session
user: ""
[2021-12-17 14:42:26.965 -0300] TRACE (38 on 788ca9a0b0bd): Request store homepage
user: "xxx"
url: "https://www.epicgames.com/store/"
[2021-12-17 14:42:28.226 -0300] TRACE (38 on 788ca9a0b0bd): Reputation request
user: "xxx"
url: "https://www.epicgames.com/id/api/reputation"
[2021-12-17 14:42:28.860 -0300] TRACE (38 on 788ca9a0b0bd): Location request
user: "xxx"
url: "https://www.epicgames.com/id/api/location"
[2021-12-17 14:42:29.490 -0300] TRACE (38 on 788ca9a0b0bd): Client redirect request
user: "xxx"
params: {
"redirectUrl": "https://www.epicgames.com/store/"
}
url: "https://www.epicgames.com/id/api/client/xxx"
[2021-12-17 14:42:30.144 -0300] TRACE (38 on 788ca9a0b0bd): Client redirect response
user: "xxx"
resp: {
"clientId": "xxx",
"clientName": "dieselWebsite",
"redirectUrl": "https://www.epicgames.com/store",
"internal": true,
"native": false,
"product": "store",
"allowedScope": [],
"epicLoginOnly": false
}
[2021-12-17 14:42:30.144 -0300] TRACE (38 on 788ca9a0b0bd): Authenticate request
user: "xxx"
url: "https://www.epicgames.com/id/api/authenticate"
[2021-12-17 14:42:30.144 -0300] TRACE (38 on 788ca9a0b0bd): Client redirect response
user: "xxx"
resp: {
"clientId": "xxx",
"clientName": "dieselWebsite",
"redirectUrl": "https://www.epicgames.com/store",
"internal": true,
"native": false,
"product": "store",
"allowedScope": [],
"epicLoginOnly": false
}
[2021-12-17 14:42:30.144 -0300] TRACE (38 on 788ca9a0b0bd): Authenticate request
user: "xxx"
url: "https://www.epicgames.com/id/api/authenticate"
[2021-12-17 14:42:30.798 -0300] TRACE (38 on 788ca9a0b0bd): Authenticate response
user: "xxx"
resp: ""
[2021-12-17 14:42:30.798 -0300] TRACE (38 on 788ca9a0b0bd): Redirect request
user: "xxx"
params: {
"clientId": "",
"redirectUrl": "https://www.epicgames.com/store/"
}
url: "https://www.epicgames.com/id/api/redirect"
[2021-12-17 14:42:31.895 -0300] TRACE (38 on 788ca9a0b0bd): Redirect response
user: "xxx"
resp: {
"redirectUrl": "https://www.epicgames.com/store/",
"authorizationCode": null,
"sid": "2bc7fdd19eb24c03bdd9aa3337b00ed9"
}
[2021-12-17 14:42:31.895 -0300] TRACE (38 on 788ca9a0b0bd): Set SID request
user: "xxx"
params: {
"sid": "2bc7fdd19eb24c03bdd9aa3337b00ed9"
}
url: "https://www.unrealengine.com/id/api/set-sid"
[2021-12-17 14:42:33.157 -0300] TRACE (38 on 788ca9a0b0bd): Set SID response headers
user: "xxx"
headers: {
"date": "Fri, 17 Dec 2021 17:42:32 GMT",
"connection": "close",
"x-powered-by": "PHP 7.2.7",
"vary": "Origin",
"access-control-allow-credentials": "true",
"content-language": "en-US",
"surrogate-control": "no-store",
"cache-control": "no-store, no-cache, must-revalidate, proxy-revalidate, no-cache",
"pragma": "no-cache",
"expires": "0",
"x-content-type-options": "nosniff",
"x-frame-options": "SAMEORIGIN",
"x-xss-protection": "1; mode=block",
"referrer-policy": "same-origin",
"content-security-policy": "default-src 'self'; style-src 'self' static-assets-prod.epicgames.com static-assets-prod.unrealengine.com",
"x-content-security-policy": "default-src 'self'; style-src 'self' static-assets-prod.epicgames.com static-assets-prod.unrealengine.com",
"x-webkit-csp": "default-src 'self'; style-src 'self' static-assets-prod.epicgames.com static-assets-prod.unrealengine.com",
"strict-transport-security": "max-age=15552000; includeSubDomains",
"set-cookie": [
"EPIC_SSO=56e4491ef4244d2b8d50844caf3a6457; Max-Age=28800; Domain=.unrealengine.com; Path=/; Expires=Sat, 18 Dec 2021 01:42:32 GMT; HttpOnly; Secure; SameSite=None",
"EPIC_BEARER_TOKEN=d081c9436f94433a8a49972401ef503c; Max-Age=28800; Domain=.unrealengine.com; Path=/; Expires=Sat, 18 Dec 2021 01:42:32 GMT; HttpOnly; Secure; SameSite=None",
"EPIC_SSO_RM=56e4491ef4244d2b8d50844caf3a6457; Max-Age=2592000; Domain=.unrealengine.com; Path=/; Expires=Sun, 16 Jan 2022 17:42:32 GMT; HttpOnly; Secure; SameSite=None"
]
}
[2021-12-17 14:42:33.158 -0300] TRACE (38 on 788ca9a0b0bd): Request store homepage
user: "xxx"
url: "https://www.epicgames.com/store/"
[2021-12-17 14:42:36.622 -0300] INFO (38 on 788ca9a0b0bd): Successfully refreshed login
user: "xxx"
[2021-12-17 14:42:36.622 -0300] DEBUG (38 on 788ca9a0b0bd): Getting global free games
user: "xxx"
[2021-12-17 14:42:36.623 -0300] TRACE (38 on 788ca9a0b0bd): Posting for all games in catalog
user: "xxx"
url: "https://www.epicgames.com/graphql"
variables: {
"allowCountries": "US",
"category": "games/edition/base|software/edition/base|editors|bundles/games|games",
"count": 1000,
"country": "US",
"effectiveDate": "[,2021-12-17T17:42:36.623Z]",
"keywords": "",
"locale": "en-US",
"onSale": true,
"releaseDate": "[,2021-12-17T17:42:36.623Z]",
"sortBy": "releaseDate",
"sortDir": "DESC",
"start": 0,
"tag": "",
"withPrice": true
}
extensions: {
"persistedQuery": {
"version": 1,

"sha256Hash": "xxx"
}
}
[2021-12-17 14:43:00.972 -0300] DEBUG (38 on 788ca9a0b0bd): Retrieved catalog data for 1043 games
user: "xxx"
[2021-12-17 14:43:00.973 -0300] TRACE (38 on 788ca9a0b0bd): Found 1 free games in catalog
user: "xxx"
[2021-12-17 14:43:00.973 -0300] DEBUG (38 on 788ca9a0b0bd): Found 1 unique free games in catalog
user: "xxx"
[2021-12-17 14:43:00.973 -0300] TRACE (38 on 788ca9a0b0bd): Free games in catalog
user: "xxx"
offers: [
{
"offerId": "1ad9b7fca007477ca454d2048d019d2f",
"offerNamespace": "b0ebefb11a9145488af78f6d2488afff",
"productName": "Neon Abyss",
"productSlug": "neon-abyss"
}
]
[2021-12-17 14:43:00.973 -0300] INFO (38 on 788ca9a0b0bd): Available free games
user: "xxx"
availableGames: [
"Neon Abyss"
]
[2021-12-17 14:43:00.974 -0300] DEBUG (38 on 788ca9a0b0bd): Checking ownership on available games
user: "xxx"
[2021-12-17 14:43:00.974 -0300] DEBUG (38 on 788ca9a0b0bd): Getting product ownership info
user: "xxx"
offerId: "1ad9b7fca007477ca454d2048d019d2f"
namespace: "b0ebefb11a9145488af78f6d2488afff"
[2021-12-17 14:43:00.974 -0300] TRACE (38 on 788ca9a0b0bd): Posting for offer entitlement
user: "xxx"
url: "https://www.epicgames.com/graphql"
variables: {
"offerId": "1ad9b7fca007477ca454d2048d019d2f",
"sandboxId": "b0ebefb11a9145488af78f6d2488afff"
}
extensions: {
"persistedQuery": {
"version": 1,

"sha256Hash": "803d00fd80aef2cbb0b998ba27b761143d228195b86cc8af55e73002f18a1678"
}
}
[2021-12-17 14:43:02.362 -0300] TRACE (38 on 788ca9a0b0bd): Entitlement response
user: "xxx"
resp: {
"Launcher": {
"entitledOfferItems": {
"namespace": "b0ebefb11a9145488af78f6d2488afff",
"offerId": "1ad9b7fca007477ca454d2048d019d2f",
"entitledToAllItemsInOffer": false,
"entitledToAnyItemInOffer": false

}
}
[2021-12-17 14:43:02.363 -0300] INFO (38 on 788ca9a0b0bd): Unpurchased free games
user: "xxx"
purchasableGames: [
"Neon Abyss"
]
[2021-12-17 14:43:02.363 -0300] INFO (38 on 788ca9a0b0bd): Purchasing Neon Abyss
[2021-12-17 14:43:02.363 -0300] TRACE (38 on 788ca9a0b0bd): Request for purchase token
user: "xxx"
searchParams: {
"namespace": "b0ebefb11a9145488af78f6d2488afff",
"offers": "1ad9b7fca007477ca454d2048d019d2f"
}
url: "https://www.epicgames.com/store/purchase"
[2021-12-17 14:43:03.708 -0300] DEBUG (38 on 788ca9a0b0bd): purchaseToken
user: "xxx"
purchaseToken: "73bba3ac94cc42e8a36c07f36f917058"
[2021-12-17 14:43:03.708 -0300] TRACE (38 on 788ca9a0b0bd): Order preview request
user: "xxx"
body: {
"useDefault": true,
"setDefault": false,
"namespace": "b0ebefb11a9145488af78f6d2488afff",
"country": null,
"countryName": null,
"orderId": null,
"orderComplete": null,
"orderError": null,
"orderPending": null,
"offers": [
"1ad9b7fca007477ca454d2048d019d2f"
],
"offerPrice": ""
}
url: "https://payment-website-pci.ol.epicgames.com/purchase/order-preview"
[2021-12-17 14:43:04.541 -0300] TRACE (38 on 788ca9a0b0bd): Order preview response
user: "xxx"
[2021-12-17 14:43:04.542 -0300] TRACE (38 on 788ca9a0b0bd): Confirm order request
user: "xxx"
body: {
"useDefault": true,
"setDefault": false,
"namespace": "b0ebefb11a9145488af78f6d2488afff",
"country": "BR",
"countryName": "Brazil",
"orderId": null,
"orderComplete": false,
"orderError": false,
"orderPending": false,
"offers": [
"1ad9b7fca007477ca454d2048d019d2f"
],
"includeAccountBalance": false,
"totalAmount": 0,
"affiliateId": "",
"creatorSource": "",
"threeDSToken": "",
"voucherCode": null,
"syncToken": "952f4ae9-e32e-43ce-a4c4-d53b639072bf",
"eulaId": null,
"lineOffers": [

"offerId": "1ad9b7fca007477ca454d2048d019d2f",
"title": "Neon Abyss",
"namespace": "b0ebefb11a9145488af78f6d2488afff",
"upgradePathId": null

],
"useDefaultBillingAccount": true,
"canQuickPurchase": true
}
url: "https://payment-website-pci.ol.epicgames.com/purchase/confirm-order"
[2021-12-17 14:43:05.250 -0300] WARN (HTTPError/38 on 788ca9a0b0bd): Response code 400 (Bad Request)
HTTPError: Response code 400 (Bad Request)
at Request. (/usr/app/node_modules/got/dist/source/as-promise/index.js:117:42)
at processTicksAndRejections (internal/process/task_queues.js:95:5)
[2021-12-17 14:43:05.251 -0300] WARN (38 on 788ca9a0b0bd): API purchase experienced an error, trying puppeteer purchase

[2021-12-17 14:43:05.261 -0300] DEBUG (38 on 788ca9a0b0bd): Setting hCaptcha accessibility cookies
[2021-12-17 14:43:05.250 -0300] WARN (HTTPError/38 on 788ca9a0b0bd): Response code 400 (Bad Request)
HTTPError: Response code 400 (Bad Request)
at Request. (/usr/app/node_modules/got/dist/source/as-promise/index.js:117:42)
at processTicksAndRejections (internal/process/task_queues.js:95:5)
[2021-12-17 14:43:05.251 -0300] WARN (38 on 788ca9a0b0bd): API purchase experienced an error, trying puppeteer purchase

[2021-12-17 14:43:05.261 -0300] DEBUG (38 on 788ca9a0b0bd): Setting hCaptcha accessibility cookies

@claabs
Copy link
Owner

claabs commented Dec 17, 2021

I can tell by the purchase request that this isn't using the latest image. Use docker pull to update to the latest.

@tmyflyte
Copy link
Author

I'm running on unraid, maybe this isn't updated? but the repo is from https://hub.docker.com/r/charlocharlie/epicgames-freegames/

https://i.imgur.com/qUSwBSV.png

@claabs
Copy link
Owner

claabs commented Dec 17, 2021

I also use Unraid. Just click "force update" and it will guarantee the latest.

@quzard
Copy link

quzard commented Dec 18, 2021

code: 400

[2021-12-18 11:25:24.753 +0800] WARN (HTTPError/40 on 1186bc3a6dad): Response code 400 (Bad Request)
HTTPError: Response code 400 (Bad Request)
at Request. (/usr/app/node_modules/got/dist/source/as-promise/index.js:117:42)
at processTicksAndRejections (internal/process/task_queues.js:95:5)
[2021-12-18 11:25:24.753 +0800] WARN (40 on 1186bc3a6dad): API purchase experienced an error, trying puppeteer purchase

@claabs
Copy link
Owner

claabs commented Dec 19, 2021

I really am stumped here. All of these logs posted are just WARN logs, and the program will continue to redeem games with it. I don't really see the issue and don't know how debug this.

@blackpanther989
Copy link

In regards to this. I've looked up the mentioned error and it might be related to a User-agent setting. I couldn't find reference to a user-agent setting in the project so maybe that might need to get added.. I'm sure the epic games client uses a special user-agent string when making api calls or web requests.

@claabs
Copy link
Owner

claabs commented Dec 19, 2021

The 400 error started showing when the purchase captcha was re-introduced.

I just tried swapping the user-agent for the one they use and it changed nothing. Ultimately, epicgames-client is using device auth, and an older purchase call. I assume it has some kind of exclusion on Epic's side that makes it not require a captcha.

I've considered switching to that method, but epicgames-freebies-claimer already does that. The goal with this project was to have an automation method that is not dependent on holes in Epic's bot prevention so I don't have to partake in an arms race with them. This project uses browser automation as a fallback for the API calls.

I'm leaving the API method in place just in case the free games revert to not requiring captchas after this holiday event.

@claabs
Copy link
Owner

claabs commented Dec 20, 2021

So I actually just encountered this on my server. I was able to get past it by just restarting the container.

I understand now that the process is just hanging with these logs being the last thing shown. I believe this is the same issue as #164. I just pushed an update in hopes that a recent puppeteer bugfix can resolve this.

@TS-x
Copy link

TS-x commented Dec 21, 2021

Usually I can restart the container and solve a new captcha for the purchase to go through, but the latest update seems to leave it hanging.

Edit: Searched around a little more. Could be related to an Epic Store/server issue. Some complaints where people have been unable to redeem today's game.


> epicgames-freegames-node@4.0.0 entrypoint-config /usr/app


> node dist/src/entrypoint-config.js



Setting timezone: America/Chicago


Run on startup: true


[2021-12-21 11:21:39.186 -0600] INFO : Started epicgames-freegames-node


    COMMIT_SHA: "d5ed3cd3ae3925ced3d06af5b5b14ed0aca81270"


    BRANCH: "master"


    DISTRO: "alpine"


[2021-12-21 11:21:39.504 -0600] INFO : Checking free games for *@gmail.com 


[2021-12-21 11:21:44.394 -0600] INFO : Successfully refreshed login


    user: "*@gmail.com"


[2021-12-21 11:21:44.395 -0600] INFO : searchStrategy is `all`: searching for weekly and promotional games


    user: "*@gmail.com"


[2021-12-21 11:21:45.113 -0600] ERROR:


    errors: [


      {


        "message": "Variable \"$sandboxId\" of required type \"String!\" was not provided.",


        "locations": [


          {


            "line": 1,


            "column": 23


          }


        ],


        "correlationId": "",


        "serviceResponse": "{\"errorStatus\":500}",


        "stack": null


      },


      {


        "message": "Variable \"$offerId\" of required type \"String!\" was not provided.",


        "locations": [


          {


            "line": 1,


            "column": 44


          }


        ],


        "correlationId": "",


        "serviceResponse": "{\"errorStatus\":500}",


        "stack": null


      }


    ]


    extensions: {}


[2021-12-21 11:21:45.113 -0600] ERROR (HTTPError): Response code 400 (Bad Request)


    HTTPError: Response code 400 (Bad Request)


        at Request.<anonymous> (/usr/app/node_modules/got/dist/source/as-promise/index.js:117:42)


        at runMicrotasks (<anonymous>)


        at processTicksAndRejections (internal/process/task_queues.js:95:5)


[2021-12-21 11:21:45.114 -0600] WARN : Current version


    COMMIT_SHA: "d5ed3cd3ae3925ced3d06af5b5b14ed0aca81270"


    BRANCH: "master"


    DISTRO: "alpine"


Run once: false


Setting cron schedule as 30 10 * * *

@claabs
Copy link
Owner

claabs commented Dec 21, 2021

Usually I can restart the container and solve a new captcha for the purchase to go through, but the latest update seems to leave it hanging.

Epic started returning undefined offers in the response. I pushed a fix to filter them out: 5de6791

@articuno1au
Copy link

articuno1au commented Dec 22, 2021

I assume the undefined offers is what is causing the below?

[2021-12-22 12:31:13.022 +1100] WARN  (RequestError): getaddrinfo ENOTFOUND payment-website-pci.ol.epicgames.com
    RequestError: getaddrinfo ENOTFOUND payment-website-pci.ol.epicgames.com
        at ClientRequest.<anonymous> (/usr/app/node_modules/got/dist/source/core/index.js:956:111)
        at Object.onceWrapper (events.js:520:26)
        at ClientRequest.emit (events.js:412:35)
        at ClientRequest.origin.emit (/usr/app/node_modules/@szmarczak/http-timer/dist/source/index.js:43:20)
        at TLSSocket.socketErrorListener (_http_client.js:475:9)
        at TLSSocket.emit (events.js:400:28)
        at emitErrorNT (internal/streams/destroy.js:106:8)
        at emitErrorCloseNT (internal/streams/destroy.js:74:3)
        at processTicksAndRejections (internal/process/task_queues.js:82:21)
        at GetAddrInfoReqWrap.onlookup [as oncomplete] (dns.js:71:26)
[2021-12-22 12:31:13.023 +1100] WARN : API purchase experienced an error, trying puppeteer purchase

I updated the container and tried again, it falls back to the puppeteer method, I fill out the captcha and then I land with an error on the page. If I click the puchare URL in the docker logs I can purchase it through the website as expected. I will try and get you logs tomorrow.

As always, thanks for all the work man :)

Edit:: Christ I hate github markup..

@articuno1au
Copy link

articuno1au commented Dec 23, 2021

Having failed with an error repeatedly, I enabled trace logging and it worked like a charm..

Good to see the second you try and show it's not working, it will immediately work 🤯

EDIT:: I suspect the reason it worked this time was that I filled in the captcha request immediately. Looking in the config directory of my container I see it's full of error files, like the below
image
Could it be that the puppeteer session is timing out which causes this (unrelated) issue?

I can spin this off into a different issue if you'd like?

@claabs
Copy link
Owner

claabs commented Dec 23, 2021

This issue has become a mess of like 10 different issues, with everyone seeing the same red herring 400 (Bad Request). The 400 is guaranteed to happen at checkout since they added captchas. I should probably just remove that warning message...

The rest of the issues here seem to be one of:

  1. Browser not starting Program hangs when launching Chromium process #164
  2. DNS issues RequestError: getaddrinfo EAI_AGAIN api.github.com #168
  3. Namespace/Offer mapping issues Unable to purchase - API purchase experienced an error, trying puppeteer purchase  #196
  4. People not updating their image
  5. Epic Games having an outage

A couple conclusions I've come to:

  1. Remove all the warnings that are regularly popping up now. Or just change the default config to puppeteerPurchase: true to not even attempt the API purchase
  2. Remove the Alpine image altogether, because the browser not starting issue seems to be occurring more regularly, and Alpine just isn't keeping its Chromium up to date quick enough for puppeteer.

@articuno1au
Copy link

Sorry about that, I wasn't sure which was the lesser evil here..

After you wrote the above, I noticed my previous stack trace showed a DNS issue, which is in addition to the DNS issue I was seeing caused by my PiHole. So that's fun (and I'm bad at typescript :( ). I'll run down the error I'm seeing and look at opening a new issue if justified.

If we expect the API purchase model is consistently broken now due to the Captcha, is there a benefit to continuing to include it? It would seem like there isn't. Combined with removing the Alpine image, it would solve for most of your problems, so makes sense to me.

@claabs
Copy link
Owner

claabs commented Dec 23, 2021

I'm currently going down the rabbit hole of removing Alpine. Currently, the issue is finding a Linux distro that supports:

  1. Latest Chrome/Chromium (96/97)
  2. arm64

Looks like the only one is Fedora, which makes things...interesting.
Edit: OpenSUSE might work as well.

@articuno1au
Copy link

I'm surprised Debian doesn't. I can see they've got an ARM64v8 image, but only Chromium90 :|

And Christ that's a rabbit hole with puppeteer as well. The requirement for 96/97 being just for good security practice? If the OS change turns out to be too much pain, another option may be to target firefox nightly binaries instead (though that's its own circle of hell I'm sure).

@claabs
Copy link
Owner

claabs commented Dec 23, 2021

Using a latest Chrome/Chromium is just to ensure compatibility with a modern version of puppeteer.
Firefox won't work due to the Chromium APIs puppeteer-extra-plugin-portal depends on.

@claabs
Copy link
Owner

claabs commented Dec 23, 2021

I published a Fedora version to the dev image tag. It seemed to work in my basic testing on amd64. Please test it. If it works well, we can push it to master.

Unfortunately, it's using Chromium 95 for some reason despite 96 being released for a while. Not sure what's happening there, I'll have to take a look later.

@articuno1au
Copy link

articuno1au commented Dec 23, 2021

Will do when I get home in 2-3 hours.

EDIT:: I've got it started, and it's seemingly working as intended. Unfortuantely there are currently no free games, so I can't tell you how it's going. Will update after the next drop when I wake up.

@claabs
Copy link
Owner

claabs commented Dec 23, 2021

I was able to figure out getting Chromium 96 running on Fedora. Check it out on the dev tag. It strikes the perfect balance of Chromium version, ARM support, and low image size. I'd still like someone to verify on arm64 before I push it to master.

OpenSUSE didn't turn out well, since installing Chromium made the image 800MB larger. It doesn't have the chromium-headless profile that Fedora has.

@articuno1au
Copy link

articuno1au commented Dec 24, 2021

So I was able to text on x86-64, and it worked perfectly. The pull size was reasonable and everything was fast.

I can't test this I'm sorry. I don't have an arm64 capable Pi, mine's 32bit :(

@claabs
Copy link
Owner

claabs commented Dec 24, 2021

I just got the puppeteer launch freeze on the dev tag. So unfortunately, it doesn't seem to fix the issue.

Edit: some searching reveals some launch freezes are solved with --no-gpu. I can try that later.

@claabs
Copy link
Owner

claabs commented Dec 29, 2021

Current status on the dev image:

In its current state, it doesn't seem to offer much value over latest. They both work as expected. The dev image does have a newer Chromium release thanks to being a rolling release distro, however Chromium version doesn't seem to actually impact much. I may just cut it into another branch in case the Alpine maintainers are a little slow releasing a new Chromium and it's needed for something.

I did add a working fix for the hang when launching a browser: #164 (comment)

Since most things have been addressed now, I'll close this for now. Feel free to open another issue if something new pops up.

@claabs claabs closed this as completed Dec 29, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

6 participants