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

After logout and login: Failed to initialize sandbox: getconf failed #7692

Open
kastiglione opened this issue Mar 11, 2019 · 21 comments
Open
Labels
P3 We're not considering working on this, but happy to review a PR. (No assignee) team-Local-Exec Issues and PRs for the Execution (Local) team type: bug

Comments

@kastiglione
Copy link
Contributor

Description of the problem:

I ran a bazel build on macOS and got this error:

ERROR: Failed to initialize sandbox: getconf failed

I had just logged out and logged in, so the Bazel daemon existed, but any session state would have changed, if that matters. At first I had to kill with Activity Monitor, the bazel daemon wouldn't die when being killed with kill -9. After reading #2489 I found that bazel shutdown works.

This is reproducible for me.

Bugs: what's the simplest, easiest way to reproduce this bug? Please provide a minimal example if possible.

  1. Run a bazel build
  2. Log out and log in
  3. Run bazel build again

What operating system are you running Bazel on?

macOS 10.14.3

What's the output of bazel info release?

release 0.23.1

Have you found anything relevant by searching the web?

Just #2489, but @philwo requested I create a new issue.

Any other information, logs, or outputs that you want to share?

As mentioned above, bazel shutdown works around the problem.

@aiuto aiuto added untriaged team-Local-Exec Issues and PRs for the Execution (Local) team labels Mar 13, 2019
@jmmv jmmv added type: bug P3 We're not considering working on this, but happy to review a PR. (No assignee) and removed untriaged labels Mar 14, 2019
@jmmv
Copy link
Contributor

jmmv commented Mar 14, 2019

Interesting and, ugh, incomplete error messages that don't say why things failed. How often do you hit this though? Seems like quite a corner case.

@philwo
Copy link
Member

philwo commented Mar 14, 2019

I'm also quite surprised, that the Bazel server survives a logout - I always thought that logging out on macOS causes all processes launched during that user session to be terminated.

We should of course fix this and it's probably not too difficult.

@kastiglione
Copy link
Contributor Author

I almost never logout, this is definitely an unlikely corner case. I created this issue just to document it, I personally don't need a fix.

@OleksiyA
Copy link

OleksiyA commented Jun 5, 2019

My OSX WindowsServer crashed couple times. I need to re-login, but all other processes were kept alive. Xcode would fail to build project afterwards.
My fix to run "bazel shutdown". After that all seems to work fine.

@evanj
Copy link

evanj commented Jul 24, 2020

I agree this is somewhat unlikely, but I also just ran into this, using Bazel 3.2.0 on Mac OS X 10.15.6 FWIW, so this problem still exists. The bazel shutdown workaround worked. Possibly this Github issue existing is a sufficient fix, since searching for the "Failed to initialize sandbox" error will lead the occasional user who hits it to find this workaround 😄

@brentleyjones
Copy link
Contributor

We've been encountering this as well, since WindowServer loves to crash on Catalina for us now.

@pcj
Copy link
Member

pcj commented Jan 30, 2021

Just hit this on macos catalina 10.15.7 and bazel 4.0.0.

@pawaramol
Copy link

Just encountered this as well on MacOS Mojave 10.14.3 and bazel 3.7.1

@bigbangvn
Copy link

Encountered this on macos 10.15.7, bazel 3.1.0

@xhuoroku
Copy link

xhuoroku commented Jun 8, 2021

Add a data point, macOS 10.15.7, bazel 4.0.0-homebrew

@jerrymarino
Copy link
Contributor

This one is still happening on Big Sur

@jschaf
Copy link

jschaf commented Nov 28, 2021

Present on Bazel 4.2.0 on macOS 11.2.2

@cmey
Copy link

cmey commented Dec 3, 2021

Happened to me today on bazel 4.2.1-homebrew on macOS 11.6.1

@fernandoacorreia
Copy link

fernandoacorreia commented Jan 6, 2022

Happening to me on macOS 11.6.2 with bazel 4.2.2 (homebrew). The workaround was to reboot.

@keith
Copy link
Member

keith commented Jan 10, 2022

Thanks for the reports folks, I think the next steps here are to:

  1. Generally investigate if this happens with the getconf CLI as well
  2. If it doesn't, investigate what the difference is between that CLI and the calls bazel does
  3. If it does, investigate if there's a way around that mentioned in the manpage or anywhere else
  4. If there's no workaround, investigate if there's another way to get the variables bazel gets from here, or if we can just replace those variables with something else.

If someone is motivated to take this on, that's where I would start!

@guillaumep
Copy link

guillaumep commented Jun 28, 2022

Happening to me on macOS 11.6.2 with bazel 4.2.2 (homebrew). The workaround was to reboot.

Happened to me also, I used the bazel shutdown command to resolve the issue.

@cassandrasandquist
Copy link

macOS 12.4 and bazel 5.2.0

@zhuangya
Copy link

zhuangya commented Feb 3, 2023

macOS 13.0 and bazel 5.0.0

@dqhieu
Copy link

dqhieu commented Apr 26, 2023

Happening to me on macOS 11.6.2 with bazel 4.2.2 (homebrew). The workaround was to reboot.

Happened to me also, I used the bazel shutdown command to resolve the issue.

bazel shutdown worked for me

@nmtitov
Copy link

nmtitov commented Jun 13, 2023

Same for macOS 13.2.1 (22D68) && bazel 6.2.1, bazel shutdown didn't help.
upd: fixed after system restart.

@alexcstaley
Copy link

Encountered this today on macOS 12.6.3 and bazel 5.4.0. Solved using bazel shutdown fix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
P3 We're not considering working on this, but happy to review a PR. (No assignee) team-Local-Exec Issues and PRs for the Execution (Local) team type: bug
Projects
None yet
Development

No branches or pull requests