RangeError: Invalid array buffer length Error in GCE 1 vCPU, 0.6 GB memory Server


#1

I am trying to install reaction commerce in Google Compute engine with f1-micro (1 vCPU, 0.6 GB memory) server configuration. I am getting while starting the reaction commerce in gcloud shell.

Please guide me what i should do.

zenmonk@eshop:~/reaction reaction init shop
Cloning the master branch of Reaction from Github...
Cloning into 'shop'...
Installing NPM packages...
npm WARN deprecated tough-cookie@2.2.2: ReDoS vulnerability parsing Set-Cookie https://nodesecurity.io/advisories/130
> dtrace-provider@0.6.0 install /home/zenmonk/reaction/shop/node_modules/dtrace-provider
> node scripts/install.js
> fibers@1.0.13 install /home/zenmonk/reaction/shop/node_modules/fibers
> node build.js || nodejs build.js
`linux-x64-v8-4.5` exists; testing
Binary is fine; exiting
> reaction@0.14.2 postinstall /home/zenmonk/reaction/shop
> .reaction/scripts/postinstall.sh
reaction@0.14.2 /home/zenmonk/reaction/shop

Reaction successfully installed!
To start your Reaction instance, just run: 
 cd shop
 reaction


zenmonk@eshop@:~/reaction/shop$ reaction

Using settings file at settings/dev.settings.json

Setting up plugin imports...

[[[[[ ~/reaction/shop ]]]]]

=> Started proxy.
=> Started MongoDB.
buffer.js:25
    const ui8 = new Uint8Array(size);
                ^

RangeError: Invalid array buffer length
    at new ArrayBuffer (native)
    at new Uint8Array (native)
    at createBuffer (buffer.js:25:17)
    at allocate (buffer.js:96:12)
    at new Buffer (buffer.js:56:12)
    at increaseBufferIfNecessary (/home/zenmonk/.meteor/packages/meteor-tool/.1.4.0-1.13j49n2++os.linux.x86_64+web.browser+web.cordova/mt-os.linux.x86_64/dev_bundle/lib/node_modules/stream-buffers/lib/writable_streambuffer.js:58:23)
    at [object Object]._write (/home/zenmonk/.meteor/packages/meteor-tool/.1.4.0-1.13j49n2++os.linux.x86_64+web.browser+web.cordova/mt-os.linux.x86_64/dev_bundle/lib/node_modules/stream-buffers/lib/writable_streambuffer.js:65:5)
    at doWrite (_stream_writable.js:300:12)
    at writeOrBuffer (_stream_writable.js:286:5)
    at [object Object].Writable.write (_stream_writable.js:214:11)
    at Request.ondata (stream.js:31:26)
    at emitOne (events.js:82:20)
    at Request.emit (events.js:169:7)
    at IncomingMessage.<anonymous> (/home/zenmonk/.meteor/packages/meteor-tool/.1.4.0-1.13j49n2++os.linux.x86_64+web.browser+web.cordova/mt-os.linux.x86_64/dev_bundle/lib/node_modules/request/request.js:1255:12)
    at emitOne (events.js:77:13)
    at IncomingMessage.emit (events.js:169:7)
    at readableAddChunk (_stream_readable.js:153:18)
    at IncomingMessage.Readable.push (_stream_readable.js:111:10)
    at HTTPParser.parserOnBody (_http_common.js:124:22)
    at TLSSocket.socketOnData (_http_client.js:320:20)
    at emitOne (events.js:77:13)
    at TLSSocket.emit (events.js:169:7)
    at readableAddChunk (_stream_readable.js:153:18)
    at TLSSocket.Readable.push (_stream_readable.js:111:10)
    at TLSWrap.onread (net.js:536:20)

Minimum RAM required to build reaction
#2

Can you please run reaction -v and tell me what it says? Also, what OS are you using?


#3
root@zenmonk:/var/www/html/reaction# reaction -v

Node: 6.3.1
NPM: 3.10.3
Reaction: 0.14.2
Reaction CLI: 0.4.4

``Server OS: Debian GNU/ Linux 8 (Jessie)`


#4

It sounds like a possible memory issue. A machine with only 600mb is kind of pushing it. Try increasing your RAM to whatever the next size up is.


#5

I am able to setup the ecommerce site in Ubuntu 14.04 OS and 2 vCPUs, 7.5 GB configuration. I will try with lower configuration.
I want to you to tell me, is there any script or way to run this in background? How to set as service in node js?


#6

It looks like you are currently running Reaction in development mode (which is only intended to be used for local development/testing). You need to build a production version of the app. Our recommended method is Docker.

https://docs.reactioncommerce.com/reaction-docs/master/deploying-reaction-using-docker

You can use any supported deployment methods for Meteor apps, but I strongly encourage you to consider using Docker so you don’t have to manually install all of the operating system dependencies yourself. It also makes version updates/rollbacks significantly easier.

The Docker deployment method allows you deploy a fully configured production setup with a single command on any Docker host. And Docker Machine has a driver for Google Compute Engine, so you can provision a Docker host on GCE with one command and then deploy your Reaction image to it with one more.