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

Creating a Report with an associated file gives an error #6075

Closed
labo-flg opened this issue Feb 22, 2024 · 0 comments · Fixed by #6078
Closed

Creating a Report with an associated file gives an error #6075

labo-flg opened this issue Feb 22, 2024 · 0 comments · Fixed by #6078
Assignees
Labels
bug use for describing something not working as expected ingestion Linked to ingestion (manual, from file, feeds & queue) solved use to identify issue that has been solved (must be linked to the solving PR)
Milestone

Comments

@labo-flg
Copy link
Member

Description

If you create a report (also confirmed with malware analysis) and associate a file in the creation form, we get a backend error.

The object seems created successfully and file is present in data tab, so I'm unsure of the consequences of this error.

Environment

Testing latest 5.12

NOT PRESENT ON PROD

Reproducible Steps

Steps to create the smallest reproducible scenario:

  1. create report with an associated file

Expected Output

no error

Actual Output

error message #<Promise> could not be cloned.

Additional information

log error:

{
  "category": "APP",
  "errors": [
    {
      "attributes": {
        "genre": "TECHNICAL",
        "http_status": 500
      },
      "message": "#<Promise> could not be cloned.",
      "name": "UNKNOWN_ERROR",
      "stack": "UNKNOWN_ERROR: #<Promise> could not be cloned.\n    at error (/opt/opencti/build/src/config/errors.js:8:10)\n    at UnknownError (/opt/opencti/build/src/config/errors.js:76:47)\n    at Object._logWithError (/opt/opencti/build/src/config/conf.js:331:23)\n    at Object.error (/opt/opencti/build/src/config/conf.js:341:48)\n    at Object.willSendResponse (/opt/opencti/build/src/graphql/loggerPlugin.js:115:20)\n    at processTicksAndRejections (node:internal/process/task_queues:95:5)\n    at async Promise.all (index 1)\n    at S (/opt/opencti/build/node_modules/apollo-server-core/src/requestPipeline.ts:530:5)\n    at processHTTPRequest (/opt/opencti/build/node_modules/apollo-server-core/src/runHttpQuery.ts:437:24)"
    },
    {
      "message": "#<Promise> could not be cloned.",
      "name": "DataCloneError",
      "stack": "DataCloneError: #<Promise> could not be cloned.\n    at new DOMException (node:internal/per_context/domexception:53:5)\n    at createEntityRaw (/opt/opencti/build/src/database/middleware.js:3046:17)\n    at createEntity (/opt/opencti/build/src/database/middleware.js:3183:22)\n    at addReport (/opt/opencti/build/src/domain/report.js:122:25)\n    at Object.resolve [as reportAdd] (/opt/opencti/build/src/resolvers/report.js:74:43)\n    at fieldResolver (/opt/opencti/build/src/graphql/authDirective.js:59:24)\n    at resolveFn (/opt/opencti/build/node_modules/apollo-server-core/src/utils/schemaInstrumentation.ts:106:18)\n    at executeField (/opt/opencti/build/node_modules/graphql/execution/execute.js:492:20)\n    at callbackFn (/opt/opencti/build/node_modules/graphql/execution/execute.js:377:22)\n    at promiseReduce (/opt/opencti/build/node_modules/graphql/jsutils/promiseReduce.js:23:9)\n    at executeFieldsSerially (/opt/opencti/build/node_modules/graphql/execution/execute.js:373:29)\n    at executeOperation (/opt/opencti/build/node_modules/graphql/execution/execute.js:347:14)\n    at execute (/opt/opencti/build/node_modules/graphql/execution/execute.js:136:20)\n    at execute (/opt/opencti/build/node_modules/apollo-server-core/src/requestPipeline.ts:504:20)\n    at processGraphQLRequest (/opt/opencti/build/node_modules/apollo-server-core/src/requestPipeline.ts:410:28)\n    at processTicksAndRejections (node:internal/process/task_queues:95:5)\n    at processHTTPRequest (/opt/opencti/build/node_modules/apollo-server-core/src/runHttpQuery.ts:437:24)"
    }
  ],
  "inner_relation_creation": 0,
  "level": "error",
  "message": "Platform unmanaged direct error",
  "operation": "ReportCreationMutation",
  "operation_query": "mutation ReportCreationMutation($input:ReportAddInput!){reportAdd(input:$input){id standard_id name description entity_type confidence parent_types ...ReportLine_node}}fragment ReportLine_node on Report{id entity_type name description published report_types createdBy{__typename __isIdentity:__typename id name entity_type}objectMarking{id definition_type definition x_opencti_order x_opencti_color}objectLabel{id value color}creators{id name}status{id order template{name color id}}workflowEnabled created_at}",
  "size": 448,
  "time": 8,
  "timestamp": "2024-02-22T09:35:09.680Z",
  "type": "WRITE_ERROR",
  "user": {
    "group_ids": [
      "a073e696-f9b8-4846-afa2-02c55fb33854",
      "dd020492-f39e-411b-b354-474b1b20ce7e"
    ],
    "ip": "93.42.69.98",
    "organization_ids": [],
    "referer": "
[https://testing.octi.staging.filigran.io/dashboard/analyses/reports"](https://testing.octi.staging.filigran.io/dashboard/analyses/reports%22)
,
    "socket": "query",
    "user_id": "a93d949b-b56d-4426-b7fe-b79ec3718b0e",
    "user_metadata": {}
  },
  "variables": {
    "input": {
      "confidence": 100,
      "content": "<p>This is a default content for all my reports that I will create 123</p>",
      "description": "",
      "externalReferences": [],
      "file": {
        "file": {
          "encoding": "7bit",
          "filename": "Capture d'écran 2023-04-17 133954.png",
          "mimetype": "image/png"
        },
        "promise": {}
      },
      "name": "Test report with file",
      "objectAssignee": [],
      "objectLabel": [],
      "objectMarking": [],
      "objectParticipant": [],
      "published": "2024-02-22T10:34:50+01:00",
      "report_types": []
    }
  },
  "version": "5.12.32"
}
@labo-flg labo-flg added bug use for describing something not working as expected needs triage use to identify issue needing triage from Filigran Product team labels Feb 22, 2024
@labo-flg labo-flg assigned labo-flg and SouadHadjiat and unassigned labo-flg Feb 22, 2024
@Kedae Kedae assigned Kedae and unassigned SouadHadjiat and labo-flg Feb 22, 2024
@Kedae Kedae removed the needs triage use to identify issue needing triage from Filigran Product team label Feb 22, 2024
@Kedae Kedae added this to the Release 6.0.0 milestone Feb 22, 2024
@Kedae Kedae added the solved use to identify issue that has been solved (must be linked to the solving PR) label Feb 22, 2024
@Jipegien Jipegien added the ingestion Linked to ingestion (manual, from file, feeds & queue) label Jul 2, 2024
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 ingestion Linked to ingestion (manual, from file, feeds & queue) solved use to identify issue that has been solved (must be linked to the solving PR)
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants