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

Improve error handling when browser is not installed (e.g. when using wrong docker image) #1459

Closed
szmarczak opened this issue Aug 11, 2022 · 3 comments · Fixed by #2050
Closed
Assignees
Labels
bug Something isn't working.

Comments

@szmarczak
Copy link
Contributor

szmarczak commented Aug 11, 2022

const crawler = new PlaywrightCrawler({
    launchContext: {
        launcher: playwright.firefox,
    },
    async requestHandler({ page }) { ... },
});

await crawler.run(['https://api.apify.com/v2/browser-info?1', 'https://api.apify.com/v2/browser-info?2']);

https://console.apify.com/view/runs/1phBbPE1cYSU5gF2a
https://github.com/apify/crawlee/actions/runs/2841856507

@szmarczak szmarczak added the bug Something isn't working. label Aug 11, 2022
@mnmkng
Copy link
Member

mnmkng commented Aug 12, 2022

I see you're using the Chrome Dockerfile. Firefox is not installed in that one. You need to use the Firefox one.

FROM apify/actor-node-playwright-chrome:16

⬇️

FROM apify/actor-node-playwright-firefox:16

Maybe SDK or Crawlee (not sure where the dockerfile definitions live now, I guess in Crawlee) could throw a helpful error if running in Docker and the browser is not installed @B4nan ?

@B4nan
Copy link
Member

B4nan commented Aug 12, 2022

Dockerfiles are in the templates, crawlee has its own templates just like apify-cli has, it would be better to have this handled in both.

But looking at the logs, I dont see any easily understandable error message we could catch and rethrow, it seems quite criptic to me. Maybe we could check it explicitly somehow (even via env vars that would be added to the base docker images.

@mnmkng
Copy link
Member

mnmkng commented Aug 12, 2022

Yeah, an explicit check would be best. Either somehow check if the browser is installed in its expected location or via the env var.

@B4nan B4nan changed the title launchContext.launcher uses chrome on Platform despite being set to firefox Improve error handling when browser is not installed (e.g. when using wrong docker image) Jul 17, 2023
B4nan pushed a commit that referenced this issue Aug 30, 2023
…2050)

Basically, just add a hint to the user that they might've forgotten to
rebase their docker image/used the wrong template.

Closes #1459
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

Successfully merging a pull request may close this issue.

4 participants