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

yarn start fails #1

Open
wagnersj opened this issue Aug 10, 2021 · 5 comments
Open

yarn start fails #1

wagnersj opened this issue Aug 10, 2021 · 5 comments

Comments

@wagnersj
Copy link

orion-dashboard fails to start when issue the yarn start command.

Initial attempt to run yarn command from fresh clone of repo leads to the following error:

$ yarn
internal/modules/cjs/loader.js:638
    throw err;
    ^

Error: Cannot find module '<full path removed>/orion-dashboard/.yarn/releases/yarn-berry.cjs'
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:636:15)
    at Function.Module._load (internal/modules/cjs/loader.js:562:25)
    at Function.Module.runMain (internal/modules/cjs/loader.js:831:12)
    at startup (internal/bootstrap/node.js:283:19)
    at bootstrapNodeJSCore (internal/bootstrap/node.js:623:3)

Solution to this problem is to copy over the .yarn/releases/yarn-berry.cjs file from the carbon-design-system/carbon-tutorial project. After this, the initial run of yarn works.

Once yarn-berry.cls is present, executing yarn start results in page from localhost being loaded in Web browser, followed by several minutes without output and escalating memory usage from node up to ~10 GB. Finally, command dies with the following error messages:

Starting the development server...


<--- Last few GCs --->

[188499:0x563d2c4066c0]   219877 ms: Mark-sweep 1346.5 (1425.0) -> 1345.1 (1424.6) MB, 1768.3 / 0.0 ms  (average mu = 0.124, current mu = 0.070) allocation failure GC in old space requested
[188499:0x563d2c4066c0]   221350 ms: Mark-sweep 1346.2 (1424.6) -> 1345.5 (1425.1) MB, 1467.6 / 0.0 ms  (average mu = 0.072, current mu = 0.004) allocation failure scavenge might not succeed


<--- JS stacktrace --->

==== JS stack trace =========================================

    0: ExitFrame [pc: 0x17a53d6dbf1d]
Security context: 0x3e054dd1e6c1 <JSObject>
    1: queue [0x20b78d9036e9] [<full path removed>/orion-dashboard/node_modules/@babel/generator/lib/buffer.js:~75] [pc=0x17a53f66e9c5](this=0x2f7c3ce8e9b9 <Buffer map = 0x3f9d03635d11>,str=0x39f937d09d61 <String[1]:  >)
    2: space [0x279d21213fb1] [<full path removed>/orion-dashboard/node_modules/@babel/generator/lib/printer....

FATAL ERROR: Ineffective mark-compacts near heap limit Allocation failed - JavaScript heap out of memory
 1: 0x563d28e32e74 node::Abort() [/usr/bin/node]
 2: 0x563d28e32ec2  [/usr/bin/node]
 3: 0x563d2902aaaa v8::Utils::ReportOOMFailure(v8::internal::Isolate*, char const*, bool) [/usr/bin/node]
 4: 0x563d2902ad25 v8::internal::V8::FatalProcessOutOfMemory(v8::internal::Isolate*, char const*, bool) [/usr/bin/node]
 5: 0x563d293dc0a6  [/usr/bin/node]
 6: 0x563d293dc1e4  [/usr/bin/node]
 7: 0x563d293ee70b v8::internal::Heap::PerformGarbageCollection(v8::internal::GarbageCollector, v8::GCCallbackFlags) [/usr/bin/node]
 8: 0x563d293eeec9 v8::internal::Heap::CollectGarbage(v8::internal::AllocationSpace, v8::internal::GarbageCollectionReason, v8::GCCallbackFlags) [/usr/bin/node]
 9: 0x563d293f17cd v8::internal::Heap::AllocateRawWithLigthRetry(int, v8::internal::AllocationSpace, v8::internal::AllocationAlignment) [/usr/bin/node]
10: 0x563d293f1826 v8::internal::Heap::AllocateRawWithRetryOrFail(int, v8::internal::AllocationSpace, v8::internal::AllocationAlignment) [/usr/bin/node]
11: 0x563d293be1c8 v8::internal::Factory::NewFillerObject(int, bool, v8::internal::AllocationSpace) [/usr/bin/node]
12: 0x563d2964317c v8::internal::Runtime_AllocateInNewSpace(int, v8::internal::Object**, v8::internal::Isolate*) [/usr/bin/node]
13: 0x17a53d6dbf1d 

The original carbon-design-system/carbon-tutorial project works fine in my environment.

OS: RHEL 8.3
node: v10.24.0
browser: Chrome 91.0.4472.77

@bouthilx
Copy link
Member

On my computer I can run yarn from a fresh clone without any problem. Perhaps the yarn-berry.cjs file is installed in my global node installation. I'll need to double check.

For yarn start, it takes up to 1.2G in resident memory, and 12G in virtual memory. I think 1.2G is reasonable and I don't think the virtual memory matters much. But it seems you did run out of memory... 🤔 How much RAM do you have on your computer?

@bouthilx
Copy link
Member

bouthilx commented Aug 23, 2021

I am a bit confused. Berry seems to be a package name for yarn starting from version 2.0. Locally I have yarn 1.16.0, so not berry. If I run yarn from scratch without the .yarnrc.yml file (the only place where berry is referenced) it works fine. Does it fail on your side? What is your yarn version?

@wagnersj
Copy link
Author

My system has the following specs.

OS: RHEL 8.4
Yarn: v1.22
Node.js: v10.24.0
RAM: 32 GB

I also tried to run on a fresh virtual machine with the same set up as above except with only 8 GB RAM. Same failure.

Going to try a new VM with Ubuntu 18.04.

@wagnersj
Copy link
Author

I was able to start the dashboard on a virtual machine with the following specs:

OS: Ubuntu Desktop 18.04.5
Yarn: v1.16
Node.js: v14.17.5
RAM: 8 GB

Note that I had to upgrade Node.js to v14.x since the initial yarn command would fail with a message about an incompatible version of node (required >= v10.x).

@wagnersj
Copy link
Author

I am now able to start the dashboard on RHEL8.4. Had to install the current LTS version of Node.js (v14.17.5). Did this by installing the n command via npm, then installed node v14.17.5 via n install lts. Had to run the initial yarn command via n exec lts yarn. From there, yarn start works and the dashboard loads.

Recommend the README.md file be updated to indicate needed version of node is 14.17.x.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants