Skip to content

[windows] Can't use LogViewer - 500 error, possible encoding issue #190

Closed

Description

@byg0n3

Sad to come back here today again, but it seems that my problems doesn't end after #189.
Theme manager and UAS looks fine for now, but can't use LogViewer.
OS: Windows 10 x64
System-Wide language: Russian
Codepage: 1251
Locale: 1251

k9spqcm 1

2016-07-14 17:11:27,227 (600) :  DEBUG (logkit:13) - Fatal error happened in Logs show: 'utf8' codec can't decode byte 0xce in position 94: invalid continuation byte

Code reference:
Contents.Code.logs.logs#show:123

Worth to mention, that it works fine on my virtualbox with Linux Mint 18 and utf-8 by default.

wt_log_logviewer_error.zip

Activity

  1. ukdtom commented on Jul 14, 2016

    @ukdtom
    Owner

    You are not the only one sorry here ;-)

    Could I get a zip of the Plex Media Server.log please

  2. byg0n3 commented on Jul 14, 2016

    @byg0n3
    Author
  3. byg0n3 commented on Jul 14, 2016

    @byg0n3
    Author

    Guess, that lines like this can be the reason.

    Jul 14, 2016 17:32:18.524 [3808] DEBUG - NetworkInterface: ignoring adapter 'Подключение по локальной сети* 2' 
    

    Can't imagine, that I'm the only one, who facing such encoding problems with plex.
    But found almost nothing usefull on the official forum. Feels bad :|

  4. ukdtom commented on Jul 14, 2016

    @ukdtom
    Owner

    ^^ Think so as well regarding the line.
    And when trying your file on my box, it claims the file can't be found....
    Puzzled here, so might take a while

  5. ukdtom commented on Jul 14, 2016

    @ukdtom
    Owner

    logs.py file

    Do an import like:
    import codecs, locale

    Then find line:

                with codecs.open(file, encoding=locale.getpreferredencoding(), errors='ignore') as content_file:
    #           with io.open(file, 'rb') as content_file:
    

    Then please report back

  6. added this to the V2.3 milestone on Jul 14, 2016
  7. self-assigned this
    on Jul 14, 2016
  8. byg0n3 commented on Jul 14, 2016

    @byg0n3
    Author

    Still 500, but now with another reason
    Fatal error happened in Logs show: builtins_open() takes at most 2 arguments (3 given)

  9. ukdtom commented on Jul 14, 2016

    @ukdtom
    Owner

    Care to try the early alpha of the next version instead?
    https://github.com/dagalufh/WebTools.bundle/archive/tommy-work.zip
    And FindMedia is not yet working on the Windows platform, but should work on Linux

  10. byg0n3 commented on Jul 14, 2016

    @byg0n3
    Author

    Sure, why not.
    Anyway I'm too nervous today for writing own code :D

  11. ukdtom commented on Jul 14, 2016

    @ukdtom
    Owner

    LOL

  12. ukdtom commented on Jul 14, 2016

    @ukdtom
    Owner

    And do report back regarding the logviewer

  13. byg0n3 commented on Jul 14, 2016

    @byg0n3
    Author

    On alpha also same 500 as in previous comment

    2016-07-14 19:13:15,194 (20b4) :  CRITICAL (core:574) - Fatal error happened in Logs show: builtins_open() takes at most 2 arguments (3 given) (most recent call last):
      File "C:\Users\dein0s\AppData\Local\Plex Media Server\Plug-ins\WebTools.bundle\Contents\Code\logs.py", line 139, in show
        with codecs.open(file, encoding=locale.getpreferredencoding(), errors='ignore') as content_file:
      File "C:\Program Files (x86)\Plex\Plex Media Server\python27.zip\codecs.py", line 881, in open
        file = __builtin__.open(filename, mode, buffering)
    TypeError: builtins_open() takes at most 2 arguments (3 given)
    

    alpha_pms_wt_logs.zip

  14. byg0n3 commented on Jul 14, 2016

    @byg0n3
    Author

    God damn, why they just can't provide full version of current 2.7.x python? Will take another ~50 mb uncompressed, but will solve so much problems.

    I remember that day, when I tried to get type of some variable. I was like O_O, wtf?
    And few minutes later, when I just gave up, it was looking like

    if isinstance(a, dict):
        print 'HOORAY'
    
  15. ukdtom commented on Jul 14, 2016

    @ukdtom
    Owner

    Try this in the log.py file:

    #           with codecs.open(file, encoding=locale.getpreferredencoding(), errors='ignore') as content_file:
                with io.open(file, 'r+', errors='ignore') as content_file:
    

    And believe it or not, but codec.open behaves differently in Plex on Windows compared to Linux..:SIGH....

  16. ukdtom commented on Jul 14, 2016

    @ukdtom
    Owner

    And has to stop for a while......Dinner time ;-)

  17. byg0n3 commented on Jul 14, 2016

    @byg0n3
    Author

    Take your time, I'm not in a hurry :)
    And, for sure, I belive you. Happened to me also few times.

    I'm getting permission restriction even when running PMS as admin with :

    with io.open(file, 'r+', errors='ignore') as content_file:
    

    Log:

    2016-07-14 19:46:33,762 (1c68) :  CRITICAL (core:574) - Fatal error happened in Logs show: [Errno 13] Permission denied: u'C:\\Users\\dein0s\\AppData\\Local\\Plex Media Server\\Logs\\Plex Media Server.log' (most recent call last):
      File "C:\Users\dein0s\AppData\Local\Plex Media Server\Plug-ins\WebTools.bundle\Contents\Code\logs.py", line 138, in show
        with io.open(file, 'r+', errors='ignore') as content_file:
    IOError: [Errno 13] Permission denied: u'C:\\Users\\dein0s\\AppData\\Local\\Plex Media Server\\Logs\\Plex Media Server.log'
    
  18. ukdtom commented on Jul 14, 2016

    @ukdtom
    Owner

    I made an error here....SIGH.....

    In the line with io.open, change 'r+' into 'r'

    Then please report back

  19. byg0n3 commented on Jul 14, 2016

    @byg0n3
    Author

    Yep, you are right. Figured it ouy few mins ago.
    Also, take a look Contents.Code.logs.logs#download:134. As I see, it needs same changes here.

  20. added a commit that references this issue on Jul 14, 2016
  21. ukdtom commented on Jul 14, 2016

    @ukdtom
    Owner

    Indeed, and fixed with 39c1d17

  22. ukdtom commented on Jul 14, 2016

    @ukdtom
    Owner

    And now wondering......Got any sidecar subs, in russian, that perhaps also breaks, when viewing in the subtitle module?

  23. byg0n3 commented on Jul 14, 2016

    @byg0n3
    Author

    On a first glance - nope.
    But, to be honest, not yet tried to go in deeps of it, because mostly using plex for watching tv shows on-line (from russian portal) and twitch.tv (their native app for android tv sux a lot).
    Aimed mostly for LV in WT under windows, because I'm too lazy to load vb everytime for debugging if I'm not in dev mode :D

    But, for sure, will take a look at subs and findmedia in a free time.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions