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

ERROR while using stix2.export_entity | " 'Cannot query field "x_opencti_reliability" " #480

Open
TheGreenmouse opened this issue Oct 30, 2023 · 1 comment
Labels
needs more info use to identify issue needing additional info to be triaged or solved

Comments

@TheGreenmouse
Copy link

Description

Hello,
I tried to get a report from STIX2, using the "Standard STIX ID".
But I get the error 'Cannot query field "x_opencti_reliability"

Environment

  1. Windows 10 via Python
  2. OpenCTI version: 5.9.4
  3. Other environment details:

Reproducible Steps

I just want to get a report from my OpenCTI using Python :

from pycti import OpenCTIApiClient
import json

api_url = "https://192.168.0.25"
api_token = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"

opencti_api_client = OpenCTIApiClient(api_url, api_token)

report = opencti_api_client.stix2.export_entity("Report", "report--1f561489-3344-54f8-a6fd-1c1d5505bf15", "full")
print(report)

Expected Output

The report.

Actual Output

INFO:pycti.entities:Reading Report {78c46a28-87e8-421a-814a-022eb86a5e77}.
ERROR:pycti.api:Cannot query field "x_opencti_reliability" on type "Identity". Did you mean to use an inline fragment on "Organization"?
Traceback (most recent call last):
File "c:\Users\xxxx\pyopenctiv2.py", line 63, in
report = opencti_api_client.report.get_by_stix_id_or_name(stix_id="78c46a28-87e8-421a-814a-022eb86a5e77")
File "C:\Users\basti\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\site-packages\pycti\entities\opencti_report.py", line 612, in get_by_stix_id_or_name
object_result = self.read(id=stix_id, customAttributes=custom_attributes)
File "C:\Users\xxxxxx\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\site-packages\pycti\entities\opencti_report.py", line 587, in read
result = self.opencti.query(query, {"id": id})
File "C:\Users\xxxxxxx\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\site-packages\pycti\api\opencti_api_client.py", line 374, in query
raise ValueError(
ValueError: {'name': 'Cannot query field "x_opencti_reliability" on type "Identity". Did you mean to use an inline fragment on "Organization"?', 'message': 'Cannot query field "x_opencti_reliability" on type "Identity". Did you mean to use an inline fragment on "Organization"?'}

@SouadHadjiat
Copy link
Member

Hello @TheGreenmouse,
Does your python client have the same version as opencti ? x_opencti_reliability is well defined in Identity type, but was added in 5.10.

@SouadHadjiat SouadHadjiat added the needs more info use to identify issue needing additional info to be triaged or solved label Dec 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs more info use to identify issue needing additional info to be triaged or solved
Projects
None yet
Development

No branches or pull requests

2 participants