-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Recently started getting "Too many open files..." spinning up cluster on Apple M1 #6072
Comments
Actually did manage to get all of those messages to go away, but now I'm getting these errors: First time:
Second time:
Looks like I'm actually getting this on Linux and WSL2 as well, so maybe some other issue. I did the following and the "Too many open files" messages went away on the M1:
Didn't get the "Too many open files..." warning by doing this, but now getting the
|
I don't think this is a Skaffold problem: I run Skaffold on an M1, admittedly with fewer containers, and I don't see this issue. It's worth poking around with
And check your
Ah, now that I'm writing this, I do remember having this problem with my older MBP. For some reason, my default ulimits for the maximum open files was set really low ( https://gist.github.com/tombigel/d503800a282fcadbee14b537735d202c |
What version of I found that installing the It looks like my |
OK, gave the link you provided a shot. At
So I increased it to But given the |
Thanks @cheslijones for bringing this issue. I am going to keep this open for now. |
Hi all. InformationSkaffold version: Contents of skaffold.yaml:
Some logs with -vdebug
I tried to increase file limit but error persists. (If I delete folder node_modules everything works well and I have no errors, but is not a solution). UPDATE |
We've also ran into this issue where my colleague on Apple M1 laptop sees this error and I, who is on MacBook Pro (15-inch, 2018)/2.2 GHz 6-Core Intel Core i7, does not. This is what he sees after starting skaffold on Apple M1: WARN[3018] Ignoring changes: listing files: unable to evaluate build args:
reading dockerfile: open /ismedia-nx-scaffold/choi/apps/api/Dockerfile: too many open files
# And predictably the re-depoy fails:
WARN[3091] Skipping deploy due to sync error: copying files: starting
command /usr/local/bin/kubectl --context docker-desktop exec api-74bc656856-gxb48
--namespace default -c api -i -- tar xmf - -C / --no-same-owner: fork/exec /usr/local/bin/kubectl: too many open files $ lsof -n | awk '{ counts[$1]++} END { for(c in counts) { print counts[c], c}}' | sort -n | tail
...
2921 Google
24570 skaffold # <-- I don't even have skaffold reported on my Intel chip MacBook Pro. The issue seems goes away if my colleague deletes the root I've created a sample repo to recreate this issue. Please follow the instructions in |
This is what we have to do npm install
npm run skaffold # generate images
# ^C to exit skaffold
rm -rf node_modules
npm run skaffold On non-M1 laptops, we can run skaffold with one command. |
I tried to look in to the sync/dockerignore code involved here, but didn't find anything obvious that would cause things to behave differently on my M1. While poking around, I did notice that the issue resolves itself by using a local skaffold build instead of the official release. |
Ah! 💡 We're currently cross-compiling Skaffold for darwin/arm64 but have to disable cgo (#5286) as we don't have the required headers and libraries available. I've been meaning to retool our release process and this provides the impetus. |
With skaffold-darwin-amd64 it works like a charm. The error has gone. I would be great if arm64 version could be fixed. |
@resumerise @cheslijones I initially installed skaffold via homebrew. So I did
But I'm still getting the same error.
Information
|
@ryan-efendy you can find out which build of skaffold you have with: Also, @briandealwis - I can confirm the issue goes away if I use a locally compiled version! ( For now I'll start recommending folks build their own copy of skaffold to get around this issue. |
@erulabs what do you mean by
I installed
Can you elaborate below. As in download the standalone binary vs. using package managers?
|
@ryan-efendy - by "locally compiled version" I mean literally cloning the |
This did the trick! After compiling the binaries myself, I just copied it over to |
This is my workaround
|
@briandealwis following up on your comment here, do you think that the recent changes to our build process should have resolved this issue ? |
Oh yes! To all following this issue, this bug should be fixed in Skaffold v1.35.1. |
@cheslijones and @Mrhoho did v1.35.1 fix your issue? |
I use the local compiled version |
@Mrhoho are you using a version that you compiled yourself? Or are you using the version from: https://github.com/GoogleContainerTools/skaffold/releases/tag/v1.35.2 |
|
@Mrhoho interesting! If you're willing, I'd like you try a few things to help us narrow the issue:
|
Macbook pro m1 max 1.MacOS arm64
2.macOS amd64
3.File limits
|
I have another problem, after a few minutes of
|
Odd! Your file limits are an order of magnitude of my machine settings. I should have asked two other things:
There are a number of reports similar to this with the M1, saying the default values for maxfiles are too low. You may get further by running |
1.ulimit -a
2.launchctl limit I modified the default value
|
I’m wondering what process has these open files, and what these files may be. Can you try running that |
Thanks for that lsof diff @Mrhoho. Based on the diff Two observations:
And just to confirm, you see this when you are not using your |
Thank you for your help! 1.Doesn't work 2.Still doesn't work Yes i did not apply this patch. I don't know the exact reason. But this patch worked for me Thanks again |
@Mrhoho: I think you're hitting a different issue than what's described in this thread. The symptoms described by others arise from executing commands by Skaffold within macOS [*] whereas your symptoms seem to be within the Docker containers. Given that you're having to tweak the fs.inotify flags from within each node, there must be some component in one of your container images that's hitting resource limits within the Docker VM. Skaffold doesn't run a file-watcher inside the containers or inside the cluster, and I'm struggling to think how Skaffold may be at fault here. [*] @cheslijones did mention seeing odd http2 errors though they happened on Linux and WSL2 too. I'm fairly certain those errors are in-container errors as Skaffold errors would have been reported with a leading |
Closing as the principal issue seems solved with the new cgo-enabled build process. |
Expected behavior
That my project would be deployed and spin-up without any issues.
Actual behavior
It is safe to say, I think, that this is isolated to Apple Silicon.
I get all of these "Too many open files..." warnings, the deployment slows down to snails crawl, other messages related to "failed to port forward is taken, retrying..." and then eventually it acts like it starts trying to rebuild the images again. Basically it is a mess...
Interestingly you can access the services, but none of the communication between them is working.
Without
-vdebug
:Screen.Recording.2021-06-23.at.12.29.11.PM.mov
With
-vdebug
:Screen.Recording.2021-06-23.at.12.16.25.PM.mov
I've only tested it is still working on AMD and Intel Linux and Windows (WSL2) machines. Works perfectly fine, the application spins up quickly and without issues.
I don't have an Intel Mac around me at this point in time to test it, but I'd imagine it works fine there as well. At least that is what I was working on for two years up until about a month ago.
Pretty sure this was working perfectly about a month ago on an M1 Mac that has since been reformatted... but I could be mistaken. I reinstalled everything following the exact same steps, however.
Information
1.26.1
skaffold.dev
, but did also trybrew
with the same results... using thedarwin-arm64
versionYou can comment out the individual
artifacts
, or themanifests
, to just deploy one service at a time. The results are the same... a ton of errors about "Too many open files..." and eventually it becomes unresponsive.Steps to reproduce the behavior
skaffold dev --port-forward -n dev
These are other dependencies:
Pretty sure can't install anything but
arm64
for these and haven't tried the non-arm
versions.This is what I've tried:
virtualization.framework
andhypervisor.framework
.terminal
under as "Universal" or "Apple Silicon".The text was updated successfully, but these errors were encountered: