Page MenuHome

Addon Blender kit showed an error after reconnecting to blender 2.91.0
Closed, ResolvedPublic

Description

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: rB0f45cab862b8
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.

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.


Note that there is no tab to the right of the Blender kit. That's because the addon is not enabled.

  1. I enabled the addon and got an error.


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.

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.

Event Timeline

Max (NetralGD) renamed this task 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.Jan 16 2021, 6:20 AM
Max (NetralGD) created this task.
Robert Guetzkow (rjg) changed the task status from Needs Triage to Needs Information from User.Jan 16 2021, 10:46 AM

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).

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 rBA7faa6b379fd818b8af8cf8279ff9f43cbdbb169e). 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 @Vilem Duha (pildanovak) ? 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"))

JSON file:

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.

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

Robert Guetzkow (rjg) closed this task as Resolved.EditedJan 16 2021, 1:10 PM
Robert Guetzkow (rjg) claimed this task.

I'm closing this as resolved. @Vilem Duha (pildanovak) 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 correct myself, I found two issues. I'll create a separate ticket for this though.

The tickets for the file reading and writing are T84778 and T84777.

Robert Guetzkow (rjg) reopened this task as Needs Information from Developers.EditedJan 16 2021, 2:08 PM

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