【发布时间】:2017-12-13 12:14:24
【问题描述】:
我刚刚按照本教程 https://www.phusionpassenger.com/library/walkthroughs/deploy/meteor/aws/apache/oss/xenial/deploy_app.html 在 Azure Ubuntu 服务器上部署了我的应用程序
本地主机:节点 v6.9.4,流星 1.6.0.1 服务器:v6.12.2,Meteor 1.6.0.1
我已经将完全相同的文件推送到 heroku 并且它可以工作。我按照相同的步骤将一个不同的项目推送到 Azure,它也可以工作。因此,Azure 不喜欢这个项目中的一些特殊之处:(
在我的本地服务器上一切正常,但在服务器上却不行。在 Apache /var/log/apache2/error.log 我收到以下错误: 会是什么?
[ 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.
这是shops.js文件的内容
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({});
});
}
【问题讨论】:
-
显示您的代码,例如进口/api/shops.js
-
用 shop.js 信息更新了问题
-
你能给我们提供你服务器上的 Meteor 版本和 nodejs 版本吗?
-
更新了本机和服务器上node和meteor版本的问题
-
尝试分离这个 const Shops = new Mongo.Collection('shops');然后导出默认店铺;
标签: reactjs azure meteor passenger