Skip to content

ci: "Failed to watch node_modules/…/package.json using fs.watch() … ENOSPC" #5495

@justinmk3

Description

@justinmk3

Problem

The Linux Unit Tests CI jobs show these (non-fatal, currently) errors indicating that something is crawling files in node_modules and trying to watch package.json

[File Watcher (parcel)] Inotify limit reached (ENOSPC) (path: /codebuild/output/src4054755577/src/github.com/aws/aws-toolkit-vscode/node_modules)
  file_editAwsFile telemetry
[File Watcher (node.js)] Failed to watch /codebuild/output/src4054755577/src/github.com/aws/aws-toolkit-vscode/node_modules/@types/readline-sync/package.json for changes using fs.watch() (Error: ENOSPC: System limit for number of file watchers reached, watch '/codebuild/output/src4054755577/src/github.com/aws/aws-toolkit-vscode/node_modules/@types/readline-sync/package.json')
[File Watcher (node.js)] Failed to watch /codebuild/output/src4054755577/src/github.com/aws/aws-toolkit-vscode/node_modules/@types/responselike/package.json for changes using fs.watch() (Error: ENOSPC: System limit for number of file watchers reached, watch '/codebuild/output/src4054755577/src/github.com/aws/aws-toolkit-vscode/node_modules/@types/responselike/package.json')
[File Watcher (node.js)] Failed to watch /codebuild/output/src4054755577/src/github.com/aws/aws-toolkit-vscode/node_modules/@types/retry/package.json for changes using fs.watch() (Error: ENOSPC: System limit for number of file watchers reached, watch '/codebuild/output/src4054755577/src/github.com/aws/aws-toolkit-vscode/node_modules/@types/retry/package.json')
[File Watcher (node.js)] Failed to watch /codebuild/output/src4054755577/src/github.com/aws/aws-toolkit-vscode/node_modules/@types/semver/package.json for changes using fs.watch() (Error: ENOSPC: System limit for number of file watchers reached, watch '/codebuild/output/src4054755577/src/github.com/aws/aws-toolkit-vscode/node_modules/@types/semver/package.json')
Unable to load and parse grammar for scope source.ssmjson from file:///codebuild/output/src4054755577/src/github.com/aws/aws-toolkit-vscode/packages/core/syntaxes/SSMJSON.tmLanguage { fileOperationResult: 1, options: { preferUnbuffered: true } }
    ✔ emits when opened by user (488ms)

Expected behavior

Toolkit/Q code should not create lots of file watchers. #2382 (Good news: this may be a CI-only issue; see "Analysis" below.)

This issue is currently not "fatal" (doesn't fail CI or interfere with tests ... yet). But:

  1. it may point to a problem that affects actual users (on Linux if not other OSes)
  2. it adds noise to the CI logs
  3. it may interfere with tests in the future

Analysis

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions