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

How do I handle this error: "too many open files in system" #30

Closed
josh-m-sharpe opened this issue Sep 20, 2019 · 15 comments
Closed

How do I handle this error: "too many open files in system" #30

josh-m-sharpe opened this issue Sep 20, 2019 · 15 comments

Comments

@josh-m-sharpe
Copy link

+------------------------------------------------------------------------------+

| (5) cache-push                                                               |
+------------------------------------------------------------------------------+
| id: cache-push                                                               |
| version: 2.2.0                                                               |
| collection: https://github.com/bitrise-io/bitrise-steplib.git                |
| toolkit: go                                                                  |
| time: 2019-09-20T12:29:56Z                                                   |
+------------------------------------------------------------------------------+
|                                                                              |
Config:
- Paths: ./vendor/bundle -> Gemfile.lock
./node_modules -> yarn.lock
- IgnoredPaths: 
- CacheAPIURL: [REDACTED]
- FingerprintMethodID: file-content-hash
- CompressArchive: false
- DebugMode: false
- StackID: 
Cleaning paths
Done in 8.034978765s
Checking previous cache status
Previous cache info found at: /tmp/cache-info.json
Done in 2m16.542042163s
Checking for file changes
Previous cache is invalid, new cache will be generated:
0 files needs to be removed
0 files has changed
116815 files added
File changes found in 58.662739ms
Generating cache archive
Failed to populate archive: failed to lstat(/Users/vagrant/git/node_modules/appium-support/node_modules/core-js/fn/math/isubh.js), error: lstat /Users/vagrant/git/node_modules/appium-support/node_modules/core-js/fn/math/isubh.js: too many open files in system
WARN[12:33:35] Step (cache-push) failed, but was marked as skippable 
|                                                                              |
+---+---------------------------------------------------------------+----------+
| ! | cache-push (exit code: 1)                                     | 3.7 min  |
+---+---------------------------------------------------------------+----------+
| Issue tracker: https://github.com/bitrise-steplib/steps-cache-push/issues    |
| Source: https://github.com/bitrise-steplib/steps-cache-push.git              |
+---+---------------------------------------------------------------+----------+
@josh-m-sharpe
Copy link
Author

josh-m-sharpe commented Sep 20, 2019

Output from ulimit:

+ ulimit
unlimited

@bitce
Copy link

bitce commented Sep 23, 2019

@josh-m-sharpe can you please include a build URL too?

@josh-m-sharpe
Copy link
Author

Apologies, I have asked this same question on intercom - Andrew responded to me there.

The failing build in question: https://app.bitrise.io/build/46a6fb95a940bd50#?tab=log

@josh-m-sharpe
Copy link
Author

For what it's worth, I see this post, and the answer, but would argue that the response is invalid:
https://discuss.bitrise.io/t/too-many-open-files-in-system-from-cache-push/9114

On CircleCI and Bitrise, my yarn install takes roughly 3 minutes.

On CircleCI, the cache restore takes 50 seconds.

So there's definitely some room for optimization.

@santiagofm
Copy link

@bitce @josh-m-sharpe Any update on this? we are experiencing the same issue: https://app.bitrise.io/build/d7b9552977bbe2e4#?tab=log

@josh-m-sharpe
Copy link
Author

josh-m-sharpe commented Oct 8, 2019 via email

@bitce
Copy link

bitce commented Oct 15, 2019

Hi guys! This should be fixed since #32 so in the latest 2.2.1 step version. Can you let us know what you're experiencing? :)

@josh-m-sharpe
Copy link
Author

josh-m-sharpe commented Oct 16, 2019 via email

@ghost
Copy link

ghost commented Oct 24, 2019

Hey @josh-m-sharpe , thanks for sharing! The step is working as intended. In build 633, the JSON parser takes 2 min 40 seconds to parse your previous cache's manifest to see if any additional uploads need to be performed. It then determines there are no changes and completes in a few hundred milliseconds.

@josh-m-sharpe
Copy link
Author

josh-m-sharpe commented Oct 24, 2019

@ahvth-bitrise I'm a little confused. I gotta say, I assumed that the reason the "Cache paths" input was structured the way it is:

image

...was because the step was doing something with the file on the right-hand side. But it sounds like this algorithm does something with every single file in the cache? That seems like huge waste of time and resources to me.

Why not just md5 the lock file? That's what I was assuming it was doing. md5 takes all of zero seconds:

time md5 yarn.lock
MD5 (yarn.lock) = 25efdb164f36da36ee85427c8494f665

real    0m0.020s
user    0m0.003s
sys     0m0.005s

@ghost
Copy link

ghost commented Oct 28, 2019

Hm, ideally the update indicator file would be the only file that gets checked in this case, yes. One issue that comes to mind looking at your specific example is that perhaps the relative paths are tripping up the step here. Could you try switching those out with the absolute paths of your update indicator files?

If that fails, I will make an investigation task for our tooling team to explore why the hashing took so long in your case.

FYI, there is also a second method here that you can make use of which only checks the date modified to designate files for upload. Could you please try setting the file-mod-time Fingerprint Method in the cache-push step's settings?

@josh-m-sharpe
Copy link
Author

I have no interest in caching based on the timestamp of the file - that will just produce false broken caches. MD5 should really be the way to go here.

@ghost
Copy link

ghost commented Oct 28, 2019

Understood. Could you please try with absolute file paths for the update indicator files and let me know if it works for you? If not, please send me the build URL here or in our Intercom conversation and I will initiate an investigation.

@josh-m-sharpe
Copy link
Author

Closing this as the "too many open files in system" is was resolved. Thanks!

@lpusok
Copy link
Contributor

lpusok commented Nov 20, 2019

Hi @josh-m-sharpe,
In the latest release (https://github.com/bitrise-steplib/steps-cache-push/releases/tag/2.2.2) speeds are improved when using an indicator file.

@github-actions github-actions bot locked and limited conversation to collaborators Apr 2, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants