Comments (24)
@samccone - Is there any update on this issue? I'm still seeing it on the most recent versions of Chrome.
I see this behavior when launching from VSCode as admin, and while I'm able to append --no-sandbox and get it to work, it causes the ominous You are using an unsupported command-line flag: --no-sandbox. Stability and security will suffer.
message. Fine in general as a workaround, but if it's something we're going to be sharing around to the team it's nice to not need to explain it to everyone.
from chrome-launcher.
@paulirish Any idea on this one? I was trying to replace PhantomJs with Headless Chrome in my project but I need to support running as an Admin which this bug is blocking. I have seen several other people reporting hitting.
from chrome-launcher.
@JoelEinbinder Any update?
from chrome-launcher.
Hey @mmanela I need to boot up a windows machine at work to debug this one, thanks for filing!
from chrome-launcher.
Thanks @samccone. This is blocking making full use of Google Chrome Pupeteer for headless automation. I appreciate any time you can spend on this.
from chrome-launcher.
@samccone we take dependency on the testing adapter built by @mmanela. It would be great if you can prioritize.
from chrome-launcher.
Sorry for the delay, I am having some problems with getting this test case to repro on my windows machine :/
from chrome-launcher.
@samccone I just reproed again using Node v8.9.4 and Chrome-Launcher 0.10.2 and with Chrome 63.0.3239.132 (Official Build) (64-bit). I attached my repro in a zip. Unzip and run node test.js from an admin command prompt and it repros for me:
from chrome-launcher.
Hello all,
I got my hands on a windows VM 👐 .. things seem to be working for me. Let me give you the steps and see if you can reproduce
git clone [email protected]:GoogleChrome/chrome-launcher.git
cd chrome-launcher
yarn install
yarn build
node
> const l = require('.');
> l.launch();
Then I type google.com into the launched chrome and see if it loads.
@mmanela @smalpani-msft can you try these steps and see if you can reproduce?
I tried on both the command prompt and the unix command shell, in both cases things worked (node 8.6.0) windows
Thanks!
from chrome-launcher.
I tried to push this a little more, but didn't have luck
@mmanela i used your zip, in an Admin command prompt with node 8.9.4 and chrome-launcher 0.10.2. However chrome launched fine. no sad tab.
I suspect this has to do with permissions on user-data-dir, but it's just a guess.
@mmanela , There's something else we can look at to debug this:
- in the launched chrome window, open
about:version
- grab the Profile Path
- Go view the
chrome-err.log
that's in that folder. That's the stderr output of the chrome binary. There's also a chrome-out.log file as well. (lighthouse saved these)
I'm hoping we'll see something useful in the error log, but if not, we can then try verbose logging. I haven't done this on windows yet, but it looks like using these flags will flip on the logging:
let launcher = require('chrome-launcher');
launcher.launch({
chromeFlags: ['--enable-logging', '--v=1', '--vmodule=metrics=2']
});
that should create a chrome_debug.log
in the parent folder of the Profile Path.
from chrome-launcher.
another note I followed my steps on #11 (comment) in a clean VM and things continued to work.
from chrome-launcher.
Thanks for the responses @samccone and @paulirish.
@samccone I followed your exact steps from a windows admin prompt and I repro the issue. This is on my box though so maybe it is something environmental.
@paulirish I tried to go to about:version but it doesn't work in the sad faced chrome. Just does this:
I tried to find chrome-err.log by searching in my %appdata% folders but I could not find the file. I then followed the steps you suggested running launcher with the extra flags. I did find a chrome_debug.log generated in the "User Data" folder but its empty. I assume its the right file since if I delete it then it gets regenerated when I try again.
I also checked the windows Application Event Viewer to see if any errors were logged there but nothing was. I was able to repro this on two machines (but mine), I will try to do it on a VM and some other machines to see if I can find a commonality.
from chrome-launcher.
@smalpani-msft Can you have someone from your team try this also?
from chrome-launcher.
@mmanela @samccone
I tried to launch chrome with chrome-launcher. I was able to reproduce the issue mentioned by @mmanela . In admin console, sad face chrome appears. But in non-admin console, chrome launches happily.
In addition, I was able to reproduce this issue with chrome driver also. When tried to launch in admin console, sad face chrome but launches happily in non-admin mode.
Chrome driver: 2.25 win32
Chrome version: 63.0.3239.132
Chrome launcher: 0.10.2
from chrome-launcher.
@mmanela Apparently launching chrome with root permissions is not supported without --no-sandbox mode. This stands true for windows as well as linux.
I was able to reproduce the issue in windows, where you get a sad faced chrome, however in linux you get this:
(node:4857) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 1): Error: Failed to launch chrome!
[4867:4867:0125/172825.457715:ERROR:zygote_host_impl_linux.cc(90)] Running as root without --no-sandbox is not supported. See https://crbug.com/638180.
TROUBLESHOOTING: https://github.com/GoogleChrome/puppeteer/blob/master/docs/troubleshooting.md
(node:4857) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
from chrome-launcher.
Awesome find and debugging @karanjitsingh. Now the trick is we need to detect
- is the user running as root
- is the user running windows
If both cases 1 and 2 are true we need to force the no-sandbox
flag to be passed
from chrome-launcher.
from chrome-launcher.
Any update on this?
from chrome-launcher.
@mmanela does adding --no-sandbox
to chromeFlags
avoid the crashed tab on your windows machine?
what about --allow-no-sandbox-job
?
chromium bugs that look relevant:
https://bugs.chromium.org/p/chromium/issues/detail?id=698307
https://bugs.chromium.org/p/chromium/issues/detail?id=167556
from chrome-launcher.
@paulirish
--allow-no-sandbox-job
, didn't fix the problem but --no-sanbdox
did.
However, what is the impact of nosandbox? My tool does need to run on a build server, so I need to make sure it works well with this flag when there are parallel processes executing.
from chrome-launcher.
@paulirish @samccone So, a couple questions then.
- Is it by design for this to not work from an admin prompt?
- If so, should chrome-launcher do what @samccone suggested and magically change the arguments to ensure it launches correctly?
from chrome-launcher.
@paulirish , @samccone can you please reply to the questions above from @mmanela? Thanks. We are curious to hear the recommendation since we have customers of our product looking to run as Admin on Windows and we launch Chrome to support debugging of pages.
from chrome-launcher.
- It is not by design that it does not work, we want it to work everywhere :)
- I think in the short term you can pass your own
--no-sandbox
flag at launch time viachromeFlags
in the longish term I think we could totally figure out how to detect when the user is running as admin and is also running under windows and automagically inject that flag.
Let me know if you have any other thoughts!
Thanks
from chrome-launcher.
Thanks for the response @samccone. What is the impact of running --no-sandbox ?
from chrome-launcher.
Related Issues (20)
- Reporting unsuccessful exit code
- crash when launch with remote debugging pipe
- Reuse an existing window HOT 1
- RangeError [ERR_FS_FILE_TOO_LARGE]: File size (3055630622) is greater than 2 GiB
- Chrome launcher wont launch HOT 1
- Beta and Dev channels are not detected
- igmore
- /Users/sample/node_modules/chrome-launcher/dist/chrome-finder.js:14 const log = require('lighthouse-logger'); ^ Error [ERR_REQUIRE_ESM]: require() of ES Module HOT 1
- Unknown error when ChromeLauncher.launch() in worker thread HOT 1
- Version v0.15.2 and kill chrome instance HOT 3
- Update readme for 1.0.0: ERR_REQUIRE_ESM
- `prefs` option doesn't work HOT 3
- Issue determining temp dir path HOT 1
- flag for setting useragentdata
- How to access environments variable with JS in chrome?
- move the red error dot to the console tab where it belongs HOT 1
- Add `--enable/disable-features=ChromeRootStoreUsed` flag HOT 2
- `user-data-dir` improperly replaced with Win32 path when running in WSL
- prefs option is incorrectly treated as a flat Record<string,JSONLike>, nested objects are not merged but overwritten HOT 1
- Search-engine dialog HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from chrome-launcher.