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

javascript error in tasks #979

Closed
crackytsi opened this issue May 24, 2019 · 5 comments
Closed

javascript error in tasks #979

crackytsi opened this issue May 24, 2019 · 5 comments
Assignees
Labels
Milestone

Comments

@crackytsi
Copy link

crackytsi commented May 24, 2019

Request Type

Bug

Work Environment

Question Answer
OS version (server) Debian
OS version (client) Seven
TheHive version / git hash 3.3
Package Type DEB

Problem Description

When I'm creating tasks using the API I can produce a task that looks retrieved that way:

{
    "owner": null,
    "_routing": "AWqc4lWZM31j2evBe_lF",
    "flag": false,
    "_type": "case_task",
    "description": null,
    "title": "TaskTitle",
    "createdAt": 1557410140945,
    "_parent": "AWqc4lWZM31j2evBe_lF",
    "createdBy": "api",
    "_id": "AWqc4lmzM31j2evBe_lG",
    "id": "AWqc4lmzM31j2evBe_lG",
    "_version": 1,
    "startDate": null,
    "status": "Waiting",
    "group": "default",
    "order": 0
}

(Note that there is no owner, no startDate and no task description)

This contains compared to manual cases the attributes owner, startDate and description (its just missing if manually created and values are not set).
This leads to a javascript error:

vendor.239643a9.js:6 TypeError: Cannot read property 'name' of null
    at scripts.292265cd.js:5
    at fn (eval at compile (vendor.239643a9.js:8), <anonymous>:4:459)
    at vendor.239643a9.js:6
    at o.$digest (vendor.239643a9.js:6)
    at o.$apply (vendor.239643a9.js:6)
    at HTMLSpanElement.<anonymous> (vendor.239643a9.js:9)
    at HTMLSpanElement.handle (vendor.239643a9.js:3)
    at HTMLSpanElement.dispatch (vendor.239643a9.js:3)
    at HTMLSpanElement.q.handle (vendor.239643a9.js:3)

Question:
Is the problem wrong usage of the API or a javascript error?
If it is wrong usage of API, how can this be done correct and how is it possible to unset a description/startDate/owner?

@nadouani
Copy link
Contributor

Can you provide a curl call to reproduce this task creation? so we can reproduce the JS error? Thanks

@crackytsi
Copy link
Author

I was able to produce this by using the example from TheHive4Py test-case-create.py:

tasks = [
    CaseTask(title='Tracking'),
    CaseTask(title='Communication'),
    CaseTask(title='Investigation', status='Waiting', flag=True)
]
# tasks = []
case = Case(title='From TheHive4Py', tlp=3, flag=True, tags=['TheHive4Py', 'sample'], description='N/A', tasks=tasks)

@nadouani
Copy link
Contributor

Ok I'll check it, thanks

@crackytsi
Copy link
Author

@nadouani I did some investigations. The problem always occures if you load the tasks and no owner is set (list tasks, go into task).

Maxbe you want to add this to the next bugfix? I am not aware of any issues but I think if the root-cause is clear it might not be to hard to fix it ;)

@nadouani
Copy link
Contributor

Sure, I’ll fix this in the next RC ;)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants