-
Notifications
You must be signed in to change notification settings - Fork 6.2k
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
🐛 Bug Report: System limit for number of file watchers reached #19619
Comments
I am not sure if it is an environmental issue or not. However, I am interested to know the purpose of the file watcher in the production environment. |
Hi @myplaybooks, would it be possible to share your Dockerfile, please? |
@awanlin I am facing issue at: My Dockerfile FROM my-private-repo/docker.io/node:18.14.1-alpine COPY --from=build /app/yarn.lock /app/package.json /app/packages/backend/dist/skeleton.tar.gz ./ |
Thanks @myplaybooks, can you tell me where are you running this when you hit the error? Just locally? When you build this in maybe a CI/CD pipeline? Also, host custom is this: |
Yeah, its happening in the production CI/CD pipeline. I couldn't reproduce the error locally. I think I need to know why we have file watchers? can we disable it in the production environment? |
Hi @myplaybooks, could you try increasing the |
Was just going to follow up with what @camilaibs suggested, also if possible reboot as that was another solution I saw on the Backstage Discord server that worked. Some more ideas might in this issue: gatsbyjs/gatsby#11406 Also, a bit more background, I'm still digging into this myself as a learning opportunity: from my reading react seems to use |
@camilaibs @awanlin After some research, I got to know that Docker doesn't let the sysctl to be modified during the build for images because it takes it from the host. To increase max_user_watches in the host, the DevOps team is asking for the reason for watchers in the production environment: https://shorturl.at/emzQ5. Do we know why we need watchers? Hard to get approval to increase the number of file watchers without knowing the reason. |
@myplaybooks the build system requires watchers to be set up for each configuration file during the build. You'll only need a small number of available watchers. In case anyone wants to contribute a fix for this I think the best path forward would be an option for |
I have the same issue during application startup. |
@antoniomuso that'd be the same solution as #19619 (comment) |
@Rugvip My doubt is are we using ~300 file watchers?? Will the above PR fix that? |
Is the 300ish file watcher happening during |
during |
Alright, thanks for reporting back. That does sound unexpected. Maybe the webpack build spins up watchers and needs to have that explicitly disabled, or similar? Opening up for more investigation and contributions 🙏 |
@freben |
📜 Description
I am getting the following issue in the build pipeline
The docker image I am using 18.14.1-alpine
yarn run v1.22.19
$ tsc
Done in 31.32s.
yarn run v1.22.19
$ backstage-cli package build
Building app separately because it is a bundled package
app: [2K
app: [1G[2m$ backstage-cli package build[22m
app:
app:
app: [31mError: ENOSPC: System limit for number of file watchers reached, watch '/app/app-config.yaml'[39m
app:
app:
app: [2K
app: [1G[31merror[39m Command failed with exit code 1.
app:
app: [2K[1G[34minfo[39m Visit [1mhttps://yarnpkg.com/en/docs/cli/run[22m for documentation about this command.
app:
Command 'yarn' exited with code 1
👍 Expected behavior
The prod pipeline should have any file watchers.
👎 Actual Behavior with Screenshots
�[36mINFO�[0m[1198] Running: [/bin/sh -c yarn tsc && yarn --cwd packages/backend build]
yarn run v1.22.19
$ tsc
Done in 31.32s.
yarn run v1.22.19
$ backstage-cli package build
Building app separately because it is a bundled package
app: �[2K
app: �[1G�[2m$ backstage-cli package build�[22m
app:
app:
app: �[31mError: ENOSPC: System limit for number of file watchers reached, watch '/app/app-config.yaml'�[39m
app:
app:
app: �[2K
app: �[1G�[31merror�[39m Command failed with exit code 1.
app:
app: �[2K�[1G�[34minfo�[39m Visit �[1mhttps://yarnpkg.com/en/docs/cli/run�[22m for documentation about this command.
app:
Command 'yarn' exited with code 1
👟 Reproduction steps
The build pipeline produces the above error.
📃 Provide the context for the Bug.
No response
🖥️ Your Environment
OS: Linux 5.15.96-0-virt - linux/x64
node: v18.14.1
yarn: 1.22.19
cli: 0.22.9 (installed)
backstage: N/A
Dependencies:
@backstage/app-defaults 1.4.1
@backstage/backend-app-api 0.4.5
@backstage/backend-common 0.19.1
@backstage/backend-dev-utils 0.1.1
@backstage/backend-plugin-api 0.5.4
@backstage/backend-tasks 0.5.4
@backstage/catalog-client 1.4.3
@backstage/catalog-model 1.4.1
@backstage/cli-common 0.1.12
@backstage/cli-node 0.1.2
@backstage/cli 0.22.9
@backstage/config-loader 1.3.2
@backstage/config 1.0.8
@backstage/core-app-api 1.9.0
@backstage/core-components 0.13.3
@backstage/core-plugin-api 1.5.3
@backstage/dev-utils 1.0.17
@backstage/errors 1.2.1
@backstage/eslint-plugin 0.1.3
@backstage/integration-aws-node 0.1.5
@backstage/integration-react 1.1.15
@backstage/integration 1.5.1
@backstage/plugin-analytics-module-ga 0.1.31
@backstage/plugin-api-docs 0.9.6
@backstage/plugin-app-backend 0.3.47
@backstage/plugin-auth-backend 0.18.5
@backstage/plugin-auth-node 0.2.16
@backstage/plugin-catalog-backend-module-bitbucket-server 0.1.12
@backstage/plugin-catalog-backend 1.11.0
@backstage/plugin-catalog-common 1.0.15
@backstage/plugin-catalog-graph 0.2.32
@backstage/plugin-catalog-import 0.9.10
@backstage/plugin-catalog-node 1.4.0
@backstage/plugin-catalog-react 1.8.0
@backstage/plugin-catalog 1.12.0
@backstage/plugin-events-node 0.2.8
@backstage/plugin-github-actions 0.6.1
@backstage/plugin-home-react 0.1.1
@backstage/plugin-home 0.5.4
@backstage/plugin-org 0.6.10
@backstage/plugin-permission-common 0.7.7
@backstage/plugin-permission-node 0.7.10
@backstage/plugin-permission-react 0.4.14
@backstage/plugin-proxy-backend 0.2.41
@backstage/plugin-scaffolder-backend 1.15.1
@backstage/plugin-scaffolder-common 1.3.2
@backstage/plugin-scaffolder-node 0.1.5
@backstage/plugin-scaffolder-react 1.5.1
@backstage/plugin-scaffolder 1.14.1
@backstage/plugin-search-backend-module-catalog 0.1.3
@backstage/plugin-search-backend-module-pg 0.5.8
@backstage/plugin-search-backend-module-techdocs 0.1.3
@backstage/plugin-search-backend-node 1.2.3
@backstage/plugin-search-backend 1.3.3
@backstage/plugin-search-common 1.2.5
@backstage/plugin-search-react 1.6.3
@backstage/plugin-search 1.3.3
@backstage/plugin-sonarqube-backend 0.2.1
@backstage/plugin-sonarqube-react 0.1.7
@backstage/plugin-sonarqube 0.7.1
@backstage/plugin-tech-radar 0.6.6
@backstage/plugin-techdocs-backend 1.6.4
@backstage/plugin-techdocs-module-addons-contrib 1.0.15
@backstage/plugin-techdocs-node 1.7.3
@backstage/plugin-techdocs-react 1.1.8
@backstage/plugin-techdocs 1.6.5
@backstage/plugin-user-settings 0.7.5
@backstage/release-manifests 0.0.9
@backstage/test-utils 1.4.1
@backstage/theme 0.4.1
@backstage/types 1.1.0
@backstage/version-bridge 1.0.4
👀 Have you spent some time to check if this bug has been raised before?
🏢 Have you read the Code of Conduct?
Are you willing to submit PR?
No, I don't have time to work on this right now
The text was updated successfully, but these errors were encountered: