First time deploying meteor app with meteor-up - meteor

This is the first time i am deploying from Meteor-up and I followed the docs to deploy a dummy application first. I am deploying on a shared linux server. Everything is going great but i can't find my app on ROOT_URL. My domain is pointing to the server and that very domain is also my ROOT_URL. when I hit the domain link it goes to the index of file explorer on the server instead of my web app. I tried to find logs but logs command and --verbose flag returned no log and the command simply run as usual.
Mup version (``1.5.3`):
Mup config
{ "servers": {
"one": {
"host": "1.2.3.4",
"username": "totalti1",
"password": "password",
"opts": {
"port": 2083
}
} }, "proxy": {
"servers": {
"one": {}
},
"domains": "host.com,subdomain.host.com",
"shared": {
"httpPort": 80,
"httpsPort": 443
} }, "app": {
"name": "my-app",
"path": "../.",
"deployCheckWaitTime": 300,
"servers": {
"one": {}
},
"buildOptions": {
"serverOnly": true
},
"env": {
"ROOT_URL": "https://host.com",
"MONGO_URL": "mongodb://mongodb:27017/my-app",
"MONGO_OPLOG_URL": "mongodb://localhost/local",
"VIRTUAL_HOST": "host.com,subdomain.host.com",
"HTTPS_METHOD": "noredirect",
"VIRTUAL_PORT": 3000,
"HTTP_FORWARDED_COUNT": 1
},
"docker": {
"image": "abernix/meteord:node-12-base",
"prepareBundle": false,
"stopAppDuringPrepareBundle": true,
"imagePort": 3000,
"args": [
"--link=mongodb:mongodb"
]
},
"enableUploadProgressBar": true,
"type": "meteor" }, "mongo": {
"version": "3.4.1",
"servers": {
"one": {}
},
"dbName": "DemoApp" } }
the port of my host is 2083 and I am not sure if that is causing a problem. I am not sure if the deployment was unsuccessful or the URL had a mistake. I was able to get some log after setting the debug Environmental variable. And here is it.
Output of command
$ DEBUG=mup* mup reconfig --verbose
mup:updates checking for updates +0ms
mup:updates Packages: [ { name: 'mup', path: '/usr/lib/node_modules/mup/package.json' } ] +2ms
mup:updates retrieving tags for mup +2ms
mup:api Running command default.reconfig +0ms
mup:module:default exec => mup reconfig +0ms
mup:api Running command meteor.envconfig +2ms
mup:module:meteor exec => mup meteor envconfig +0ms
Started TaskList: Configuring App [213.136.76.119] - Pushing the Startup Script
mup:updates finished update check for mup +1s
I am looking for some instant help as i am stuck on this deployment for three days now. Thanks in Advance
EDIT
Is there a way to know that the deployment was successful or not. Also is there something wrong with my ROOT_URL? Root url contains the IP of server on which i have hosted the app. The domain also points to the IP. When I access by IP it says
Sorry!
IP changed or server misconfig or site may have moved to different ip. Contact your hosting provider.
When i access via domain it shows the empty directory the default domain is set to.

Related

Swiftui and firebase emulators not working on physical device / simulator

I am working on a swiftui app and just started using the Emulator suite of firebase.
Everything is fine when i preview the app and write to a firestore collection or authenticate a user. The problem is that whenever i want to test it on a simulator or a actual physical device it does nothing. And i cannot find anything online regarding using emulator with a physical device in your local lan.
What could be stopping my physical device to make a connection with my Macbook where the emulators are running?
See my firebase.json config below:
NOTE: i have tryed to put "host": "192.168.x.x" or "0.0.0.0" <- my macbook ip adres
But with no result.
{
"firestore": {
"rules": "firestore.rules",
"indexes": "firestore.indexes.json"
},
"functions": {
"predeploy": [
"npm --prefix \"$RESOURCE_DIR\" run lint"
]
},
"storage": {
"rules": "storage.rules"
},
"emulators": {
"auth": {
"port": 9099
},
"functions": {
"port": 5001
},
"firestore": {
"port": 8080
},
"storage": {
"port": 9199
},
"ui": {
"enabled": true
}
}
}
code below FirebaseApp.configure()
Where Localhost is "192.168.x.x" my macbook IP
let settings = Firestore.firestore().settings
settings.host = "localhost:8080"
settings.isPersistenceEnabled = false
settings.isSSLEnabled = false
Firestore.firestore().settings = settings
In the info.plist i added App transport Security Settings:
Allows local networking = YES
What i see in debug.log (This might be unrelated)
Jul 04, 2021 10:20:53 AM io.gapi.emulators.netty.HttpVersionRoutingHandler channelRead
INFO: Detected non-HTTP/2 connection.
What could be a problem to stop my phone from connecting to my firebase emulators hosted on my macbook which is in the same local network as my phone.
When i use firebase cloud version everything works fine.
Could it be something in my firewall or on the macbook itself?
Which would explain that both physical and a simulator cannot write /read to firestore.
Hope some one can help me!
Would love to test functions and everything else locally first.
Greetings,
Dylan

What constitute/determines Zeit serverless functions count

I recently moved a Nextjs project to Zeit platform. Until I configured environment setup I could deploy with no issue. After the environment setup which is very minimal as
{
"version": 2,
"name": "<....>",
"alias": "<...>",
"routes": [
{
"src": "^/service-worker.js$",
"dest": "/_next/public/service-worker.js",
"headers": {
"cache-control": "public, max-age=43200, immutable",
"Service-Worker-Allowed": "/"
}
}
],
"builds": [{ "src": "package.json", "use": "#now/next" }],
"env": {
"SENTRY_DNS": "<...>",
"DEV_BASE_URL": "<...>",
"PROD_BASE_URL": "<...>",
"NODE_ENV": "<...>"
}
}
I get this error when I deploy
As seen in the stub configuration, I have no server API setup, so I am confused about what could cause the function count
I had this same issue just trying to deploy my app for the first time. I believe every /pages creates a serverless function. There's some info on it here: https://vercel.com/docs/v2/serverless-functions/introduction
I tried removing some of my pages to test the theory and was able to get ti deploying by cutting down to 12 pages.

"Unexpected error determining execution environment" when running Firebase emulator

Everything works correctly when I deploy my functions, but running the same code locally with the Firebase emulator gives me the following error:
{
"message": "Unexpected error determining execution environment: request to http://169.254.169.254/computeMetadata/v1/instance failed, reason: connect EHOSTDOWN 169.254.169.254:80 - Local (192.168.1.101:56456)",
"type": "system",
"errno": "EHOSTDOWN",
"code": "EHOSTDOWN",
"config": {
"url": "http://169.254.169.254/computeMetadata/v1/instance",
"headers": {
"Metadata-Flavor": "Google"
},
"retryConfig": {
"noResponseRetries": 0,
"currentRetryAttempt": 0,
"retry": 3,
"retryDelay": 100,
"httpMethodsToRetry": [
"GET",
"HEAD",
"PUT",
"OPTIONS",
"DELETE"
],
"statusCodesToRetry": [
[
100,
199
],
[
429,
429
],
[
500,
599
]
]
},
"responseType": "text",
"timeout": 3000,
"params": {},
"method": "GET"
}
}
What should I do to be able to test my code with the emulator?
If your cloud function requires admin rights, then you need to configure a service account for the cloud functions to run under.
Follow the instructions here:
https://firebase.google.com/docs/admin/setup
The mains steps are:
1) Create a Service Account and download the .json private key files (keep this secret)
In the console where you will run your emulator:
2) Set the GOOGLE_APPLICATION_CREDENTIALS environment variable to the absolute path of the private key file saved in step 1. For example export GOOGLE_APPLICATION_CREDENTIALS="/Users/..../...account.json"
3) Now run your emulator firebase emulators:start --only functions
Now the locally emulated function knows the environment. So when you do something like admin.initializeApp(functions.config().firebase); it gets configured properly.

Meteor Up Setup Error on DigitalOcean

I am 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, and am 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: 'http://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. On running mup setup, I get the following error:
Started TaskList: Setup Docker
[http://162.243.57.207] - setup docker
Error getaddrinfo ENOTFOUND http://162.243.57.207 http://162.243.57.207:22
Can anyone point me in the right direction?
The error—as described in your original post—is as follows:
Started TaskList: Setup Docker
[http://162.243.57.207] - setup docker
Error getaddrinfo ENOTFOUND http://162.243.57.207 http://162.243.57.207:22
The error basically means it can’t find the host http://162.243.57.207. So let’s look at the `servers part of your configuration:
servers: {
one: {
host: 'http://162.243.57.207',
username: 'cs673f16',
pem: '/Users/gautambhat/.ssh/id_rsa'
// password:
// or leave blank for authenticate from ssh-agent
}
},
Your host setting is a URL when it should be a hostname or IP address; meaning host: 'http://162.243.57.207' should just be 162.243.57.207. So change that and try again:
servers: {
one: {
host: '162.243.57.207',
username: 'cs673f16',
pem: '/Users/gautambhat/.ssh/id_rsa'
// password:
// or leave blank for authenticate from ssh-agent
}
},

Verifying Deployment: FAILED on deploying Telescope App

I'm trying to deploy the TelescopeApp to DigitalOcean, using mup. All seems to be going well until the 'Verifying Deployment: FAILED'. I am using the abernix/meteord:base dockerimage.
The error reads "Failed at the v8-profiler#5.6.5 install script 'node-pre-gyp install --fallback-to-build'. Make sure you have the latest version of node.js and npm installed. If you do, this is most likely a problem with the v8-profiler package, not with npm itself."
The entire error is here http://pastebin.com/4pDHy5KM
I tried to install Telescope on another DigitalOcean droplet, and deploy it from there, but got the same error when deploying to the Telescope droplet. Any ideas on how to fix this?
mup.js:
module.exports = {
servers: {
one: {
host: 'x.x.x.x',
username: 'root'
}
},
meteor: {
name: 'Telescope',
path: '.',
servers: {
one: {}
},
buildOptions: {
serverOnly: true,
},
env: {
ROOT_URL: 'http://x.x.x.x',
},
dockerImage: 'abernix/meteord:base',
deployCheckWaitTime: 60
},
mongo: {
oplog: true,
port: 27017,
servers: {
one: {},
},
},
};
On the slack channel of the TelescopeApp I was told to disable nova:kadira
and to run mup with the --settings flag to be sure. This solved the deployment problem.

Resources