hfaran / slack-export-viewer

A Slack Export archive viewer that allows you to easily view and share your Slack team's export
https://pypi.python.org/pypi/slack-export-viewer
MIT License
957 stars 192 forks source link

IndexError: list index out of range #22

Closed hfaran closed 8 years ago

hfaran commented 8 years ago

From @ottominggu

C:\>slack-export-viewer -z f:/Slackchat/hita.zip
/tmp\_slackviewer\2eb3aac8e2200c59495898f693f1a2752d946d34 already exists
 * Running on http://localhost:5000/ (Press CTRL+C to quit)
ERROR:root:A channel reference was detected but metadata not found in channels.json: u'C0AK0LRFX'
ERROR:root:A channel reference was detected but metadata not found in channels.json: u'C0AK0LRFX'
ERROR:root:A channel reference was detected but metadata not found in channels.json: u'C0AMH9V26'
ERROR:root:A channel reference was detected but metadata not found in channels.json: u'C0AMH9V26'
ERROR:root:A channel reference was detected but metadata not found in channels.json: u'C0BS45DBJ'
ERROR:root:A channel reference was detected but metadata not found in channels.json: u'C0BS45DBJ'
127.0.0.1 - - [30/Apr/2016 13:10:50] "GET / HTTP/1.1" 500 -
INFO:werkzeug:127.0.0.1 - - [30/Apr/2016 13:10:50] "GET / HTTP/1.1" 500 -
Error on request:
Traceback (most recent call last):
  File "c:\python27\lib\site-packages\werkzeug\serving.py", line 193, in run_wsgi
    execute(self.server.app)
  File "c:\python27\lib\site-packages\werkzeug\serving.py", line 181, in execute
    application_iter = app(environ, start_response)
  File "c:\python27\lib\site-packages\flask\app.py", line 1836, in __call__
    return self.wsgi_app(environ, start_response)
  File "c:\python27\lib\site-packages\flask\app.py", line 1820, in wsgi_app
    response = self.make_response(self.handle_exception(e))
  File "c:\python27\lib\site-packages\flask\app.py", line 1403, in handle_exception
    reraise(exc_type, exc_value, tb)
  File "c:\python27\lib\site-packages\flask\app.py", line 1817, in wsgi_app
    response = self.full_dispatch_request()
  File "c:\python27\lib\site-packages\flask\app.py", line 1477, in full_dispatch_request
    rv = self.handle_user_exception(e)
  File "c:\python27\lib\site-packages\flask\app.py", line 1381, in handle_user_exception
    reraise(exc_type, exc_value, tb)
  File "c:\python27\lib\site-packages\flask\app.py", line 1475, in full_dispatch_request
    rv = self.dispatch_request()
  File "c:\python27\lib\site-packages\flask\app.py", line 1461, in dispatch_request
    return self.view_functions[rule.endpoint](**req.view_args)
  File "c:\python27\lib\site-packages\slackviewer\app.py", line 24, in index
    return channel_name("general")
  File "c:\python27\lib\site-packages\slackviewer\app.py", line 17, in channel_name
    channels=sorted(channels))
  File "c:\python27\lib\site-packages\flask\templating.py", line 128, in render_template
    context, ctx.app)
  File "c:\python27\lib\site-packages\flask\templating.py", line 110, in _render
    rv = template.render(context)
  File "c:\python27\lib\site-packages\jinja2\environment.py", line 989, in render
    return self.environment.handle_exception(exc_info, True)
  File "c:\python27\lib\site-packages\jinja2\environment.py", line 754, in handle_exception
    reraise(exc_type, exc_value, tb)
  File "c:\python27\lib\site-packages\slackviewer\templates\viewer.html", line 34, in top-level template code
    <div class="msg">{{ message.msg|safe }}</div>
  File "c:\python27\lib\site-packages\jinja2\environment.py", line 408, in getattr
    return getattr(obj, attribute)
  File "c:\python27\lib\site-packages\slackviewer\message.py", line 71, in msg
    if not message[0].strip():
IndexError: list index out of range
Newbiegalau commented 8 years ago

slack-export-viewer -z f:/Slackchat/group.zip /tmp_slackviewer\2eb3aac8e2200c59495898f693f1a2752d946d34 already exists Traceback (most recent call last): File "c:\python27\lib\runpy.py", line 162, in _run_module_as_main "main", fname, loader, pkg_name) File "c:\python27\lib\runpy.py", line 72, in _run_code exec code in run_globals File "C:\Python27\Scripts\slack-export-viewer.exemain.py", line 9, in File "c:\python27\lib\site-packages\click\core.py", line 716, in call return self.main(_args, _kwargs) File "c:\python27\lib\site-packages\click\core.py", line 696, in main rv = self.invoke(ctx) File "c:\python27\lib\site-packages\click\core.py", line 889, in invoke return ctx.invoke(self.callback, _ctx.params) File "c:\python27\lib\site-packages\click\core.py", line 534, in invoke return callback(_args, **kwargs) File "c:\python27\lib\site-packages\slackviewer\main.py", line 67, in main port=port File "c:\python27\lib\site-packages\flask\app.py", line 758, in run from werkzeug.serving import run_simple File "c:\python27\lib\site-packages\werkzeug\serving.py", line 195 except KeyError:

still problem after follow your sugesstion

hfaran commented 8 years ago

It's another bug, so I'll take a look at it in a bit in #22. Also make sure to wrap your output above with triple-backticks. It's completely unreadable otherwise.

Newbiegalau commented 8 years ago

but why on your capture picture there's no problem?

hfaran commented 8 years ago

What capture picture?

Newbiegalau commented 8 years ago

I mean on this https://github.com/hfaran/slack-export-viewer/blob/master/screenshot.png

hfaran commented 8 years ago

It's because the Slack archive that I have tested with didn't have the specific type of message that yours does that is causing the bug. I'm not sure at this point what it is but I might add a debug mode tomorrow so I can find out and fix it.

Newbiegalau commented 8 years ago

seems like icon(gif) problem maybe or link or picture maybe..

hfaran commented 8 years ago

Resolved by #24