honeynet / beeswarm

Honeypot deployment made easy
GNU General Public License v3.0
235 stars 64 forks source link

Time does not match format #232

Closed uolevi closed 8 years ago

uolevi commented 8 years ago

In server, I saw this:

  File "/usr/local/lib/python2.7/dist-packages/gevent/greenlet.py", line 534, in run
    result = self._run(*self.args, **self.kwargs)
  File "/usr/local/lib/python2.7/dist-packages/Beeswarm-0.7.17-py2.7.egg/beeswarm/server/db/database_actor.py", line 162, in _run
    self.persist_session(topic, data)
  File "/usr/local/lib/python2.7/dist-packages/Beeswarm-0.7.17-py2.7.egg/beeswarm/server/db/database_actor.py", line 259, in persist_session
    transcript_timestamp = datetime.strptime(entry['timestamp'], '%Y-%m-%dT%H:%M:%S.%f')
  File "/usr/lib/python2.7/_strptime.py", line 332, in _strptime
    (data_string, format))
ValueError: time data '2016-11-09T11:30:40' does not match format '%Y-%m-%dT%H:%M:%S.%f'
<DatabaseActor at 0x7ffa0a7cd050> failed with ValueError

2016-11-09 13:31:29,434 (beeswarm.server.server) Stopping because <DatabaseActor at 0x7ffa0a7cd050> died: time data '2016-11-09T11:30:40' does not match format '%Y-%m-%dT%H:%M:%S.%f'
2016-11-09 13:31:29,434 (root) Stopping server.
johnnykv commented 8 years ago

Nice find! This happens if the session fall on exactly microsecond 0. Apparently isoformat() only appends .microseconds if microsecond > 0.