Python API错误消息疑难解答(Highrise API)

时间:2015-09-25 21:21:37

标签: python api python-3.x highrise

我运行此脚本(https://github.com/mikehking/highrise-analysis/blob/master/highrise-analysis.py)来计算用户对Highrise CRM系统(www.highrisehq.com)的使用情况。最近,该脚本一直在返回此错误;但是我不确定它告诉我的是什么 - 任何人都可以帮我解决这个问题吗?

由于

Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/urllib3/connectionpool.py", line 557, in urlopen
    body=body, headers=headers)
  File "/usr/lib/python3/dist-packages/urllib3/connectionpool.py", line 382, in _make_request
    conn.request(method, url, **httplib_request_kw)
  File "/usr/lib/python3.4/http/client.py", line 1065, in request
    self._send_request(method, url, body, headers)
  File "/usr/lib/python3.4/http/client.py", line 1103, in _send_request
    self.endheaders(body)
  File "/usr/lib/python3.4/http/client.py", line 1061, in endheaders
    self._send_output(message_body)
  File "/usr/lib/python3.4/http/client.py", line 906, in _send_output
    self.send(msg)
  File "/usr/lib/python3.4/http/client.py", line 841, in send
    self.connect()
  File "/usr/lib/python3/dist-packages/urllib3/connectionpool.py", line 133, in connect
    ssl_version=resolved_ssl_version)
  File "/usr/lib/python3/dist-packages/urllib3/util.py", line 619, in ssl_wrap_socket
    return context.wrap_socket(sock, server_hostname=server_hostname)
  File "/usr/lib/python3.4/ssl.py", line 364, in wrap_socket
    _context=self)
  File "/usr/lib/python3.4/ssl.py", line 578, in __init__
    self.do_handshake()
  File "/usr/lib/python3.4/ssl.py", line 805, in do_handshake
    self._sslobj.do_handshake()
ssl.SSLEOFError: EOF occurred in violation of protocol (_ssl.c:598)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/requests/adapters.py", line 330, in send
    timeout=timeout
  File "/usr/lib/python3/dist-packages/urllib3/connectionpool.py", line 590, in urlopen
    raise SSLError(e)
urllib3.exceptions.SSLError: EOF occurred in violation of protocol (_ssl.c:598)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/mikehking/workspace/highrise-analysis/highrise-analysis.py", line 188, in <module>
    Create_Notes_Backup(PROD_API_KEY, PROD_API_USR, 'highrise-production-notes.bak', 'highrise-production-users.bak', 'highrise-production-people.bak', 'highrise-production-cases.bak', trailing_days = 365) # Production Environment
  File "/home/mikehking/workspace/highrise-analysis/highrise-analysis.py", line 71, in Create_Notes_Backup
    tmp_notes = high.get_person_notes(person.highrise_id)
  File "/usr/local/lib/python3.4/dist-packages/highton/highton.py", line 436, in get_person_notes
    return self._get_notes(subject_id, 'people')
  File "/usr/local/lib/python3.4/dist-packages/highton/highton.py", line 433, in _get_notes
    highrise_type, subject_id)), Note)
  File "/usr/local/lib/python3.4/dist-packages/highton/highton.py", line 115, in _get_data
    content = self._get_request(endpoint, params).content
  File "/usr/local/lib/python3.4/dist-packages/highton/highton.py", line 44, in _get_request
    params=params,
  File "/usr/lib/python3/dist-packages/requests/api.py", line 55, in get
    return request('get', url, **kwargs)
  File "/usr/lib/python3/dist-packages/requests/api.py", line 44, in request
    return session.request(method=method, url=url, **kwargs)
  File "/usr/lib/python3/dist-packages/requests/sessions.py", line 455, in request
    resp = self.send(prep, **send_kwargs)
  File "/usr/lib/python3/dist-packages/requests/sessions.py", line 558, in send
    r = adapter.send(request, **kwargs)
  File "/usr/lib/python3/dist-packages/requests/adapters.py", line 385, in send
    raise SSLError(e)
requests.exceptions.SSLError: EOF occurred in violation of protocol (_ssl.c:598)

1 个答案:

答案 0 :(得分:1)

最后一次回溯表明该脚本正在尝试Create_Notes_Backup,但在与Highrise API进行通信时遇到错误。

错误消息:

  

ssl.SSLEOFError:违反协议发生EOF(_ssl.c:598)

与接受您的连接但随后立即或过早关闭的服务器一致。这可能是防火墙问题。

如果您在此计算机上安装了OpenSSL,则可以尝试这样的方法来检查连接:

openssl s_client -crlf -connect USER.highrisehq.com:443

其中USER是您的高层用户。您通常应该获得一个包含技术详细信息的长TLS握手跟踪,以---结尾,然后等待您的输入。