question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Jira response (class: Issue ) is not picklable

See original GitHub issue

looks like Issue class is not pickable

sqlalchemy.exc.InvalidRequestError: This Session's transaction has been rolled back due to a previous exception during flush. To begin a new transaction with this Session, first issue Session.rollback(). Original exception was: (pickle.PicklingError) Can't pickle <class 'jira.resources.PropertyHolder'>: it's not found as jira.resources.PropertyHolder [SQL: u'INSERT INTO xcom (`key`, value, timestamp, execution_date, task_id, dag_id) VALUES (%s, %s, now(), %s, %s, %s)'] [parameters: [{'task_id': '<task_id>', 'execution_date': datetime.datetime(2016, 12, 13, 0, 4), 'value': [<JIRA Issue: key=u'<project>-1855', id=u'<id>'>], 'key': 'result_set', 'dag_id': '<dag_id>'}]]

I also tried this with manual json.dumps to confirm, here is the stacktrace

Traceback (most recent call last):
...
.....
.......
"/usr/local/Cellar/python/2.7.11/Frameworks/Python.framework/Versions/2.7/lib/python2.7/json/__init__.py", line 244, in dumps
    return _default_encoder.encode(obj)
  File "/usr/local/Cellar/python/2.7.11/Frameworks/Python.framework/Versions/2.7/lib/python2.7/json/encoder.py", line 207, in encode
    chunks = self.iterencode(o, _one_shot=True)
  File "/usr/local/Cellar/python/2.7.11/Frameworks/Python.framework/Versions/2.7/lib/python2.7/json/encoder.py", line 270, in iterencode
    return _iterencode(o, 0)
  File "/usr/local/Cellar/python/2.7.11/Frameworks/Python.framework/Versions/2.7/lib/python2.7/json/encoder.py", line 184, in default
    raise TypeError(repr(o) + " is not JSON serializable")
TypeError: <JIRA Issue: key=u'<project>-1855', id=u'<id>'> is not JSON serializable

Do anybody know how can should I serialize any response from JIRA ?

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Reactions:2
  • Comments:11 (2 by maintainers)

github_iconTop GitHub Comments

4reactions
nieuwefncommented, Aug 15, 2018

Is there any update on this? @mdoar 's solution works for pickle.dump, but I’m not able to load the dumped data back with pickle.load.

Fatal Python error: Cannot recover from stack overflow.
Current thread 0x000033f0 (most recent call first):
  File "C:\Python\lib\site-packages\jira\resources.py", line 174 in __getattr__
3reactions
thoni56commented, Dec 19, 2018

Would be really cool if this could make it into a release soon…

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to serialize a jira issue object in Python? - Stack Overflow
jira -cache package worked for me. It can cache an issue list and load it. https://pypi.org/project/jira-cache/. Example:
Read more >
JIRA Resource Property Holder is not Picklable
But it seems that JIRA Resource object is not picklable and multiprocessing can't be used. But multithreading can be used.
Read more >
Solved: Notification still get sent out even though Notifi...
I've updated the Notification Scheme to delete everyone with "Updated issue" and yet I still get JIRA notifications. I tried the Notification Helper...
Read more >
RESTException (Atlassian JIRA 7.2.2 API)
Class RESTException · javax.ws.rs.WebApplicationException · com.atlassian.jira.rest.v2.issue.RESTException.
Read more >
Issues in updating custom field of a JIRA in python
I have a JIRA Ticket where I am trying to update the field of "Verified Version:" of ... When not version is updated,...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found