-
Notifications
You must be signed in to change notification settings - Fork 699
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
fix(browser-pool): improve error handling when browser is not found #2050
Conversation
…s if browser fails to launch on Apify platform
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can you give me examples of how this looks in the logs?
private _notifyOfFailedLaunch() { | ||
let debugMessage = `Failed to launch browser. ${this.launchOptions?.executablePath ? 'Check whether the provided executable path is correct.' : ''} `; | ||
if (process.env.APIFY_IS_AT_HOME) { | ||
debugMessage += 'Make sure you used the correct Actor template for Playwright: ' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
its about using correct docker image, not actor template, i'd not mention the templates here at all
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think some new users and those who are not familiar with docker might not make the connection between the wrong docker image and the fact that they can fix the issue by instantiating with a new template. Maybe we could change it from Make sure
to Try instantiating with that template ...
? But for now I've removed the mention
@@ -74,7 +74,12 @@ export class PuppeteerPlugin extends BrowserPlugin< | |||
} | |||
} catch (error) { | |||
await close(); | |||
|
|||
if (process.env.APIFY_IS_AT_HOME) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it feels weird that for playwright we handle this outside of apify platform too, but here we dont. FYI puppeteer now has a similar CLI for installing the browsers https://pptr.dev/browsers-api/
not sure if its already mentioned in the error produced by puppetter?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not really. But the bad thing about this command is that it installs executable into the folder where it was executed, and under a long directory hierarchy, like chromium/mac_arm/-xxxx.../../.../MacOS/Chromium
, and you have to be aware of that executable location, to e.g. pass it into PUPPETEER_EXECUTABLE_PATH
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It mentions troubleshooting guide though most of the times
The first screenshot looks like we retry that request? I'd say this should cause a hard failure. We have the |
…cause` instead of just rethrowing
Ok, that looks much better, let's see if it won't break any of the E2E tests: https://github.com/apify/crawlee/actions/runs/6026358796 |
Basically, just add a hint to the user that they might've forgotten to rebase their docker image/used the wrong template.
Closes #1459