R
Railwayβ€’9mo ago
LoLip_p

I can't load playwright.

I'm sorry, but I don't understand how I can set playwright. I created pyproject.toml and entered python -m playwright install-deps but still refuses to work, even after restarting. Project id: 9a367791-75b9-4c5a-9222-9a8097183908 If any additional information is required to solve this problem, I am ready to provide it.
No description
Solution:
you'd need to to create a custom build phase that runs that command, the docs for doing so are here https://nixpacks.com/docs/guides/configuring-builds#new-phase but to set you off in the right direction, add this as a nixpacks.toml file to your project ```toml [phases.playwright]...
Jump to solution
23 Replies
Percy
Percyβ€’9mo ago
Project ID: 9a367791-75b9-4c5a-9222-9a8097183908
LoLip_p
LoLip_pβ€’9mo ago
πŸ‘‰ πŸ‘ˆ
Solution
Brody
Brodyβ€’9mo ago
you'd need to to create a custom build phase that runs that command, the docs for doing so are here https://nixpacks.com/docs/guides/configuring-builds#new-phase but to set you off in the right direction, add this as a nixpacks.toml file to your project
[phases.playwright]
dependsOn = ['install']
cmds = ['playwright install']
[phases.playwright]
dependsOn = ['install']
cmds = ['playwright install']
this will run that install command after all the projects dependencies have been installed
LoLip_p
LoLip_pβ€’9mo ago
thank you very much! I'll go try it
Brody
Brodyβ€’9mo ago
worked?
LoLip_p
LoLip_pβ€’9mo ago
Yes! I succeeded. Thanks againπŸ˜…
Brody
Brodyβ€’9mo ago
no problem!
LoLip_p
LoLip_pβ€’9mo ago
for those who had the same problem. here is my solution: you need to create a nixpacks.toml file and write into it:
[phases.playwright]
dependsOn = ['install']
cmds = ['playwright install']

[phases.playwrightdeps]
dependsOn = ['install']
cmds = ['playwright install-deps']
[phases.playwright]
dependsOn = ['install']
cmds = ['playwright install']

[phases.playwrightdeps]
dependsOn = ['install']
cmds = ['playwright install-deps']
Brody
Brodyβ€’9mo ago
the playwrightdeps phase might want to run after the playwright phase so in the playwrightdeps phases you should do dependsOn = ['playwright'] so they are ran in order unless the order doesn’t matter of those two commands, if so, ignore that suggestion
Will
Willβ€’9mo ago
I've followed the steps above and I'm getting this error during the playwrightdeps phase: Sub-process /usr/bin/dpkg returned an error code (1) Here is my nixpacks.toml file: [phases.playwright] dependsOn = ['install'] cmds = ['playwright install'] [phases.playwrightdeps] dependsOn = ['playwright'] cmds = ['playwright install-deps']
Brody
Brodyβ€’9mo ago
full build logs please
Will
Willβ€’9mo ago
No description
No description
No description
Brody
Brodyβ€’9mo ago
show me the table at the top of the build logs
Will
Willβ€’9mo ago
No description
No description
Will
Willβ€’9mo ago
I also tried to run the install-deps command in a postbuild script in my app's project.json (I am using an NX monorepo), which resulted in a slightly more descriptive error: ln: failed to create symbolic link '/etc/resolv.conf': Device or resource busy Created symlink /etc/systemd/system/sysinit.target.wants/systemd-pstore.service β†’ /lib/systemd/system/systemd-pstore.service. systemd-machine-id-setup: /lib/x86_64-linux-gnu/libc.so.6: version GLIBC_2.36' not found (required by /nix/store/9lhvbvvm3s7kv7maak5vm7as6fwjgfa7-util-linux-minimal-2.39.2-lib/lib/libmount.so.1) systemd-machine-id-setup: /lib/x86_64-linux-gnu/libc.so.6: version GLIBC_ABI_DT_RELR' not found (required by /nix/store/aw2fw9ag10wr9pf0qk4nk5sxi0q0bn56-glibc-2.37-8/lib/libdl.so.2) systemd-machine-id-setup: /lib/x86_64-linux-gnu/libc.so.6: version GLIBC_ABI_DT_RELR' not found (required by /nix/store/aw2fw9ag10wr9pf0qk4nk5sxi0q0bn56-glibc-2.37-8/lib/libpthread.so.0) dpkg: error processing package systemd (--configure): installed systemd package post-installation script subprocess returned error exit status 1 Errors were encountered while processing: systemd E: Sub-process /usr/bin/dpkg returned an error code (1) Failed to install browser dependencies Error: Installation process exited with code: 100 Warning: run-commands command "npx playwright install-deps" exited with non-zero status code`
Brody
Brodyβ€’9mo ago
I'd like to note that crawlers are generally not allowed on railway, do you have permission from the sites you are crawling?
Will
Willβ€’9mo ago
Hi Brody, the app is not a crawler in the traditional sense of the word, I just couldn't think of a better name! It's for internal use for our users, as opposed to being a scraper or bot or something similar πŸ˜†
Brody
Brodyβ€’9mo ago
I will choose to take your word
Will
Willβ€’9mo ago
We use codenames in our codebase as opposed to product names to avoid having to change the name if we change the brandname, hence sillymarch
Brody
Brodyβ€’9mo ago
add a railway.toml file to your project with this in it
[build]
nixpacksVersion = "1.15.0"
[build]
nixpacksVersion = "1.15.0"
@jr - the glibc 2.36 nightmare isn't over yet 😭
Will
Willβ€’9mo ago
Ok I'm adding the railway.toml file along with the existing nixpacks.toml file, and will report back asap
Will
Willβ€’9mo ago
That has done the trick I think! Thank you. However, I'm now faced with another issue. It is a secondary issue, so I can start a new chat if desired. Essentially, our app needs to run Playwright in headful mode (headless:false). To do this I've placed xvfb-run infront of our deploy command as instructed here: https://playwright.dev/docs/ci#running-headed (full command: xvfb-run nx run sillymarch-crawler:serve:production --hostname=0.0.0.0). However, nothing is being shown in our deploy logs and we're getting the 'Application failed to respond' message when navigating to the app.
Continuous Integration | Playwright
Playwright tests can be executed in CI environments. We have created sample configurations for common CI providers.
Brody
Brodyβ€’9mo ago
yes new thread if you dont mind πŸ™‚