Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[backend] Works tracking fail to complete at "update processed time" #5762

Closed
richard-julien opened this issue Jan 31, 2024 · 2 comments · Fixed by #5763
Closed

[backend] Works tracking fail to complete at "update processed time" #5762

richard-julien opened this issue Jan 31, 2024 · 2 comments · Fixed by #5763
Assignees
Labels
bug use for describing something not working as expected solved use to identify issue that has been solved (must be linked to the solving PR)

Comments

@richard-julien
Copy link
Member

richard-julien commented Jan 31, 2024

Description

Auto complete works at processed time update fail because of type enforcing in the search engine

illegal_argument_exception: Integer value passed as String

Data in redis are stored in string so we need to convert this figures to int before using it.

Code can be refactored to only use one function (currently one is ok and the other not)

@MaxwellDPS
Copy link

Still seeing this on 5.12.33 FYSA

{
    "category": "APP",
    "error": {
        "_error": {},
        "_showLocations": false,
        "_showPath": false,
        "data": {
            "_error": {},
            "_showLocations": false,
            "_showPath": false,
            "data": {
                "body": {
                    "script": {
                        "lang": "painless",
                        "params": {
                            "completed_number": "159333",
                            "completed_time": "2024-03-15T20:11:18.222Z"
                        },
                        "source": "ctx._source['status'] = \"complete\";\n                  ctx._source['completed_time'] = params.completed_time;\n                  ctx._source['completed_number'] = params.completed_number;"
                    }
                },
                "cause": {
                    "meta": {
                        "body": {
                            "error": {
                                "caused_by": {
                                    "reason": "Integer value passed as String",
                                    "type": "illegal_argument_exception"
                                },
                                "reason": "[1:631] failed to parse field [completed_number] of type [integer] in document with id 'work_<REMOVED>_2024-03-13T20:46:35.244Z'. Preview of field's value: '159333'",
                                "root_cause": {
                                    "0": {
                                        "reason": "[1:631] failed to parse field [completed_number] of type [integer] in document with id 'work_<REMOVED>_2024-03-13T20:46:35.244Z'. Preview of field's value: '159333'",
                                        "type": "document_parsing_exception"
                                    }
                                },
                                "type": "document_parsing_exception"
                            },
                            "status": 400
                        },
                        "headers": {
                            "content-length": "611",
                            "content-type": "application/vnd.elasticsearch+json;compatible-with=8",
                            "x-elastic-product": "Elasticsearch"
                        },
                        "meta": {
                            "aborted": false,
                            "attempts": 0,
                            "connection": {
                                "_openRequests": 0,
                                "deadCount": 0,
                                "headers": {
                                    "authorization": "[redacted]"
                                },
                                "id": "<REMOVED>",
                                "pool": {
                                    "_events": {},
                                    "_eventsCount": 0
                                },
                                "resurrectTimeout": 0,
                                "timeout": 30000,
                                "tls": {},
                                "url": "<REMOVED>",
                                "weight": 1000
                            },
                            "context": null,
                            "name": "elasticsearch-js",
                            "request": {
                                "id": 83283,
                                "options": {},
                                "params": {
                                    "body": "{\"script\":{\"source\":\"ctx._source['status'] = \\\"complete\\\";\\n                  ctx._source['completed_time'] = params.completed_time;\\n                  ctx._source['completed_number'] = params.completed_number;\",\"lang\":\"painless\",\"params\":{\"completed_time\":\"2024-03-15T20:11:18.222Z\",\"completed_number\":\"159333\"}}}",
                                    "headers": {
                                        "accept": "application/vnd.elasticsearch+json; compatible-with=8",
                                        "content-length": "314",
                                        "content-type": "application/vnd.elasticsearch+json; compatible-with=8",
                                        "user-agent": "elasticsearch-js/8.11.0 (linux 5.14.0-319.el9.x86_64-x64; Node.js 20.11.1; Transport 8.4.0)",
                                        "x-elastic-client-meta": "es=8.11.0,js=20.11.1,t=8.4.0,hc=20.11.1"
                                    },
                                    "method": "POST",
                                    "path": "/opencti_history-000002/_update/work_<REMOVED>_2024-03-13T20%3A46%3A35.244Z",
                                    "querystring": "retry_on_conflict=5&timeout=5m&refresh=true"
                                }
                            }
                        },
                        "statusCode": 400,
                        "warnings": null
                    },
                    "name": "ResponseError",
                    "options": {
                        "redaction": {
                            "additionalKeys": [],
                            "type": "replace"
                        }
                    }
                },
                "documentId": "work_<REMOVED>_2024-03-13T20:46:35.244Z",
                "genre": "TECHNICAL",
                "http_status": 500
            },
            "internalData": {},
            "name": "DATABASE_ERROR",
            "time_thrown": "2024-03-15T20:11:18.251Z"
        },
        "level": "info",
        "message": "[OPENCTI-MODULE] Connector manager error processing work closing",
        "timestamp": "2024-03-15T20:11:18.252Z",
        "version": "5.12.33"
    }
}

@richard-julien
Copy link
Member Author

Hi @MaxwellDPS , correct. This one was fixed in 6.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug use for describing something not working as expected solved use to identify issue that has been solved (must be linked to the solving PR)
Projects
None yet
3 participants