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

Error during make test: 'Error: Cannot find module '/node/test/fixtures/nested-index/one' #16357

Closed
Tiriel opened this issue Oct 21, 2017 · 13 comments
Labels
question Issues that look for answers. test Issues and PRs related to the tests.

Comments

@Tiriel
Copy link
Contributor

Tiriel commented Oct 21, 2017

Heyr there,

  • Version: nodejs/node/master, during build
  • Platform: Linux [ laptop identifier ] 4.10.0-37-generic Add a Gitter chat badge to README.md #41~16.04.1-Ubuntu SMP Fri Oct 6 22:42:59 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux
  • Subsystem:

I've got this error during make test and couldn't find another issue about it (included: end of test command):

[ ... other tests are green ] 
[----------] Global test environment tear-down
[==========] 62 tests from 7 test cases ran. (1002 ms total)
[  PASSED  ] 62 tests.
/usr/bin/python2.7 tools/test.py --mode=release -J \
	async-hooks \
	default \
	addons addons-napi \
	doctool known_issues
=== release test-require-resolve ===                                           
Path: parallel/test-require-resolve
module.js:510
    throw err;
    ^

Error: Cannot find module '/home/benjamin/dev/javascript/node/test/fixtures/nested-index/one'
    at Function.Module._resolveFilename (module.js:508:15)
    at Function.resolve (internal/module.js:18:19)
    at Object.<anonymous> (/home/benjamin/Dev/javascript/node/test/parallel/test-require-resolve.js:35:11)
    at Module._compile (module.js:607:30)
    at Object.Module._extensions..js (module.js:618:10)
    at Module.load (module.js:526:32)
    at tryModuleLoad (module.js:489:12)
    at Function.Module._load (module.js:481:3)
    at Function.Module.runMain (module.js:648:10)
    at startup (bootstrap_node.js:191:16)
Command: out/Release/node /home/benjamin/Dev/javascript/node/test/parallel/test-require-resolve.js
=== release test-npm-install ===                                               
Path: parallel/test-npm-install
Command: out/Release/node /home/benjamin/Dev/javascript/node/test/parallel/test-npm-install.js
--- TIMEOUT ---
[04:52|%  89|+ 1804|-   2]: Done                                        
Makefile:209 : la recette pour la cible « test » a échouée
make: *** [test] Erreur 1

This happens consistently.
I tried re reunning ./configure and make, but every time make test outputs this error.
For the record, the output of ./configure:

creating ./icu_config.gypi
* Using ICU in deps/icu-small
creating ./icu_config.gypi
{ 'target_defaults': { 'cflags': [],
                       'default_configuration': 'Release',
                       'defines': [],
                       'include_dirs': [],
                       'libraries': []},
  'variables': { 'asan': 0,
                 'coverage': 'false',
                 'debug_devtools': 'node',
                 'debug_http2': 'false',
                 'debug_nghttp2': 'false',
                 'force_dynamic_crt': 0,
                 'gas_version': 0,
                 'host_arch': 'x64',
                 'icu_data_file': 'icudt59l.dat',
                 'icu_data_in': '../../deps/icu-small/source/data/in/icudt59l.dat',
                 'icu_endianness': 'l',
                 'icu_gyp_path': 'tools/icu/icu-generic.gyp',
                 'icu_locales': 'en,root',
                 'icu_path': 'deps/icu-small',
                 'icu_small': 'true',
                 'icu_ver_major': '59',
                 'node_byteorder': 'little',
                 'node_enable_d8': 'false',
                 'node_enable_v8_vtunejit': 'false',
                 'node_install_npm': 'true',
                 'node_module_version': 59,
                 'node_no_browser_globals': 'false',
                 'node_prefix': '/usr/local',
                 'node_release_urlbase': '',
                 'node_shared': 'false',
                 'node_shared_cares': 'false',
                 'node_shared_http_parser': 'false',
                 'node_shared_libuv': 'false',
                 'node_shared_openssl': 'false',
                 'node_shared_zlib': 'false',
                 'node_tag': '',
                 'node_use_bundled_v8': 'true',
                 'node_use_dtrace': 'false',
                 'node_use_etw': 'false',
                 'node_use_lttng': 'false',
                 'node_use_openssl': 'true',
                 'node_use_perfctr': 'false',
                 'node_use_v8_platform': 'true',
                 'node_without_node_options': 'false',
                 'openssl_fips': '',
                 'openssl_no_asm': 0,
                 'shlib_suffix': 'so.59',
                 'target_arch': 'x64',
                 'uv_parent_path': '/deps/uv/',
                 'uv_use_dtrace': 'false',
                 'v8_enable_gdbjit': 0,
                 'v8_enable_i18n_support': 1,
                 'v8_enable_inspector': 1,
                 'v8_no_strict_aliasing': 1,
                 'v8_optimized_debug': 0,
                 'v8_promise_internal_field_count': 1,
                 'v8_random_seed': 0,
                 'v8_trace_maps': 0,
                 'v8_use_snapshot': 'true',
                 'want_separate_host_toolset': 0}}
creating ./config.gypi
creating ./config.mk

make doesn't output any error message, but last line is this one and I don't know if it's supposed to be:

if [ ! -r node -o ! -L node ]; then ln -fs out/Release/node node; fi

Thank you!
Cheers

@bnoordhuis
Copy link
Member

Do you have /home/benjamin/dev symlinked to /home/benjamin/Dev or vice versa? I suspect the difference in casing is what is making the tests fail:

Error: Cannot find module '/home/benjamin/dev/...'
    # ...
    at Object.<anonymous> (/home/benjamin/Dev/...

@bnoordhuis bnoordhuis added question Issues that look for answers. test Issues and PRs related to the tests. labels Oct 21, 2017
@Tiriel
Copy link
Contributor Author

Tiriel commented Oct 21, 2017

Absolutely not. That's even weird, since the dev (lower cased) dir doesn't even exist.
I hadn't noticed the difference in casing.

You think a simple symbolic link would do the trick? Is there a way to prevent such a thing, to prevent difference in casing breaks the tests?

@bnoordhuis
Copy link
Member

Out of curiosity, what does mount print? If it's not a symlink, my second guess would be that your home directory is on a case-insensitive file system.

@Tiriel
Copy link
Contributor Author

Tiriel commented Oct 21, 2017

Here's the result of mount:

sysfs on /sys type sysfs (rw,nosuid,nodev,noexec,relatime)
proc on /proc type proc (rw,nosuid,nodev,noexec,relatime)
udev on /dev type devtmpfs (rw,nosuid,relatime,size=4005460k,nr_inodes=1001365,mode=755)
devpts on /dev/pts type devpts (rw,nosuid,noexec,relatime,gid=5,mode=620,ptmxmode=000)
tmpfs on /run type tmpfs (rw,nosuid,noexec,relatime,size=805480k,mode=755)
/dev/sdb3 on / type ext4 (rw,relatime,errors=remount-ro,data=ordered)
securityfs on /sys/kernel/security type securityfs (rw,nosuid,nodev,noexec,relatime)
tmpfs on /dev/shm type tmpfs (rw,nosuid,nodev)
tmpfs on /run/lock type tmpfs (rw,nosuid,nodev,noexec,relatime,size=5120k)
tmpfs on /sys/fs/cgroup type tmpfs (ro,nosuid,nodev,noexec,mode=755)
cgroup on /sys/fs/cgroup/systemd type cgroup (rw,nosuid,nodev,noexec,relatime,xattr,release_agent=/lib/systemd/systemd-cgroups-agent,name=systemd)
pstore on /sys/fs/pstore type pstore (rw,nosuid,nodev,noexec,relatime)
efivarfs on /sys/firmware/efi/efivars type efivarfs (rw,nosuid,nodev,noexec,relatime)
cgroup on /sys/fs/cgroup/memory type cgroup (rw,nosuid,nodev,noexec,relatime,memory)
cgroup on /sys/fs/cgroup/net_cls,net_prio type cgroup (rw,nosuid,nodev,noexec,relatime,net_cls,net_prio)
cgroup on /sys/fs/cgroup/perf_event type cgroup (rw,nosuid,nodev,noexec,relatime,perf_event)
cgroup on /sys/fs/cgroup/freezer type cgroup (rw,nosuid,nodev,noexec,relatime,freezer)
cgroup on /sys/fs/cgroup/cpuset type cgroup (rw,nosuid,nodev,noexec,relatime,cpuset)
cgroup on /sys/fs/cgroup/hugetlb type cgroup (rw,nosuid,nodev,noexec,relatime,hugetlb)
cgroup on /sys/fs/cgroup/devices type cgroup (rw,nosuid,nodev,noexec,relatime,devices)
cgroup on /sys/fs/cgroup/cpu,cpuacct type cgroup (rw,nosuid,nodev,noexec,relatime,cpu,cpuacct)
cgroup on /sys/fs/cgroup/blkio type cgroup (rw,nosuid,nodev,noexec,relatime,blkio)
cgroup on /sys/fs/cgroup/pids type cgroup (rw,nosuid,nodev,noexec,relatime,pids)
systemd-1 on /proc/sys/fs/binfmt_misc type autofs (rw,relatime,fd=28,pgrp=1,timeout=0,minproto=5,maxproto=5,direct,pipe_ino=17626)
mqueue on /dev/mqueue type mqueue (rw,relatime)
debugfs on /sys/kernel/debug type debugfs (rw,relatime)
fusectl on /sys/fs/fuse/connections type fusectl (rw,relatime)
hugetlbfs on /dev/hugepages type hugetlbfs (rw,relatime)
/dev/sda1 on /boot/efi type vfat (rw,relatime,fmask=0077,dmask=0077,codepage=437,iocharset=iso8859-1,shortname=mixed,errors=remount-ro)
tmpfs on /tmp type tmpfs (rw)
/dev/sdb3 on /var/lib/docker/aufs type ext4 (rw,relatime,errors=remount-ro,data=ordered)
tmpfs on /run/user/1000 type tmpfs (rw,nosuid,nodev,relatime,size=805480k,mode=700,uid=1000,gid=1000)
gvfsd-fuse on /run/user/1000/gvfs type fuse.gvfsd-fuse (rw,nosuid,nodev,relatime,user_id=1000,group_id=1000)
jetbrains-toolbox on /tmp/.mount_kQfTgq type fuse.jetbrains-toolbox (ro,nosuid,nodev,relatime,user_id=1000,group_id=1000)

The file is indeed on an ext4 filesystem, which is case-sensitive iirc.
Any solution, apart from renaming all my directories? 😅

@bnoordhuis
Copy link
Member

Hm, sorry, no. I can't think of anything that would cause that. Maybe someone else has a suggestion.

@Tiriel
Copy link
Contributor Author

Tiriel commented Oct 21, 2017

No problem, thanks anyway!

From what I've seen, the test it's all about is pretty simple and should not cause any problem. Most of all, the script loads all other modules properly except this one.

I've looked around, and I'm still new to Node internals, but from what I've seen paths are converted to lowercase only for win32 systems, which is not the case here since I'm on Ubuntu. Unless the dual boot gets Node all fuzzy...

I'm deeply puzzled.

@Tiriel
Copy link
Contributor Author

Tiriel commented Oct 21, 2017

Quick update, this is getting weirder.

I tried creating a symlink from Dev to dev and re run make test. Here's what I got:

[----------] Global test environment tear-down
[==========] 62 tests from 7 test cases ran. (1560 ms total)
[  PASSED  ] 62 tests.
/usr/bin/python2.7 tools/test.py --mode=release -J \
	async-hooks \
	default \
	addons addons-napi \
	doctool known_issues
=== release test-require-resolve ===                                           
Path: parallel/test-require-resolve
assert.js:45
  throw new errors.AssertionError({
  ^

AssertionError [ERR_ASSERTION]: '/home/benjamin/dev/javascript/node/test/fixtures/nested-index/one/index.js' === '/home/benjamin/Dev/javascript/node/test/fixtures/nested-index/one/index.js'
    at Object.<anonymous> (/home/benjamin/Dev/javascript/node/test/parallel/test-require-resolve.js:33:8)
    at Module._compile (module.js:607:30)
    at Object.Module._extensions..js (module.js:618:10)
    at Module.load (module.js:526:32)
    at tryModuleLoad (module.js:489:12)
    at Function.Module._load (module.js:481:3)
    at Function.Module.runMain (module.js:648:10)
    at startup (bootstrap_node.js:191:16)
    at bootstrap_node.js:609:3
Command: out/Release/node /home/benjamin/Dev/javascript/node/test/parallel/test-require-resolve.js
[03:56|% 100|+ 2021|-   1]: Done                                               
Makefile:209 : la recette pour la cible « test » a échouée
make: *** [test] Erreur 1

The test case in question:

assert.strictEqual(
  fixtures.path('nested-index', 'one', 'index.js').toLowerCase(),
  require.resolve(fixtures.path('nested-index', 'one').toLowerCase()));

Both paths are supposed to be lower cased, so how come the error displays 'Dev' with an upper case?

And why does THIS particular module poses so much problem? It only contains an export to "hello from one!"...

@drewfish
Copy link
Contributor

I'm running into the same issue (starting with 8.8.0, but not seeing it in 8.7.0). I added some console logging, with the following results:

  • fixtures.path('nested-index', 'one') works
  • require.resolve(fixtures.path('nested-index', 'one')) works
  • require.resolve(fixtures.path('nested-index', 'one').toLowerCase()) throws

Should the toLowerCase() perhaps move outside of the require.resolve()?

@cjihrig
Copy link
Contributor

cjihrig commented Oct 25, 2017

Does #16486 fix the problem for you?

@apapirovski
Copy link
Member

apapirovski commented Oct 25, 2017

@drewfish It should definitely be require.resolve(fixtures.path('nested-index', 'one')).toLowerCase() as it is in the updated test case.

@drewfish
Copy link
Contributor

Yep, that fixed it, thanks! (I've backported this fix on our internal 8.8.0 until 8.8.1 is available.)

@refack
Copy link
Contributor

refack commented Oct 25, 2017

Closing since #16486 landed and is a confirmed fix

@refack refack closed this as completed Oct 25, 2017
@Tiriel
Copy link
Contributor Author

Tiriel commented Oct 26, 2017

Just to be sure. Has the change been merged into master? I still got the error when pulling this morning.

Otherwise, when replicating changes or building v8.8.1, the problem is fixed indeed.
Thank you guys!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Issues that look for answers. test Issues and PRs related to the tests.
Projects
None yet
Development

No branches or pull requests

6 participants