Meteor 1.8.1 Deployment on Elastic Beanstalk

#1

Hi Everyone,

I am using Meteor 1.8.1 and want to deploy my app on Elastic Beanstalk, I have done it earlier so I know the process but this time there is no error in the dashboard of the Elastic Beanstalk, My app deployed successfully but when trying to open the URL it returns nothing.

Also, While checking the logs there was some 302 redirection which I find causing the issue.

Attaching the logs I received from AWS,

/var/log/nodejs/nodejs.log
-------------------------------------
    at /var/app/current/programs/server/boot.js:419:36
    at Array.forEach (<anonymous>)
    at /var/app/current/programs/server/boot.js:228:19
    at /var/app/current/programs/server/boot.js:479:5
    at Function.run (/var/app/current/programs/server/profile.js:510:12)
    at /var/app/current/programs/server/boot.js:478:11
The version of @babel/runtime installed in your node_modules directory 
(7.0.0-beta.47) is out of date. Please upgrade it by running 

  meteor npm install --save @babel/runtime@latest

in your application directory.

/var/app/current/programs/server/node_modules/fibers/fibers.js:90
					return fn.apply(this, arguments);
					          ^

Error: Must pass options.rootUrl or set ROOT_URL in the server environment
    at Object.Meteor.absoluteUrl (packages/meteor.js:1378:11)
    at runWebAppServer (packages/webapp/webapp_server.js:771:18)
    at webapp_server.js (packages/webapp/webapp_server.js:1175:1)
    at fileEvaluate (packages/modules-runtime.js:336:7)
    at Module.require (packages/modules-runtime.js:238:14)
    at require (packages/modules-runtime.js:258:21)
    at /var/app/current/programs/server/packages/webapp.js:1588:15
    at /var/app/current/programs/server/packages/webapp.js:1597:3
    at /var/app/current/programs/server/boot.js:419:36
    at Array.forEach (<anonymous>)
    at /var/app/current/programs/server/boot.js:228:19
    at /var/app/current/programs/server/boot.js:479:5
    at Function.run (/var/app/current/programs/server/profile.js:510:12)
    at /var/app/current/programs/server/boot.js:478:11
The version of @babel/runtime installed in your node_modules directory 
(7.0.0-beta.47) is out of date. Please upgrade it by running 

  meteor npm install --save @babel/runtime@latest

in your application directory.

/var/app/current/programs/server/node_modules/fibers/fibers.js:90
					return fn.apply(this, arguments);
					          ^

Error: Must pass options.rootUrl or set ROOT_URL in the server environment
    at Object.Meteor.absoluteUrl (packages/meteor.js:1378:11)
    at runWebAppServer (packages/webapp/webapp_server.js:771:18)
    at webapp_server.js (packages/webapp/webapp_server.js:1175:1)
    at fileEvaluate (packages/modules-runtime.js:336:7)
    at Module.require (packages/modules-runtime.js:238:14)
    at require (packages/modules-runtime.js:258:21)
    at /var/app/current/programs/server/packages/webapp.js:1588:15
    at /var/app/current/programs/server/packages/webapp.js:1597:3
    at /var/app/current/programs/server/boot.js:419:36
    at Array.forEach (<anonymous>)
    at /var/app/current/programs/server/boot.js:228:19
    at /var/app/current/programs/server/boot.js:479:5
    at Function.run (/var/app/current/programs/server/profile.js:510:12)
    at /var/app/current/programs/server/boot.js:478:11
The version of @babel/runtime installed in your node_modules directory 
(7.0.0-beta.47) is out of date. Please upgrade it by running 

  meteor npm install --save @babel/runtime@latest

in your application directory.

The version of @babel/runtime installed in your node_modules directory 
(7.0.0-beta.47) is out of date. Please upgrade it by running 

  meteor npm install --save @babel/runtime@latest

in your application directory.

The version of @babel/runtime installed in your node_modules directory 
(7.0.0-beta.47) is out of date. Please upgrade it by running 

  meteor npm install --save @babel/runtime@latest

in your application directory.

The version of @babel/runtime installed in your node_modules directory 
(7.0.0-beta.47) is out of date. Please upgrade it by running 

  meteor npm install --save @babel/runtime@latest

in your application directory.

The version of @babel/runtime installed in your node_modules directory 
(7.0.0-beta.47) is out of date. Please upgrade it by running 

  meteor npm install --save @babel/runtime@latest

in your application directory.

The version of @babel/runtime installed in your node_modules directory 
(7.0.0-beta.47) is out of date. Please upgrade it by running 

  meteor npm install --save @babel/runtime@latest

in your application directory.




-------------------------------------
/var/log/nginx/error.log
-------------------------------------
2019/04/21 04:35:56 [error] 4797#0: *1 connect() failed (111: Connection refused) while connecting to upstream, client: 103.211.17.229, server: , request: "GET / HTTP/1.1", upstream: "http://127.0.0.1:8081/", host: "interviewcracker-env.psspya3ca8.ap-south-1.elasticbeanstalk.com"
2019/04/21 04:35:56 [error] 4797#0: *1 connect() failed (111: Connection refused) while connecting to upstream, client: 103.211.17.229, server: , request: "GET /favicon.ico HTTP/1.1", upstream: "http://127.0.0.1:8081/favicon.ico", host: "interviewcracker-env.psspya3ca8.ap-south-1.elasticbeanstalk.com", referrer: "http://interviewcracker-env.psspya3ca8.ap-south-1.elasticbeanstalk.com/"
2019/04/21 04:37:16 [error] 4797#0: *12 connect() failed (111: Connection refused) while connecting to upstream, client: 103.211.17.229, server: , request: "GET / HTTP/1.1", upstream: "http://127.0.0.1:8081/", host: "interviewcracker-env.psspya3ca8.ap-south-1.elasticbeanstalk.com"
2019/04/21 04:37:16 [error] 4797#0: *12 connect() failed (111: Connection refused) while connecting to upstream, client: 103.211.17.229, server: , request: "GET /favicon.ico HTTP/1.1", upstream: "http://127.0.0.1:8081/favicon.ico", host: "interviewcracker-env.psspya3ca8.ap-south-1.elasticbeanstalk.com", referrer: "http://interviewcracker-env.psspya3ca8.ap-south-1.elasticbeanstalk.com/"




-------------------------------------
/var/log/nginx/access.log
-------------------------------------
103.211.17.229 - - [21/Apr/2019:04:35:00 +0000] "GET / HTTP/1.1" 502 575 "-" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/71.0.3578.80 Safari/537.36" "-"
103.211.17.229 - - [21/Apr/2019:04:35:00 +0000] "GET /favicon.ico HTTP/1.1" 502 575 "http://interviewcracker-env.psspya3ca8.ap-south-1.elasticbeanstalk.com/" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/71.0.3578.80 Safari/537.36" "-"
103.211.17.229 - - [21/Apr/2019:04:35:02 +0000] "GET / HTTP/1.1" 502 575 "-" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/71.0.3578.80 Safari/537.36" "-"
103.211.17.229 - - [21/Apr/2019:04:35:02 +0000] "GET /favicon.ico HTTP/1.1" 502 575 "http://interviewcracker-env.psspya3ca8.ap-south-1.elasticbeanstalk.com/" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/71.0.3578.80 Safari/537.36" "-"
103.211.17.229 - - [21/Apr/2019:04:35:14 +0000] "GET / HTTP/1.1" 502 575 "-" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/71.0.3578.80 Safari/537.36" "-"
103.211.17.229 - - [21/Apr/2019:04:35:14 +0000] "GET /favicon.ico HTTP/1.1" 502 575 "http://interviewcracker-env.psspya3ca8.ap-south-1.elasticbeanstalk.com/" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/71.0.3578.80 Safari/537.36" "-"
103.211.17.229 - - [21/Apr/2019:04:35:16 +0000] "GET / HTTP/1.1" 502 575 "-" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/71.0.3578.80 Safari/537.36" "-"
103.211.17.229 - - [21/Apr/2019:04:35:16 +0000] "GET /favicon.ico HTTP/1.1" 502 575 "http://interviewcracker-env.psspya3ca8.ap-south-1.elasticbeanstalk.com/" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/71.0.3578.80 Safari/537.36" "-"
103.211.17.229 - - [21/Apr/2019:04:35:56 +0000] "GET / HTTP/1.1" 502 575 "-" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/71.0.3578.80 Safari/537.36" "-"
103.211.17.229 - - [21/Apr/2019:04:35:56 +0000] "GET /favicon.ico HTTP/1.1" 502 575 "http://interviewcracker-env.psspya3ca8.ap-south-1.elasticbeanstalk.com/" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/71.0.3578.80 Safari/537.36" "-"
103.211.17.229 - - [21/Apr/2019:04:37:16 +0000] "GET / HTTP/1.1" 502 575 "-" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/71.0.3578.80 Safari/537.36" "-"
103.211.17.229 - - [21/Apr/2019:04:37:16 +0000] "GET /favicon.ico HTTP/1.1" 502 575 "http://interviewcracker-env.psspya3ca8.ap-south-1.elasticbeanstalk.com/" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/71.0.3578.80 Safari/537.36" "-"
103.211.17.229 - - [21/Apr/2019:04:38:30 +0000] "GET / HTTP/1.1" 302 5 "-" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/71.0.3578.80 Safari/537.36" "-"
103.211.17.229 - - [21/Apr/2019:04:40:07 +0000] "GET / HTTP/1.1" 302 5 "-" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/71.0.3578.80 Safari/537.36" "-"
103.211.17.229 - - [21/Apr/2019:04:42:36 +0000] "GET / HTTP/1.1" 302 5 "-" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/71.0.3578.80 Safari/537.36" "-"
103.211.17.229 - - [21/Apr/2019:04:44:58 +0000] "GET / HTTP/1.1" 302 5 "-" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/71.0.3578.80 Safari/537.36" "-"
103.211.17.229 - - [21/Apr/2019:04:45:08 +0000] "GET / HTTP/1.1" 302 5 "-" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/71.0.3578.80 Safari/537.36" "-"
103.211.17.229 - - [21/Apr/2019:04:45:11 +0000] "GET / HTTP/1.1" 302 5 "-" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/71.0.3578.80 Safari/537.36" "-"
103.211.17.229 - - [21/Apr/2019:04:49:44 +0000] "GET / HTTP/1.1" 302 5 "-" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/71.0.3578.80 Safari/537.36" "-"
103.211.17.229 - - [21/Apr/2019:04:59:24 +0000] "GET / HTTP/1.1" 302 5 "-" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/71.0.3578.80 Safari/537.36" "-"
103.211.17.229 - - [21/Apr/2019:05:05:56 +0000] "GET / HTTP/1.1" 302 5 "-" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/71.0.3578.80 Safari/537.36" "-"
103.211.17.229 - - [21/Apr/2019:05:09:43 +0000] "GET / HTTP/1.1" 302 5 "-" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/71.0.3578.80 Safari/537.36" "-"
64.233.173.155 - - [21/Apr/2019:05:10:01 +0000] "GET / HTTP/1.1" 302 5 "-" "Mozilla/5.0 (Linux; Android 8.1.0; Moto G (5) Plus) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/73.0.3683.90 Mobile Safari/537.36" "103.211.17.218"
103.211.17.229 - - [21/Apr/2019:05:14:06 +0000] "GET / HTTP/1.1" 302 5 "-" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/71.0.3578.80 Safari/537.36" "-"
103.211.17.229 - - [21/Apr/2019:05:14:18 +0000] "GET / HTTP/1.1" 302 5 "-" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/71.0.3578.80 Safari/537.36" "-"
103.211.17.229 - - [21/Apr/2019:05:24:44 +0000] "GET / HTTP/1.1" 302 5 "-" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/71.0.3578.80 Safari/537.36" "-"

Initially, the was some error regarding ROOT_URL but later they are fixed. There is no as such error in the Logs. Please help.

Your help will be appreciated.

#2

Have you tried fixing the babel error?

#3

I tried but its not getting solved. Do you know any solution for this?

#4

You can manually edit package.json and edit the version for babel

I’m currently using this for our 1.8.1 projects: "@babel/runtime": "^7.4.3",

#5

Let me try! wait just 5 minutes

#6

The error is still there @rjdavid

#7

Same error output in the logs?

#8

Yes @rjdavid its same

#9

You need to execute meteor npm install if you are still seeing exactly the same error message.

#10

But this should be independent of Meteor as its a nodejs project. Isn’t it?

#11

Technically, it is just npm install

meteor npm install ensures that you are using the compatible node version

I’m not sure how you deploy, but running meteor npm install updates your package-lock.json which you can later use during deployment by executing meteor npm ci

#12

Ok, Let me try this @rjdavid

#13

The error is still there!

#14

Is this issue occurs in previous versions too or its just for Meteor 1.8.1?

#15

Where are you solving the error? The error must be fixed before you deploy.

Are you familiar how package.json works?

#16

In the programs/server directory? is it right?

#17

Fix it first in your development build. And then repeat your deployment.

How do you deploy, anyway?

#18

Deployment Build means I need to make build again after solving the error. Ok doing that!

#19

Actually, I am trying two ways to deploy first is this and another one is docker!

In that also, I am getting error /bin/sh: cd: line 1: can’t cd to programs/server/
thats way I need some method to work for me

#20

How do you deploy @rjdavid?