简体   繁体   English

安装失败了arangodb foxx应用程序

[英]mount is failing for arangodb foxx application

I have created a foxx-application for a app I am working on. 我为我正在开发的应用程序创建了一个foxx应用程序。 I was trying to install the foxx app in arangodb mainline. 我试图在arangodb主线上安装foxx应用程序。
I have followed the following steps: 我按照以下步骤操作:
1. create new database from arangosh 'db._createDatabase("databasename")' 1.从arangosh'db._createDatabase(“databasename”)创建新数据库
2. run command 'foxx-manager --server.database "" fetch directory ' 2.运行命令'foxx-manager --server.database“”获取目录“
3. then run command 'foxx-manager --server.database "" mount ' 3.然后运行命令'foxx-manager --server.database“”mount“

But, when I looked at the logs it is giving following error 但是,当我查看日志时,它会发出以下错误

2014-11-23T04:08:44Z [2584] ERROR Cannot compute Foxx application routes: [ArangoError 1924: graph not found] 2014-11-23T04:08:44Z [2584] ERROR无法计算Foxx应用程序路径:[ArangoError 1924:graph not found]
2014-11-23T04:08:44Z [2584] ERROR Cannot mount Foxx application 'app:contactspace:1.0': Error: Cannot compute the routing table for Foxx application 'app:contactspace:1.0', check the log file for errors!\\n at Object.exports.appRoutes (/usr/share/arangodb/js/server/modules/org/arangodb/foxx/manager.js:1525:15)\\n at Object.reloadRouting (/usr/share/arangodb/js/server/modules/org/arangodb/actions.js:1241:38)\\n at global context method:1:33\\n 2014-11-23T04:08:44Z [2584]错误无法挂载Foxx应用程序'app:contactspace:1.0':错误:无法计算Foxx应用程序'app:contactspace:1.0'的路由表,检查日志文件是否有错误! \\ n at.atloadRouting(/ usr / share / arangodb /)中的Object.exports.appRoutes(/usr/share/arangodb/js/server/modules/org/arangodb/foxx/manager.js:1525:15)。 js / server / modules / org / arangodb / actions.js:1241:38)\\ n在全局上下文方法:1:33 \\ n

I am not able understand the cause of this error. 我无法理解这个错误的原因。 The setup script is running fine after mount but the mount itself is giving error. 安装后脚本运行正常,但安装本身出错。

The foxx app is working fine in case of arangodb dev instance. 在arangodb dev实例的情况下,foxx应用程序正常工作。

Additional information from here : 来自此处的其他信息:

Yes I am creating a general graph with only one edge definition. 是的我正在创建一个只有一个边缘定义的通用图形。 below is the setup.js for that 下面是setup.js

// load modules
var graph_module = require("org/arangodb/general-graph");

// create graph if does not already exists
var graph = null;
if(!graph_module._exists("sampleGraph")) {
    var containsXRelation = graph_module._directedRelation("containsX", ["X"], ["X"]);
    var edgeDefinitions = graph_module._edgeDefinitions(containsXRelation);
    graph = graph_module._create("sampleGraph", edgeDefinitions);
}
else {
    graph = graph_module._graph("sampleGraph");
}

them some more stuff like creating index's... 他们更多的东西,如创建索引......

Also, I have some graph related code outside the controller actions: 另外,我在控制器操作之外有一些与图形相关的代码:

var sampleGraph = graph_module._graph("sampleGraph");
var vertex = contactSpaceGraph._getVertexCollectionByName("contactX");
var edge = contactSpaceGraph._getEdgeCollectionByName("X");

What you're doing is what I would have done as well, there are a few little errors in there that lead to the errors: 你正在做的是我本来会做的,那里有一些导致错误的小错误:

  • You wrote contactX instead of containsX in the controller 您在控制器中编写了contactX而不是containsX
  • You switched the name of the vertex collection and the edge collection in your controller (getVertexCollectionByName should receive X, getEdgeCollectionByName should receive containsX) 您在控制器中切换了顶点集合的名称和边集合(getVertexCollectionByName应该接收X,getEdgeCollectionByName应该接收containsX)

If you change those things, you are good to go :) Just tried it locally. 如果你改变了那些东西,你就可以去了:)只是在本地尝试过。

A small remark: In Foxx the idea is that every collection name is prefixed with some information about the mount point. 一个小小的评论:在Foxx中,我们的想法是每个集合名称都带有一些关于挂载点的信息。 The reason for that is that you should be able to install a Foxx app multiple times without them having a conflict – also multiple apps might have a collection 'x' and expect different things to be stored in there. 这样做的原因是你应该能够多次安装Foxx应用程序而不会发生冲突 - 多个应用程序也可能有一个集合'x'并期望在那里存储不同的东西。 This is why we have applicationContext.collectionName :) I would suggest to use this when you name your graph-related collections as well! 这就是为什么我们有applicationContext.collectionName :)我建议您在命名与图形相关的集合时使用它! If you want to see how it works, I converted your snippets into a simple example app. 如果您想了解它是如何工作的,我将您的代码段转换为一个简单的示例应用程序。 Here's the Gist for it: 这是它的要点:

https://gist.github.com/moonglum/21208befa3ce6227559d https://gist.github.com/moonglum/21208befa3ce6227559d

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM