Addon Blender kit showed an error after reconnecting to blender 2.91.0 #84766

Closed
opened 2021-01-16 06:20:58 +01:00 by Max · 26 comments

System Information
Operating system: Windows-10-10.0.18362-SP0 64 Bits
Graphics card: Radeon RX Vega ATI Technologies Inc. 4.5.14757 Core Profile Context 20.12.1 27.20.14501.28009

Blender Version
Broken: version: 2.91.0, branch: master, commit date: 2020-11-25 08:34, hash: blender/blender@0f45cab862
Worked: (newest version of Blender that worked as expected)

Addon Information
Name: BlenderKit Online Asset Library (1, 0, 32)
Author: Vilem Duha, Petr Dlouhy

Short description of error
The addon worked before, but with a new connection (on/off) stopped working and started giving this error.
Also before that, there were times when the addon did not show materials or models. But hung up with an endless search and never responded again.
image.png

Exact steps for others to reproduce the error

  1. Instal last blender 2.91.0 (wrote this because I tried to fix the problem by reinstalling blender and also deleting the blenderkit_data folder. But it didn't work)
  2. Open Edit - Preferences - Addons.
    Get this screen.
    image.png
    Note that there is no tab to the right of the Blender kit. That's because the addon is not enabled.
  3. I enabled the addon and got an error.
    image.png
    Addon is not enabled, but on the right side of the tab it appeared.
    4.I try to enable the addon again and get another error.
    image.png
    At the same time, the addon itself is in the tab, but it does not work, except for settings. Can't log in, Can't search.
    image.png
**System Information** Operating system: Windows-10-10.0.18362-SP0 64 Bits Graphics card: Radeon RX Vega ATI Technologies Inc. 4.5.14757 Core Profile Context 20.12.1 27.20.14501.28009 **Blender Version** Broken: version: 2.91.0, branch: master, commit date: 2020-11-25 08:34, hash: `blender/blender@0f45cab862` Worked: (newest version of Blender that worked as expected) **Addon Information** Name: BlenderKit Online Asset Library (1, 0, 32) Author: Vilem Duha, Petr Dlouhy **Short description of error** The addon worked before, but with a new connection (on/off) stopped working and started giving this error. Also before that, there were times when the addon did not show materials or models. But hung up with an endless search and never responded again. ![image.png](https://archive.blender.org/developer/F9581478/image.png) **Exact steps for others to reproduce the error** 1. Instal last blender 2.91.0 (wrote this because I tried to fix the problem by reinstalling blender and also deleting the blenderkit_data folder. But it didn't work) 2. Open Edit - Preferences - Addons. Get this screen. ![image.png](https://archive.blender.org/developer/F9581705/image.png) Note that there is no tab to the right of the Blender kit. That's because the addon is not enabled. 3. I enabled the addon and got an error. ![image.png](https://archive.blender.org/developer/F9581717/image.png) Addon is not enabled, but on the right side of the tab it appeared. 4.I try to enable the addon again and get another error. ![image.png](https://archive.blender.org/developer/F9581720/image.png) At the same time, the addon itself is in the tab, but it does not work, except for settings. Can't log in, Can't search. ![image.png](https://archive.blender.org/developer/F9581729/image.png)
Author

Added subscriber: @NetralGD

Added subscriber: @NetralGD

#85163 was marked as duplicate of this issue

#85163 was marked as duplicate of this issue

#74770 was marked as duplicate of this issue

#74770 was marked as duplicate of this issue

#84827 was marked as duplicate of this issue

#84827 was marked as duplicate of this issue

#84826 was marked as duplicate of this issue

#84826 was marked as duplicate of this issue

#84754 was marked as duplicate of this issue

#84754 was marked as duplicate of this issue
Max changed title from Showed an error after reconnecting to blender 2.91.0 to Addon Blender kit showed an error after reconnecting to blender 2.91.0 2021-01-16 06:21:54 +01:00

Added subscriber: @rjg

Added subscriber: @rjg

Changed status from 'Needs Triage' to: 'Needs User Info'

Changed status from 'Needs Triage' to: 'Needs User Info'

Could you please describe the exact steps necessary to reproduce this problem. From a quick look at the code of the add-on in 2.91 and current master I couldn't see an obvious problem (e.g. using bpy.utils.register_class instead of bpy.utils.unregister_class).

Could you please describe the exact steps necessary to reproduce this problem. From a quick look at the code of the add-on in 2.91 and current master I couldn't see an obvious problem (e.g. using `bpy.utils.register_class` instead of `bpy.utils.unregister_class`).

Added subscriber: @VilemDuha

Added subscriber: @VilemDuha

Thank you for the update. The error you've originally reported, that happens when attempting to enable the add-on again, is a consequence of the first error which occurs during register(). Since the first error interrupts the registration the add-on is only half-registered and the preferences don't show it as enabled. Consequently when you try to enable it once more, Blender complains that the SearchOperator was already registered as there was no attempt made to call unregister() first.

The first problem that is caused by the preferences failing to load is handled more gracefully in 2.92 (see 7faa6b379f). Based on the stack trace alone I cannot tell why the JSON file isn't setup as intended. We may have to look at the file to identify what went wrong @VilemDuha ? I'm not sure if the content can be shared publicly though as the file is supposed to contain the API keys.

The JSON file should be located at the result of the following Python script:

import bpy
import os

print(os.path.join(bpy.utils.user_resource('SCRIPTS'), "presets", "bkit.json"))
Thank you for the update. The error you've originally reported, that happens when attempting to enable the add-on again, is a consequence of the first error which occurs during `register()`. Since the first error interrupts the registration the add-on is only half-registered and the preferences don't show it as enabled. Consequently when you try to enable it once more, Blender complains that the `SearchOperator` was already registered as there was no attempt made to call `unregister()` first. The first problem that is caused by the preferences failing to load is handled more gracefully in 2.92 (see 7faa6b379f). Based on the stack trace alone I cannot tell why the JSON file isn't setup as intended. We may have to look at the file to identify what went wrong @VilemDuha ? I'm not sure if the content can be shared publicly though as the file is supposed to contain the API keys. The JSON file should be located at the result of the following Python script: ``` import bpy import os print(os.path.join(bpy.utils.user_resource('SCRIPTS'), "presets", "bkit.json")) ```
Author

JSON file: bkit.json

Also on the portable version of blender 2.92. the addon works.

JSON file: [bkit.json](https://archive.blender.org/developer/F9581765/bkit.json) Also on the portable version of blender 2.92. the addon works.

That file is filled with NUL bytes, so it is not a surprise that the decoding doesn't work. I would suggest you rename or delete the file and then try to enable the add-on again.

That file is filled with `NUL` bytes, so it is not a surprise that the decoding doesn't work. I would suggest you rename or delete the file and then try to enable the add-on again.
Author

Yes, after deleting the file, the addon worked without errors.
Thanks for the help!

Yes, after deleting the file, the addon worked without errors. Thanks for the help!

Changed status from 'Needs User Info' to: 'Resolved'

Changed status from 'Needs User Info' to: 'Resolved'
Robert Guetzkow self-assigned this 2021-01-16 13:10:27 +01:00

I'm closing this as resolved. @VilemDuha Please reopen if you think we can investigate why the previous JSON was improperly written with the available information. The code for this looks fine to me in 2.91 and later versions.

I'm closing this as resolved. @VilemDuha Please reopen if you think we can investigate why the previous JSON was improperly written with the available information. The code for this looks fine to me in 2.91 and later versions.

Added subscriber: @B.arifi

Added subscriber: @B.arifi

I correct myself, I found two issues. I'll create a separate ticket for this though.

I correct myself, I found two issues. I'll create a separate ticket for this though.

The tickets for the file reading and writing are #84778 and #84777.

The tickets for the file reading and writing are #84778 and #84777.

Changed status from 'Resolved' to: 'Needs Developer To Reproduce'

Changed status from 'Resolved' to: 'Needs Developer To Reproduce'

I'm reopening this ticket as this does not appear to be an isolated incident (see merged ticket). I suspect that #84778 is the cause for the problem or an exception occurred while writing the JSON and at the time that the users didn't notice.

I'm reopening this ticket as this does not appear to be an isolated incident (see merged ticket). I suspect that #84778 is the cause for the problem or an exception occurred while writing the JSON and at the time that the users didn't notice.

This issue was referenced by af50ac2340

This issue was referenced by af50ac234088b0d7eeab54cd498c0318a1f95c76
Member

Changed status from 'Needs Developer To Reproduce' to: 'Resolved'

Changed status from 'Needs Developer To Reproduce' to: 'Resolved'

Added subscriber: @kayosens

Added subscriber: @kayosens
Added subscribers: @jamesbarnes5056, @Ponlets, @jpmb76, @ankitm, @DURUT, @StephenSwaney

Added subscribers: @CarraroStudio, @mano-wii

Added subscribers: @CarraroStudio, @mano-wii
Sign in to join this conversation.
No Milestone
No project
No Assignees
4 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: blender/blender-addons#84766
No description provided.