Giter Site home page Giter Site logo

vknotification's People

Contributors

assisken avatar

Watchers

Andrew avatar  avatar

Forkers

ishumihin

vknotification's Issues

Перестаёт работать

Примерно через 3 часа перестаёт работать сервер ожидания событий, но падения не происходит как в #3 и скрипт продолжает крутиться в пустую.

Сохранение логов

в методе

    def __log(self, msg):  
        if self.debug >= 1:
            print(msg)

добавить запись логов в файл

Время в логах

в методе

    def __log(self, msg):  
        if self.debug >= 1:
            print(msg)

добавить вывод времени в человекочитаемом виде

504

5.03.2016 11:36:43: [ERROR] Ошибка запроса, получен ответ 504

больше информации

requests.exceptions.ConnectionError: ('Connection aborted.', ConnectionResetError(104, 'Connection reset by peer'))

9
Traceback (most recent call last):
  File "/usr/local/lib/python3.4/dist-packages/requests/packages/urllib3/connectionpool.py", line 376, in _make_request
    httplib_response = conn.getresponse(buffering=True)
TypeError: getresponse() got an unexpected keyword argument 'buffering'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/lib/python3.4/dist-packages/requests/packages/urllib3/connectionpool.py", line 559, in urlopen
    body=body, headers=headers)
  File "/usr/local/lib/python3.4/dist-packages/requests/packages/urllib3/connectionpool.py", line 378, in _make_request
    httplib_response = conn.getresponse()
  File "/usr/lib/python3.4/http/client.py", line 1172, in getresponse
    response.begin()
  File "/usr/lib/python3.4/http/client.py", line 351, in begin
    version, status, reason = self._read_status()
  File "/usr/lib/python3.4/http/client.py", line 313, in _read_status
    line = str(self.fp.readline(_MAXLINE + 1), "iso-8859-1")
  File "/usr/lib/python3.4/socket.py", line 371, in readinto                                                                                                                         
    return self._sock.recv_into(b)                                                                                                                                                   
  File "/usr/lib/python3.4/ssl.py", line 745, in recv_into                                                                                                                           
    return self.read(nbytes, buffer)                                                                                                                                                 
  File "/usr/lib/python3.4/ssl.py", line 617, in read                                                                                                                                
    v = self._sslobj.read(len, buffer)                                                                                                                                               
ConnectionResetError: [Errno 104] Connection reset by peer                                                                                                                           

During handling of the above exception, another exception occurred:                                                                                                                  

Traceback (most recent call last):                                                                                                                                                   
  File "/usr/local/lib/python3.4/dist-packages/requests/adapters.py", line 376, in send                                                                                              
    timeout=timeout                                                                                                                                                                  
  File "/usr/local/lib/python3.4/dist-packages/requests/packages/urllib3/connectionpool.py", line 609, in urlopen                                                                    
    _stacktrace=sys.exc_info()[2])                                                                                                                                                   
  File "/usr/local/lib/python3.4/dist-packages/requests/packages/urllib3/util/retry.py", line 247, in increment                                                                      
    raise six.reraise(type(error), error, _stacktrace)                                                                                                                               
  File "/usr/local/lib/python3.4/dist-packages/requests/packages/urllib3/packages/six.py", line 309, in reraise                                                                      
    raise value.with_traceback(tb)                                                                                                                                                   
  File "/usr/local/lib/python3.4/dist-packages/requests/packages/urllib3/connectionpool.py", line 559, in urlopen                                                                    
    body=body, headers=headers)                                                                                                                                                      
  File "/usr/local/lib/python3.4/dist-packages/requests/packages/urllib3/connectionpool.py", line 378, in _make_request                                                              
    httplib_response = conn.getresponse()                                                                                                                                            
  File "/usr/lib/python3.4/http/client.py", line 1172, in getresponse                                                                                                                
    response.begin()                                                                                                                                                                 
  File "/usr/lib/python3.4/http/client.py", line 351, in begin
    version, status, reason = self._read_status()
  File "/usr/lib/python3.4/http/client.py", line 313, in _read_status
    line = str(self.fp.readline(_MAXLINE + 1), "iso-8859-1")
  File "/usr/lib/python3.4/socket.py", line 371, in readinto
    return self._sock.recv_into(b)
  File "/usr/lib/python3.4/ssl.py", line 745, in recv_into
    return self.read(nbytes, buffer)
  File "/usr/lib/python3.4/ssl.py", line 617, in read
    v = self._sslobj.read(len, buffer)
requests.packages.urllib3.exceptions.ProtocolError: ('Connection aborted.', ConnectionResetError(104, 'Connection reset by peer'))

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "vkNoty.py", line 6, in <module>
    main.enable().main_loop()
  File "/home/andrew/nord/vkNotification/main.py", line 78, in main_loop
    self.loop()  # то запускаем петлю
  File "/home/andrew/nord/vkNotification/main.py", line 101, in loop
    messages, self.pts = self.__get_long_poll_history()  # получаем лс
  File "/home/andrew/nord/vkNotification/main.py", line 155, in __get_long_poll_history
    data = self.vk.method('messages.getLongPollHistory', {'ts': self.ts, 'pts': self.pts, 'fields': fields})
  File "/home/andrew/nord/vkNotification/vk_api/vk_api.py", line 392, in method
    response = self.http.post(url, values)
  File "/usr/local/lib/python3.4/dist-packages/requests/sessions.py", line 511, in post
    return self.request('POST', url, data=data, json=json, **kwargs)
  File "/usr/local/lib/python3.4/dist-packages/requests/sessions.py", line 468, in request
    resp = self.send(prep, **send_kwargs)
  File "/usr/local/lib/python3.4/dist-packages/requests/sessions.py", line 576, in send
    r = adapter.send(request, **kwargs)
  File "/usr/local/lib/python3.4/dist-packages/requests/adapters.py", line 426, in send
    raise ConnectionError(err, request=request)
requests.exceptions.ConnectionError: ('Connection aborted.', ConnectionResetError(104, 'Connection reset by peer'))

Краш 01.03.16

Traceback (most recent call last):
  File "/usr/local/lib/python3.4/dist-packages/requests/packages/urllib3/connectionpool.py", line 376, in _make_request
    httplib_response = conn.getresponse(buffering=True)
TypeError: getresponse() got an unexpected keyword argument 'buffering'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/lib/python3.4/dist-packages/requests/packages/urllib3/connectionpool.py", line 559, in urlopen
    body=body, headers=headers)
  File "/usr/local/lib/python3.4/dist-packages/requests/packages/urllib3/connectionpool.py", line 378, in _make_request
    httplib_response = conn.getresponse()
  File "/usr/lib/python3.4/http/client.py", line 1172, in getresponse
    response.begin()
  File "/usr/lib/python3.4/http/client.py", line 351, in begin
    version, status, reason = self._read_status()
  File "/usr/lib/python3.4/http/client.py", line 321, in _read_status
    raise BadStatusLine(line)
http.client.BadStatusLine: ''

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/lib/python3.4/dist-packages/requests/adapters.py", line 376, in send
    timeout=timeout
  File "/usr/local/lib/python3.4/dist-packages/requests/packages/urllib3/connectionpool.py", line 609, in urlopen
    _stacktrace=sys.exc_info()[2])
  File "/usr/local/lib/python3.4/dist-packages/requests/packages/urllib3/util/retry.py", line 247, in increment
    raise six.reraise(type(error), error, _stacktrace)
  File "/usr/local/lib/python3.4/dist-packages/requests/packages/urllib3/packages/six.py", line 309, in reraise
    raise value.with_traceback(tb)
  File "/usr/local/lib/python3.4/dist-packages/requests/packages/urllib3/connectionpool.py", line 559, in urlopen
    body=body, headers=headers)
  File "/usr/local/lib/python3.4/dist-packages/requests/packages/urllib3/connectionpool.py", line 378, in _make_request
    httplib_response = conn.getresponse()
  File "/usr/lib/python3.4/http/client.py", line 1172, in getresponse
    response.begin()
  File "/usr/lib/python3.4/http/client.py", line 351, in begin
    version, status, reason = self._read_status()
  File "/usr/lib/python3.4/http/client.py", line 321, in _read_status
    raise BadStatusLine(line)
requests.packages.urllib3.exceptions.ProtocolError: ('Connection aborted.', BadStatusLine("''",))

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "vkNoty.py", line 5, in <module>
    main.enable().main_loop()
  File "/home/andrew/nord/vkNotification/main.py", line 75, in main_loop
    self.loop()  # то запускаем петлю
  File "/home/andrew/nord/vkNotification/main.py", line 86, in loop
    response = requests.get(self.long_poll_url())  # получаем события с сервера событий
  File "/usr/local/lib/python3.4/dist-packages/requests/api.py", line 67, in get
    return request('get', url, params=params, **kwargs)
  File "/usr/local/lib/python3.4/dist-packages/requests/api.py", line 53, in request
    return session.request(method=method, url=url, **kwargs)
  File "/usr/local/lib/python3.4/dist-packages/requests/sessions.py", line 468, in request
    resp = self.send(prep, **send_kwargs)
  File "/usr/local/lib/python3.4/dist-packages/requests/sessions.py", line 576, in send
    r = adapter.send(request, **kwargs)
  File "/usr/local/lib/python3.4/dist-packages/requests/adapters.py", line 426, in send
    raise ConnectionError(err, request=request)
requests.exceptions.ConnectionError: ('Connection aborted.', BadStatusLine("''",))

Краш KeyError: 'ts'

Traceback (most recent call last):
  File "main.py", line 212, in <module>
    main()
  File "main.py", line 70, in main
    ts = data['ts']
KeyError: 'ts'

502

Traceback (most recent call last):
  File "vkNoty.py", line 6, in <module>
    main.enable().main_loop()
  File "/home/andrew/nord/vkNotification/main.py", line 78, in main_loop
    self.loop()  # то запускаем петлю
  File "/home/andrew/nord/vkNotification/main.py", line 101, in loop
    messages, self.pts = self.__get_long_poll_history()  # получаем лс
  File "/home/andrew/nord/vkNotification/main.py", line 155, in __get_long_poll_history
    data = self.vk.method('messages.getLongPollHistory', {'ts': self.ts, 'pts': self.pts, 'fields': fields})
  File "/home/andrew/nord/vkNotification/vk_api/vk_api.py", line 404, in method
    raise error
vk_api.vk_api.ApiHttpError: Response code 502

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.