Getting a mup setup error (AWS EC2 instance) - meteor

I am trying to setup a simple Telescope Meteor app on an AWS EC2 instance and I am getting an error message when trying to run mup setup:
Here is my mup.json file:
{
// Server authentication info
"servers": [
{
"host": "ec2-54-191-197-203.us-west-2.compute.amazonaws.com",
"username": "ubuntu",
//"password": "password"
// or pem file (ssh based authentication)
//"pem": "/Users/apple/Coding/Contract Work/TelescopeApp.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.36 by default. Do not use v, only version number.
"nodeVersion": "0.10.36",
// Install PhantomJS in the server
"setupPhantom": true,
// Show a progress bar during the upload of the bundle to the server.
// Might cause an error in some rare cases if set to true, for instance in Shippable CI
"enableUploadProgressBar": true,
// Application name (No spaces)
"appName": "TelescopeApp",
// Location of app (local directory)
"app": "/Users/apple/Coding/Contract Work",
// Configure environment
"env": {
"PORT": 80,
"ROOT_URL": "http://ec2-54-191-197-203.us-west-2.compute.amazonaws.com",
"MONGO_URL" "mongodb://localhost:27017/Telescope-database"
},
// 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": 15
}
Here is the error message:
Meteor Up: Production Quality Meteor Deployments
------------------------------------------------
/usr/local/lib/node_modules/mup/node_modules/cjson/index.js:226
throw err;
^
SyntaxError: Trailing comma in object at 10:5
}
^
File: "/Users/apple/Coding/Contract Work/Telescope/mup.json"
at SyntaxError (native)
at Object.parseJSON (/usr/local/lib/node_modules/mup/node_modules/jju/lib/parse.js:745:13)
at Object.parse (/usr/local/lib/node_modules/mup/node_modules/json-parse-helpfulerror/index.js:10:13)
at Object.exports.parse (/usr/local/lib/node_modules/mup/node_modules/cjson/index.js:90:28)
at Object.load (/usr/local/lib/node_modules/mup/node_modules/cjson/index.js:223:24)
at Object.exports.read (/usr/local/lib/node_modules/mup/lib/config.js:12:25)
at Object.<anonymous> (/usr/local/lib/node_modules/mup/bin/mup:20:23)
at Module._compile (module.js:541:32)
at Object.Module._extensions..js (module.js:550:10)
at Module.load (module.js:456:32)
What am I doing wrong?

change
"username": "ubuntu",
to
"username": "ubuntu"
You probably commented the "password: "password" line and forgot to remove the additional comma after "username": "ubuntu",.

Related

Debug Next.js App with VSCode in NX monorepo

I'm currently trying to debug a Next.js Application inside a NX monorepo.
I have enabled the Auto Attach setting in VSCode's User Settings.
When I start the Application using the serve command, I can see output in the Debug Console and also print out the current process by typing process or console.log(process) into the Debug Console.
However, I cannot set any breakpoints in the server side code, for example in getServerSideProps.
I checked Next.js Debugging Documentation for the missing pieces, and tried setting the NODE_OPTIONS='--inspect' in my Next.js Application via .env file.
Update: Seems like it's a missing feature on NX.
Got it working, thanks to the information from this Pull Request.
.vscode/launch.json
{
"version": "0.2.0",
"resolveSourceMapLocations": ["${workspaceFolder}/**", "!**/node_modules/**"],
"configurations": [
{
"name": "name-of-the-app – Server",
"type": "node",
"request": "launch",
"runtimeExecutable": "yarn",
"runtimeArgs": [
"nx",
"run",
"name-of-the-app:serve",
"-r",
"ts-node/register",
"-r",
"tsconfig-paths/register"
],
"outputCapture": "std",
"internalConsoleOptions": "openOnSessionStart",
"console": "internalConsole",
"env": {
"TS_NODE_IGNORE": "false",
"TS_NODE_PROJECT": "${workspaceFolder}/apps/name-of-the-app/tsconfig.json"
},
"cwd": "${workspaceFolder}/apps/name-of-the-app/"
}
]
}
Note: I'm using yarn. You might have to replace it with npm instead.

Error Deploying Meteor App on DigitalOcean Using Meteor Up

I was trying to deploy a Meteor app onto a DigitalOcean droplet, via its IP address (I have no domain name). I am doing this kind of thing for the first time, so was having a lot of issues with it.
This is my droplet on Digital Ocean:
I created a MUP (Meteor Up) directory outside my Meteor app’s repo using mup init, and this is the mup.js file that I have:
module.exports = {
servers: {
one: {
host: '162.243.57.207',
username: 'cs673f16',
pem: '/Users/gautambhat/.ssh/id_rsa'
// password:
// or leave blank for authenticate from ssh-agent
}
},
meteor: {
name: 'meetcute',
path: '/Users/gautambhat/Repos/CS673_team2',
servers: {
one: {}
},
buildOptions: {
serverOnly: true,
},
env: {
ROOT_URL: 'http://162.243.57.207',
PORT : 3000
//MONGO_URL: 'mongodb://localhost/meteor'
},
//dockerImage: 'kadirahq/meteord'
deployCheckWaitTime: 60
},
mongo: {
oplog: true,
port: 27017,
servers: {
one: {},
},
},
};
Also, I don't know my MONGO_URL, or where to find it, so I just commented it out. After running setup, and the running mup deploy, I get this:
=> Starting meteor app on port:80
assert.js:93
throw new assert.AssertionError({
^
AssertionError: "undefined" === "function"
at wrapPathFunction (/bundle/bundle/programs/server/mini-files.js:77:10)
at Object.<anonymous> (/bundle/bundle/programs/server/mini-files.js:108:24)
at Module._compile (module.js:456:26)
at Object.Module._extensions..js (module.js:474:10)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:312:12)
at Module.require (module.js:364:17)
at require (module.js:380:17)
at Object.<anonymous> (/bundle/bundle/programs/server/boot.js:9:13)
at Module._compile (module.js:456:26)
-----------------------------------STDOUT-----------------------------------
After researching a bit online on different sites, I found a fix here
The new kadirahq/mup
The default dockerImage is meteorhacks/meteord:base and thus still uses Node 0.10.43. If someone builds and publishes a new image from the base, it could be easily swapped in. I've gone ahead and provided an abernix/meteord:base image with the necessary changes to run Node 4.4.7 + the benefit of NPM 3 on an updated distro (jessie instead of wheezy). I'm not sure if this is something that kadira will provide soon themselves or not.
You can use my image by adding the following in your mup.js, inside the meteor object (see docs for details), and re-deploying with mup deploy:
dockerImage: 'abernix/meteord:base'

Meteor settings file error

I would like use settings.json for create the first user when i start my APP for the first time, but i've error on my browser.
My settings.json :
{
"admin": {
"username": "username",
"password": "password"
},
"smtp": "smtp://example#example.com"
}
My /lib/userAccount.js :
let username = Meteor.settings.admin.username;
Accounts.createUser({
username: username,
password: 'steph0407'
});
And error return on browser :
Erreur : TypeError: Meteor.settings.admin is undefined
Do you have any idea why i've this error ?
Thak you !
You should start meteor app with: meteor --settings ./path/to/settings.json
Remember also that anything in Your settings not under a key called "public" is only made available to the server.
If you put something under a key called "public", it will be available to client and the server.
You should move userAccount.js to server folder or check if (Meteor.isServer) {} in Your lib folder.

events.js:72 meteor up deploy

i tried everything what i found in net but nothing helped me... i try deploy app in my server on Debian 8.2, and every time after: mup deploy i got this:
Meteor Up: Production Quality Meteor Deployments
------------------------------------------------
Building Started: /Volumes/Macintosh HD/Users/myName/Google Drive/_projects/Coda/lottato_com
events.js:72
throw er; // Unhandled 'error' event
^
Error: spawn ENOENT
at errnoException (child_process.js:1011:11)
at Process.ChildProcess._handle.onexit (child_process.js:802:34)
my mup.json look lik:
{
"servers": [
{
"host": "server IP",
"username": "root",
"password": "blablabla"
}
],
"setupMongo": false,
"setupNode": true,
"nodeVersion": "0.10.36",
"enableUploadProgressBar": true,
"appName": "myAppName",
"app": "/Volumes/Macintosh HD/Users/myName/Google Drive/_projects/Coda/myAppName",
"env": {
"MONGO_URL": "//<login>:<password>#ds061464.mongolab.com:61111/myAppdb",
"ROOT_URL": "http://myApp.com"
},
"deployCheckWaitTime": 15
}
i can't handle with this issue almost 3 day! i tried deploy form server, change path, but it still didn't work and don't yet work...
and when i try to look in log, i got this:
Meteor Up: Production Quality Meteor Deployments
------------------------------------------------
[178.63.41.196] tail: cannot open ‘/var/log/upstart/lottato.log’ for reading: No such file or directory
tail: no files remaining
also u tried use mupx insted of mup, n now i got:
Invalid configuration file mup.json: There is no meteor app in the current app path.
new mup.json look like:
{
"servers": [
{
"host": "server IP",
"username": "root",
"password": "blablabla",
"env": {}
}
],
"setupMongo": false,
"appName": "appName",
"app": "~/Google Drive/_projects/Coda/appName",
"env": {
"PORT": 80,
"ROOT_URL": "http://appName.com",
"MONGO_URL": "mongodb://login:pass#ds035735.mongolab.com:35735/appName"
},
"deployCheckWaitTime": 15,
"enableUploadProgressBar": true
}
but i tried any type of path, with ~ or full path, n always the same, installation is starting only when in field path i writ:
"app": ".",
after increasing to 0.10.40 you should run 'mup setup' again followed by 'mup deploy'.
In my project I have mup.json in the project root (same level as .meteor) and
"app": "/Volumes/Macintosh HD/Users/myName/Google Drive/_projects/Coda/myAppName"
looks like
"app": ".",
Not sure if that is important.
i resolve this problem only with mupx + i moved project on server and deploy it from server to the same server.

grunt-contrib-connect | root path must be a string Use

While running Grunt task, getting following error.
Running "connect:client" (connect) task
Warning: root path must be a string Use --force to continue.
TypeError: root path must be a string
at Function.serveStatic (/Users/marif/Dev/JavaScript/JavaScript-Boilerplate/node_modules/grunt-contrib-connect/node_modules/connect/node_modules/serve-static/index.js:43:11)
at Object.livereloadMiddleware (/Users/marif/Dev/JavaScript/JavaScript-Boilerplate/GruntFile.js:25:23)
at Object.<anonymous> (/Users/marif/Dev/JavaScript/JavaScript-Boilerplate/node_modules/grunt-contrib-connect/tasks/connect.js:110:41)
at Object.<anonymous> (/Users/marif/Dev/JavaScript/JavaScript-Boilerplate/node_modules/grunt/lib/grunt/task.js:264:15)
at Object.thisTask.fn (/Users/marif/Dev/JavaScript/JavaScript-Boilerplate/node_modules/grunt/lib/grunt/task.js:82:16)
at Object.<anonymous> (/Users/marif/Dev/JavaScript/JavaScript-Boilerplate/node_modules/grunt/lib/util/task.js:301:30)
at Task.runTaskFn (/Users/marif/Dev/JavaScript/JavaScript-Boilerplate/node_modules/grunt/lib/util/task.js:251:24)
at Task.<anonymous> (/Users/marif/Dev/JavaScript/JavaScript-Boilerplate/node_modules/grunt/lib/util/task.js:300:12)
at /Users/marif/Dev/JavaScript/JavaScript-Boilerplate/node_modules/grunt/lib/util/task.js:227:11
at process._tickCallback (node.js:355:11)
Grunt task is as given below:
connect: {
client: {
options: {
// The server's port, and the folder to serve from:
// Ex: 'localhost:9000' would serve up 'client/index.html'
port: 9000,
// change this to '0.0.0.0' to access the server from outside
hostname: 'localhost',
base: '<%= jsb.app %>',
// Custom middleware for the HTTP server:
// The injected JavaScript reloads the page.
middleware: livereloadMiddleware
}
}
}
Have tried to uninstall and install the npm package but no luck so far.
Can someone please point, what exactly I am missing here?
It seems like my options.base in my middleware function was becoming an array because I have updated the npm package grunt-contrib-connect to latest which is 0.10.1.
Have to change the snippet rather:
connect.static(options.base),
// Make empty directories browsable.
connect.directory(options.base)
It must be an Array and it should start working:
connect.static(options.base[0]),
// Make empty directories browsable.
connect.directory(options.base[0])
Hope it also helps someone!

Resources