Code Monkey home page Code Monkey logo

Comments (24)

veleek avatar veleek commented on May 13, 2024 1

@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.

mmanela avatar mmanela commented on May 13, 2024

@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.

mmanela avatar mmanela commented on May 13, 2024

@JoelEinbinder Any update?

from chrome-launcher.

samccone avatar samccone commented on May 13, 2024

Hey @mmanela I need to boot up a windows machine at work to debug this one, thanks for filing!

from chrome-launcher.

mmanela avatar mmanela commented on May 13, 2024

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.

smalpani-gh avatar smalpani-gh commented on May 13, 2024

@samccone we take dependency on the testing adapter built by @mmanela. It would be great if you can prioritize.

from chrome-launcher.

samccone avatar samccone commented on May 13, 2024

Sorry for the delay, I am having some problems with getting this test case to repro on my windows machine :/

from chrome-launcher.

mmanela avatar mmanela commented on May 13, 2024

@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:

image

reproChromeAdmin.zip

from chrome-launcher.

samccone avatar samccone commented on May 13, 2024

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.

paulirish avatar paulirish commented on May 13, 2024

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:

  1. in the launched chrome window, open about:version
  2. grab the Profile Path
  3. 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.

samccone avatar samccone commented on May 13, 2024

another note I followed my steps on #11 (comment) in a clean VM and things continued to work.

from chrome-launcher.

mmanela avatar mmanela commented on May 13, 2024

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:
image

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.

image

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.

mmanela avatar mmanela commented on May 13, 2024

@smalpani-msft Can you have someone from your team try this also?

from chrome-launcher.

abhishkk avatar abhishkk commented on May 13, 2024

@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.

karanjitsingh avatar karanjitsingh commented on May 13, 2024

@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.

samccone avatar samccone commented on May 13, 2024

Awesome find and debugging @karanjitsingh. Now the trick is we need to detect

  1. is the user running as root
  2. 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.

mmanela avatar mmanela commented on May 13, 2024

from chrome-launcher.

mmanela avatar mmanela commented on May 13, 2024

Any update on this?

from chrome-launcher.

paulirish avatar paulirish commented on May 13, 2024

@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.

mmanela avatar mmanela commented on May 13, 2024

@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.

mmanela avatar mmanela commented on May 13, 2024

@paulirish @samccone So, a couple questions then.

  1. Is it by design for this to not work from an admin prompt?
  2. If so, should chrome-launcher do what @samccone suggested and magically change the arguments to ensure it launches correctly?

from chrome-launcher.

dhanvikapila avatar dhanvikapila commented on May 13, 2024

@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.

samccone avatar samccone commented on May 13, 2024
  1. It is not by design that it does not work, we want it to work everywhere :)
  2. I think in the short term you can pass your own --no-sandbox flag at launch time via chromeFlags

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.

mmanela avatar mmanela commented on May 13, 2024

Thanks for the response @samccone. What is the impact of running --no-sandbox ?

from chrome-launcher.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.