question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

object of type 'NoneType' has no len()

See original GitHub issue

I’m submitting a …

  • bug report
  • feature request
  • support request

General information

Cannot play any media

Addon version used

v0.15.1, but failing since v0.15.0

Description

When selecting a episode or a movie, this last one fail.

Steps to Reproduce

  1. [First Step] Browse to a media
  2. [Second Step] Select it

Expected behavior:

The episode or movie should play

Actual behavior:

None (just crash)

Installation

  • I’m using this Netflix Repo
  • I’m using other Netflix Repo (Please specify which)
  • I’m using a different source (Please tell which)

Operating System

  • Linux (x86/x64)
  • OSX (x86/x64)
  • Windows (x86/x64)
  • Linux (ARM)
  • Android

Additional informatin on the environment

LibreELEC (official): 9.0.2, kernel: Linux ARM 32-bit version 4.19.36 Raspberry PI firmware version: Mar 6 2019 14:47:17

Debug log

2019-08-25 13:26:45.256 T:1739563888   ERROR: [plugin.video.netflix (0)] Traceback (most recent call last):
                                              File "/storage/.kodi/addons/plugin.video.netflix/resources/lib/services/msl/http_server.py", line 47, in do_GET
                                                data = self.server.msl_handler.load_manifest(int(params['id'][0]))
                                              File "/storage/.kodi/addons/plugin.video.netflix/resources/lib/services/msl/msl_handler.py", line 41, in error_catching_wrapper
                                                return func(*args, **kwargs)
                                              File "/storage/.kodi/addons/plugin.video.netflix/resources/lib/common/misc_utils.py", line 246, in timing_wrapper
                                                return func(*args, **kwargs)
                                              File "/storage/.kodi/addons/plugin.video.netflix/resources/lib/services/msl/msl_handler.py", line 109, in load_manifest
                                                manifest = self._load_manifest(viewable_id, g.get_esn())
                                              File "/storage/.kodi/addons/plugin.video.netflix/resources/lib/common/misc_utils.py", line 246, in timing_wrapper
                                                return func(*args, **kwargs)
                                              File "/storage/.kodi/addons/plugin.video.netflix/resources/lib/services/msl/msl_handler.py", line 195, in _load_manifest
                                                manifest_request_data, esn)
                                              File "/storage/.kodi/addons/plugin.video.netflix/resources/lib/common/misc_utils.py", line 246, in timing_wrapper
                                                return func(*args, **kwargs)
                                              File "/storage/.kodi/addons/plugin.video.netflix/resources/lib/services/msl/msl_handler.py", line 244, in _chunked_request
                                                self._post(endpoint, self.request_builder.msl_request(request_data, esn)))
                                              File "/storage/.kodi/addons/plugin.video.netflix/resources/lib/common/misc_utils.py", line 246, in timing_wrapper
                                                return func(*args, **kwargs)
                                              File "/storage/.kodi/addons/plugin.video.netflix/resources/lib/services/msl/request_builder.py", line 37, in msl_request
                                                return (json.dumps(self._signed_header(esn)) +
                                              File "/storage/.kodi/addons/plugin.video.netflix/resources/lib/common/misc_utils.py", line 246, in timing_wrapper
                                                return func(*args, **kwargs)
                                              File "/storage/.kodi/addons/plugin.video.netflix/resources/lib/services/msl/request_builder.py", line 57, in _signed_header
                                                esn)
                                              File "/storage/.kodi/addons/plugin.video.netflix/resources/lib/services/msl/default_crypto.py", line 62, in encrypt
                                                cipher = AES.new(self.encryption_key, AES.MODE_CBC, init_vector)
                                              File "/usr/lib/python2.7/site-packages/Crypto/Cipher/AES.py", line 200, in new
                                              File "/usr/lib/python2.7/site-packages/Crypto/Cipher/__init__.py", line 55, in _create_cipher
                                              File "/usr/lib/python2.7/site-packages/Crypto/Cipher/_mode_cbc.py", line 234, in _create_cbc_cipher
                                              File "/usr/lib/python2.7/site-packages/Crypto/Cipher/AES.py", line 89, in _create_base_cipher
                                            TypeError: object of type 'NoneType' has no len()
2019-08-25 13:26:45.258 T:1739563888   ERROR: Traceback (most recent call last):
2019-08-25 13:26:45.259 T:1739563888   ERROR:   File "/usr/lib/python2.7/SocketServer.py", line 290, in _handle_request_noblock
2019-08-25 13:26:45.259 T:1739563888   ERROR:   File "/usr/lib/python2.7/SocketServer.py", line 318, in process_request
2019-08-25 13:26:45.259 T:1739563888   ERROR:   File "/usr/lib/python2.7/SocketServer.py", line 331, in finish_request
2019-08-25 13:26:45.259 T:1739563888   ERROR:   File "/usr/lib/python2.7/SocketServer.py", line 654, in __init__
2019-08-25 13:26:45.260 T:1739563888   ERROR:   File "/usr/lib/python2.7/SocketServer.py", line 713, in finish
2019-08-25 13:26:45.260 T:1739563888   ERROR:   File "/usr/lib/python2.7/socket.py", line 283, in close
2019-08-25 13:26:45.260 T:1739563888   ERROR:   File "/usr/lib/python2.7/socket.py", line 307, in flush
2019-08-25 13:26:45.260 T:1739563888   ERROR: error: [Errno 32] Broken pipe

Other information

I had to trunk the log as Elementum was extremely verbose. Let me know if you want me to drop the full one.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:25 (8 by maintainers)

github_iconTop GitHub Comments

2reactions
CastagnaITcommented, Aug 25, 2019

restarting the device should be solve

1reaction
CastagnaITcommented, Aug 28, 2019

Well, now I found the real problem:

  • the ESN is set at startup in the database
  • As there’s no username/password, handshake can’t be performed
  • When opening the addon, credentials are requested, and login is performed
  • Then we call update_session_data() (in nfssession.py), that will call _update_esn
  • Update ESN checks if the ESN has change, and if changed calls common.send_signal(signal=common.Signals.ESN_CHANGED, data=esn), that triggers perform_key_handshake in msl_handler.py

But the ESN didn’t change, so signal is not sent, and handshake is not made, resulting in the error. But, we need the ESN to be set or it will thrown an error at migration, that’s why we made that commit “Simplified code for manual ESN” 0be5d97

I have no idea how to fix it…

I’m studying a way, I also suspect that the database copy works but that the completion of the file copy is not waited by code causing the impossibility to check the tables and resulting start-up error i’ll let you know

Read more comments on GitHub >

github_iconTop Results From Across the Web

"object of type 'NoneType' has no len()" error - Stack Overflow
You are asking for the Length of a variable that contains None. None is a special value (of type NoneType) that has no...
Read more >
Python TypeError: object of type 'NoneType' has no len()
The “TypeError: object of type 'NoneType' has no len() ” error is caused when you try to use the len() method on an...
Read more >
TypeError: object of type 'NoneType' has no len() - Yawin Tutor
The TypeError: object of type 'NoneType' has no len() error occurs while attempting to find the length of an object that returns 'None'....
Read more >
TypeError: object of type 'NoneType' has no len() - STechies
This error is generated in Python when we try to calculate the length of an object which returns 'none'. Let us understand it...
Read more >
TypeError: object of type 'NoneType' has no len() in Python
Reason 1: Assigning None Value to len() Function · Solution 1: Change the None Value · Solution 2: Using an if-else Statement ·...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found