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.

Not able to use JIRA authed instance as pickle serialized object.

See original GitHub issue

I am trying to save a jira authed instance as a pickle serialized object in a Django’s request session.

The object is saved successfully and pickled, unpickled succesfully.

However when using the stored instance, it gives error:


Traceback (most recent call last):
  File "/usr/local/lib/python2.7/dist-packages/django/core/handlers/base.py", line 149, in get_response
    response = self.process_exception_by_middleware(e, request)
  File "/usr/local/lib/python2.7/dist-packages/django/core/handlers/base.py", line 147, in get_response
    response = wrapped_callback(request, *callback_args, **callback_kwargs)
  File "/var/www/dsm_postman/daakiya/views.py", line 406, in create_jira_bug
    a = jira_instance.issue('TSTH-1082')
  File "/usr/local/lib/python2.7/dist-packages/jira/client.py", line 853, in issue
    issue.find(id, params=params)
  File "/usr/local/lib/python2.7/dist-packages/jira/resources.py", line 168, in find
    self._load(url, params=params)
  File "/usr/local/lib/python2.7/dist-packages/jira/resources.py", line 275, in _load
    r = self._session.get(url, headers=headers, params=params)
  File "/usr/local/lib/python2.7/dist-packages/jira/resilientsession.py", line 149, in get
    return self.__verb('GET', url, **kwargs)
  File "/usr/local/lib/python2.7/dist-packages/jira/resilientsession.py", line 118, in __verb
    while retry_number <= self.max_retries:
AttributeError: 'ResilientSession' object has no attribute 'max_retries'

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Reactions:1
  • Comments:8 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
danielwsuttoncommented, Feb 20, 2017

Hi, I think this is a bug, i had the same issue,

my workaround was simple though,

   jira_instance = some_method_to_get_jira_object()
    if not hasattr(jira_instance._session, 'max_retries'):
        setattr(jira_instance._session, 'max_retries', 3)
   a = jira_instance.issue(bug_id)

Obviously you will might need to change it up a bit depending to match your naming schemes.

1reaction
ssbarneacommented, Dec 3, 2016

I will close this because I don’t see it as a bug in ResilientSession class. It is quite simple: the max_retries attribute is added as part of the __init__ so if you get it missing while calling a method clearly unpickling was not done correctly.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to serialize a jira issue object in Python? - Stack Overflow
Example : def get_issues(): jira = JIRA(auth) if not cache.exists(): issues = jira.search_issues('project = BLAH') cached ...
Read more >
Basic authentification not allowed jira cloud instance
Hello team We are using jira cloud instance (connecting with google account ). I'm searching for script to download a backup every week ......
Read more >
Python web services client examples
In this example, we get an incident record by sys_id (with basic authentication). #!/bin/env python # use the SOAPpy module from SOAPpy import ......
Read more >
Release Notes — Airflow Documentation
This means that if a custom operator implements this as an instance-level variable, it will not be able to be used for operator-mapping....
Read more >
Non-JSON Documents | Couchbase Docs
The serialization format depends on the language (for example, Pickle for Python, Marshal for Ruby, Java Serialization for Java, etc). Using this format...
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