linkedin / linkedin/pyexchange

How can I know what's the problem about connections

Open
#68 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
154
Forks
91
PR merge metrics
No merged PRs in 30d

Description

## While I try to create an event at start using pyexchange:

AttributeError Traceback (most recent call last)
in ()
31
32 # Connect to Exchange and create the event
---> 33 event.create()

/usr/local/lib/python2.7/dist-packages/pyexchange/exchange2010/**init**.pyc in create(self)
260 body = soap_request.new_event(self)
261
--> 262 response_xml = self.service.send(body)
263 self._id, self._change_key = self._parse_id_and_change_key_from_response(response_xml)
264

/usr/local/lib/python2.7/dist-packages/pyexchange/base/soap.pyc in send(self, xml, headers, retries, timeout, encoding)
32 request_xml = self._wrap_soap_xml_request(xml)
33 log.info(etree.tostring(request_xml, encoding=encoding, pretty_print=True))
---> 34 response = self._send_soap_request(request_xml, headers=headers, retries=retries, timeout=timeout, encoding=encoding)
35 return self._parse(response, encoding=encoding)
36

/usr/local/lib/python2.7/dist-packages/pyexchange/exchange2010/**init**.pyc in _send_soap_request(self, body, headers, retries, timeout, encoding)
42 "Content-type": "text/xml; charset=%s " % encoding
43 }
---> 44 return super(Exchange2010Service, self)._send_soap_request(body, headers=headers, retries=retries, timeout=timeout, encoding=encoding)
45
46 def _check_for_errors(self, xml_tree):

/usr/local/lib/python2.7/dist-packages/pyexchange/base/soap.pyc in _send_soap_request(self, xml, headers, retries, timeout, encoding)
63 body = etree.tostring(xml, encoding=encoding)
64
---> 65 response = self.connection.send(body, headers, retries, timeout)
66 return response
67

/usr/local/lib/python2.7/dist-packages/pyexchange/connection.pyc in send(self, body, headers, retries, timeout, encoding)
65 response.raise_for_status()
66 except requests.exceptions.RequestException as err:
---> 67 log.debug(err.response.content)
68 raise FailedExchangeException(u'Unable to connect to Exchange: %s' % err)
69

AttributeError: 'NoneType' object has no attribute 'content'

It connect to company's exchange server and Lightning is working. So I wondering how can I trouble shooting about the connections?

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the traceback in pyexchange/connection.py, especially send(), then follow the call through base/soap.py and the Exchange2010 service. Reproduce event.create() against the Exchange server and determine what connection failure leads to the NoneType error; done should make that failure diagnosable rather than masking it.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
api, backend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.