continuedev / continue

⏩ Continue is the leading open-source AI code assistant. You can connect any models and any context to build custom autocomplete and chat experiences inside VS Code and JetBrains
https://docs.continue.dev/
Apache License 2.0
18.4k stars 1.52k forks source link

New @Docs "Failed to launch the browser process! [...] No usable sandbox!", chrome coredumps mentioned in the system log #2146

Open TiagoTiago opened 1 month ago

TiagoTiago commented 1 month ago

Before submitting your bug report

Relevant environment info

 - OS: Linux Mint 20.3 Kernel: 5.15.0-119-generic 
 - Continue: v0.8.47 AND v0.9.202 (pre-release)
 - IDE: VSCodium 
     Version: 1.92.2
     Release: 24228
     Commit: 21b1e2955ddda36eeba3a94e643128e465285b93
     Date: 2024-08-15T18:27:27.910Z
     Electron: 30.1.2
     ElectronBuildId: undefined
     Chromium: 124.0.6367.243
     Node.js: 20.14.0
     V8: 12.4.254.20-electron.0 
 - config.json: I tried deleting the existing one to start with a default one, still got the same results, so doesn't seem to be relevant

Description

Cannot create new custom Docs or use old ones; builtin chromium seems to always crash showing an error message on VSCodium (and a rare few times says it worked but the new docs do not show up).

Error message seems to suggest some issue with sandboxing chrome; and system log reports chrome coredumped.

To reproduce

Write @Docs, go to the bottom of the list to pick the option to create a new one, fill name and url (random example, SciPy and https://docs.scipy.org/doc/scipy/), click submit. Error pops up and the Doc is not created.

Log output

Extension Host] Error handling webview message: {
  "msg": {
    "messageId": "######################",
    "messageType": "context/addDocs",
    "data": {
      "startUrl": "https://docs.scipy.org/doc/scipy/",
      "title": "SciPy",
      "faviconUrl": ""
    }
  }
}

Error: Failed to launch the browser process!
[##################:FATAL:zygote_host_impl_linux.cc(########)] No usable sandbox! If you are running on Ubuntu 23.10+ or another Linux distro that has disabled unprivileged user namespaces with AppArmor, see https://chromium.googlesource.com/chromium/src/+/main/docs/security/apparmor-userns-restrictions.md. Otherwise see https://chromium.googlesource.com/chromium/src/+/main/docs/linux/suid_sandbox_development.md for more information on developing with the (older) SUID sandbox. If you want to live dangerously and need an immediate workaround, you can try using --no-sandbox.

(Numbers replaced by random count of #'s cause I dunno if they could be decoded as sensitive information, or used for fingerprinting etc. After this there are many lines I'm not sure how sensitive they are, lemme know if you're looking for something in specific there, or even if there actually nothing sensitive that could ever be shown there and it's all safe to copypaste)

As mentioned before, the system log reports chrome has core dumped; dunno how sensitive the info in there is.

TiagoTiago commented 1 month ago

Not sure if I'm testing it right, but looks like things still fail if I revert to older versions of Continue, which might suggest something changed in VSCodium itself.

TiagoTiago commented 1 month ago

Ah, I just noticed hidden at the bottom of the error message, this link, which seems might be relevant: https://pptr.dev/troubleshooting/

TiagoTiago commented 1 month ago

Another datapoint, I haven't yet confirmed the exact version where it stops working yet, but I found that back in version v0.8.45 of Continue, custom Docs do work again (not sure if it was necessary to force reindexing or if it would've worked without that if I just switched the to that version and waited).

sestinj commented 1 month ago

The change is because we started using a headless browser to do the indexing, and it likely doesn't play well with Linux Mint

@Patrick-Erichsen have we left any ability to fall back to the old indexer?

TiagoTiago commented 1 month ago

Btw, in case it makes any difference, the latest version I've managed to get to index docs so far was v0.9.192 (pre-release)

Patrick-Erichsen commented 1 month ago

@sestinj currently no, but should be easy to implement a fallback. Curious if there's a better way we can detect if a user is closable of running chromium before erroring out though. Maybe a static list of OS'?

Patrick-Erichsen commented 1 month ago

@TiagoTiago - the above PR should provide a fallback to Chromium for docs crawling. On the next pre-release, what should happen is that Continue attempts to pull down Chromium one more time, catches the error, and then going forward use a lighter weight library, Cheerio for crawling.

Let me know if you have any issues!

TiagoTiago commented 1 month ago

@TiagoTiago - the above PR should provide a fallback to Chromium for docs crawling. On the next pre-release, what should happen is that Continue attempts to pull down Chromium one more time, catches the error, and then going forward use a lighter weight library, Cheerio for crawling.

Let me know if you have any issues!

Thanx. I'm not sure where to look for it, is there a version number with this patch already? Looking at the options available on VSCodium, the latest pre-release is .206 , is that it?

TiagoTiago commented 1 month ago

I tried .207 and looking at the console when I try to add a custom doc, Cheerio crawls, says a number of articles, and then there's an message on the console saying zero chunks generated. I haven't been able to identify any error messages besides it saying it generated zero chunks. And sometimes it didn't seem to even say anything at all.