Grisome build succeeds locally but fails on AWS Amplify - aws-amplify

I have a Gridsome site that I'm trying to deploy to AWS Amplify.
The site builds fine and with no errors locally with gridsome build, however on AWS Amplify, it fails.
I initially thought the error was related to a non-SSR component I was using that required <ClientOnly> tags, as this was throwing warnings in my local build. However, I've since removed that component and the issue persists.
I also thought the issue may be due to some outdated dependencies being required by packages related to webpack, but after several hours of trying to resolve these, I'm relatively confident this is not the case.
I don't quite understand the error log, but I think the issue may be related to the large number of images on my website, and AWS Amplify running out of memory (ENOMEM) while processing them. I haven't been able to find a way to increase the memory allocation for AWS Amplify, if this is even the cause.
The AWS Amplify log provides the following information:
2020-04-23T14:21:23.331Z [WARNING]: Gridsome v0.7.14
2020-04-23T14:21:23.867Z [WARNING]: Initializing plugins...
2020-04-23T14:21:24.053Z [WARNING]: Load sources - 0.1s
2020-04-23T14:21:24.166Z [WARNING]: Create GraphQL schema - 0.11s
2020-04-23T14:21:24.200Z [WARNING]: Create pages and templates - 0.03s
2020-04-23T14:21:24.224Z [WARNING]: Generate temporary code - 0.02s
2020-04-23T14:21:24.224Z [WARNING]: Bootstrap finish - 0.89s
2020-04-23T14:21:24.226Z [WARNING]: Compiling assets...
2020-04-23T14:28:43.461Z [WARNING]: Compile assets - 439.23s
2020-04-23T14:28:43.487Z [WARNING]: Execute GraphQL (14 queries) - 0.03s
2020-04-23T14:28:43.492Z [WARNING]: Write out page data (14 files) - 0s
2020-04-23T14:28:45.196Z [WARNING]: Render HTML (14 files) - 1.7s
2020-04-23T14:28:45.198Z [WARNING]: Process files (0 files) - 0s
2020-04-23T14:28:45.563Z [INFO]: [2K
2020-04-23T14:28:45.563Z [INFO]: [1GProcessing images (7675 images) - 0%
2020-04-23T14:28:47.487Z [INFO]: [2K
2020-04-23T14:28:47.489Z [INFO]: [1GProcessing images (7675 images) - 0%
2020-04-23T14:28:47.579Z [INFO]: [2K[1G
2020-04-23T14:28:47.579Z [INFO]: Processing images (7675 images) - 1%
2020-04-23T14:28:48.834Z [INFO]: [2K[1GProcessing images (7675 images) - 1%
...
2020-04-23T14:33:25.168Z [INFO]: [2K[1GProcessing images (7675 images) - 41%
2020-04-23T14:33:26.901Z [WARNING]: internal/child_process.js:366
throw errnoException(err, 'spawn');
^
Error: spawn ENOMEM
at ChildProcess.spawn (internal/child_process.js:366:11)
at spawn (child_process.js:551:9)
at Object.fork (child_process.js:113:10)
at ChildProcessWorker.initialize (/codebuild/output/src926123643/src/website/node_modules/jest-worker/build/workers/ChildProcessWorker.js:105:44)
at ChildProcessWorker.onExit (/codebuild/output/src926123643/src/website/node_modules/jest-worker/build/workers/ChildProcessWorker.js:204:12)
at ChildProcess.emit (events.js:198:13)
at Process.ChildProcess._handle.onexit (internal/child_process.js:248:12)
2020-04-23T14:33:27.254Z [WARNING]: npm
2020-04-23T14:33:27.254Z [WARNING]: ERR! code ELIFECYCLE
npm ERR! errno 1
2020-04-23T14:33:27.255Z [WARNING]: npm
2020-04-23T14:33:27.259Z [WARNING]: ERR! website# build: `gridsome build`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the website# build script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
2020-04-23T14:33:27.270Z [WARNING]:
2020-04-23T14:33:27.270Z [WARNING]: npm ERR! A complete log of this run can be found in:
npm ERR! /root/.npm/_logs/2020-04-23T14_33_27_259Z-debug.log
2020-04-23T14:33:27.270Z [HELP]: Outputting the npm debug log
0 info it worked if it ends with ok
1 verbose cli [ '/root/.nvm/versions/node/v10.16.0/bin/node',
1 verbose cli '/root/.nvm/versions/node/v10.16.0/bin/npm',
1 verbose cli 'run',
1 verbose cli 'build' ]
2 info using npm#6.9.0
3 info using node#v10.16.0
4 verbose run-script [ 'prebuild', 'build', 'postbuild' ]
5 info lifecycle website#~prebuild: website#
6 info lifecycle website#~build: website#
7 verbose lifecycle website#~build: unsafe-perm in lifecycle true
8 verbose lifecycle website#~build: PATH: /root/.nvm/versions/node/v10.16.0/lib/node_modules/npm/node_modules/npm-lifecycle/node-gyp-bin:/codebuild/output/src926123643/src/website/node_modules/.bin:/usr/local/rvm/gems/ruby-2.4.6/bin:/usr/local/rvm/gems/ruby-2.4.6#global/bin:/usr/local/rvm/rubies/ruby-2.4.6/bin:/usr/local/rvm/bin:/root/.yarn/bin:/root/.config/yarn/global/node_modules/.bin:/root/.nvm/versions/node/v10.16.0/bin:/root/.local/bin:/usr/local/rvm/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
9 verbose lifecycle website#~build: CWD: /codebuild/output/src926123643/src/website
10 silly lifecycle website#~build: Args: [ '-c', 'gridsome build' ]
11 silly lifecycle website#~build: Returned: code: 1 signal: null
12 info lifecycle website#~build: Failed to exec build script
13 verbose stack Error: website# build: `gridsome build`
13 verbose stack Exit status 1
13 verbose stack at EventEmitter.<anonymous> (/root/.nvm/versions/node/v10.16.0/lib/node_modules/npm/node_modules/npm-lifecycle/index.js:301:16)
13 verbose stack at EventEmitter.emit (events.js:198:13)
13 verbose stack at ChildProcess.<anonymous> (/root/.nvm/versions/node/v10.16.0/lib/node_modules/npm/node_modules/npm-lifecycle/lib/spawn.js:55:14)
13 verbose stack at ChildProcess.emit (events.js:198:13)
13 verbose stack at maybeClose (internal/child_process.js:982:16)
13 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:259:5)
14 verbose pkgid website#
15 verbose cwd /codebuild/output/src926123643/src/website
16 verbose Linux 4.14.165-103.209.amzn1.x86_64
17 verbose argv "/root/.nvm/versions/node/v10.16.0/bin/node" "/root/.nvm/versions/node/v10.16.0/bin/npm" "run" "build"
18 verbose node v10.16.0
19 verbose npm v6.9.0
20 error code ELIFECYCLE
21 error errno 1
22 error website# build: `gridsome build`
22 error Exit status 1
23 error Failed at the website# build script.
23 error This is probably not a problem with npm. There is likely additional logging output above.
24 verbose exit [ 1, true ]
2020-04-23T14:33:27.291Z [ERROR]: !!! Build failed
2020-04-23T14:33:27.292Z [ERROR]: !!! Non-Zero Exit Code detected
2020-04-23T14:33:27.292Z [INFO]: # Starting environment caching...
2020-04-23T14:33:27.296Z [INFO]: # Environment caching completed
Terminating logging...
My package.json contains the following:
{
"name": "website",
"private": true,
"scripts": {
"build": "gridsome build",
"develop": "gridsome develop",
"explore": "gridsome explore"
},
"dependencies": {
"#gridsome/source-filesystem": "^0.6.2",
"#gridsome/transformer-remark": "^0.5.0",
"gridsome": "^0.7.14",
"gridsome-plugin-gtm": "^0.1.1",
"marked": "^0.8.0",
"vue-burger-menu": "^2.0.4",
"vue-easy-lightbox": "^0.11.0",
"vue-slick-carousel": "^1.0.5"
},
"devDependencies": {
"node-sass": "^4.13.1",
"normalize.css": "^8.0.1",
"sass-loader": "^8.0.2",
"style-resources-loader": "^1.3.3"
},
"browserslist": [
"defaults"
]
}
I'd be grateful for any help in trying to resolve this issue.
Thank you in advance.
UPDATE #1
I am now quite sure this is due to the large number of images being processed on my site via <g-image>.
I decided to try to build using AWS CodeBuild to see if I got any more information. It failed too, but did give me some more helpful errors.
When I removed all but a handful of images, the build works. Once I get above ~300 images being displayed at different dimensions, things start to fail. The error messages:
Process files (0 files) - 0s
...
[2K·[1GProcessing images (4671 images) - 58%Error: Failed to process image src/assets/media/jobs/1.jpg. spawn ENOMEM
at pMap.concurrency (/codebuild/output/src132267748/src/github.com/xxxxx/website/node_modules/gridsome/lib/workers/image-processor.js:113:13)
(sharp:31795): GLib-CRITICAL **: 04:50:22.507: g_hash_table_lookup: assertion 'hash_table != NULL' failed
(sharp:31795): GLib-CRITICAL **: 04:50:22.516: g_hash_table_lookup: assertion 'hash_table != NULL' failed
(sharp:31795): GLib-CRITICAL **: 04:50:22.516: g_hash_table_insert_internal: assertion 'hash_table != NULL' failed
(sharp:31795): GLib-CRITICAL **: 04:50:22.516: g_hash_table_lookup: assertion 'hash_table != NULL' failed
So, yeah, I guess this is a Gridsome bug?
UPDATE #2
Adding node-options=--max_old_space_size=4096 in the .npmrc file causes the build to hang and eventually timeout.
UPDATE #3
Batch resized images so the max width/height was 2000px (effective max file size of ~2MB). Builds are now succeeding.
Hopefully someone can assist with a solution so we can build from the source files without pre-processing images.

This appears to be a bug where Gridsome runs out of memory processing a large number of large files.
This workaround preprocesses all of the image files in order to reduce the load of each image before Gridsome tries to process them.
Preprocess images with Sharp
// image-preprocessor.js
const fs = require("fs");
const path = require("path");
const sharp = require("sharp");
const dirPath = "./src/assets/";
const maxWidth = 2000;
const maxHeight = 2000;
const getAllFiles = function(dirPath, arrayOfFiles) {
files = fs.readdirSync(dirPath);
arrayOfFiles = arrayOfFiles || [];
files.forEach(function(file) {
if (fs.statSync(`${dirPath}/${file}`).isDirectory()) {
arrayOfFiles = getAllFiles(`${dirPath}/${file}`, arrayOfFiles);
} else {
arrayOfFiles.push(path.join(__dirname, dirPath, "/", file));
}
});
return arrayOfFiles;
};
const result = getAllFiles(dirPath);
result.forEach(async (file) => {
await sharp(`${file}`)
.resize(maxWidth, maxHeight, {
fit: "inside",
})
.toBuffer(function(err, buffer) {
fs.writeFile(`${file}`, buffer, function(err) {
if (err) {
console.log(err);
}
});
});
});
Add the image preprocesser to the builspec
// buildspec.yml
...
build:
commands:
- node image-preprocessor.js
- npm run build
...
Note that because the preprocessing is done every time Gridsome is built via the buildpsec, the source images remain untouched in the repository (and ultimately await a proper fix to this issue).

Related

NextJS collecting page data fails with status code 500

I have a NextJS application which builds an optimised front end. npm run build is now throwing this error:
> my-app#0.1.0 build C:\git\MyApp\MyApp-UI\src
> next build
info - Loaded env from C:\git\MyApp\MyApp-UI\src\.env.local
info - Loaded env from C:\git\MyApp\MyApp-UI\src\.env.production
(node:15540) Warning: Setting the NODE_TLS_REJECT_UNAUTHORIZED environment variable to '0' makes TLS connections and HTTPS requests insecure by disabling certificate verification.
(Use `node --trace-warnings ...` to show where the warning was created)
info - Checking validity of types
info - Creating an optimized production build
info - Compiled successfully
When it gets to this point I see this:
info - Collecting page data ..
But a moment later that line disappears and I see this:
> Build error occurred
Error: Request failed with status code 500
at createError (C:\git\MyApp\MyApp-UI\src\node_modules\axios\lib\core\createError.js:16:15)
at settle (C:\git\MyApp\MyApp-UI\src\node_modules\axios\lib\core\settle.js:17:12)
at IncomingMessage.handleStreamEnd (C:\git\MyApp\MyApp-UI\src\node_modules\axios\lib\adapters\http.js:293:11)
at IncomingMessage.emit (events.js:387:35)
at endReadableNT (internal/streams/readable.js:1317:12)
at processTicksAndRejections (internal/process/task_queues.js:82:21) {
type: 'Error',
config: {
transitional: {
silentJSONParsing: true,
forcedJSONParsing: true,
clarifyTimeoutError: false
},
transformRequest: [ null ],
transformResponse: [ null ],
timeout: 0,
xsrfCookieName: 'XSRF-TOKEN',
xsrfHeaderName: 'X-XSRF-TOKEN',
maxContentLength: -1,
maxBodyLength: -1,
headers: { Accept: 'application/json', 'User-Agent': 'axios/0.23.0' },
method: 'get',
url: 'http://localhost:8080/api/v1/catalog/en-GB/pages',
data: null,
withCredentials: false
},
status: 500
}
info - Collecting page data .npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! my-app#0.1.0 build: `next build`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the my-app#0.1.0 build script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
The package.json contains this:
"scripts": {
"dev": "next dev",
"build": "next build",
"start": "next start",
"lint": "eslint ./ --ext js,jsx,ts,tsx",
"export": "next export",
"gzip": "gzipper compress --gzip-level 9 --verbose --output-file-format [filename].[ext] ./out ./zipped",
"sitemap": "node ./sitemap-generator/sitemap-gen.js",
"sitemap-index": "node ./sitemap-generator/sitemap-index-gen.js"
},
The URL at 8080 which provides the build-time data returns sensible content when I drop it into a browser. As far as I can see, there is no error there.
The basic question is, what would be causing this and where should I look to identify the source?
If this is something to do with the NODE_TLS_REJECT_UNAUTHORIZED environment variable, where/what do I need to adjust and what is that? (I can't find that variable in the solution.)
Turns out there was an error in the solution which was being called but due to errors being ignored I had not seen it get caught in the debugger.

Cannot run .NET Core Angular app through WSL

I am trying to learn the basics of .NET Core and I have installed the .NET SDK 2.2 for Linux (I am using Windows Subsystem for Linux). I want to build a Web App with the Angular framework, so I got this GitHub repository on my machine with these two commands:
$ dotnet tool install -g web
$ web new angular-spa ProjectName
Now, basically the next step would be a simple
npm run dev
but when I try this in bash, I get some errors:
0 info it worked if it ends with ok
1 verbose cli [ '/usr/bin/node', '/usr/bin/npm', 'run', 'dev' ]
2 info using npm#3.5.2
3 info using node#v8.10.0
4 verbose run-script [ 'predev', 'dev', 'postdev' ]
5 info lifecycle my-app#0.0.0~predev: my-app#0.0.0
6 silly lifecycle my-app#0.0.0~predev: no script for predev, continuing
7 info lifecycle my-app#0.0.0~dev: my-app#0.0.0
8 verbose lifecycle my-app#0.0.0~dev: unsafe-perm in lifecycle true
9 verbose lifecycle my-app#0.0.0~dev: PATH: /usr/share/npm/bin/node-gyp-bin:/mnt/c/Users/rober/OneDrive/Dev Place/Developer Place/C#/dotnetWSL/angularAPP/AngularApp/MyApp/node_modules/.bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/mnt/c/Windows/System32:/mnt/c/Windows:/mnt/c/Windows/System32/wbem:/mnt/c/Windows/System32/WindowsPowerShell/v1.0:/mnt/c/Windows/System32/OpenSSH:/mnt/c/Program Files/Microsoft VS Code/bin:/mnt/c/Program Files (x86)/Wolfram Research/WolframScript:/mnt/c/Users/rober/AppData/Local/Microsoft/WindowsApps:/mnt/c/Users/rober/AppData/Local/hyper/app-3.0.2/resources/bin:/mnt/c/Users/rober/AppData/Local/GitHubDesktop/bin:/snap/bin:/home/basavyr/.dotnet/tools
10 verbose lifecycle my-app#0.0.0~dev: CWD: /mnt/c/Users/rober/OneDrive/Dev Place/Developer Place/C#/dotnetWSL/angularAPP/AngularApp/MyApp
11 silly lifecycle my-app#0.0.0~dev: Args: [ '-c', 'ng build --aot --watch' ]
12 silly lifecycle my-app#0.0.0~dev: Returned: code: 1 signal: null
13 info lifecycle my-app#0.0.0~dev: Failed to exec dev script
14 verbose stack Error: my-app#0.0.0 dev: `ng build --aot --watch`
14 verbose stack Exit status 1
14 verbose stack at EventEmitter.<anonymous> (/usr/share/npm/lib/utils/lifecycle.js:232:16)
14 verbose stack at emitTwo (events.js:126:13)
14 verbose stack at EventEmitter.emit (events.js:214:7)
14 verbose stack at ChildProcess.<anonymous> (/usr/share/npm/lib/utils/spawn.js:24:14)
14 verbose stack at emitTwo (events.js:126:13)
14 verbose stack at ChildProcess.emit (events.js:214:7)
14 verbose stack at maybeClose (internal/child_process.js:925:16)
14 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:209:5)
15 verbose pkgid my-app#0.0.0
16 verbose cwd /mnt/c/Users/rober/OneDrive/Dev Place/Developer Place/C#/dotnetWSL/angularAPP/AngularApp/MyApp
17 error Linux 4.4.0-17763-Microsoft
18 error argv "/usr/bin/node" "/usr/bin/npm" "run" "dev"
19 error node v8.10.0
20 error npm v3.5.2
21 error code ELIFECYCLE
22 error my-app#0.0.0 dev: `ng build --aot --watch`
22 error Exit status 1
23 error Failed at the my-app#0.0.0 dev script 'ng build --aot --watch'.
23 error Make sure you have the latest version of node.js and npm installed.
23 error If you do, this is most likely a problem with the my-app package,
23 error not with npm itself.
23 error Tell the author that this fails on your system:
23 error ng build --aot --watch
23 error You can get information on how to open an issue for this project with:
23 error npm bugs my-app
23 error Or if that isn't available, you can get their info via:
23 error npm owner ls my-app
23 error There is likely additional logging output above.
24 verbose exit [ 1, true ]
From what I see here, the npm or node versions are not the latest ones, however, I did an update today just to make sure and the issue is still here.
I would appreciate any help. Please remember that I am new to the concept of .NET web apps and my experience with Angular is also minimal: I recently started to get familiarized.

is it possible to run meteor with mongoDB on Maverics 10.9.5?

I'm running OsX 10.9.5 and React 16. After meteor installation fallowed by instruction from site https://www.meteor.com/install, installation process goes without any problems.
When I'm trying run meteor from terminal meteor run I get this:
[[[[[ ~/Codding/cdbioffice ]]]]]
=> Started proxy.
dyld: Symbol not found: _fchmodat
Referenced from:
/Users/lukasz/.meteor/packages/meteor-tool/.1.8.0_2.cty1uc.prsil++os.osx.x86_64+web.browser+web.browser.legacy+web.cordova/mt-os.osx.x86_64/dev_bundle/mongodb/bin/mongod
Expected in: /usr/lib/libSystem.B.dylib
in
/Users/lukasz/.meteor/packages/meteor-tool/.1.8.0_2.cty1uc.prsil++os.osx.x86_64+web.browser+web.browser.legacy+web.cordova/mt-os.osx.x86_64/dev_bundle/mongodb/bin/mongod
Unexpected mongo exit code null. Restarting.
dyld: Symbol not found: _fchmodat
Referenced from:
/Users/lukasz/.meteor/packages/meteor-tool/.1.8.0_2.cty1uc.prsil++os.osx.x86_64+web.browser+web.browser.legacy+web.cordova/mt-os.osx.x86_64/dev_bundle/mongodb/bin/mongod
Expected in: /usr/lib/libSystem.B.dylib
in
/Users/lukasz/.meteor/packages/meteor-tool/.1.8.0_2.cty1uc.prsil++os.osx.x86_64+web.browser+web.browser.legacy+web.cordova/mt-os.osx.x86_64/dev_bundle/mongodb/bin/mongod
Unexpected mongo exit code null. Restarting.
dyld: Symbol not found: _fchmodat
Referenced from:
/Users/lukasz/.meteor/packages/meteor-tool/.1.8.0_2.cty1uc.prsil++os.osx.x86_64+web.browser+web.browser.legacy+web.cordova/mt-os.osx.x86_64/dev_bundle/mongodb/bin/mongod
Expected in: /usr/lib/libSystem.B.dylib
in
/Users/lukasz/.meteor/packages/meteor-tool/.1.8.0_2.cty1uc.prsil++os.osx.x86_64+web.browser+web.browser.legacy+web.cordova/mt-os.osx.x86_64/dev_bundle/mongodb/bin/mongod
Unexpected mongo exit code null. Restarting.
Can't start Mongo server
In VisualStudio from project directory after meteor npm start in terminal I get additional info:
npm ERR! code ELIFECYCLE
npm ERR! errno 254
npm ERR! cd-bioffice-meteor# start: `meteor run --settings settings.json`
npm ERR! Exit status 254
npm ERR!
npm ERR! Failed at the cd-bioffice-meteor# start script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! /Users/lukasz/.npm/_logs/2019-01-14T13_48_22_707Z-debug.log
and in log file:
0 info it worked if it ends with ok
1 verbose cli [ '/Users/lukasz/.meteor/packages/meteor-tool/.1.8.0_2.cty1uc.prsil++os.osx.x86_64+web.browser+web.browser.legacy+web.cordova/mt-os.osx.x86_64/dev_bundle/bin/node',
1 verbose cli '/Users/lukasz/.meteor/packages/meteor-tool/.1.8.0_2.cty1uc.prsil++os.osx.x86_64+web.browser+web.browser.legacy+web.cordova/mt-os.osx.x86_64/dev_bundle/bin/npm',
1 verbose cli 'start' ]
2 info using npm#6.4.1
3 info using node#v8.11.4
4 verbose run-script [ 'prestart', 'start', 'poststart' ]
5 info lifecycle cd-bioffice-meteor#~prestart: cd-bioffice-meteor#
6 info lifecycle cd-bioffice-meteor#~start: cd-bioffice-meteor#
7 verbose lifecycle cd-bioffice-meteor#~start: unsafe-perm in lifecycle true
8 verbose lifecycle cd-bioffice-meteor#~start: PATH: /Users/lukasz/.meteor/packages/meteor-tool/.1.8.0_2.cty1uc.prsil++os.osx.x86_64+web.browser+web.browser.legacy+web.cordova/mt-os.osx.x86_64/dev_bundle/lib/node_modules/npm/node_modules/npm-lifecycle/node-gyp-bin:/Users/lukasz/Codding/cdbioffice/node_modules/.bin:/Users/lukasz/.meteor/packages/meteor-tool/.1.8.0_2.cty1uc.prsil++os.osx.x86_64+web.browser+web.browser.legacy+web.cordova/mt-os.osx.x86_64/dev_bundle/bin:/Users/lukasz/.meteor/packages/meteor-tool/.1.8.0_2.cty1uc.prsil++os.osx.x86_64+web.browser+web.browser.legacy+web.cordova/mt-os.osx.x86_64:/Users/lukasz/.meteor/packages/meteor-tool/.1.8.0_2.cty1uc.prsil++os.osx.x86_64+web.browser+web.browser.legacy+web.cordova/mt-os.osx.x86_64/dev_bundle/lib/node_modules/.bin:/Users/lukasz/.npm-global/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/opt/X11/bin:/usr/local/MacGPG2/bin:/Users/lukasz/.npm-global/bin
9 verbose lifecycle cd-bioffice-meteor#~start: CWD: /Users/lukasz/Codding/cdbioffice
10 silly lifecycle cd-bioffice-meteor#~start: Args: [ '-c', 'meteor run --settings settings.json' ]
11 silly lifecycle cd-bioffice-meteor#~start: Returned: code: 254 signal: null
12 info lifecycle cd-bioffice-meteor#~start: Failed to exec start script
13 verbose stack Error: cd-bioffice-meteor# start: `meteor run --settings settings.json`
13 verbose stack Exit status 254
13 verbose stack at EventEmitter.<anonymous> (/Users/lukasz/.meteor/packages/meteor-tool/.1.8.0_2.cty1uc.prsil++os.osx.x86_64+web.browser+web.browser.legacy+web.cordova/mt-os.osx.x86_64/dev_bundle/lib/node_modules/npm/node_modules/npm-lifecycle/index.js:301:16)
13 verbose stack at emitTwo (events.js:126:13)
13 verbose stack at EventEmitter.emit (events.js:214:7)
13 verbose stack at ChildProcess.<anonymous> (/Users/lukasz/.meteor/packages/meteor-tool/.1.8.0_2.cty1uc.prsil++os.osx.x86_64+web.browser+web.browser.legacy+web.cordova/mt-os.osx.x86_64/dev_bundle/lib/node_modules/npm/node_modules/npm-lifecycle/lib/spawn.js:55:14)
13 verbose stack at emitTwo (events.js:126:13)
13 verbose stack at ChildProcess.emit (events.js:214:7)
13 verbose stack at maybeClose (internal/child_process.js:925:16)
13 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:209:5)
14 verbose pkgid cd-bioffice-meteor#
15 verbose cwd /Users/lukasz/Codding/cdbioffice
16 verbose Darwin 13.4.0
17 verbose argv "/Users/lukasz/.meteor/packages/meteor-tool/.1.8.0_2.cty1uc.prsil++os.osx.x86_64+web.browser+web.browser.legacy+web.cordova/mt-os.osx.x86_64/dev_bundle/bin/node" "/Users/lukasz/.meteor/packages/meteor-tool/.1.8.0_2.cty1uc.prsil++os.osx.x86_64+web.browser+web.browser.legacy+web.cordova/mt-os.osx.x86_64/dev_bundle/bin/npm" "start"
18 verbose node v8.11.4
19 verbose npm v6.4.1
20 error code ELIFECYCLE
21 error errno 254
22 error cd-bioffice-meteor# start: `meteor run --settings settings.json`
22 error Exit status 254
23 error Failed at the cd-bioffice-meteor# start script.
23 error This is probably not a problem with npm. There is likely additional logging output above.
24 verbose exit [ 254, true ]
What I'm doing wrong? I found bunch of answer on this topic but I'm not sure witch direction should I go. One of them is that OsX 10.9 is to old to run that config. I don't want to make this situation worst.
System:
Maverics 10.9.5
node -v && npm -v
v9.5.0
5.6.0
Thanks for your help.
package.json for existing project (I'm interested on):
{
"name": "cd-bioffice-meteor",
"private": true,
"scripts": {
"start": "meteor run --settings settings.json",
"test": "meteor test --once --driver-package meteortesting:mocha",
"test-app": "TEST_WATCH=1 meteor test --full-app --driver-package meteortesting:mocha",
"visualize": "meteor --production --extra-packages bundle-visualizer"
},
"dependencies": {
"#babel/runtime": "^7.1.5",
"bcrypt": "^3.0.0",
"meteor-node-stubs": "^0.4.1",
"moment": "^2.22.2",
"moment-timezone": "^0.5.21",
"npm": "^6.5.0",
"polished": "^2.0.3",
"react": "^16.5.1",
"react-bootstrap": "^0.32.4",
"react-dom": "^16.5.1",
"react-inlinesvg": "^0.8.1",
"react-router-bootstrap": "^0.24.4",
"react-router-dom": "^4.3.1",
"serialport": "^7.1.3",
"styled-components": "^3.4.6"
},
"meteor": {
"mainModule": {
"client": "client/main.jsx",
"server": "server/main.js"
},
"testModule": "tests/main.js"
}
}

Meteor deploy Bcrypt error Invoking deployment process

I want to deploy a meteor app (v1.2) to digital ocean. I am using MUP with this tutorial.
When I run mup deploy verbose I get this error (see below). I tried this as well being how i am on linux. meteor build myAppHere --architecture os.linux.x86_64 . But I still get the error.
Any ideas?
Started TaskList: Deploy app 'myAppHere' (linux)
[162.243.58.84] - Uploading bundle
[162.243.58.84] - Uploading bundle: SUCCESS
[162.243.58.84] - Setting up Environment Variables
[162.243.58.84] - Setting up Environment Variables: SUCCESS
[162.243.58.84] - Invoking deployment process
[162.243.58.84] x Invoking deployment process: FAILED
-----------------------------------STDERR-----------------------------------
ile=node.lib',
gyp info spawn args '-Dmodule_root_dir=/opt/myAppHere/tmp/bundle/programs/server/npm/npm-bcrypt/node_modules/bcrypt',
gyp info spawn args '--depth=.',
gyp info spawn args '--no-parallel',
gyp info spawn args '--generator-output',
gyp info spawn args 'build',
gyp info spawn args '-Goutput_dir=.' ]
gyp info spawn make
gyp info spawn args [ 'BUILDTYPE=Release', '-C', 'build' ]
gyp info ok
npm WARN package.json meteor-dev-bundle#0.0.0 No description
npm WARN package.json meteor-dev-bundle#0.0.0 No repository field.
npm WARN package.json meteor-dev-bundle#0.0.0 No README data
stop: Unknown instance:
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0curl: (7) Failed to connect to localhost port 81: Connection refused
Latest deployment failed! Reverted back to the previous version.
What is your node version? Most probably installed nodejs version is old. You can try with "nodeVersion": "0.10.40" in your mup.json

Meteor-Up failures on 2 different servers

I am experiencing failure every time I try to deploy to either an AWS/EC2 instance or a Digital Ocean droplet. With the EC2 instance I am using a pem file and with the droplet I am using password access. There were a lot of hoops to jump through to get through the mup setup, but that is finally successful on both instances. It's the mup deploy that fails on the Invoking deployment process: step.
Here's my mup.json for the droplet:
{
// Server authentication info
"servers": [
{
"host": "xx.xx.xx.xx",
"username": "root",
"password": "notmypassword"
// or pem file (ssh based authentication)
//"pem": "~/.ssh/id_rsa"
//"pem": "/users/alex/dropbox/awspems/projectmanager.pem"
}
],
// Install MongoDB in the server, does not destroy local MongoDB on future setup
"setupMongo": true,
// WARNING: Node.js is required! Only skip if you already have Node.js installed on server.
"setupNode": true,
// WARNING: If nodeVersion omitted will setup 0.10.33 by default. Do not use v, only version number.
"nodeVersion": "0.10.35",
// Install PhantomJS in the server
"setupPhantom": true,
// Application name (No spaces)
"appName": "projectmanager",
// Location of app (local directory)
"app": "/users/alex/dropbox/projectmanager",
// Configure environment
"env": {
"ROOT_URL": "http://xx.xx.xx.xx"
},
// Meteor Up checks if the app comes online just after the deployment
// before mup checks that, it will wait for no. of seconds configured below
"deployCheckWaitTime": 30
}
The following messages appear whether in the EC2 instance or the droplet instance:
Claire-MacAir-7:projectmanager alex$ mup deploy
Meteor Up: Production Quality Meteor Deployments
------------------------------------------------
“ Checkout Kadira!
It's the best way to monitor performance of your app.
Visit: https://kadira.io/mup ”
Building Started: /users/notmyusername/dropbox/projectmanager
Started TaskList: Deploy app 'projectmanager' (linux)
[xx.xx.xx.xx] - Uploading bundle
[xx.xx.xx.xx] ✔ Uploading bundle: SUCCESS
[xx.xx.xx.xx] - Setting up Environment Variables
[xx.xx.xx.xx] ✔ Setting up Environment Variables: SUCCESS
[xx.xx.xx.xx] - Invoking deployment process
[xx.xx.xx.xx] ✘ Invoking deployment process: FAILED
-----------------------------------STDERR-----------------------------------
ir=/root/.node-gyp/0.10.35',
gyp info spawn args '-Dmodule_root_dir=/opt/projectmanager/tmp/bundle/programs/server/npm/npm-bcrypt/node_modules/bcrypt',
gyp info spawn args '--depth=.',
gyp info spawn args '--no-parallel',
gyp info spawn args '--generator-output',
gyp info spawn args 'build',
gyp info spawn args '-Goutput_dir=.' ]
gyp info spawn make
gyp info spawn args [ 'BUILDTYPE=Release', '-C', 'build' ]
gyp info ok
npm WARN package.json meteor-dev-bundle#0.0.0 No description
npm WARN package.json meteor-dev-bundle#0.0.0 No repository field.
npm WARN package.json meteor-dev-bundle#0.0.0 No README data
stop: Unknown instance:
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0curl: (7) Failed to connect to localhost port 80: Connection refused
App did not pick up! Please check app logs.
-----------------------------------STDOUT-----------------------------------
LE(target) Release/obj.target/bcrypt_lib.node: Finished
COPY Release/bcrypt_lib.node
make: Leaving directory `/opt/projectmanager/tmp/bundle/programs/server/npm/npm-bcrypt/node_modules/bcrypt/build'
> fibers#1.0.1 install /opt/projectmanager/tmp/bundle/programs/server/node_modules/fibers
> node ./build.js
`linux-x64-v8-3.14` exists; testing
Binary is fine; exiting
underscore#1.5.2 node_modules/underscore
semver#4.1.0 node_modules/semver
chalk#0.5.1 node_modules/chalk
├── escape-string-regexp#1.0.2
├── ansi-styles#1.1.0
├── supports-color#0.2.0
├── strip-ansi#0.3.0 (ansi-regex#0.2.1)
└── has-ansi#0.1.0 (ansi-regex#0.2.1)
eachline#2.3.3 node_modules/eachline
└── type-of#2.0.1
source-map-support#0.2.8 node_modules/source-map-support
└── source-map#0.1.32 (amdefine#0.1.0)
fibers#1.0.1 node_modules/fibers
Waiting for MongoDB to initialize. (5 minutes)
connected
projectmanager start/running, process 11786
Waiting for 30 seconds while app is booting up
Checking is app booted or not?
----------------------------------------------------------------------------
Completed TaskList: Deploy app 'projectmanager' (linux)
The project works perfectly with no errors on my localhost.
Any ideas?
Thanks in advance, Alex Adams
And the solution is:
The mup logs showed that it didn't like a path designated for a folder to hold uploaded files. I changed the app to use GridFS, thus storing the files in the database. The app deploys correctly now.

Resources