Skip to content

Inconsistent missing files error when testing #1760

Description

@igilham

🐞 bug report

Affected Rule

I'm not certain I can pinpoint a rule but I started getting this error after enabling a test using Jest.

I copied the jest_test rule from Stack Overflow.

Is this a regression?

Unknown. I haven't tested with different versions of Bazel or rules_nodejs yet.

Description

I started getting errors after enabling testing via Jest and a custom rule in an example repository I use for testing Bazel and rules_nodejs features. The error complains about missing files

The error occurs about 3/4 of the time on my Mac and I have not yet seen it work successfully in a few runs on my Linux CI environment running on GitHub Actions.

I tried disabling the caching of Bazel outputs in CI but this has not helped.

🔬 Minimal Reproduction

The errors can be seen in the CI workflow in this PR: igilham/bazel-example#34. The repo is larger than needed to demonstrate this issue, but the PR change is small enough to be representative of a minimal reproduction.

🔥 Exception or Error

Continuous integration failures.

The below comes from a successful run on my Mac:

❯ yarn test
yarn run v1.22.4
$ bazelisk test //...
INFO: Analyzed 28 targets (1 packages loaded, 26 targets configured).
INFO: Found 27 targets and 1 test target...
INFO: Elapsed time: 19.725s, Critical Path: 18.09s
INFO: 8 processes: 4 darwin-sandbox, 4 worker.
INFO: Build completed successfully, 16 total actions
//libs/javascript/jest_test:test                                         PASSED in 8.9s

Executed 1 out of 1 test: 1 test passes.
INFO: Build completed successfully, 16 total actions
✨  Done in 19.98s.

The below comes from a failed run on my Mac:


❯ yarn test
yarn run v1.22.4
$ bazelisk test //...
INFO: Analyzed 28 targets (1 packages loaded, 26 targets configured).
INFO: Found 27 targets and 1 test target...
ERROR: missing input file 'node_modules/bazel_example/apps/typescript/no_deps/bin.sh.runfiles/bazel_example/apps/typescript/no_deps/index.d.
ts', owner: '//:node_modules/bazel_example/apps/typescript/no_deps/bin.sh.runfiles/bazel_example/apps/typescript/no_deps/index.d.ts':/Users/
gilhai01/code/bazel-example/node_modules/bazel_example/apps/typescript/no_deps/bin.sh.runfiles/bazel_example/apps/typescript/no_deps/index.d
.ts (No such file or directory)
ERROR: /Users/gilhai01/code/bazel-example/BUILD.bazel:9:1: //:node_modules: missing input file 'LabelCause{label=//:node_modules/bazel_examp
le/apps/typescript/no_deps/bin.sh.runfiles/bazel_example/apps/typescript/no_deps/index.d.ts, msg=missing input file 'node_modules/bazel_exam
ple/apps/typescript/no_deps/bin.sh.runfiles/bazel_example/apps/typescript/no_deps/index.d.ts', owner: '//:node_modules/bazel_example/apps/ty
pescript/no_deps/bin.sh.runfiles/bazel_example/apps/typescript/no_deps/index.d.ts':/Users/gilhai01/code/bazel-example/node_modules/bazel_exa
mple/apps/typescript/no_deps/bin.sh.runfiles/bazel_example/apps/typescript/no_deps/index.d.ts (No such file or directory)}'
ERROR: missing input file 'node_modules/bazel_example/apps/typescript/no_deps/bin.sh.runfiles/bazel_example/apps/typescript/no_deps/index.js
', owner: '//:node_modules/bazel_example/apps/typescript/no_deps/bin.sh.runfiles/bazel_example/apps/typescript/no_deps/index.js':/Users/gilh
ai01/code/bazel-example/node_modules/bazel_example/apps/typescript/no_deps/bin.sh.runfiles/bazel_example/apps/typescript/no_deps/index.js (N
o such file or directory)
ERROR: /Users/gilhai01/code/bazel-example/BUILD.bazel:9:1: //:node_modules: missing input file 'LabelCause{label=//:node_modules/bazel_examp
le/apps/typescript/no_deps/bin.sh.runfiles/bazel_example/apps/typescript/no_deps/index.js, msg=missing input file 'node_modules/bazel_exampl
e/apps/typescript/no_deps/bin.sh.runfiles/bazel_example/apps/typescript/no_deps/index.js', owner: '//:node_modules/bazel_example/apps/typesc
ript/no_deps/bin.sh.runfiles/bazel_example/apps/typescript/no_deps/index.js':/Users/gilhai01/code/bazel-example/node_modules/bazel_example/a
pps/typescript/no_deps/bin.sh.runfiles/bazel_example/apps/typescript/no_deps/index.js (No such file or directory)}'
ERROR: missing input file 'node_modules/bazel_example/apps/typescript/no_deps/index.d.ts', owner: '//:node_modules/bazel_example/apps/typesc
ript/no_deps/index.d.ts':/Users/gilhai01/code/bazel-example/node_modules/bazel_example/apps/typescript/no_deps/index.d.ts (No such file or d
irectory)
ERROR: /Users/gilhai01/code/bazel-example/BUILD.bazel:9:1: //:node_modules: missing input file 'LabelCause{label=//:node_modules/bazel_examp
le/apps/typescript/no_deps/index.d.ts, msg=missing input file 'node_modules/bazel_example/apps/typescript/no_deps/index.d.ts', owner: '//:no
de_modules/bazel_example/apps/typescript/no_deps/index.d.ts':/Users/gilhai01/code/bazel-example/node_modules/bazel_example/apps/typescript/n
o_deps/index.d.ts (No such file or directory)}'
ERROR: missing input file 'node_modules/bazel_example/apps/typescript/no_deps/index.js', owner: '//:node_modules/bazel_example/apps/typescri
pt/no_deps/index.js':/Users/gilhai01/code/bazel-example/node_modules/bazel_example/apps/typescript/no_deps/index.js (No such file or directo
ry)
ERROR: /Users/gilhai01/code/bazel-example/BUILD.bazel:9:1: //:node_modules: missing input file 'LabelCause{label=//:node_modules/bazel_examp
le/apps/typescript/no_deps/index.js, msg=missing input file 'node_modules/bazel_example/apps/typescript/no_deps/index.js', owner: '//:node_m
odules/bazel_example/apps/typescript/no_deps/index.js':/Users/gilhai01/code/bazel-example/node_modules/bazel_example/apps/typescript/no_deps
/index.js (No such file or directory)}'
ERROR: missing input file 'node_modules/bazel_example/libs/typescript/external_deps/index.d.ts', owner: '//:node_modules/bazel_example/libs/
typescript/external_deps/index.d.ts':/Users/gilhai01/code/bazel-example/node_modules/bazel_example/libs/typescript/external_deps/index.d.ts 
(No such file or directory)
ERROR: /Users/gilhai01/code/bazel-example/BUILD.bazel:9:1: //:node_modules: missing input file 'LabelCause{label=//:node_modules/bazel_examp
le/libs/typescript/external_deps/index.d.ts, msg=missing input file 'node_modules/bazel_example/libs/typescript/external_deps/index.d.ts', o
wner: '//:node_modules/bazel_example/libs/typescript/external_deps/index.d.ts':/Users/gilhai01/code/bazel-example/node_modules/bazel_example
/libs/typescript/external_deps/index.d.ts (No such file or directory)}'
ERROR: missing input file 'node_modules/bazel_example/libs/typescript/external_deps/index.js', owner: '//:node_modules/bazel_example/libs/ty
pescript/external_deps/index.js':/Users/gilhai01/code/bazel-example/node_modules/bazel_example/libs/typescript/external_deps/index.js (No su
ch file or directory)
ERROR: /Users/gilhai01/code/bazel-example/BUILD.bazel:9:1: //:node_modules: missing input file 'LabelCause{label=//:node_modules/bazel_examp
le/libs/typescript/external_deps/index.js, msg=missing input file 'node_modules/bazel_example/libs/typescript/external_deps/index.js', owner
: '//:node_modules/bazel_example/libs/typescript/external_deps/index.js':/Users/gilhai01/code/bazel-example/node_modules/bazel_example/libs/
typescript/external_deps/index.js (No such file or directory)}'
ERROR: missing input file 'node_modules/bazel_example/libs/typescript/no_deps/index.d.ts', owner: '//:node_modules/bazel_example/libs/typesc
ript/no_deps/index.d.ts':/Users/gilhai01/code/bazel-example/node_modules/bazel_example/libs/typescript/no_deps/index.d.ts (No such file or d
irectory)
ERROR: /Users/gilhai01/code/bazel-example/BUILD.bazel:9:1: //:node_modules: missing input file 'LabelCause{label=//:node_modules/bazel_examp
le/libs/typescript/no_deps/index.d.ts, msg=missing input file 'node_modules/bazel_example/libs/typescript/no_deps/index.d.ts', owner: '//:no
de_modules/bazel_example/libs/typescript/no_deps/index.d.ts':/Users/gilhai01/code/bazel-example/node_modules/bazel_example/libs/typescript/n
o_deps/index.d.ts (No such file or directory)}'
ERROR: missing input file 'node_modules/bazel_example/libs/typescript/no_deps/index.js', owner: '//:node_modules/bazel_example/libs/typescri
pt/no_deps/index.js':/Users/gilhai01/code/bazel-example/node_modules/bazel_example/libs/typescript/no_deps/index.js (No such file or directo
ry)
ERROR: /Users/gilhai01/code/bazel-example/BUILD.bazel:9:1: //:node_modules: missing input file 'LabelCause{label=//:node_modules/bazel_examp
le/libs/typescript/no_deps/index.js, msg=missing input file 'node_modules/bazel_example/libs/typescript/no_deps/index.js', owner: '//:node_m
odules/bazel_example/libs/typescript/no_deps/index.js':/Users/gilhai01/code/bazel-example/node_modules/bazel_example/libs/typescript/no_deps
/index.js (No such file or directory)}'
ERROR: /Users/gilhai01/code/bazel-example/BUILD.bazel:9:1 8 input file(s) do not exist
INFO: Elapsed time: 10.902s, Critical Path: 9.46s
INFO: 5 processes: 2 darwin-sandbox, 3 worker.
FAILED: Build did NOT complete successfully
//libs/javascript/jest_test:test                                      NO STATUS

FAILED: Build did NOT complete successfully
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

🌍 Your Environment

I'm using Bazelisk via Yarn.

Operating System:

  
MacOS 10.14.6 Mojave
  

Output of bazelisk version:


Bazelisk version: v1.3.0
Build label: 2.2.0
Build target: bazel-out/darwin-opt/bin/src/main/java/com/google/devtools/build/lib/bazel/BazelServer_deploy.jar
Build time: Tue Mar 3 09:28:15 2020 (1583227695)
Build timestamp: 1583227695
Build timestamp as int: 1583227695

Rules_nodejs version:

1.5.0, matched exactly in package.json.

  
http_archive(
    name = "build_bazel_rules_nodejs",
    sha256 = "d0c4bb8b902c1658f42eb5563809c70a06e46015d64057d25560b0eb4bdc9007",
    urls = ["https://github.com/bazelbuild/rules_nodejs/releases/download/1.5.0/rules_nodejs-1.5.0.tar.gz"],
)
  

This issue seems very similar to #1701, but the missing files are from my own packages, not from external dependencies. Unlike that issue, running bazelisk sync does not temporarily fix the failures.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Can Close?We will close this in 30 days if there is no further activitybug

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions