[Update 3] PSA: To everyone having issues while importing spells
Added 2020-06-08 10:40:56 +0000 UTCDisclaimer: I am still investigation the issues, and I will update this post as necessary.
Update 3
The recently released update to vtta-dndbeyond seems to have solved the issues we were having successfully. Thanks to everyone who participated to fixing the bugs and providing feedback!
Update 2
The changes are not live on 3.0.6, please update your module and provide any feedback you might discover - thank you!
Update 1
While the instructions below are still valid, it is not the root cause if the issues. I was able to get logs from three users not seeing the described issues below and still experiencing the issues/ symptoms. The search continues.
As a result, I rewrote part of the lookup logic that checks if a monster's spells are already in your compendium. I would love to receive feedback from tester's before going live with these changes - anyone willing to contribute is invited to do so. Please install the attached file and try to import a monster with spells, report any findings (preferably on Discord) - thank you for your patience and your willingness to help to get to the root cause of this annoying bug!
--------------------------------------
Issue
Trying to import monsters that are spellcasters is not possible. Instead, the "Spells"-Button spins infinitely and the "Import" button does not appear. Additionally, you are unable to open your spell compendium within Foundry by clicking on it. You are seeing errors like this in your %userdata%/Logs/error.log:
{"level":"error","timestamp":"2020-06-08 12:04:21","message":"EPERM: operation not permitted, rename 'C:\\Users\\RISEWI\\AppData\\Local\\FoundryVTT\\Data\\worlds\\dev\\packs\\ddb-spells.db~' -> 'C:\\Users\\RISEWI\\AppData\\Local\\FoundryVTT\\Data\\worlds\\dev\\packs\\ddb-spells.db'","stack":"Error: EPERM: operation not permitted, rename 'C:\\Users\\RISEWI\\AppData\\Local\\FoundryVTT\\Data\\worlds\\dev\\packs\\ddb-spells.db~' -> 'C:\\Users\\RISEWI\\AppData\\Local\\FoundryVTT\\Data\\worlds\\dev\\packs\\ddb-spells.db'"}
Probable cause
When you enable vtta-dndbeyond for the first time, the module checks for existance of three compendiums and creates them if necessary. If you are using the Electron app, and if you followed the advice to create a secondary GM user which is connected while enabling the module, both logged in GM accounts will create the compendiums, resulting in duplicate entries in Foundry's configuration.
For reasons unknownst to me, this will work well until is some cleaning up (?) within Foundry going on, or load times cause the configuration to blow up, or the moon phase is just plain wrong. You will see the described errors and symptoms above.
How to fix
Disclaimer: The changes below are working on my local installation, but are not tested thoroughly. I would like to connect so several worlds to see if the proposed change is indeed functioning well. Please contact me, preferably on Discord for a quicker response, if you are affected and willing to be my ginea pig. Thanks!
For the brave of heart: There are two files that need to be adjusted in order to restore functionality. The one file is the world-configuration, found in %userdata/worlds/%yourworldname%/world.json, the other is the settings database found at %userdata/ worlds/%yourworldname%/data/settings.db.
Disclaimer: Follow these instructions to the point. If you mess up, it might result in data loss. Make a backup of your world before you continue.
1) Shutdown your Foundry server
2) Go to your User data directory and from there, into the world that experiences the issues, e.g. Data\worlds\demo-world
Editing the world-configuration
3) Open up the %userdata/worlds/%yourworldname%/world.json in an text editor of your choice
In the packs-section, you will see the duplicate entries:

Each entry is enclosed in braces: {...}, and all entries are enclosed in brackets: [...]. Select all duplicate entries and delete them. Make sure that you remove and excess comma before the closing bracket (see the image below).
You can copy the contents of the file and insert in into a JSON validator to see if you have made any correctable mistakes here: https://jsonlint.com/

4) Save the file, and close it.
Editing the settings
Note: This is not JSON file, but a database file. Do not use the JSON validator linked above and correct the errors here.
5) Now open up %userdata/ worlds/%yourworldname%/data/settings.db.
Here, each line counts as one entry. You will see that there are duplicate entries here, but it might be not super clear since the key/value pairs might be ordered differently within each line.

6) Search for
- "key":"vtta-dndbeyond.entity-spell-compendium"
- "key":"vtta-dndbeyond.entity-item-compendium" and
- "key":"vtta-dndbeyond.entity-monster-compendium"
and delete any duplicate entries. Save the file and close the editor.

7) You can now start Foundry. If it does not start, check the error log file located at %userdata%/Logs/error.log for hints. Post it on the discord to get timely feedback.
8) Try to open up the three compendiums and watch the window open. Try importing a spellcaster now, you will succeed.