Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Download content failed after update Kolibri to v0.16.0-beta0 #728

Closed
starnight opened this issue Aug 3, 2023 · 5 comments · Fixed by #729
Closed

Download content failed after update Kolibri to v0.16.0-beta0 #728

starnight opened this issue Aug 3, 2023 · 5 comments · Fixed by #729
Assignees
Labels
bug Something isn't working

Comments

@starnight
Copy link
Contributor

The download of Artist package is stuck at 10%
10percent
Seems the error: AttributeError: 'FileDownload' object has no attribute 'run'

INFO 2023-08-03 11:12:15,626 kolibri_explore_plugin.collectionviews Saving download state: {'grade': 'artist', 'name': '0001', 'stage': 'IMPORTING_CONTENT', 'current_job_id': 'abe76143005d4583a2a7aa721f800690', 'current_task': {'task': 'remotecontentimport', 'params': {'channel_id': '1520f018610256549c98ca0140cceebe', 'channel_name': 'Virtual Field Trips', 'node_ids': ['6fe6f580dc6c54df91c131c17b5548fd', '37f9039b5ae55ec6a7194198e8531837'], 'exclude_node_ids': [], 'fail_on_error': True}}, 'tasks_pending': [{'task': 'remotecontentimport', 'params': {'channel_id': '59b8deeb90f544da923187e77c8d3820', 'channel_name': 'wikiHow', 'node_ids': ['b6a27f3179e545a7ae36aba9ebcdd7e0', '8b094975fb034ffabe8f84e94236c450', '454b964a232b40b6b1ac757bc8682442', '18794db672544db9b1fc5113b0f11ab0', 'bedd4f11617a4a91bea8eb563eade367'], 'exclude_node_ids': [], 'fail_on_error': True}}, {'task': 'remotecontentimport', 'params': {'channel_id': '057f871caa405ec29d62ba0523c193d7', 'channel_name': 'Music', 'node_ids': ['fee375c9593051e580656ee6ea988f1d', '6d5a97dd59c555c09d3aebfb54a5a256', 'ed3bc69a222b50baa81d2b4621776ea3', '4cf9c5c24352504d9e82d89649acdef1'], 'exclude_node_ids': [], 'fail_on_error': True}}, {'task': 'remotecontentimport', 'params': {'channel_id': 'f061fce103ff5d4e9b8433e67802e666', 'channel_name': 'Arts & Crafts', 'node_ids': ['c4e8db9e8c4657aab03e4d60d0739fd7', '4c4d8ea7a9db5614bdd18d2a1cbbd7fb', 'b46315b5a5c55992b4e70ce876690a37', '782d0145c5df5f9692c0e71ca18df2ad', 'a19656e6e54056c7a8642ea7246cde3e', '19babfa40f6b5f64b0404d1c03980a7c', 'a5a3168bb39b52cf8337d74e2dbb0cda'], 'exclude_node_ids': [], 'fail_on_error': True}}, {'task': 'remotecontentimport', 'params': {'channel_id': 'e11462f71c6f5472b113311c69071b05', 'channel_name': 'Dance', 'node_ids': ['c08d46d405355850926e7e27acf35663', '8e5de022aa23530f9dd5e8a144e3b1f1', '8a50feaea98452fc9d3dc46fab10a33f'], 'exclude_node_ids': [], 'fail_on_error': True}}, {'task': 'remotecontentimport', 'params': {'channel_id': 'b40491d1ef8b5506b8c6ae861372e9de', 'channel_name': 'Jewelry Making', 'node_ids': ['a5d7911a7e3555e89054f6d3f5a3087f', '037e5278d0175dbbaee3e3eaae345b46', 'fb259af752015b2ab39d786a0dae0e03'], 'exclude_node_ids': [], 'fail_on_error': True}}, {'task': 'remotecontentimport', 'params': {'channel_id': '79a50be66bad5eb686c42617c914fd45', 'channel_name': 'Careers', 'node_ids': ['2185f2ced9db5ad295386bcbad8ca4e5', '69d579c0b5e1550b8ba05caf429dc81a'], 'exclude_node_ids': [], 'fail_on_error': True}}, {'task': 'remotecontentimport', 'params': {'channel_id': '1b1fc9bd453a4c52bb5628d9ae804ede', 'channel_name': 'The SciGirls Collection', 'node_ids': ['65e3efecb1f247429dfd2ce83284eb3a', '9ecd909319964a448defbbc985a4c977', 'a6a373e3080b432e8979292f2e4e9027'], 'exclude_node_ids': [], 'fail_on_error': True}}, {'task': 'remotecontentimport', 'params': {'channel_id': '97111903de564de49483a9705d41a8ac', 'channel_name': 'Career Girls', 'node_ids': ['d48bba63221b45b08eb5b7e85aa6d4c8', 'aed0ad11eaeb4c75a4f93569492f3f7f', 'dc02a16cf93d4961b082e45a9569a21a'], 'exclude_node_ids': [], 'fail_on_error': True}}, {'task': 'remotecontentimport', 'params': {'channel_id': 'f1ada7abc4194ff48a958337a31972c7', 'channel_name': 'EiE Families', 'node_ids': ['61fec930f3da4377bc7526b58cef7261'], 'exclude_node_ids': [], 'fail_on_error': True}}], 'tasks_completed': [], 'tasks_previously_completed': [{'task': 'remotechannelimport', 'params': {'channel_id': '1520f018610256549c98ca0140cceebe', 'channel_name': 'unknown'}}, {'task': 'remotechannelimport', 'params': {'channel_id': '59b8deeb90f544da923187e77c8d3820', 'channel_name': 'unknown'}}, {'task': 'remotechannelimport', 'params': {'channel_id': '057f871caa405ec29d62ba0523c193d7', 'channel_name': 'unknown'}}, {'task': 'remotechannelimport', 'params': {'channel_id': 'f061fce103ff5d4e9b8433e67802e666', 'channel_name': 'unknown'}}, {'task': 'remotechannelimport', 'params': {'channel_id': 'e11462f71c6f5472b113311c69071b05', 'channel_name': 'unknown'}}, {'task': 'remotechannelimport', 'params': {'channel_id': 'b40491d1ef8b5506b8c6ae861372e9de', 'channel_name': 'unknown'}}, {'task': 'remotechannelimport', 'params': {'channel_id': '79a50be66bad5eb686c42617c914fd45', 'channel_name': 'unknown'}}, {'task': 'remotechannelimport', 'params': {'channel_id': '1b1fc9bd453a4c52bb5628d9ae804ede', 'channel_name': 'unknown'}}, {'task': 'remotechannelimport', 'params': {'channel_id': '97111903de564de49483a9705d41a8ac', 'channel_name': 'unknown'}}, {'task': 'remotechannelimport', 'params': {'channel_id': 'f1ada7abc4194ff48a958337a31972c7', 'channel_name': 'unknown'}}]}
INFO 2023-08-03 11:12:15,643 cherrypy.access 127.0.0.1 - - "POST /explore/api/ek-collections/update-download" 200 0 "http://localhost:5000/en/explore/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) kolibri-electron/1.0.0 Chrome/108.0.5359.215 Electron/22.3.7 Safari/537.36"
ERROR 2023-08-03 11:12:16,272 kolibri.core.content.utils.resource_import An error occurred during content import: 'FileDownload' object has no attribute 'run'
WARNING 2023-08-03 11:12:16,328 root ERROR    2023-08-03 11:12:16,272 An error occurred during content import: 'FileDownload' object has no attribute 'run'
INFO 2023-08-03 11:12:16,409 kolibri.core.content.utils.annotation Setting availability of non-topic ContentNode objects based on LocalFile availability in 1 batches of 9000
INFO 2023-08-03 11:12:16,435 kolibri.core.content.utils.annotation Annotating ContentNode objects with children for 2 levels
INFO 2023-08-03 11:12:16,439 kolibri.core.content.utils.annotation Annotating ContentNode objects with children for level 2
INFO 2023-08-03 11:12:16,440 kolibri.core.content.utils.annotation Annotating ContentNode objects with children for level 1
ERROR 2023-08-03 11:12:16,490 kolibri.core.tasks.job Job abe76143005d4583a2a7aa721f800690 raised an exception: Traceback (most recent call last):
  File "src\kolibri\core\tasks\job.py", line 302, in execute
  File "src\kolibri\core\tasks\registry.py", line 238, in __call__
  File "src\kolibri\dist\kolibri_explore_plugin\tasks.py", line 120, in remotecontentimport
  File "src\kolibri\core\content\utils\resource_import.py", line 194, in run
  File "src\kolibri\core\content\utils\resource_import.py", line 314, in run_import
  File "src\kolibri\core\content\utils\resource_import.py", line 143, in _handle_future
  File "concurrent\futures\_base.py", line 439, in result
  File "concurrent\futures\_base.py", line 391, in __get_result
  File "concurrent\futures\thread.py", line 58, in run
  File "src\kolibri\core\content\utils\resource_import.py", line 114, in _start_file_transfer
AttributeError: 'FileDownload' object has no attribute 'run'

kolibri.txt

@starnight
Copy link
Contributor Author

Actaully, v0.16.0-alpha21 hits the same issue, too.

I tested with Endless Key (Windows). I believe Android version hits the same issue, too.

@starnight starnight self-assigned this Aug 3, 2023
@starnight starnight added the bug Something isn't working label Aug 3, 2023
@starnight
Copy link
Contributor Author

The manager in kolibri_explore_plugin/tasks.py:120 is a manager_class inherits ExploreRemoteChannelResourceImportManager -> ExploreRemoteResourceImportManagerBase implements create_file_transfer() returning a FileDownload object.

We are using our own FileDownloader now. But, it does not implement run(), neither its parent Transfer class.

@starnight
Copy link
Contributor Author

Looks like Kolibri's commit ("Simplify Transfer subclasses now that they don't need to expose iterators.") makes the big change.

@starnight
Copy link
Contributor Author

starnight commented Aug 3, 2023

After I revert commits:

Then, built the WHL locally, replaced the kolibri-explore-plugin on Windows with this new one and tested it with Kolibri v0.16.0-alpha21.

The download works. Took 4~5 minutes to download the artist pack on a Windows VM.

starnight added a commit that referenced this issue Aug 3, 2023
starnight added a commit that referenced this issue Aug 3, 2023
starnight added a commit that referenced this issue Aug 3, 2023
@vanessa-chang
Copy link

Verify passed in Windows 6.31.2.0 and Chromebook: Ladybird 6.31-379

Packages can be dowloaded without issues.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants