Приложение My Meteor работает нормально на локальном хосте, но когда я разворачиваю его на myApp.meteor.com
, я получаю ошибку ниже. Я стараюсь понять эти журналы ошибок. Есть идеи?Meteor Crash: MongoError: ns name too long, max size is 128
[Thu Jun 25 2015 06:35:23 GMT+0000 (UTC)]
WARNING /meteor/dev_bundles/0.4.18/lib/node_modules/fibers/future.js:278
throw(ex);
^
[Thu Jun 25 2015 06:35:23 GMT+0000 (UTC)]
WARNING MongoError: ns name too long, max size is 128
at Object.Future.wait
(/meteor/dev_bundles/0.4.18/lib/node_modules/fibers/future.js:398:15)
at [object Object].MongoConnection._ensureIndex
(packages/mongo/mongo_driver.js:733:1)
at FileCollection.Mongo.Collection._ensureIndex
(packages/mongo/collection.js:620:1)
at new FileCollection (packages/vsivsi:file-
collection/gridFS_server.coffee:65:15)
at FileCollection (packages/vsivsi:file-
collection/gridFS_server.coffee:21:24)
at app/lib/collections.js:15:12
at /meteor/containers/55bd5013-6244-5f59-9f74-
c6798eb58003/bundle/programs/server/boot.js:229:5
- - - - -
И код в моем collections.js
файле приводится ниже с линией 15 отмечено в комментарии. Он основан на коллекции файлов Meteor File Sample App 10. Обратите внимание, что MD5 на самом деле довольно длинный идентификатор, но я не уверен, как он/если он используется Mongo. Несмотря на это, он работает на localhost.
Meteor.startup(function() {
console.log('collections are loading');
myData = FileCollection('myFiles', { // This is line 15 that triggers error
resumable: true,
http: [
{
method: 'get',
// This GET routes path like /gridfs/myFiles/md5/9f4cd4e1d9e7cb1273ad2860fa909398.jpeg
path: '/md5/:md5',
// note that my :md5 also contains suffix with media type. Suffix was appended in link helper
// I added suffix so that other programs can determine MIME type from URL's suffix, without reading file header
lookup: function (params, query) {
// params.md5 contains more than the MD5 and hence needs to be split to get true MD5 portion
var tempArray = params.md5.split('.');
var firstHalf = tempArray[0]; // heres the MD5 part to ensure that Vaughn's code isn't affected
return {
md5: firstHalf // a query mapping url to myFiles
};
}
}
]
});
});
Спасибо за трассировку, что Lukasz. Я добавил код collections.js в OP с линией 15, отмеченной в // комментарии. – Thor