创建新的FiwareService时,Orion CB中出现错误500

问题描述

我在MongoDB 4.0.5之上使用Fiware Orion CB版本2.1.0。一旦启动,一切似乎都可以正常工作,但是一段时间(几天)无问题地提取数据,现在,每次我尝试在新的fiwareservice中创建新实体时,OrionCB都会出现500错误(如果我尝试在现有的FS中创建相同的实体,则可以使用),而且我必须重新启动Mongo和Orion容器,才能使新的FS创建成功。

请求是:

curl --location --request POST 'context.infinitech.easier-ai.eu/v2/entities/' \
--header 'fiware-service: itscenterctag' \
--header 'fiware-servicepath: /vehicle' \
--header 'Authorization: Bearer XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX' \
--header 'Content-Type: application/json' \
--data-raw ' {
        "id": "TEST","type": "test","dateObserved": {
            "type": "DateTime","value": "2020-10-02T14:00:00.00Z","Metadata": {}
        },"test": {
            "type": "Number","value": 6.1,"Metadata": {
                "timestamp": {
                    "type": "DateTime","value": "2020-10-02T14:00:00.00Z"
                }
            }
        },"location": {
            "type": "geo:json","value": {
                "type": "Point","coordinates": [
                    -7.733611,42.079166
                ]
            },"name": {
            "type": "Text","value": "test","Metadata": {}
        }
    }'

猎户座回应:

{
    "error": "InternalError","description": "Database Error (collection: orion-itscenterctag.entities - insert(): { _id: { id: "TEST",type: "test",servicePath: "/vehicle" },attrNames: [ "dateObserved","test","location","name" ],attrs: { dateObserved: { type: "DateTime",creDate: 1603208149,modDate: 1603208149,value: 1601647200.0,mdNames: [] },test: { type: "Number",value: 6.1,md: { timestamp: { type: "DateTime",value: 1601647200.0 } },mdNames: [ "timestamp" ] },location: { type: "geo:json",value: { type: "Point",coordinates: [ -7.733611,42.079166 ] },name: { type: "Text",value: "test",mdNames: [] } },location: { attrName: "location",coords: { type: "Point",42.079166 ] } },lastCorrelator: "ec0dba3a-12e9-11eb-a65d-52e1fcc227da" } - exception: OperationException: { index: 0,code: 8,errmsg: "1: Operation not permitted",op: { _id: { id: "TEST",lastCorrelator: "ec0dba3a-12e9-11eb-a65d-52e1fcc227da" } })"
}

从MongoDB日志中,我得到:

2020-10-20T15:35:49.592+0000 E STORAGE  [conn1] WiredTiger error (1) [1603208149:592173][1:0x7ff40cab4700],WT_SESSION.create: __posix_open_file,715: /data/db/collection-18--6388608708582174430.wt: handle-open: open: Operation not permitted Raw: [1603208149:592173][1:0x7ff40cab4700],715: /data/db/collection-18--6388608708582174430.wt: handle-open: open: Operation not permitted
2020-10-20T15:35:49.592+0000 E -        [conn1] Assertion: UnkNownError: 1: Operation not permitted src/mongo/db/catalog/database_impl.cpp 831
2020-10-20T15:35:49.597+0000 I STORAGE  [conn1] createCollection: orion-itscenterctag.entities with generated UUID: a9c4273f-cddd-42bf-af6b-cbd96cbe034d
2020-10-20T15:35:49.598+0000 E STORAGE  [conn1] WiredTiger error (1) [1603208149:598543][1:0x7ff40cab4700],715: /data/db/collection-19--6388608708582174430.wt: handle-open: open: Operation not permitted Raw: [1603208149:598543][1:0x7ff40cab4700],715: /data/db/collection-19--6388608708582174430.wt: handle-open: open: Operation not permitted
2020-10-20T15:35:49.598+0000 E -        [conn1] Assertion: UnkNownError: 1: Operation not permitted src/mongo/db/catalog/database_impl.cpp 831
2020-10-20T15:35:49.598+0000 I STORAGE  [conn1] createCollection: orion-itscenterctag.entities with generated UUID: 49b14431-f217-48e7-93ed-d2f2f8e7a4fc
2020-10-20T15:35:49.600+0000 E STORAGE  [conn1] WiredTiger error (1) [1603208149:600253][1:0x7ff40cab4700],715: /data/db/collection-20--6388608708582174430.wt: handle-open: open: Operation not permitted Raw: [1603208149:600253][1:0x7ff40cab4700],715: /data/db/collection-20--6388608708582174430.wt: handle-open: open: Operation not permitted
2020-10-20T15:35:49.600+0000 E -        [conn1] Assertion: UnkNownError: 1: Operation not permitted src/mongo/db/catalog/database_impl.cpp 831
2020-10-20T15:35:49.600+0000 I STORAGE  [conn1] createCollection: orion-itscenterctag.entities with generated UUID: 600ec5a0-6841-4948-93c8-4fd062223479
2020-10-20T15:35:49.601+0000 E STORAGE  [conn1] WiredTiger error (1) [1603208149:601495][1:0x7ff40cab4700],715: /data/db/collection-21--6388608708582174430.wt: handle-open: open: Operation not permitted Raw: [1603208149:601495][1:0x7ff40cab4700],715: /data/db/collection-21--6388608708582174430.wt: handle-open: open: Operation not permitted
2020-10-20T15:35:49.601+0000 E -        [conn1] Assertion: UnkNownError: 1: Operation not permitted src/mongo/db/catalog/database_impl.cpp 831

更新:

仅在尝试创建新的FiwareService(通过在新的FS中创建新的实体)时发生。在已创建的FS中管理任何现有实体都可以正常工作。

更新二:(根据评论

> use orion-foo
switched to db orion-foo
> db.entities.insert({x:1})
WriteResult({
        "nInserted" : 0,"writeError" : {
                "code" : 8,"errmsg" : "1: Operation not permitted"
        }
})

解决方法

考虑到UPDATEII中的信息,看来问题出在MongoDB实例本身,而不是Orion。我的意思是,mongo shell的失败表明数据库本身不允许创建新数据库(无论是谁创建的,要么是Orion,要么是mongo shell上的您,要么是连接到MongoDB的第三个应用程序)。

因此,建议您检查一下数据库设置。令人惊讶的是,根据该报告,它在一开始就可以工作,但一段时间后开始失败。也许某些带外操作(即管理过程)正在更改移动权限?