0
votes

I am currently trying to deploy a Meteor project to an external server for the first time. The server is hosted by DigitalOcean, running ubuntu 16.04, and has an SSH key set up for password-free access.

The error I am getting from MUP is:

[159.203.165.13] - Setup Docker
events.js:165
  throw er; // Unhandled 'error' event
  ^

Error: All configured authentication methods failed
at tryNextAuth (/usr/lib/node_modules/mup/node_modules/nodemiral/node_modules/ssh2/lib/client.js:290:17)
at SSH2Stream.onUSERAUTH_FAILURE (/usr/lib/node_modules/mup/node_modules/nodemiral/node_modules/ssh2/lib/client.js:469:5)
at SSH2Stream.emit (events.js:180:13)
at parsePacket (/usr/lib/node_modules/mup/node_modules/ssh2-streams/lib/ssh.js:3647:10)
at SSH2Stream._transform (/usr/lib/node_modules/mup/node_modules/ssh2-streams/lib/ssh.js:551:13)
at SSH2Stream.Transform._read (_stream_transform.js:185:10)
at SSH2Stream._read (/usr/lib/node_modules/mup/node_modules/ssh2-streams/lib/ssh.js:212:15)
at SSH2Stream.Transform._write (_stream_transform.js:173:12)
at doWrite (_stream_writable.js:410:12)
at writeOrBuffer (_stream_writable.js:396:5)
at SSH2Stream.Writable.write (_stream_writable.js:294:11)
at Socket.ondata (_stream_readable.js:651:20)
at Socket.emit (events.js:180:13)
at addChunk (_stream_readable.js:274:12)
at readableAddChunk (_stream_readable.js:261:11)
at Socket.Readable.push (_stream_readable.js:218:10)

Emitted 'error' event at:
at tryNextAuth (/usr/lib/node_modules/mup/node_modules/nodemiral/node_modules/ssh2/lib/client.js:292:12)
at SSH2Stream.onUSERAUTH_FAILURE (/usr/lib/node_modules/mup/node_modules/nodemiral/node_modules/ssh2/lib/client.js:469:5)
[... lines matching original stack trace ...]
at Socket.Readable.push (_stream_readable.js:218:10)

At this point I have tried several solutions involving the mup file as per other recommendations such as:

1) Adding in a password - Gives the exact same error as though the change didn't occur.

2) Adding in the same SSH key that I use for authentication to the server as per digital ocean - Says 'privateKey value does not contain a (valid) private key'. I have tried both the key that is used for authentication to the server and every other key I could find short of generating a new one just for Meteor's use.

3) Leaving both blank and allowing it to 'try' ssh-agent - pretends it doesn't know what ssh-agent is and throws an error saying the same thing as when I use a password.

I have looked through and followed the same instructions in the following article: http://meteortips.com/deployment-tutorial/digitalocean-part-1/

This article assumes that there are only two possible states. One being that an ssh key has NOT been used or set up so it needs to be generated. The second being that an ssh key exists and is set up exactly where they expect it. Unfortunately I seem to be in a different situation. I generated a key using putty prior to setting up the D.O server and created the droplet using that. After creation, the file did not exist. The only thing in the ~/.ssh/ directory was a single file named "authorized_keys" that held the key I would use to connect to the server. This file cannot be used, nor any file on the server in the other ssh key locations.I also tried copying over the file directly onto the server to no avail as well.

In some vain hope at finding a solution I also tried running these same commands in both the Meteor build bundle an the source code folder. Neither worked. I should mention that although this is the only article I still have open to try for a solution, I have tried every one I could find using MUP.

If anyone can point me in the right direction with this so I can stop flailing wildly in the dark I would be incredibly grateful.

Edit: As requested, below is the current mup.js file with removed credentials

module.exports = {
  servers: {
one: {
  // TODO: set host address, username, and authentication method
  host: '111.111.111.11',
  username: 'root',
  // ssh-agent: '/home/Meteor/MeteorKey.pem'
  pem: '~/.ssh/id_rsa.pub'
  //  password: 'password1'
  // or neither for authenticate from ssh-agent
 }
},

app: {
// TODO: change app name and path
name: 'app-name',
path: '../',

servers: {
  one: {},
},

buildOptions: {
  serverOnly: true,
},

env: {
  // TODO: Change to your app's url
  // If you are using ssl, it needs to start with https://
  ROOT_URL: 'http://www.app-name.com',
  MONGO_URL: 'mongodb://mongodb/meteor',
  MONGO_OPLOG_URL: 'mongodb://mongodb/local',
},

docker: {
  // change to 'abernix/meteord:base' if your app is using Meteor 1.4 - 1.5
  image: 'abernix/meteord:node-8.4.0-base',
},

// Show progress bar while uploading bundle to server
// You might need to disable it on CI servers
enableUploadProgressBar: true
},

mongo: {
 version: '3.4.1',
 servers: {
   one: {}
 }
},

// (Optional)
// Use the proxy to setup ssl or to route requests to the correct
// app when there are several apps

// proxy: {
//   domains: 'mywebsite.com,www.mywebsite.com',
1
can you share mup.js file (remove the credentials)?Ankit
I have now added the mup.js code with the names/ips changedKM529
That tutorial is pretty old, although the server auth config did not change. The first thing that I noticed is that you are specifying id_rsa.pub, and it's not the private key file (it normally contains the public key). The corresponding private key file has the same name name, without the extension (i.e, id_rsa). It is likely that your ssh-agent is not configured properly. Try to only leave the server address and the username, and follow the instructions in the official docs. Test with mup ssh oneMasterAM

1 Answers

0
votes

The error message you are receiving:

Error: All configured authentication methods failed

Means that the SSH connection is failing. So the credentials you are using (pity you removed them from the config) are not working. Try using a command line ssh using these same credentials, and then trouble shoot that - once you can ssh into the server, then mup should be able to do it's work.

You can get more information out of ssh by specifying one or more -v parameters, eg:

ssh -v -v [email protected]

and it will give you information about the authentication methods it is trying as it goes through them. This will help you narrow down the problem.