Deployment of MeteorJS and React app on Azure

2019-08-17 12:26发布

I've just deployed my app on Azure Ubuntu server following this tutorial https://www.phusionpassenger.com/library/walkthroughs/deploy/meteor/aws/apache/oss/xenial/deploy_app.html

Localhost: node v6.9.4, Meteor 1.6.0.1 Server: v6.12.2, Meteor 1.6.0.1

I've pushed absolutely the same files to heroku and it works. I've pushed a different project to Azure following the same steps and it also works. Therefore, there is something particular in this project that Azure does not like :(

On my local server everything works fine, but on the server it does not work. In Apache /var/log/apache2/error.log I get the following error: What could it be?

[ E 2017-12-13 11:48:02.9289 10769/Tb age/Cor/Con/CheckoutSession.cpp:285 ]: [Client 3-1] Cannot checkout session because a spawning error occurred. The identifier of the error is 0305fa70. Please see earlier logs for details about the error.
[ E 2017-12-13 11:48:02.9289 10769/Td age/Cor/Con/CheckoutSession.cpp:285 ]: [Client 4-1] Cannot checkout session because a spawning error occurred. The identifier of the error is 0305fa70. Please see earlier logs for details about the error.
App 27630 stdout: 
App 27630 stderr: Note: you are using a pure-JavaScript implementation of bcrypt.
App 27630 stderr: While this implementation will work correctly, it is known to be
App 27630 stderr: approximately three times slower than the native implementation.
App 27630 stderr: In order to use the native implementation instead, run
App 27630 stderr: 
App 27630 stderr:   meteor npm install --save bcrypt
App 27630 stderr: 
App 27630 stderr: in the root directory of your application.
App 27630 stdout: Shops collection was empty, adding shops from scratch...
App 27630 stderr: /var/www/onecherry/bundle/programs/server/node_modules/fibers/future.js:280
App 27630 stderr:                       throw(ex);
App 27630 stderr:                       ^
App 27630 stderr: 
App 27630 stderr: TypeError: Object.getOwnPropertyDescriptors is not a function
App 27630 stderr:     at insert (packages/mongo/collection.js:435:12)
App 27630 stderr:     at shops.js (imports/api/shops.js:10:11)
App 27630 stderr:     at fileEvaluate (packages/modules-runtime.js:343:9)
App 27630 stderr:     at require (packages/modules-runtime.js:238:16)
App 27630 stderr:     at main.js (server/main.js:1:208)
App 27630 stderr:     at fileEvaluate (packages/modules-runtime.js:343:9)
App 27630 stderr:     at require (packages/modules-runtime.js:238:16)
App 27630 stderr:     at /var/www/onecherry/bundle/programs/server/app/app.js:684:1
App 27630 stderr:     at infos.forEach.info (/var/www/onecherry/bundle/programs/server/boot.js:414:13)
App 27630 stderr:     at Array.forEach (native)
[ E 2017-12-13 11:49:15.3011 10769/Tr age/Cor/App/Implementation.cpp:304 ]: Could not spawn process for application /var/www/onecherry/bundle: An error occurred while starting the web application. It exited before signalling successful startup back to Phusion Passenger.
  Error ID: cc5e5c15
  Error details saved to: /tmp/passenger-error-DVtWtb.html
  Message from application: An error occurred while starting the web application. It exited before signalling successful startup back to Phusion Passenger. Please read <a href="https://github.com/phusion/passenger/wiki/Debugging-application-startup-problems">this article</a> for more information about this problem.<br>
<h2>Raw process output:</h2>
<pre>
Note: you are using a pure-JavaScript implementation of bcrypt.
While this implementation will work correctly, it is known to be
approximately three times slower than the native implementation.
In order to use the native implementation instead, run

  meteor npm install --save bcrypt

in the root directory of your application.
Shops collection was empty, adding shops from scratch...
/var/www/onecherry/bundle/programs/server/node_modules/fibers/future.js:280
                        throw(ex);
                        ^

TypeError: Object.getOwnPropertyDescriptors is not a function
    at insert (packages/mongo/collection.js:435:12)
    at shops.js (imports/api/shops.js:10:11)
    at fileEvaluate (packages/modules-runtime.js:343:9)
    at require (packages/modules-runtime.js:238:16)
    at main.js (server/main.js:1:208)
    at fileEvaluate (packages/modules-runtime.js:343:9)
    at require (packages/modules-runtime.js:238:16)
    at /var/www/onecherry/bundle/programs/server/app/app.js:684:1
    at infos.forEach.info (/var/www/onecherry/bundle/programs/server/boot.js:414:13)
    at Array.forEach (native)
</pre>

[ E 2017-12-13 11:49:15.3052 10769/T7 age/Cor/Con/CheckoutSession.cpp:285 ]: [Client 1-2] Cannot checkout session because a spawning error occurred. The identifier of the error is cc5e5c15. Please see earlier logs for details about the error.
App 27654 stdout: 
App 27654 stderr: Note: you are using a pure-JavaScript implementation of bcrypt.
App 27654 stderr: While this implementation will work correctly, it is known to be
App 27654 stderr: approximately three times slower than the native implementation.
App 27654 stderr: In order to use the native implementation instead, run
App 27654 stderr: 
App 27654 stderr:   meteor npm install --save bcrypt
App 27654 stderr: 
App 27654 stderr: in the root directory of your application.
App 27654 stdout: Shops collection was empty, adding shops from scratch...
App 27654 stderr: /var/www/onecherry/bundle/programs/server/node_modules/fibers/future.js:280
App 27654 stderr:                       throw(ex);
App 27654 stderr:                       ^
App 27654 stderr: 
App 27654 stderr: TypeError: Object.getOwnPropertyDescriptors is not a function
App 27654 stderr:     at insert (packages/mongo/collection.js:435:12)
App 27654 stderr:     at shops.js (imports/api/shops.js:10:11)
App 27654 stderr:     at fileEvaluate (packages/modules-runtime.js:343:9)
App 27654 stderr:     at require (packages/modules-runtime.js:238:16)
App 27654 stderr:     at main.js (server/main.js:1:208)
App 27654 stderr:     at fileEvaluate (packages/modules-runtime.js:343:9)
App 27654 stderr:     at require (packages/modules-runtime.js:238:16)
App 27654 stderr:     at /var/www/onecherry/bundle/programs/server/app/app.js:684:1
App 27654 stderr:     at infos.forEach.info (/var/www/onecherry/bundle/programs/server/boot.js:414:13)
App 27654 stderr:     at Array.forEach (native)
[ E 2017-12-13 11:49:17.4650 10769/Tu age/Cor/App/Implementation.cpp:304 ]: Could not spawn process for application /var/www/onecherry/bundle: An error occurred while starting the web application. It exited before signalling successful startup back to Phusion Passenger.
  Error ID: be5123f1
  Error details saved to: /tmp/passenger-error-BBAMEZ.html
  Message from application: An error occurred while starting the web application. It exited before signalling successful startup back to Phusion Passenger. Please read <a href="https://github.com/phusion/passenger/wiki/Debugging-application-startup-problems">this article</a> for more information about this problem.<br>
<h2>Raw process output:</h2>
<pre>
Note: you are using a pure-JavaScript implementation of bcrypt.
While this implementation will work correctly, it is known to be
approximately three times slower than the native implementation.
In order to use the native implementation instead, run

  meteor npm install --save bcrypt

in the root directory of your application.
Shops collection was empty, adding shops from scratch...
/var/www/onecherry/bundle/programs/server/node_modules/fibers/future.js:280
                        throw(ex);
                        ^

TypeError: Object.getOwnPropertyDescriptors is not a function
    at insert (packages/mongo/collection.js:435:12)
    at shops.js (imports/api/shops.js:10:11)
    at fileEvaluate (packages/modules-runtime.js:343:9)
    at require (packages/modules-runtime.js:238:16)
    at main.js (server/main.js:1:208)
    at fileEvaluate (packages/modules-runtime.js:343:9)
    at require (packages/modules-runtime.js:238:16)
    at /var/www/onecherry/bundle/programs/server/app/app.js:684:1
    at infos.forEach.info (/var/www/onecherry/bundle/programs/server/boot.js:414:13)
    at Array.forEach (native)
</pre>

[ E 2017-12-13 11:49:17.4693 10769/T9 age/Cor/Con/CheckoutSession.cpp:285 ]: [Client 2-2] Cannot checkout session because a spawning error occurred. The identifier of the error is be5123f1. Please see earlier logs for details about the error.

This is the content of shops.js file

import {Meteor} from 'meteor/meteor';
import {Mongo} from 'meteor/mongo';
import SimpleSchema from 'simpl-schema';

export const Shops = new Mongo.Collection('shops');

if (Meteor.isServer) {
  if (Shops.find().fetch().length == 0) {
    console.log('Shops collection was empty, adding shops from scratch...');
    Shops.insert({
      organisation: 'Shelter Scotland',
      address: "134 Nicolson St, Edinburgh EH8 9EH",
      openingHours: {
        'Mon': '10.00am - 5.45pm',
        'Tue': '10.00am - 5.45pm',
        'Wed': '10.00am - 5.45pm',
        'Thu': '10.00am - 5.45pm',
        'Fri': '10.00am - 5.45pm',
        'Sat': '10.00am - 5.45pm',
        'Sun': '11.00am - 4.00pm'
      },
      secretCode: 6543652765
    })
  } else {
    console.log('shops collection is not empty');
  }

  Meteor.publish('shopsPublication', function() { 
    return Shops.find({});
  });

}

1条回答
2楼-- · 2019-08-17 12:58

I've updated all dependencies on the server and my app. Now it all works! Especially npm and node packages.

查看更多
登录 后发表回答